code stringlengths 5 1M | repo_name stringlengths 5 109 | path stringlengths 6 208 | language stringclasses 1
value | license stringclasses 15
values | size int64 5 1M |
|---|---|---|---|---|---|
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | mahak/spark | sql/core/src/test/scala/org/apache/spark/sql/execution/command/v2/ShowPartitionsSuite.scala | Scala | apache-2.0 | 1,923 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | ron8hu/spark | core/src/main/scala/org/apache/spark/api/python/PythonRunner.scala | Scala | apache-2.0 | 15,523 |
/*
* Copyright 2017-2022 Viktor Lövgren
*
* SPDX-License-Identifier: MIT
*/
package ciris.circe
import cats.implicits._
import ciris.{ConfigDecoder, ConfigError}
import io.circe.{Decoder, Json}
import io.circe.{DecodingFailure, ParsingFailure}
import io.circe.yaml.parser.parse
package object yaml {
final def c... | vlovgr/ciris | modules/circe-yaml/src/main/scala/ciris/circe/yaml/yaml.scala | Scala | mit | 3,045 |
package sbtbuildinfo
case class ScalaCaseObjectRenderer(options: Seq[BuildInfoOption], pkg: String, obj: String) extends ScalaRenderer {
override def fileType = BuildInfoType.Source
override def extension = "scala"
val traitNames = options.collect{case BuildInfoOption.Traits(ts @ _*) => ts}.flatten
val objTra... | sbt/sbt-buildinfo | src/main/scala/sbtbuildinfo/ScalaCaseObjectRenderer.scala | Scala | mit | 2,700 |
//汇总统计_建模剖析1
//一、数学理论
//二、建模实例
package org.apache.spark.mllib_analysis.statistic
import org.apache.spark.{SparkConf,SparkContext}
import org.apache.spark.mllib.linalg.Vector
import org.apache.spark.mllib.stat.{MultivariateStatisticalSummary, Statistics}
object Summary_statistics extends App{
val conf = new Spark... | xieguobin/Spark_2.0.0_cn1 | ds_analysis/statistics/base_stat/汇总统计_建模剖析1.scala | Scala | apache-2.0 | 6,857 |
//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
/** @author John Miller
* @builder scalation.linalgebra.bld.BldBidMatrix
* @version 1.3
* @date Mon May 19 15:52:24 EDT 2014
* @see LICENSE (MIT style license file).
*/
package scalation.linalgebra
import scala.io.Sourc... | NBKlepp/fda | scalation_1.3/scalation_mathstat/src/main/scala/scalation/linalgebra/BidMatrixL.scala | Scala | mit | 43,579 |
package org.scalajs.core.compiler.test
import util._
import org.junit.Test
import org.scalajs.core.ir.{Trees => js, Types => jstpe}
class OptimizationTest extends JSASTTest {
@Test
def unwrapScalaFunWrapper: Unit = {
// Make sure we do not wrap and unwrap right away
"""
import scala.scalajs.js
... | lrytz/scala-js | compiler/src/test/scala/org/scalajs/core/compiler/test/OptimizationTest.scala | Scala | bsd-3-clause | 4,507 |
package com.twitter.zipkin.storage.anormdb
import com.twitter.zipkin.storage.SpanStoreSpec
class AnormSpanStoreSpec extends SpanStoreSpec {
val db = DB(new DBConfig("sqlite-memory", install = true))
var store = new AnormSpanStore(db, Some(db.install()))
override def clear = {
store = new AnormSpanStore(db,... | jstanier/zipkin | zipkin-anormdb/src/test/scala/com/twitter/zipkin/storage/anormdb/AnormSpanStoreSpec.scala | Scala | apache-2.0 | 347 |
package com.github.dzhg.tedis.server
import com.github.dzhg.tedis.TedisErrors
import com.github.dzhg.tedis.utils.{ServerAndClient, TedisSuite}
class StrlenSpec extends TedisSuite with ServerAndClient with TedisErrors {
"TedisServer" when {
"strlen" must {
"return correct length for key" in {
clie... | dzhg/tedis | src/test/scala/com/github/dzhg/tedis/server/StrlenSpec.scala | Scala | mit | 810 |
/*
* Copyright (c) 2012-2016 Snowplow Analytics Ltd. All rights reserved.
*
* This program is licensed to you under the Apache License Version 2.0,
* and you may not use this file except in compliance with the Apache License Version 2.0.
* You may obtain a copy of the Apache License Version 2.0 at http://www.apach... | TimothyKlim/snowplow | 3-enrich/scala-common-enrich/src/main/scala/com.snowplowanalytics.snowplow.enrich/common/enrichments/registry/apirequest/ApiRequestEnrichment.scala | Scala | apache-2.0 | 6,723 |
package org.overviewproject.pdfocr.pdf
import java.awt.image.BufferedImage
import java.io.IOException
import java.nio.file.{Files,Paths}
import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.Future
import org.overviewproject.pdfocr.exceptions._
import org.overviewproject.pdfocr.test.UnitSp... | overview/pdfocr | src/test/scala/org/overviewproject/pdfocr/pdf/PdfDocumentSpec.scala | Scala | agpl-3.0 | 2,695 |
package com.pbassiner
sealed trait DiskIO[A]
object DiskIO {
final case class Read(file: String) extends DiskIO[Array[Byte]]
final case class Write(file: String, contents: Array[Byte]) extends DiskIO[Unit]
final case class Delete(file: String) extends DiskIO[Boolean]
}
| pbassiner/free-as-in-monads | src/main/scala/com/pbassiner/DiskIO.scala | Scala | mit | 278 |
package toguru.toggles
import toguru.toggles.events.Rollout
case class Toggle(
id: String,
name: String,
description: String,
tags: Map[String, String] = Map.empty,
activations: IndexedSeq[ToggleActivation] = IndexedSeq.empty)
case class ToggleActivati... | andreas-schroeder/toguru | app/toguru/toggles/Toggle.scala | Scala | mit | 406 |
package ch.epfl.scala.index
package views
package html
object PaginationTests extends org.specs2.mutable.Specification {
"pagination" >> {
"base case" >> {
// *1*
paginationRender(1, 1) ==== ((None, List(1), None))
}
"full" >> {
// *1* 2 3 >
paginationRender(1, 3) ==== ((None, Lis... | adamwy/scaladex | template/src/test/scala/ch.epfl.scala.index.views.html/PaginationTests.scala | Scala | bsd-3-clause | 1,343 |
package com.socrata.datacoordinator
package secondary
import java.sql.SQLException
import com.rojoma.simplearm.v2._
import com.socrata.datacoordinator.truth.loader.{Delogger, MissingVersion}
import com.socrata.datacoordinator.id.DatasetId
import com.socrata.datacoordinator.truth.metadata
import com.socrata.datacoordi... | socrata-platform/data-coordinator | coordinatorlib/src/main/scala/com/socrata/datacoordinator/secondary/PlaybackToSecondary.scala | Scala | apache-2.0 | 34,139 |
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you ... | shaoxuan-wang/flink | flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/plan/rules/physical/stream/StreamExecTemporalSortRule.scala | Scala | apache-2.0 | 3,552 |
package ch.wsl.box.client.mocks
import ch.wsl.box.client.services.REST
import ch.wsl.box.client.viewmodel.BoxDef.BoxDefinitionMerge
import ch.wsl.box.client.viewmodel.BoxDefinition
import ch.wsl.box.model.shared.{BoxTranslationsFields, CSVTable, Child, ExportDef, Field, FormActionsMetadata, IDs, JSONCount, JSONField, ... | Insubric/box | client/src/test/scala/ch/wsl/box/client/mocks/RestMock.scala | Scala | apache-2.0 | 6,338 |
package ch.dyn.nawak.graphs.tests.equality
import org.scalatest._
import ch.dyn.nawak.graphs._
class NodeEqualitySpec extends FlatSpec with Matchers {
val n1 = new Node[Int](Option(1))
val n2 = new Node[Int](Option(1))
val n3 = new Node[Int](Option(3))
val emptyNode = new Node[Int](None)
val emptyNode2 = new N... | triman/graphs | GraphTests/src/ch/dyn/nawak/graphs/tests/equality/NodeEqualitySpec.scala | Scala | mit | 782 |
package effectful.examples.pure.dao.sql
case class FieldColumnMapping(
fieldName: String,
columnIndex: Int,
columnName: ColName
)
//object FieldColumnMapping {
// def apply(
// fieldName: String,
// columnIndex: Int,
// columnName: String
// ) : FieldColumnMapping =
// FieldColumnMapping(
// ... | S-Mach/effectful | src/test/scala/effectful/examples/pure/dao/sql/RecordMapping.scala | Scala | mit | 1,118 |
package com.github.rosmith.nlp.service.datasource
import com.github.rosmith.nlp.query.Query
import com.github.rosmith.nlp.query.model.AnnotatedSentence
import com.github.rosmith.nlp.query.solution.IQuerySolution
import com.hp.hpl.jena.ontology.OntModel
import org.slf4j.Logger
import com.hp.hpl.jena.rdf.model.Model
imp... | rosmith/giet | src/main/scala/com/github/rosmith/nlp/service/datasource/Datasource.scala | Scala | mit | 621 |
package scalaxy.streams
import scala.language.existentials
private[streams] trait Strategies
extends Streams
with SideEffectsDetection
with Reporters
{
self: StreamTransforms =>
val global: scala.reflect.api.Universe
import global._
def hasKnownLimitationOrBug(stream: Stream): Boolean = {
d... | nativelibs4java/scalaxy-streams | src/main/scala/streams/Strategies.scala | Scala | bsd-3-clause | 7,700 |
package com.googlecode.kanbanik.integration
import org.junit.runner.RunWith
import org.scalatest.BeforeAndAfter
import org.scalatest.FlatSpec
import org.scalatest.junit.JUnitRunner
import com.googlecode.kanbanik.commands.CreateUserCommand
import com.googlecode.kanbanik.commands.DeleteUserCommand
import com.googlecode.... | mortenpoulsen/kanbanik | kanbanik-server/src/test/scala/com/googlecode/kanbanik/integration/UserIntegrationTest.scala | Scala | apache-2.0 | 2,911 |
package io.iohk.ethereum.consensus.blocks
import java.util.concurrent.atomic.AtomicReference
import akka.util.ByteString
import io.iohk.ethereum.consensus.ConsensusConfig
import io.iohk.ethereum.consensus.difficulty.DifficultyCalculator
import io.iohk.ethereum.consensus.ethash.blocks.Ommers
import io.iohk.ethereum.con... | input-output-hk/etc-client | src/main/scala/io/iohk/ethereum/consensus/blocks/BlockGeneratorSkeleton.scala | Scala | mit | 7,487 |
package com.datastax.spark.connector
import com.datastax.driver.core.{CodecRegistry, ResultSet, Row, TypeCodec}
/** Represents a single row fetched from Cassandra.
* Offers getters to read individual fields by column name or column index.
* The getters try to convert value to desired type, whenever possible.
* ... | ponkin/spark-cassandra-connector | spark-cassandra-connector/src/main/scala/com/datastax/spark/connector/CassandraRow.scala | Scala | apache-2.0 | 7,610 |
package models
import play.api.db._
import play.api.Play.current
import anorm._
import anorm.SqlParser._
case class Board(id: Pk[Long] = NotAssigned, name: String, comment: String)
object Board {
val simple = {
get[Pk[Long]]("id") ~
get[String]("name") ~
get[String]("comment") map {
case id~name~comment => B... | gorgon-zola/playchat | app/models/Board.scala | Scala | apache-2.0 | 529 |
package com.socrata.datacoordinator.resources.collocation
import java.util.UUID
import com.socrata.http.server.{HttpRequest, HttpResponse}
case class SecondaryMoveJobsJobResource(jobId: String,
secondaryMoveJobs: UUID => SecondaryMoveJobsResult,
... | socrata-platform/data-coordinator | coordinator/src/main/scala/com/socrata/datacoordinator/resources/collocation/SecondaryMoveJobsJobResource.scala | Scala | apache-2.0 | 781 |
package edu.usc.irds.sparkler.storage.elasticsearch
import edu.usc.irds.sparkler.Constants
import edu.usc.irds.sparkler.storage.{StorageRDD, SparklerGroupPartition}
import edu.usc.irds.sparkler.model.{Resource, ResourceStatus, SparklerJob}
import org.apache.spark.rdd.RDD
import org.apache.spark.{Partition, SparkContex... | USCDataScience/sparkler | sparkler-app/src/main/scala/edu/usc/irds/sparkler/storage/elasticsearch/ElasticsearchDeepRDD.scala | Scala | apache-2.0 | 6,878 |
/*
* Copyright (c) 2013-2014 Telefónica Investigación y Desarrollo S.A.U.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unle... | telefonicaid/fiware-cosmos-platform | infinity/server/src/test/scala/es/tid/cosmos/infinity/server/util/ToCloseTest.scala | Scala | apache-2.0 | 1,525 |
package io.github.pauljamescleary.petstore
package infrastructure.endpoint
import domain.orders._
import infrastructure.repository.inmemory._
import cats.effect._
import io.circe._
import io.circe.generic.semiauto._
import org.http4s._
import org.http4s.implicits._
import org.http4s.dsl._
import org.http4s.circe._
imp... | pauljamescleary/scala-pet-store | src/test/scala/io/github/pauljamescleary/petstore/infrastructure/endpoint/OrderEndpointsSpec.scala | Scala | apache-2.0 | 3,050 |
/*
* Copyright 2011-2019 Asakusa Framework Team.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable ... | ueshin/asakusafw-spark | runtime/src/main/scala/com/asakusafw/spark/runtime/directio/HadoopObjectFactory.scala | Scala | apache-2.0 | 922 |
/*
* Copyright 2001-2008 Artima, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agre... | svn2github/scalatest | src/test/scala/org/scalatest/BeforeAndAfterSuite.scala | Scala | apache-2.0 | 13,779 |
import test._
import org.specs2.mutable.Specification
class Specific2ArityHomoSpec extends Specification {
"A case class with an `Int` field in the second position" should {
"serialize and deserialize correctly" in {
val record1 = AvroTypeProviderTest14(1, 2)
val record2 = AvroTypeProviderTest14(3, ... | julianpeeters/sbt-avrohugger | src/sbt-test/avrohugger/SpecificStringEnumSerializationTests/src/test/scala/specific/Specific2ArityHomoSpec.scala | Scala | apache-2.0 | 5,086 |
/**
* Copyright 2011-2016 GatlingCorp (http://gatling.io)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by appli... | ryez/gatling | gatling-metrics/src/test/scala/io/gatling/metrics/sender/TcpSenderSpec.scala | Scala | apache-2.0 | 2,761 |
/**
* Created by zhouqihua on 2017/9/26.
*/
import scala.collection.mutable.ArrayBuffer
class KMSchedulerFAIR(val parallelism: Int = 5) extends KMSchedulerSFSH {
override protected val schedulerType: String = "FAIR"
override def scheduling(timeSlice: Double): Unit = {
}
def schedulingInOneChannel(cha... | kimihe/Swallow | swallow-sim/flow/src/main/scala/KMSchedulerFAIR.scala | Scala | apache-2.0 | 1,324 |
package org.json
/**
*
* JSONException
* ledger-wallet-ripple-chrome
*
* Created by Pierre Pollastri on 16/06/2016.
*
* The MIT License (MIT)
*
* Copyright (c) 2016 Ledger
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated document... | LedgerHQ/ledger-wallet-ripple | src/main/scala/org/json/JSONException.scala | Scala | mit | 1,357 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | kimoonkim/spark | core/src/main/scala/org/apache/spark/scheduler/TaskSetManager.scala | Scala | apache-2.0 | 41,258 |
object Foo {
// Will cause a warning
val bar = 1 == ""
}
| xuwei-k/xsbt | sbt-app/src/sbt-test/reporter/source-mapper/src/main/scala/Foo.scala | Scala | apache-2.0 | 61 |
package me.lachlanap.summis.controllers
import play.api.mvc._
import me.lachlanap.summis.logic._
case class Context(request: Request[_],
appVersion: String,
loggedInAccount: Option[Account],
url: String, menu: Menu,
session: Session) {
/**... | thorinii/summis-server | app/me/lachlanap/summis/controllers/Context.scala | Scala | mit | 1,084 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | tophua/spark1.52 | examples/src/main/scala/org/apache/spark/examples/NetworkWordCount.scala | Scala | apache-2.0 | 3,033 |
/*
* Copyright 2015 Foundational Development
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law ... | rssvihla/datastax_work | spark_commons/benchmarks/spark_throughput/src/test/scala/pro/foundev/benchmarks/spark_throughput/MaxBenchmarkLauncherSpec.scala | Scala | apache-2.0 | 1,668 |
package scala.collection
import org.junit.Assert._
import org.junit.Test
import scala.util.Random
/* Test for scala/bug#7614 */
class TraversableOnceTest {
val list = List.fill(1000)(Random.nextInt(10000) - 5000)
@deprecated("Tests deprecated API", since="2.13")
@Test
def copyToBuffer(): Unit = {
val b1 ... | lrytz/scala | test/junit/scala/collection/TraversableOnceTest.scala | Scala | apache-2.0 | 471 |
package edu.stanford.graphics.shapenet.common
import edu.stanford.graphics.shapenet.Constants
import edu.stanford.graphics.shapenet.util.{CSVFile, IOUtils}
import org.json.simple.JSONValue
import scala.collection.JavaConversions._
import scala.collection.mutable
import scala.collection.mutable.ArrayBuffer
/**
* Simp... | ShapeNet/shapenet-viewer | src/main/scala/edu/stanford/graphics/shapenet/common/CategoryTaxonomy.scala | Scala | mit | 9,483 |
import org.apache.http.client.methods.HttpUriRequest
import org.apache.http.client.{ResponseHandler, HttpClient}
import org.apache.http.protocol.HttpContext
import org.apache.http.{HttpRequest, HttpHost}
import org.specs2.mutable.Specification
object HttpSpec extends Specification {
import dispatch.classic._
im... | dispatch/dispatch | http/src/test/scala/HttpSpec.scala | Scala | lgpl-2.1 | 5,704 |
package spark.scheduler
import spark.scheduler.cluster.TaskInfo
import scala.collection.mutable.Map
import spark._
import spark.executor.TaskMetrics
/**
* Types of events that can be handled by the DAGScheduler. The DAGScheduler uses an event queue
* architecture where any thread can post an event (e.g. a task fin... | koeninger/spark | core/src/main/scala/spark/scheduler/DAGSchedulerEvent.scala | Scala | bsd-3-clause | 1,249 |
/*
* Copyright © 2017 Full 360 Inc
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
* deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish,... | full360/prometheus_client_scala | client-akka/src/main/scala/com/full360/prometheus/http/akka/AkkaHttpMetricService.scala | Scala | mit | 1,749 |
package mechanics
import Node._
/**
* The Node class represents the nodes used by the character pathfinding included
* in the Grid class. One node approximately represents the middle of a grid cell.
* The algoritm used is a variation of the A* pathfinding algorithm.
* Here, efficiency is more important than mathe... | Berthur/AgeOfLords | src/mechanics/Node.scala | Scala | gpl-3.0 | 2,060 |
package io.gatling.keycloak
import akka.actor.ActorDSL._
import akka.actor.ActorRef
import io.gatling.core.action.Interruptable
import io.gatling.core.action.builder.ActionBuilder
import io.gatling.core.config.Protocols
import io.gatling.core.result.writer.DataWriterClient
import io.gatling.core.session.{Session, Expr... | rvansa/keycloak-benchmark | src/main/scala/io/gatling/keycloak/RefreshToken.scala | Scala | apache-2.0 | 1,329 |
package com.normation.rudder.domain.eventlog
import scala.xml.Elem
import com.normation.eventlog.EventLog
import com.normation.eventlog.EventLogDetails
import com.normation.eventlog.EventLogFilter
import com.normation.eventlog.EventLogType
import com.normation.rudder.domain.Constants
import com.normation.utils.Hashco... | armeniaca/rudder | rudder-core/src/main/scala/com/normation/rudder/domain/eventlog/PolicyServerEventLog.scala | Scala | gpl-3.0 | 1,655 |
package org.scalafmt.config
import metaconfig._
import metaconfig.generic.Surface
/**
*
* @param openParenCallSite
* If true AND bin-packing is true, then call-site
* arguments won't be aligned by the opening
* parenthesis. For example, this output
* will be disallowed
*
* function(a,
* ... | olafurpg/scalafmt | scalafmt-core/shared/src/main/scala/org/scalafmt/config/Align.scala | Scala | apache-2.0 | 4,808 |
package com.hideto0710.scalack.builders
import com.hideto0710.scalack.Scalack
import com.hideto0710.scalack.Scalack.Auth
import com.typesafe.config.ConfigFactory
import org.scalatest.{FlatSpec, Matchers}
import scala.concurrent.Await
import scala.concurrent.duration.Duration
class ListChannelsSpec extends FlatSpec()... | hideto0710/scalack | src/test/scala/com/hideto0710/scalack/builders/ListChannelsSpec.scala | Scala | mit | 886 |
package scalapb.docs
object CommonProtos {
def row(libName: String, version: String): String = {
s"""### $libName
|ScalaPB 0.10.x:
|```scala
|libraryDependencies ++= Seq(
| "com.thesamet.scalapb.common-protos" %% "${libName}-scalapb_0.10" % "${version}" % "protobuf",
| "com.t... | trueaccord/ScalaPB | docs/src/main/scala/scalapb/docs/CommonProtos.scala | Scala | apache-2.0 | 1,057 |
/* scala-stm - (c) 2009-2011, Stanford University, PPL */
package stmbench7.scalastm
import scala.concurrent.stm._
import stmbench7.core._
class ModuleImpl(id: Int, typ: String, buildDate: Int, man: Manual
) extends DesignObjImpl(id, typ, buildDate) with Module {
val designRoot = Ref(null : ComplexAssembl... | nbronson/scala-stm | disabled/stmbench7/scalastm/ModuleImpl.scala | Scala | bsd-3-clause | 475 |
package scorex.network
import java.net.{InetAddress, InetSocketAddress, NetworkInterface, URI}
import akka.actor._
import akka.io.Tcp._
import akka.io.{IO, Tcp}
import akka.pattern.ask
import akka.util.Timeout
import scorex.app.Application
import scorex.network.message.{Message, MessageSpec}
import scorex.network.pee... | ScorexProject/Scorex-Lagonaki | scorex-basics/src/main/scala/scorex/network/NetworkController.scala | Scala | cc0-1.0 | 6,458 |
/*
* OneTimeFiltering.scala
* One-time filtering algorithms.
*
* Created By: Avi Pfeffer ([email protected])
* Creation Date: Jan 1, 2009
*
* Copyright 2013 Avrom J. Pfeffer and Charles River Analytics, Inc.
* See http://www.cra.com or email [email protected] for information.
*
* See http://www.github.c... | jyuhuan/figaro | Figaro/src/main/scala/com/cra/figaro/algorithm/filtering/OneTimeFiltering.scala | Scala | bsd-3-clause | 1,532 |
/*
* Copyright 2012 Arktekk AS
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to i... | arktekk/scala-atom | src/main/scala/no/arktekk/atom/extension/opensearch/IntAtomExtension.scala | Scala | apache-2.0 | 1,312 |
/***********************************************************************
* Copyright (c) 2013-2018 Commonwealth Computer Research, Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Apache License, Version 2.0
* which accompanies this distribution and... | ddseapy/geomesa | geomesa-utils/src/test/scala/org/locationtech/geomesa/utils/stats/TopKTest.scala | Scala | apache-2.0 | 10,185 |
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you ... | ueshin/apache-flink | flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/plan/ProjectionTranslator.scala | Scala | apache-2.0 | 12,940 |
package org.kimbasoft.akka.eventbus
import akka.actor.{DeadLetter, Props, Actor}
import org.kimbasoft.akka.eventbus.EventBusMessages._
import scala.util.{Failure, Success}
/**
* Missing documentation.
*
* @author <a href="[email protected]">Steffen Krause</a>
* @since 1.0
*/
class EventBusActor(name... | kimba74/sandbox-scala | src/main/scala/org/kimbasoft/akka/eventbus/EventBusActor.scala | Scala | gpl-3.0 | 1,625 |
package api.status
import java.io.File
import java.util.UUID
import org.json4s.JInt
import org.json4s.JsonDSL._
import org.json4s.jackson.JsonMethods.{ compact, parse, render }
import api.common.DsmoqSpec
import dsmoq.AppConf
import dsmoq.controllers.AjaxResponse
import dsmoq.services.json.GroupData.Group
import dsm... | nkawa/dsmoq | server/apiServer/src/test/scala/api/status/GroupStatusCheckSpec.scala | Scala | apache-2.0 | 49,657 |
/*
* Copyright 2021 HM Revenue & Customs
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or a... | hmrc/amls-frontend | app/controllers/businessactivities/RiskAssessmentController.scala | Scala | apache-2.0 | 3,733 |
/**
* Copyright (c) 2016-2017, Benjamin Fradet, and other contributors.
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file... | BenFradet/spark-kafka-writer | src/test/scala/com/github/benfradet/spark/kafka/writer/RDDKafkaWriterSpec.scala | Scala | apache-2.0 | 2,299 |
/*
* The Bluejelly project, Copyright 2012.
*
* This source code is distributed under the terms of
* the BSD license, see the LICENSE file for details.
*/
package bluejelly.bjc.parser
import java.math.BigInteger
import scala.annotation.tailrec
import scala.collection.mutable.StringBuilder
import scala.language.... | ppedemon/Bluejelly | bluejelly-bjc/src/main/scala/bluejelly/bjc/parser/Lexer.scala | Scala | bsd-3-clause | 10,838 |
package tomduhourq.learningscalaz.truthy
import tomduhourq.learningscalaz.op.ToCanIsTruthyOps
/**
* Boolean typeclass.
*/
trait CanTruthy[A] { self =>
def truthys(a: A): Boolean
}
object CanTruthy {
def apply[A](implicit ev: CanTruthy[A]) = ev
def truthys[A](f: A => Boolean) = new CanTruthy[A] {
def tru... | tomduhourq/learning-scalaz | src/main/scala/tomduhourq/learningscalaz/truthy/CanTruthy.scala | Scala | apache-2.0 | 905 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | style95/openwhisk | common/scala/src/main/scala/org/apache/openwhisk/http/ErrorResponse.scala | Scala | apache-2.0 | 14,052 |
package amora.backend
import scala.concurrent.Future
import scala.util.Failure
import scala.util.Success
import akka.actor.ActorRef
import akka.actor.ActorSystem
import amora.backend.actors.NvimMsg.NvimSignal
import amora.backend.internal.WindowTreeCreator
import nvim.{Selection ⇒ _, _}
import nvim.internal.Notificat... | sschaef/tooling-research | backend/src/main/scala/amora/backend/NvimAccessor.scala | Scala | mit | 5,964 |
package jk_5.nailed.logging
import java.util.logging.{LogManager, Level, Logger}
import java.io.PrintStream
import jk_5.nailed.Nailed
/**
* No description given
*
* @author jk-5
*/
object NailedLogging {
final val sysOut = System.out
private final val globalLogger = Logger.getLogger(Logger.GLOBAL_LOGGER_NAM... | nailed/nailed-legacy | src/main/scala/jk_5/nailed/logging/NailedLogging.scala | Scala | unlicense | 1,433 |
package jigg.nlp.ccg
/*
Copyright 2013-2015 Hiroshi Noji
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or ... | mynlp/jigg | src/main/scala/jigg/nlp/ccg/OutputCategoryList.scala | Scala | apache-2.0 | 3,445 |
package org.tuubes.core.engine
/**
* Asynchronous source of events consumed by observers (or "listeners").
*
* @tparam A events emitted by this observables
*/
trait Observable[A] {
def subscribe(f: A => Unit): Unit
// TODO add unsubscribe
// TODO add functional operations like filter and map
}
trait BiObserv... | mcphoton/Photon-Server | core/src/main/scala/org/tuubes/core/engine/Observable.scala | Scala | lgpl-3.0 | 458 |
package sampler.cluster.abc.actor.root
import akka.actor.Actor
import akka.actor.Props
import akka.routing.FromConfig
import sampler.cluster.abc.actor.BroadcastActor
import sampler.cluster.abc.actor.ReceiveActor
import sampler.cluster.abc.actor.worker.WorkerActorImpl
import sampler.cluster.abc.config.ABCConfig
import ... | tsaratoon/Sampler | sampler-cluster/src/main/scala/sampler/cluster/abc/actor/root/ChildActorsComponent.scala | Scala | apache-2.0 | 1,022 |
package is.hail.types.physical
import is.hail.annotations.UnsafeUtils
import is.hail.types.BaseStruct
import is.hail.types.virtual.{TTuple, Type}
import is.hail.utils._
object PCanonicalTuple {
def apply(required: Boolean, args: PType*): PCanonicalTuple = PCanonicalTuple(args.iterator.zipWithIndex.map { case (t, i) ... | hail-is/hail | hail/src/main/scala/is/hail/types/physical/PCanonicalTuple.scala | Scala | mit | 1,637 |
package test_data.v20
import scala.xml.Elem
case class SectionAboutTheCareYouProvide(xml: Elem) {
val rootPath = xml \\\\ "DWPCATransaction" \\\\ "DWPCAClaim" \\\\ "Caree"
val nationalInsuranceNumber = rootPath \\\\ "NationalInsuranceNumber"
val dateOfBirth = rootPath \\\\ "DateOfBirth"
val liveSameAddre... | Department-for-Work-and-Pensions/RenderingService | test/test_data/v20/SectionAboutTheCareYouProvide.scala | Scala | mit | 1,283 |
/***********************************************************************
* Copyright (c) 2013-2016 Commonwealth Computer Research, Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Apache License, Version 2.0
* which accompanies this distribution and is ... | mdzimmerman/geomesa | geomesa-utils/src/main/scala/org/locationtech/geomesa/utils/CartesianProductIterable.scala | Scala | apache-2.0 | 1,899 |
package com.github.jmora.scala.util
object App extends App {
println(" - Hello World!")
}
| jmora/scala.util | src/main/scala/com/github/jmora/scala/util/App.scala | Scala | mit | 94 |
import org.scalacheck._, Prop._, Gen._, Arbitrary._
import scala.tools.reflect.{ToolBox, ToolBoxError}
import scala.reflect.runtime.currentMirror
import scala.reflect.runtime.universe._, Flag._, internal.reificationSupport.setSymbol
class QuasiquoteProperties(name: String) extends Properties(name) with ArbitraryTreesA... | felixmulder/scala | test/files/scalacheck/quasiquotes/QuasiquoteProperties.scala | Scala | bsd-3-clause | 4,128 |
package fuel.example
import scala.Range
import fuel.func.RunExperiment
import fuel.func.SimpleEA
import fuel.moves.PermutationMoves
import fuel.util.OptColl
/**
* Traveling Salesperson problem.
*
* Minimized fitness function.
*/
object TSP extends App {
new OptColl('numCities -> 30, 'maxGenerations -> 300)... | iwob/fuel | src/main/scala/fuel/example/TSP.scala | Scala | mit | 794 |
/*
* Copyright (c) 2016, Team Mion
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIM... | teammion/tm-morefood | src/main/scala/io/teammion/morefood/EventHandler.scala | Scala | isc | 1,706 |
package app
import util.Directory._
import util.Implicits._
import util.ControlUtil._
import _root_.util.{ReferrerAuthenticator, JGitUtil, FileUtil, StringUtil}
import service._
import org.scalatra._
import java.io.File
import org.eclipse.jgit.api.Git
import org.eclipse.jgit.lib._
import org.apache.commons.io.FileUtil... | smly/gitbucket | src/main/scala/app/RepositoryViewerController.scala | Scala | apache-2.0 | 9,296 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | zzcclp/carbondata | integration/spark/src/main/scala/org/apache/carbondata/events/DropTableEvents.scala | Scala | apache-2.0 | 1,703 |
/**
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may... | wangcy6/storm_app | frame/kafka-0.11.0/kafka-0.11.0.1-src/core/src/main/scala/kafka/log/LogCleanerManager.scala | Scala | apache-2.0 | 13,682 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | HuaweiBigData/carbondata | integration/spark2/src/main/scala/org/apache/spark/sql/execution/command/preaaggregate/PreAggregateListeners.scala | Scala | apache-2.0 | 11,323 |
package org.broadinstitute.dsde.firecloud.webservice
import akka.http.scaladsl.client.RequestBuilding
import akka.http.scaladsl.server.{Directives, Route}
import com.typesafe.scalalogging.LazyLogging
import org.broadinstitute.dsde.firecloud.service.{ExportEntitiesByTypeActor, ExportEntitiesByTypeArguments, FireCloudDi... | broadinstitute/firecloud-orchestration | src/main/scala/org/broadinstitute/dsde/firecloud/webservice/ExportEntitiesApiService.scala | Scala | bsd-3-clause | 1,542 |
package org.jetbrains.plugins.scala.lang.formatting
import com.intellij.formatting.{Wrap, WrapType}
import com.intellij.lang.ASTNode
import com.intellij.psi.PsiElement
import com.intellij.psi.util.PsiTreeUtil
import org.jetbrains.plugins.scala.lang.formatting.settings.ScalaCodeStyleSettings
import org.jetbrains.plugin... | LPTK/intellij-scala | src/org/jetbrains/plugins/scala/lang/formatting/ScalaWrapManager.scala | Scala | apache-2.0 | 9,473 |
/**
* Licensed to the Minutemen Group under one or more contributor license
* agreements. See the COPYRIGHT file distributed with this work for
* additional information regarding copyright ownership.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you
* may not use this file except in complian... | mohiva/silhouette | modules/provider-oauth2/src/main/scala/silhouette/provider/oauth2/DropboxProvider.scala | Scala | apache-2.0 | 4,835 |
package dk.tennis.compare
import dk.atp.api.tournament.GenericTournamentAtpApi
import dk.tennisprob.tournament.GenericTournamentProbCalc
import dk.tennis.compare.rating.multiskill.matchloader.MatchesLoader
import dk.tennis.compare.rating.multiskill.infer.matchprob.givenmatchresults.InferMatchProbGivenMatchResults
impo... | danielkorzekwa/tennis-player-compare | model-tester/src/test/scala/dk/tennis/compare/TournamentApp.scala | Scala | bsd-2-clause | 2,813 |
/*
* Copyright (c) 2021, salesforce.com, inc.
* All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
*/
package com.krux.hyperion.precondition
import com.krux.hyperion.adt.HString
import com.kru... | realstraw/hyperion | core/src/main/scala/com/krux/hyperion/precondition/DynamoDBTableExistsPrecondition.scala | Scala | bsd-3-clause | 1,727 |
/*
* Copyright 2016 The BigDL Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agr... | yiheng/BigDL | spark/dl/src/test/scala/com/intel/analytics/bigdl/transform/vision/image/augmentation/RandomAlterRatioSpec.scala | Scala | apache-2.0 | 1,430 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not u... | knockdata/spark-highcharts | src/main/scala/com/knockdata/spark/highcharts/plotoptions/Pyramid.scala | Scala | apache-2.0 | 2,737 |
/*
* Copyright 2021 HM Revenue & Customs
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or a... | hmrc/amls-frontend | test/controllers/businessdetails/CorporationTaxRegisteredControllerSpec.scala | Scala | apache-2.0 | 5,481 |
package mesosphere.marathon.api
import mesosphere.chaos.http.RestModule
import mesosphere.jackson.CaseClassModule
import mesosphere.marathon.api.v2.json.MarathonModule
import com.google.inject.Scopes
import com.fasterxml.jackson.module.scala.DefaultScalaModule
class MarathonRestModule extends RestModule {
override... | sielaq/marathon | src/main/scala/mesosphere/marathon/api/MarathonRestModule.scala | Scala | apache-2.0 | 1,617 |
package org.littlewings.lyricsbot
import java.util.TimeZone
import org.quartz.CronScheduleBuilder._
import org.quartz.JobBuilder._
import org.quartz.TriggerBuilder._
import org.quartz.impl.StdSchedulerFactory
import org.quartz.{Job, Scheduler}
object ScheduledLyricsBotSupport {
private lazy val SCHEDULER: Schedule... | kazuhira-r/lyrics-bot | src/main/scala/org/littlewings/lyricsbot/ScheduledLyricsBotSupport.scala | Scala | apache-2.0 | 1,231 |
package com.sksamuel.elastic4s.requests.indexes
import com.sksamuel.elastic4s.requests.analyzers.{AnalyzerDefinition, NormalizerDefinition}
import com.sksamuel.elastic4s.requests.mappings.MappingDefinition
import com.sksamuel.elastic4s.requests.searches.queries.Query
import com.sksamuel.exts.OptionImplicits._
case cl... | stringbean/elastic4s | elastic4s-core/src/main/scala/com/sksamuel/elastic4s/requests/indexes/CreateIndexTemplateRequest.scala | Scala | apache-2.0 | 3,730 |
/*
* Copyright 2014 http4s.org
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to i... | http4s/blaze | core/src/test/scala/org/http4s/blaze/pipeline/PipelineSuite.scala | Scala | apache-2.0 | 3,567 |
object Test {
trait Tagged[A]
// Negation Tagged: NotTagged[A] is available only if there are no Tagged[A] in scope.
trait NotTagged[A]
trait NotTaggedLowPrio {
implicit def notTaggedInstance[A]: NotTagged[A] = null
}
object NotTagged extends NotTaggedLowPrio {
implicit def notTaggedAmbiguity1[A](... | som-snytt/dotty | tests/pos-scala2/i3396.scala | Scala | apache-2.0 | 914 |
package wdl.expression
import org.scalatest.{FlatSpec, Matchers}
import wom.types._
import wom.values._
import scala.util.Success
class PureStandardLibraryFunctionsSpec extends FlatSpec with Matchers {
behavior of "transpose"
it should "transpose a 2x3 into a 3x2" in {
val inArray = WomArray(WomArrayType(W... | ohsu-comp-bio/cromwell | wdl/src/test/scala/wdl/expression/PureStandardLibraryFunctionsSpec.scala | Scala | bsd-3-clause | 3,274 |
package scalax.collection
import org.scalatest.{Spec, Matchers}
import GraphPredef._, GraphEdge._, edge._, edge.LBase._, edge.Implicits._
import org.scalatest.junit.JUnitRunner
import org.junit.runner.RunWith
import custom.flight._,
custom.flight.Helper._,
custom.flight.FlightImplicits._
... | chen0031/scala-graph | core/src/test/scala/scalax/collection/TEdge.scala | Scala | bsd-3-clause | 7,600 |
package org.cakesolutions.akkapatterns
import org.specs2.mutable.Specification
import org.specs2.specification.Analysis
import org.specs2.analysis.ClassycleDependencyFinder
class ArchitectureSpec extends Specification with Analysis with ClassycleDependencyFinder {
"The architecture" should {
"Have properly def... | anand-singh/akka-patterns | sbt/src/test/scala/org/cakesolutions/akkapatterns/ArchitectureSpec.scala | Scala | apache-2.0 | 566 |
package fpinscala.datastructures
sealed trait Tree[+A]
case class Leaf[A](value: A) extends Tree[A]
case class Branch[A](left: Tree[A], right: Tree[A]) extends Tree[A]
object Tree {
def size[A](t: Tree[A]): Int = t match {
case Leaf(_) => 1
case Branch(l,r) => 1 + size(l) + size(r)
}
/*
We are us... | ShokuninSan/fpinscala | answers/src/main/scala/fpinscala/datastructures/Tree.scala | Scala | mit | 2,926 |
import akka.actor.Actor
import akka.actor.ActorRef
import akka.actor.ActorSystem
import akka.actor.Props
import scala.util.Random
//WorkerType
//////////
object WorkerType extends Enumeration {
type WorkerType = Value
val Elf, Reindeer = Value
}
//Worker
////////
class Worker(
workerType: WorkerType.WorkerType,... | eXeDK/dpt908e14 | SantaClaus/SantaClausScala.scala | Scala | mit | 2,804 |
/*
Copyright 2012 Twitter, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distr... | rubanm/scalding | scalding-commons/src/main/scala/com/twitter/scalding/commons/source/VersionedKeyValSource.scala | Scala | apache-2.0 | 9,965 |
package com.kelebra.github.impatient.scala.katas
import org.scalacheck.Gen
import scala.collection.mutable.ArrayBuffer
class ArraysSpec extends ScalaTestSetup[Arrays] {
val implementation = Arrays
"Control Structures and Functions" when {
"method range implemented" should {
"work for integers" in {... | kelebra/impatient-scala-katas | src/test/scala/com/kelebra/github/impatient/scala/katas/ArraysSpec.scala | Scala | mit | 3,066 |
Subsets and Splits
Filtered Scala Code Snippets
The query filters and retrieves a sample of code snippets that meet specific criteria, providing a basic overview of the dataset's content without revealing deeper insights.