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 |
|---|---|---|---|---|---|
package epic.sequences
import breeze.util.Index
import breeze.numerics
import breeze.linalg.{argmax, softmax, DenseVector}
import epic.framework._
import java.util
import collection.mutable.ArrayBuffer
import breeze.features.FeatureVector
import epic.constraints.{LabeledSpanConstraints, TagConstraints}
import epic.uti... | followyourheart/epic | src/main/scala/epic/sequences/CRF.scala | Scala | apache-2.0 | 13,322 |
package io.getquill.context.jdbc.sqlite
import io.getquill.{ JdbcContext, Literal, SqliteDialect, TestEntities }
import io.getquill.context.jdbc.TestEncoders
import io.getquill.context.sql.TestDecoders
object testContext extends JdbcContext[SqliteDialect, Literal]("testSqliteDB") with TestEntities with TestEncoders w... | jcranky/quill | quill-jdbc/src/test/scala/io/getquill/context/jdbc/sqlite/TestContext.scala | Scala | apache-2.0 | 337 |
/*
* 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 ... | holdenk/spark | sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/FileSourceStrategy.scala | Scala | apache-2.0 | 11,322 |
package com.eevolution.context.dictionary.infrastructure.repository
import com.eevolution.context.dictionary.domain.model.PackageImportDetail
import com.eevolution.context.dictionary.infrastructure.db.DbContext._
/**
* Copyright (C) 2003-2017, e-Evolution Consultants S.A. , http://www.e-evolution.com
* This progr... | adempiere/ADReactiveSystem | dictionary-impl/src/main/scala/com/eevolution/context/dictionary/infrastructure/repository/PackageImportDetailMapping.scala | Scala | gpl-3.0 | 1,978 |
/*
* Copyright 2015 Webtrends (http://www.webtrends.com)
*
* See the LICENCE.txt 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 compliance with the License.
* Yo... | Webtrends/wookiee-socko | src/test/scala/com/webtrends/harness/component/socko/CommandSpec.scala | Scala | apache-2.0 | 3,656 |
import leon.annotation._
import leon.lang._
object InsertionSort {
sealed abstract class List
case class Cons(head: BigInt,tail: List) extends List
case class Nil() extends List
sealed abstract class OptInt
case class Some(value: BigInt) extends OptInt
case class None() extends OptInt
def size(l : List... | regb/leon | testcases/verification/list-algorithms/InsertionSort.scala | Scala | gpl-3.0 | 2,863 |
/** MACHINE-GENERATED FROM AVRO SCHEMA. DO NOT EDIT DIRECTLY */
package example.idl.model
import org.apache.avro.Schema
import org.oedura.scavro.{AvroMetadata, AvroReader, AvroSerializeable}
import other.ns.model.{ExternalDependency, Suit}
import example.idl.{DependentRecord => JDependentRecord, DependentRecord2 =>... | julianpeeters/avrohugger | avrohugger-core/src/test/expected/scavro/example/idl/model/ImportProtocol.scala | Scala | apache-2.0 | 3,482 |
package pl.touk.nussknacker.k8s.manager.deployment
import net.ceedubs.ficus.Ficus
import net.ceedubs.ficus.Ficus._
import net.ceedubs.ficus.readers.ArbitraryTypeReader._
import net.ceedubs.ficus.readers.ValueReader
import pl.touk.nussknacker.k8s.manager.deployment.K8sScalingConfig._
trait K8sScalingOptionsDeterminer ... | TouK/nussknacker | engine/lite/k8sDeploymentManager/src/main/scala/pl/touk/nussknacker/k8s/manager/deployment/K8sScalingOptionsDeterminer.scala | Scala | apache-2.0 | 2,941 |
/*
* Accio is a platform to launch computer science experiments.
* Copyright (C) 2016-2018 Vincent Primault <v.primault@ucl.ac.uk>
*
* Accio is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version... | privamov/accio | accio/javatests/fr/cnrs/liris/lumos/transport/LumosServiceCollector.scala | Scala | gpl-3.0 | 1,897 |
package com.wuyuntao.aeneas.migration.dsl
import com.datastax.driver.core.RegularStatement
import com.datastax.driver.core.SimpleStatement
trait DbModifier extends TableModifier with ColumnModifier with TypeModifier {
def executeStatement(statement: RegularStatement)
def executeSql(sql: String) = {
... | wuyuntao/Aeneas | aeneas-migration/src/main/scala/com/wuyuntao/aeneas/migration/dsl/DbModifier.scala | Scala | apache-2.0 | 370 |
package challenge7
import core._
/*
* A state data type that represents the threading
* of some state value through computations in some effect M.
*/
case class StateT[M[_], S, A](run: S => M[(S, A)]) {
/*
* Exercise 7.1:
*
* Implement map for StateT[M, S, A].
*
* The following laws must hold:
... | Kimply/scala-challenge | src/main/scala/challenge7/StateT.scala | Scala | mit | 2,477 |
package applicative
import monad.Functor
import monad.Monad.Id
import monoid.Monoid
import monoid.Monoid.Foldable
/**
* Created by ariwaranosai on 16/8/27.
*
*/
trait Applicative[F[_]] extends Functor[F] { self =>
def map2[A, B, C](fa: F[A], fb: F[B])(f: (A, B) => C): F[C]
def map2_[A, B, C](fa: F[A], fb: ... | ariwaranosai/FPinScala | src/main/scala/applicative/Applicative.scala | Scala | mit | 5,217 |
/**
* 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... | usakey/kafka | core/src/main/scala/kafka/server/ZookeeperLeaderElector.scala | Scala | apache-2.0 | 5,879 |
// Copyright: 2017 Sam Halliday
// License: http://www.gnu.org/licenses/lgpl.html
import sbt._
import sbt.Keys._
object NeoJmhKeys {
/** Where you put your JMH code. */
val Jmh = config("jmh") extend Test
val neoJmhGenerator = settingKey[String]("Available: `reflection` or `asm`")
}
/**
* https://github.com/k... | vovapolu/scala-data-classes | project/NeoJmh.scala | Scala | lgpl-3.0 | 3,024 |
package tul.poiis.decision_tree
import scala.collection.mutable.ListBuffer
object InputParsers {
def parseMovieEntry(csv_entry: Map[String, String]): (Int, Movie) = {
val fieldsList = ListBuffer[MovieField]()
fieldsList += new PopularityField(csv_entry("popularity"))
fieldsList += new BudgetField(csv_en... | CucumisSativus/decision-tree-movie-evaluator | src/main/scala/tul/poiis/decision_tree/InputParsers.scala | Scala | mit | 2,074 |
package com.sksamuel.elastic4s
sealed trait VersionType
object VersionType {
def valueOf(str: String): VersionType = str.toLowerCase match {
case "external" => VersionType.External
case "externalgte" | "external_gte" => VersionType.ExternalGte
case "force" => V... | Tecsisa/elastic4s | elastic4s-core/src/main/scala/com/sksamuel/elastic4s/VersionType.scala | Scala | apache-2.0 | 725 |
/*
* Copyright 2014 Databricks
*
* 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... | eranr/spark-storlets | src/main/scala/org/apache/storlets/spark/csv/util/InferSchema.scala | Scala | apache-2.0 | 5,891 |
package skinny
/**
* Pagination builder.
*/
object Pagination {
def page(pageNo: Int): PaginationPageNoBuilder = {
PaginationPageNoBuilder(pageNo = Option(pageNo))
}
def per(pageSize: Int): PaginationPageSizeBuilder = {
PaginationPageSizeBuilder(pageSize = Option(pageSize))
}
}
/**
* Pagination ... | Kuchitama/skinny-framework | common/src/main/scala/skinny/Pagination.scala | Scala | mit | 847 |
package com.spike.giantdataanalysis.spark.example.rdd
import com.spike.giantdataanalysis.spark.support.Datasets
object RDDCreation {
def main(args: Array[String]): Unit = {
// 创建RDD的两种方式: 从外部数据源加载; 在驱动程序中并行化集合
val inputFile = Datasets.DATA_DIR + "sonnets.txt"
val input = sc.textFile(inputFile)
print... | zhoujiagen/giant-data-analysis | data-management-infrastructure/scala-infrastructure-apache-spark/src/main/scala/com/spike/giantdataanalysis/spark/example/rdd/RDDCreation.scala | Scala | mit | 499 |
/*
* Copyright (C) 2009-2018 Lightbend Inc. <https://www.lightbend.com>
*/
package play.api.mvc
trait RequestExtractors extends AcceptExtractors {
/**
* Convenient extractor allowing to apply two extractors.
* Example of use:
* {{{
* request match {
* case Accepts.Json() & Accepts.Html() => "Thi... | Shenker93/playframework | framework/src/play/src/main/scala/play/api/mvc/RequestExtractors.scala | Scala | apache-2.0 | 1,598 |
/**
* Copyright (C) 2016 Verizon. All Rights Reserved.
*
* 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 o... | Verizon/trapezium | framework/src/main/scala/com/verizon/bda/trapezium/framework/manager/WorkflowConfig.scala | Scala | apache-2.0 | 7,941 |
package org.jetbrains.plugins.scala
package lang.refactoring.move
import java.lang.Boolean
import java.util
import com.intellij.psi.{PsiClass, PsiElement}
import com.intellij.refactoring.move.moveClassesOrPackages.MoveAllClassesInFileHandler
import org.jetbrains.plugins.scala.lang.psi.ScalaPsiUtil
import org.jetbrain... | LPTK/intellij-scala | src/org/jetbrains/plugins/scala/lang/refactoring/move/MoveScalaClassesInFileHandler.scala | Scala | apache-2.0 | 1,557 |
/*
* Part of NDLA article-api.
* Copyright (C) 2019 NDLA
*
* See LICENSE
*/
package no.ndla.articleapi.integration
import java.util.concurrent.Executors
import com.typesafe.scalalogging.LazyLogging
import no.ndla.articleapi.ArticleApiProperties.SearchHost
import no.ndla.articleapi.model.domain.{Article, Article... | NDLANO/article-api | src/main/scala/no/ndla/articleapi/integration/SearchApiClient.scala | Scala | gpl-3.0 | 2,941 |
// code-examples/TypeLessDoMore/semicolon-example-script.scala
// Trailing equals sign indicates more code on next line
def equalsign = {
val reallySuperLongValueNameThatGoesOnForeverSoYouNeedANewLine =
"wow that was a long value name"
println(reallySuperLongValueNameThatGoesOnForeverSoYouNeedANewLine)
}
// ... | XClouded/t4f-core | scala/src/tmp/TypeLessDoMore/semicolon-example-script.scala | Scala | apache-2.0 | 613 |
object Bar
trait Foo {
@AnnotationWithClassType(cls = classOf[Bar.type])
def function: Any = ???
}
| scala/scala | test/files/pos/classOfObjectType/Foo.scala | Scala | apache-2.0 | 105 |
package dotty.tools.dotc
package transform
import core._
import Symbols._, Types._, Contexts._, SymDenotations._, DenotTransformers._, Flags._
import util.Positions._
import SymUtils._
import StdNames._, NameOps._
class MixinOps(cls: ClassSymbol, thisTransform: DenotTransformer)(implicit ctx: Context) {
import ast.... | folone/dotty | src/dotty/tools/dotc/transform/MixinOps.scala | Scala | bsd-3-clause | 1,821 |
package com.sksamuel.elastic4s.fields
import com.sksamuel.elastic4s.ext.OptionImplicits._
case class DynamicField(override val name: String,
analyzer: Option[String] = None,
boost: Option[Double] = None,
coerce: Option[Boolean] = None,
... | sksamuel/elastic4s | elastic4s-domain/src/main/scala/com/sksamuel/elastic4s/fields/DynamicField.scala | Scala | apache-2.0 | 2,534 |
/***********************************************************************
* 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/main/scala/org/locationtech/geomesa/utils/conf/ConfigLoader.scala | Scala | apache-2.0 | 2,575 |
package com.cterm2.miniflags
import net.minecraft.world.WorldServer
import cpw.mods.fml.common.eventhandler._
import cpw.mods.fml.common.gameevent.PlayerEvent
import net.minecraft.entity.player.EntityPlayerMP
import cpw.mods.fml.relauncher.{SideOnly, Side}
import net.minecraftforge.common.DimensionManager
object FMLE... | Pctg-x8/miniflags | src/FMLEvents.scala | Scala | lgpl-2.1 | 943 |
/*
* 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/ct-calculations | src/main/scala/uk/gov/hmrc/ct/CATO16.scala | Scala | apache-2.0 | 2,168 |
package org.bitcoins.core.script.interpreter.testprotocol
import org.bitcoins.core.protocol.script.{ScriptSignature, ScriptPubKey}
import org.bitcoins.core.script.constant.ScriptToken
/**
* Created by chris on 3/14/16.
*/
trait ScriptSignatureCoreTestCase {
/**
* The parsed asm representation for the core test... | SuredBits/bitcoin-s-sidechains | src/test/scala/org/bitcoins/core/script/interpreter/testprotocol/ScriptSignatureCoreTestCase.scala | Scala | mit | 1,036 |
package com.twitter.finatra.http.integration.tweetexample.test
import com.fasterxml.jackson.databind.JsonNode
import com.twitter.finagle.http.Status
import com.twitter.finatra.http.integration.tweetexample.main.TweetsEndpointServer
import com.twitter.finatra.http.test.EmbeddedHttpServer
import com.twitter.inject.serve... | tempbottle/finatra | http/src/test/scala/com/twitter/finatra/http/integration/tweetexample/test/TweetsControllerIntegrationTest.scala | Scala | apache-2.0 | 4,260 |
/*
* Copyright 2018 Analytics Zoo 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... | intel-analytics/analytics-zoo | zoo/src/main/scala/com/intel/analytics/zoo/pipeline/api/keras/layers/HardTanh.scala | Scala | apache-2.0 | 2,606 |
package blitztags
import org.scalatest.FlatSpec
import org.scalatest.matchers.ShouldMatchers
import org.scalamock.scalatest.MockFactory
import scala.xml._
import blitztags.AddElementCommands._
class VoidElementSpec extends FlatSpec with ShouldMatchers with MockFactory with Attributes {
val Br = VoidElement("br")
... | Luegg/blitztags | src/test/scala/blitztags/AddElementCommandsSpec.scala | Scala | mit | 3,973 |
package slick.ast
import scala.collection.compat.immutable._
import scala.collection.mutable.ListBuffer
import scala.language.existentials
import scala.reflect.ClassTag
import slick.SlickException
import slick.util.{Dumpable, DumpInfo, GlobalConfig, ConstArray}
import TypeUtil._
/** A node in the Slick AST.
* Every... | slick/slick | slick/src/main/scala/slick/ast/Node.scala | Scala | bsd-2-clause | 35,340 |
/*
* 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 ... | goldmedal/spark | core/src/test/scala/org/apache/spark/util/FileAppenderSuite.scala | Scala | apache-2.0 | 15,370 |
package ch28_heap
import scala.util.control.Breaks._
class Heap(val capacity: Int, var elementCount: Int = 0) {
def this(arrayParam: Array[Int], bottomUp: Boolean) = {
this(arrayParam.length + 1)
if (bottomUp) {
arrayParam.foreach(this.insert)
} else {
//copy data into array of heap
f... | wangzheng0822/algo | scala/src/main/scala/ch28_heap/Heap.scala | Scala | apache-2.0 | 2,514 |
package msgpack4z
import scalaprops._
import scala.util.control.NonFatal
import scalaz._
abstract class SpecBase extends Scalaprops {
protected[this] final def expectException[A](f: => A): Unit = {
val ex = new Exception("expect Exception")
try {
val _ = f
throw ex
} catch {
case NonFa... | msgpack4z/msgpack4z-core | src/test/scala/msgpack4z/SpecBase.scala | Scala | mit | 1,925 |
package sp.domain
case class State(state: Map[ID, SPValue]) {
def add(tuple: (ID, SPValue)) = State(state.+(tuple))
def add(m: Map[ID, SPValue]) = State(state ++ m)
}
// TODO: Move to internal relation identification
case class States(states: Map[ID, Set[SPValue]]) {
def apply(id: ID): Set[SPValue] = states(... | kristoferB/SP | sp1/src/main/scala/sp/domain/State.scala | Scala | mit | 766 |
package com.tibidat
import scala.slick.jdbc.JdbcBackend.Database
import scala.slick.driver.H2Driver
class Model(name: String, dal: DAL, db: Database) {
import dal._
import dal.profile.simple._
implicit val implicitSession = db.createSession
def createDB = dal.create
def dropDB = dal.drop
def purgeDB... | m2w/ephemeral | src/main/scala/com/tibidat/DB.scala | Scala | mit | 956 |
/*
* 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 ... | rmetzger/flink | flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/calcite/RelTimeIndicatorConverter.scala | Scala | apache-2.0 | 22,495 |
package com.rasterfoundry.api.toolrun
import com.rasterfoundry.akkautil._
import com.rasterfoundry.datamodel._
import com.rasterfoundry.database.filter.Filterables._
import com.rasterfoundry.database.{ToolRunDao, UserDao}
import com.rasterfoundry.api.project.ProjectAuthorizationDirectives
import com.rasterfoundry.akka... | azavea/raster-foundry | app-backend/api/src/main/scala/toolrun/Routes.scala | Scala | apache-2.0 | 9,308 |
/**
* Copyright (C) 2009-2011 the original author or authors.
* See the notice.md 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 compliance with the License.
* Yo... | fusesource/coffeebar | src/main/scala/org/fusesource/coffeebar/auth/Authenticator.scala | Scala | apache-2.0 | 1,019 |
package reactivemongo.api
import scala.util.Try
import reactivemongo.bson.buffer.{ ReadableBuffer, WritableBuffer }
trait SerializationPack { self: Singleton =>
type Value
type ElementProducer
type Document <: Value
type Writer[A]
type Reader[A]
type NarrowValueReader[A]
private[reactivemongo]type Wide... | charleskubicek/ReactiveMongo | driver/src/main/scala/api/serializationpack.scala | Scala | apache-2.0 | 3,012 |
package breeze.optimize.linear
import org.scalatest._;
import org.scalatest.junit._;
import org.scalatest.prop._;
import org.junit.runner.RunWith
@RunWith(classOf[JUnitRunner])
class CompetitiveLinkingTest extends FunSuite with Checkers {
test("sanity check") {
val arr = Array( Seq(2.,4.,7.,9.), Seq(3.,9.,5.,1... | tjhunter/scalanlp-core | learn/src/test/scala/breeze/optimize/linear/CompetitiveLinkingTest.scala | Scala | apache-2.0 | 550 |
/*
* 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 ... | StephanEwen/incubator-flink | flink-table/flink-table-planner/src/test/scala/org/apache/flink/table/planner/runtime/batch/sql/CalcITCase.scala | Scala | apache-2.0 | 51,901 |
/*
* Tup2_1Expanded.scala
* (FScape)
*
* Copyright (c) 2001-2022 Hanns Holger Rutz. All rights reserved.
*
* This software is published under the GNU Affero General Public License v3+
*
*
* For further information, please contact Hanns Holger Rutz at
* contact@sciss.de
*/
package de.sciss.lucre.swing.... | Sciss/FScape-next | views/src/main/scala/de/sciss/lucre/swing/graph/impl/Tup2_1Expanded.scala | Scala | agpl-3.0 | 846 |
// Copyright: 2010 - 2016 https://github.com/ensime/ensime-server/graphs
// Licence: http://www.gnu.org/licenses/gpl-3.0.en.html
package org.ensime.intg
import org.ensime.api._
import org.ensime.core._
import org.ensime.fixture._
import org.ensime.util.EnsimeSpec
import org.ensime.util.file._
class BasicWorkflow exte... | d1egoaz/ensime-sbt | src/sbt-test/sbt-ensime/ensime-server/core/src/it/scala/org/ensime/intg/BasicWorkflow.scala | Scala | apache-2.0 | 23,769 |
package unit
import org.specs2.mutable._
import org.specs2.runner._
import org.junit.runner._
import play.api.test._
import play.api.test.Helpers._
import org.specs2.matcher.Matcher
import play.api.mvc.AnyContent
import play.api.mvc.Action
import Helpers._
@RunWith(classOf[JUnitRunner])
class JobsSpec extends Specifi... | fsteeg/appd | test/unit/JobsSpec.scala | Scala | epl-1.0 | 2,015 |
package services
import utils.Zookeeper
import kafka.utils.ZkUtils
import scala.collection._
import models.topics.Topics
import models.topics.Topic
import models.topics.DetailedTopics
import models.topics.BrokerTopicItem
object TopicService {
val topicsZPath = "/brokers/topics"
/**
* Gets all the topi... | alanlavintman/kafka-admin | app/services/TopicService.scala | Scala | mit | 1,892 |
package org.eigengo.cm.api
import spray.testkit.Specs2RouteTest
import org.specs2.mutable.Specification
import akka.actor.{Props, Actor}
import org.eigengo.cm.core.CoordinatorActor.Begin
class RecogServiceSpec extends Specification with Specs2RouteTest with BasicRecogService {
class TestCoordinatorActor extends Ac... | janm399/lambdadays2014 | jvm/src/test/scala/org/eigengo/cm/api/RecogServiceSpec.scala | Scala | apache-2.0 | 740 |
package play.api.libs.iteratee
import scala.concurrent._
import scala.concurrent.duration.Duration
import scala.concurrent.ExecutionContext.Implicits.global
import org.specs2.mutable._
object EnumerateesSpec extends Specification {
"Enumeratee.drop" should {
"ignore 3 chunkes when applied with 3" in {
... | noel-yap/setter-for-catan | play-2.1.1/framework/src/iteratees/src/test/scala/play/api/libs/iteratee/EnumerateesSpec.scala | Scala | apache-2.0 | 6,813 |
package com.learning.akka.typedactors.remoting
import java.util.concurrent.TimeUnit
import akka.actor._
import akka.util.Timeout
import com.typesafe.config.ConfigFactory
import scala.concurrent.duration._
import scala.collection.concurrent.TrieMap
trait Processor {
def process(message: String): String
}
class Pr... | lgrcyanny/LearningAkka | src/main/scala/com/learning/akka/typedactors/remoting/Master.scala | Scala | gpl-2.0 | 1,844 |
/**
* Copyright (C) 2010-2012 LShift Ltd.
*
* 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... | lshift/diffa | agent/src/test/scala/net/lshift/diffa/agent/itest/ChangeEventRateLimitingTest.scala | Scala | apache-2.0 | 3,218 |
/*
* Copyright 2014–2018 SlamData 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 agr... | jedesah/Quasar | connector/src/main/scala/quasar/qscript/analysis/ShapePreserving.scala | Scala | apache-2.0 | 4,575 |
package io.drakon.forgeraven.logging
/**
* Processing utilities for wrangling Log4j2 to behave.
*
* @author Arkan
*/
object LogHacks {
// TODO: Bully log4j2 horribly and without mercy, and insert Appenders into it.
}
| Emberwalker/ForgeRaven | src/main/scala/io/drakon/forgeraven/logging/LogHacks.scala | Scala | mit | 226 |
package mockws
import akka.NotUsed
import akka.stream.scaladsl.Source
import akka.util.ByteString
import mockws.MockWSHelpers._
import org.scalatestplus.scalacheck.ScalaCheckPropertyChecks
import play.api.http.HttpEntity
import play.api.libs.ws.WSClient
import play.api.mvc.MultipartFormData.DataPart
import play.api.mv... | leanovate/play-mockws | src/test/scala/mockws/StreamingTest.scala | Scala | mit | 5,413 |
/*
* ParticleFilter.scala
* Particle Filtering
*
* Created By: Avi Pfeffer (apfeffer@cra.com)
* Creation Date: Jan 1, 2009
*
* Copyright 2013 Avrom J. Pfeffer and Charles River Analytics, Inc.
* See http://www.cra.com or email figaro@cra.com for information.
*
* See http://www.github.com/p2t2/figaro... | bruttenberg/figaro | Figaro/src/main/scala/com/cra/figaro/algorithm/filtering/ParticleFilter.scala | Scala | bsd-3-clause | 11,221 |
/*
* 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... | intel-analytics/BigDL | scala/dllib/src/main/scala/com/intel/analytics/bigdl/dllib/keras/layers/GetShape.scala | Scala | apache-2.0 | 1,953 |
package chapter4
import org.scalatest.{FlatSpec, Matchers}
import scala.{Option => _, Some => _, Either => _, _}
class OptionSpec
extends FlatSpec
with Matchers {
behavior of "Chapter4 Option"
"Options Some.map" should "convert Some" in {
Some(6) should equal(Some(3).map(_ * 2))
}
"Options None.map... | chelck/fpis | src/test/scala/chapter4/OptionSpec.scala | Scala | mit | 1,599 |
/*
* 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 ... | minixalpha/spark | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/ScalaUDF.scala | Scala | apache-2.0 | 53,794 |
package entity
/**
* Samsara Aquarius
* Article share case class
*
* @author sczyh30
* @since 0.2.22
*
* @param sid share id, auto increment
* @param title article title
* @param url article url
* @param user user id, if not login could be default 0
*/
case class Share(sid: Int, title: String, ur... | sczyh30/samsara-aquarius | app/entity/Share.scala | Scala | mit | 360 |
package composition.webserviceclients.vehicleandkeeperlookup
import com.tzavellas.sse.guice.ScalaModule
import composition.webserviceclients.vehicleandkeeperlookup.TestVehicleAndKeeperLookupWebService.createResponse
import org.mockito.Matchers.any
import org.mockito.Mockito.when
import org.scalatest.mock.MockitoSugar
... | dvla/vrm-retention-online | test/composition/webserviceclients/vehicleandkeeperlookup/VehicleAndKeeperDetailsCallServerDown.scala | Scala | mit | 1,155 |
package chapter25
/**
* 25.2 공통 연산 한데 묶기
*
* 컬렉션 라이브러리 재설계의 주 목적은 타입을 자연스럽게 만드는 동시에 구현 코드를
* 최대한 공유하는 것이었다. 특히 스칼라의 컬렉션은 동일 결과타입(same result type) 원칙을
* 따른다. 가능하면, 어떤 컬렉션에 대해 실행한 변환 연산의 결과가 같은 타입의 컬렉션이어야 한다는 것이다.
*
* 이 절의 내용은 다른 부분보다 조금 심오하기 때문에 흡수하는데 시간이 걸릴 것이다.
*
* 구현 트레이트(implementation trait)라 불리는 제네릭 ... | seraekim/srkim-lang-scala | src/main/java/chapter25/c25_i02.scala | Scala | bsd-3-clause | 6,420 |
def f(a: Int)(b: Int) = {}
println(/* */f {1} {2}) | ilinum/intellij-scala | testdata/resolve2/function/block/BlocksToCurryied.scala | Scala | apache-2.0 | 51 |
package spatial.nodes
import argon.core._
import spatial.aliases._
object CounterChainType extends Type[CounterChain] {
override def wrapped(x: Exp[CounterChain]) = CounterChain(x)
override def unwrapped(x: CounterChain) = x.s
override def typeArguments = Nil
override def isPrimitive = false
override def st... | stanford-ppl/spatial-lang | spatial/core/src/spatial/nodes/CounterChain.scala | Scala | mit | 507 |
package com.twitter.finagle.netty3.transport
import com.twitter.concurrent.AsyncQueue
import com.twitter.finagle.transport.{Transport, TransportContext, LegacyContext}
import com.twitter.finagle.{ChannelClosedException, ChannelException, Status}
import com.twitter.util.{Future, Promise, Return, Time}
import java.net.S... | mkhq/finagle | finagle-netty3/src/main/scala/com/twitter/finagle/netty3/transport/ChannelTransport.scala | Scala | apache-2.0 | 6,444 |
/*
* 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 ... | bwsw/sj-platform | core/sj-mesos-framework/src/main/scala/com/bwsw/sj/mesos/framework/task/Task.scala | Scala | apache-2.0 | 3,137 |
/*
* (c) Copyright 2016 Hewlett Packard Enterprise Development LP
*
* 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 b... | hpe-cct/cct-core | src/main/scala/cogx/compiler/codegenerator/opencl/hyperkernels/SupersampleHyperKernel.scala | Scala | apache-2.0 | 3,285 |
package com.meteorcode.pathway.test
import me.hawkweisman.util.random._
import org.scalacheck.Gen
import org.scalatest.mock.MockitoSugar
import org.scalatest.prop.PropertyChecks
import org.scalatest.{Matchers, WordSpec, BeforeAndAfterEach}
/**
* General-purpose base class for a Pathway ScalaTest spec
*
* Created ... | MeteorCode/Pathway | src/test/scala/com/meteorcode/pathway/test/PathwaySpec.scala | Scala | mit | 2,018 |
package de.frosner.broccoli.websocket
import de.frosner.broccoli.models.Template.templateApiWrites
import de.frosner.broccoli.models._
import enumeratum._
import play.api.libs.json._
import scala.collection.immutable
sealed trait OutgoingMessage
object OutgoingMessage {
/**
* The type of an outgoing message ... | FRosner/cluster-broccoli | server/src/main/scala/de/frosner/broccoli/websocket/OutgoingMessage.scala | Scala | apache-2.0 | 4,152 |
package au.id.cxd.math.model.evaluation
/**
* compute peak percentage deviation.
*
* @param obs
* @param sim
*/
class PeakPercentDeviation(val obs:Seq[Double], val sim:Seq[Double]) {
def op():Double = {
val maxObs = obs.max
val maxSim = sim.max
val pdv = 100.0 * (maxSim - maxObs) / maxObs
... | cxd/scala-au.id.cxd.math | math/src/main/scala/au/id/cxd/math/model/evaluation/PeakPercentDeviation.scala | Scala | mit | 463 |
package org.juanitodread.pitayafinch.nlp.tools.sentences
import org.juanitodread.pitayafinch.UnitSpec
import org.juanitodread.pitayafinch.formatters.NumberFormatter
import org.juanitodread.pitayafinch.model.nlp.sentences.FinderResult
class FinderSpec extends UnitSpec {
val trainingModel: String = "/nlp/models/sente... | juanitodread/pitaya-finch | src/test/scala/org/juanitodread/pitayafinch/nlp/tools/sentences/FinderSpec.scala | Scala | apache-2.0 | 1,800 |
/*
* 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/test/scala/org/apache/carbondata/view/testutil/Tpcds_1_4_Tables.scala | Scala | apache-2.0 | 29,063 |
/*
* 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... | luchy0120/BigDL | spark/dl/src/main/scala/com/intel/analytics/bigdl/nn/TanhShrink.scala | Scala | apache-2.0 | 1,831 |
package com.hyenawarrior.oldnorsedictionary.new_word.new_pos_helpers
import android.view.View
import com.hyenawarrior.OldNorseGrammar.grammar.enums.{Case, GNumber}
import com.hyenawarrior.oldnorsedictionary.new_word.pages.WordData
/**
* Created by HyenaWarrior on 2017.04.17..
*/
object AddNewPosHelper
{
val DECLEN... | HyenaSoftware/IG-Dictionary | app/src/main/scala/com/hyenawarrior/oldnorsedictionary/new_word/new_pos_helpers/AddNewPosHelper.scala | Scala | lgpl-3.0 | 804 |
package com.excilys.computerdatabase.gatling.process
import com.typesafe.config.ConfigFactory
import io.gatling.core.Predef._
import io.gatling.http.Predef._
/**
* Created by Cédric Cousseran on 29/03/16.
* Process to add a computer when Spring Security is enabled.
*/
object AddSecurity {
val config = ConfigF... | nadiacom/training-java | gatling-test/src/test/scala/com/excilys/computerdatabase/gatling/process/AddSecurity.scala | Scala | apache-2.0 | 1,617 |
package is.hail.expr.ir.functions
import is.hail.annotations._
import is.hail.asm4s._
import is.hail.expr.ir._
import is.hail.types._
import is.hail.utils._
import is.hail.asm4s.coerce
import is.hail.experimental.ExperimentalFunctions
import is.hail.types.physical._
import is.hail.types.physical.stypes.{EmitType, SCod... | hail-is/hail | hail/src/main/scala/is/hail/expr/ir/functions/Functions.scala | Scala | mit | 37,580 |
package org.jetbrains.plugins.scala
package lang
package psi
package impl
package expr
import com.intellij.lang.ASTNode
import org.jetbrains.plugins.scala.lang.psi.api.expr._
/**
* @author Alexander Podkhalyuzin
* Date: 07.03.2008
*/
class ScAnnotationExprImpl(node: ASTNode) extends ScalaPsiElementImpl (node) with S... | LPTK/intellij-scala | src/org/jetbrains/plugins/scala/lang/psi/impl/expr/ScAnnotationExprImpl.scala | Scala | apache-2.0 | 395 |
package nl.rabobank.oss.rules.dsl.core
import nl.rabobank.oss.rules.dsl.core.TableSelectorGlossary._
import nl.rabobank.oss.rules.dsl.nl.grammar.DslTableSelector.prikken
import nl.rabobank.oss.rules.dsl.nl.grammar._
class TableSelectorBerekening extends {
} with Berekening (
Gegeven (altijd)
Bereken
ResultS... | scala-rules/scala-rules | engine/src/test/scala/nl/rabobank/oss/rules/dsl/core/TableSelectorBerekening.scala | Scala | mit | 459 |
package org.ensime.indexer.lucene
import org.apache.lucene.document.Field._
import org.apache.lucene.document._
import org.scalatest.{ FunSpec, Matchers }
class LuceneSerializationSpec extends FunSpec with Matchers {
def thereAndBackAgain[T](t: T)(implicit p: DocumentProvider[T], r: DocumentRecovery[T]): Unit = {
... | eddsteel/ensime | core/src/test/scala/org/ensime/indexer/lucene/LuceneSerializationSpec.scala | Scala | gpl-3.0 | 949 |
package org.jetbrains.sbt.shell.sbt_latest
import org.jetbrains.sbt.shell.UseSbtTestRunTest
import org.junit.Ignore
/**
* Created by Roman.Shein on 13.04.2017.
*/
@Ignore
class UseSbtTestRunTest_latest extends UseSbtTestRunTest {
override def getPath: String = "sbt/shell/sbtTestRunTest"
}
| JetBrains/intellij-scala | scala/scala-impl/test/org/jetbrains/sbt/shell/sbt_latest/UseSbtTestRunTest_latest.scala | Scala | apache-2.0 | 298 |
abstract class A {
override def toString(): String // crucial
def toString(sb: StringBuilder): StringBuilder // crucial
}
case class B() extends A {
// overloaded version is implemented, causing toString not to be implemented?
def toString(sb: StringBuilder): StringBuilder = sys.error("")
}
object Test exte... | folone/dotty | tests/pending/run/t1042.scala | Scala | bsd-3-clause | 373 |
/*
* Copyright: Copyright (C) 2016, ATS Advanced Telematic Systems GmbH
* License: MPL-2.0
*/
package org.genivi.sota.core
import java.io.File
import java.net.URI
import org.genivi.sota.data.PackageId._
import org.genivi.sota.marshalling.CirceMarshallingSupport._
import io.circe.generic.auto._
import org.genivi.s... | PDXostc/rvi_sota_server | core/src/test/scala/org/genivi/sota/core/PackagesResourceSpec.scala | Scala | mpl-2.0 | 5,724 |
/*
* Copyright © 2014 Teo Klestrup, Carl Dybdahl
*
* This file is part of Republix.
*
* Republix is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your op... | teozkr/republix-online | republix/src/main/scala/republix/ui/Lobby.scala | Scala | agpl-3.0 | 2,318 |
package core
import org.json4s.jackson.Serialization.{ read, writePretty }
import org.json4s.{ DefaultFormats, Formats, jackson, Serialization }
import org.joda.time.DateTime
import akka.http.scaladsl.marshalling._
import akka.http.scaladsl.unmarshalling._
import akka.http.scaladsl.model.{ ContentType, ContentTypeRang... | enpassant/wooster | src/main/scala/core/BaseFormats.scala | Scala | apache-2.0 | 3,457 |
/*
* La Trobe University - Distributed Deep Learning System
* Copyright 2016 Matthias Langer (t3l@threelights.de)
*
* 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.apa... | bashimao/ltudl | blaze/src/main/scala/edu/latrobe/blaze/modules/jvm/AddBias_JVM.scala | Scala | apache-2.0 | 8,325 |
package scala.slick.test.jdbc
import scala.slick.jdbc.{PositionedResult, PositionedResultIterator}
import com.typesafe.slick.testkit.util.DelegateResultSet
import org.junit.Test
import org.junit.Assert._
class PositionedResultTest {
@Test def testMaxRows {
assertEquals(5, createFakePR(5, 0).length)
assertE... | dvinokurov/slick | slick-testkit/src/test/scala/scala/slick/test/jdbc/PositionedResultTest.scala | Scala | bsd-2-clause | 1,028 |
/*!
* Copyright 2013-2014 Dennis Hörsch.
*
* 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 ... | dhs3000/dropwizard-scala | src/main/scala/de/dennishoersch/dropwizard/blog/domain/Author.scala | Scala | apache-2.0 | 741 |
/*
* 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/test/scala/org/apache/carbondata/spark/testsuite/createTable/TestCreateTableWithCompactionOptions.scala | Scala | apache-2.0 | 6,562 |
/*
* 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 ... | Panos-Bletsos/spark-cost-model-optimizer | core/src/test/scala/org/apache/spark/ui/jobs/JobProgressListenerSuite.scala | Scala | apache-2.0 | 17,468 |
package org.http4s
package dsl
package impl
import cats.{Applicative, Monad}
import org.http4s.headers._
import ResponseGenerator.addEntityLength
import cats.arrow.FunctionK
trait ResponseGenerator extends Any {
def status: Status
}
private[impl] object ResponseGenerator {
def addEntityLength[G[_]](entity: Entit... | ChristopherDavenport/http4s | dsl/src/main/scala/org/http4s/dsl/impl/ResponseGenerator.scala | Scala | apache-2.0 | 6,921 |
/*
* Copyright 2012-2013 Stephane Godbillon (@sgodbillon) and Zenexity
*
* 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 req... | ornicar/ReactiveMongo | driver/src/main/scala/api/collections/QueryCodecs.scala | Scala | apache-2.0 | 2,223 |
package stefanholzmueller.pp2.check
import stefanholzmueller.pp2.util.Dice
import stefanholzmueller.pp2.util.IntTriple
class OutcomeCalculatorAdapter extends OutcomeExaminer {
def examine(check: Check, diceTriple: IntTriple): Outcome = {
val (options, attributes, points, difficulty) = OutcomeCalculator.ja... | stefanholzmueller/pp2scala | src/main/scala/stefanholzmueller/pp2/check/OutcomeCalculator.scala | Scala | bsd-2-clause | 3,525 |
/**
* Copyright (C) 2010-2011 LShift Ltd.
*
* 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... | lshift/diffa | kernel/src/main/scala/net/lshift/diffa/kernel/participants/StringPrefixCategoryFunction.scala | Scala | apache-2.0 | 1,937 |
package org.web3scala.json
import org.scalatest.{FlatSpec, Matchers}
class JacksonJsonMapperSpec extends FlatSpec with Matchers {
"JacksonJsonMapper" should "serialize AnyRef value into a byte array" in {
val result = new JacksonJsonMapper().writeAsBytes("test")
result.mkString(", ") shouldBe "34, 116, 101,... | web3scala/web3scala | src/test/scala/org/web3scala/json/JacksonJsonMapperSpec.scala | Scala | apache-2.0 | 340 |
package bio
package attribute
/**
* Access functions for the attribute list
*/
trait AttributeAccess {
/**
* @return list of attributes matching message
*/
def attribList(message: Message, attributes: List[Attribute]): List[Attribute] = {
attributes.filter { a =>
a.send(message) match {
... | bioscala/bioscala | src/main/scala/bio/attributes/access.scala | Scala | bsd-2-clause | 961 |
package spark.scheduler.cluster
import java.io.{File, FileInputStream, FileOutputStream}
import scala.collection.mutable.ArrayBuffer
import scala.collection.mutable.HashMap
import scala.collection.mutable.HashSet
import spark._
import spark.TaskState.TaskState
import spark.scheduler._
import java.nio.ByteBuffer
impo... | joeywen/spark_cpp_api | core/src/main/scala/spark/scheduler/cluster/ClusterScheduler.scala | Scala | bsd-3-clause | 8,522 |
package io.eels
import java.nio.file.Files
import org.apache.hadoop.conf.Configuration
import org.apache.hadoop.fs.{FileSystem, Path}
import org.scalatest.{Matchers, WordSpec}
class FilePatternTest extends WordSpec with Matchers {
implicit val fs = FileSystem.get(new Configuration())
"FilePattern" should {
... | sksamuel/eel-sdk | eel-core/src/test/scala/io/eels/FilePatternTest.scala | Scala | apache-2.0 | 2,452 |
/*
* 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 ... | jkbradley/spark | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/ordering.scala | Scala | apache-2.0 | 5,129 |
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.