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 ... | ArvinDevel/onlineAggregationOnSparkV2 | core/src/test/scala/org/apache/spark/SparkContextSuite.scala | Scala | apache-2.0 | 11,678 |
package is.hail.utils
import scala.reflect.ClassTag
final class MissingArrayBuilder[@specialized T](initialCapacity: Int)(implicit tct: ClassTag[T]) {
private var b: Array[T] = new Array[T](initialCapacity)
private var missing: Array[Boolean] = new Array[Boolean](initialCapacity)
private var size_ : Int = 0
... | hail-is/hail | hail/src/main/scala/is/hail/utils/MissingArrayBuilder.scala | Scala | mit | 1,855 |
package ingress.submission
import org.specs2.mock.Mockito
import org.specs2.mutable.Specification
import com.rabbitmq.client.{QueueingConsumer, Channel, Connection}
import play.api.libs.ws.WS
import play.api.test.{FakeApplication, FakeRequest}
import play.api.test.Helpers._
import com.rabbitmq.client.AMQP.BasicProper... | Department-for-Work-and-Pensions/ClaimReceived | cr/test/ingress/submission/SubmissionServiceIntegrationSpec.scala | Scala | mit | 5,002 |
/* __ *\\
** ________ ___ / / ___ Scala API **
** / __/ __// _ | / / / _ | (c) 2003-2013, LAMP/EPFL **
** __\\ \\/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\\___/_/... | felixmulder/scala | src/library/scala/sys/process/ProcessBuilderImpl.scala | Scala | bsd-3-clause | 8,943 |
/*
* Copyright 2022 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/vat-registration-frontend | app/forms/constraints/EmailAddressConstraints.scala | Scala | apache-2.0 | 2,233 |
package pl.touk.nussknacker.engine.flink.util.transformer
import cats.data.NonEmptyList
import com.typesafe.config.ConfigFactory
import com.typesafe.config.ConfigValueFactory.fromAnyRef
import org.apache.flink.streaming.api.scala._
import org.scalatest.{FunSuite, Inside, Matchers}
import pl.touk.nussknacker.engine.api... | TouK/nussknacker | engine/flink/components/base/src/test/scala/pl/touk/nussknacker/engine/flink/util/transformer/ForEachTransformerSpec.scala | Scala | apache-2.0 | 6,094 |
/*
* Scala (https://www.scala-lang.org)
*
* Copyright EPFL and Lightbend, Inc.
*
* Licensed under Apache License 2.0
* (http://www.apache.org/licenses/LICENSE-2.0).
*
* See the NOTICE file distributed with this work for
* additional information regarding copyright ownership.
*/
package scala
package runtime
... | scala/scala | src/library/scala/runtime/Null$.scala | Scala | apache-2.0 | 644 |
/*
* Copyright (c) 2015-2016 Luciano Resende
*
* 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 ... | lresende/spark-sandbox | src/main/scala/com/luck/csv/CsvApplication.scala | Scala | apache-2.0 | 1,997 |
package com.easyforger.creatures
import net.minecraft.entity.monster.EntityCreeper
import net.minecraft.world.World
case class CreeperConfig(common: CommonEntityConfig = CommonEntityConfig(),
fuseTime: Option[Int] = None,
explosionRadius: Option[Int] = None,
... | ThiagoGarciaAlves/easyforger | src/main/scala/com/easyforger/creatures/CustomCreeper.scala | Scala | gpl-3.0 | 862 |
package io.hydrosphere.mist.api.ml.classification
import io.hydrosphere.mist.api.ml._
import org.apache.spark.ml.classification.{DecisionTreeClassificationModel, RandomForestClassificationModel}
import org.apache.spark.ml.linalg.{DenseVector, Vector, Vectors}
class LocalRandomForestClassificationModel(override val sp... | KineticCookie/mist | mist-lib/src/main/scala-2.11/io/hydrosphere/mist/api/ml/classification/LocalRandomForestClassificationModel.scala | Scala | apache-2.0 | 3,209 |
/*
* Copyright 2013 Sanjin Sehic
*
* 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... | saserr/CQRS | src/scala/org/saserr/cqrs/Storage.scala | Scala | apache-2.0 | 1,971 |
package mesosphere.marathon
import java.util.jar.{Attributes, Manifest}
import scala.Predef._
import scala.util.control.NonFatal
import scala.jdk.CollectionConverters._
import mesosphere.marathon.io.IO
case object BuildInfo {
private val marathonJar = "\\\\bmesosphere\\\\.marathon\\\\.marathon-[0-9.]+".r
val Defa... | mesosphere/marathon | src/main/scala/mesosphere/marathon/BuildInfo.scala | Scala | apache-2.0 | 2,372 |
/*
* Copyright (C) Lightbend Inc. <https://www.lightbend.com>
*/
package play.filters.csp
import akka.util.ByteString
import javax.inject.Inject
import play.api.libs.streams.Accumulator
import play.api.mvc.request.RequestAttrKey
import play.api.mvc.EssentialAction
import play.api.mvc.RequestHeader
import play.api.m... | benmccann/playframework | web/play-filters-helpers/src/main/scala/play/filters/csp/CSPResultProcessor.scala | Scala | apache-2.0 | 2,350 |
/*
* Wire
* Copyright (C) 2016 Wire Swiss GmbH
*
* This program 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 3 of the License, or
* (at your option) any later version.
*
* This progr... | wireapp/wire-android-sync-engine | zmessaging/src/main/scala/com/waz/model/ConversationData.scala | Scala | gpl-3.0 | 16,090 |
package scala
import org.scalatest.{FlatSpec, Matchers}
import sai.bytecode.Clazz
class BasicBlockTest extends FlatSpec with Matchers {
val clazz = new Clazz("misc.BasicBlockExamples")
"A ControlFlowGraph" should "have 1 basic block for a method without control flow instructions" in {
val method = clazz.lo... | oliverhaase/sai | src/test/scala/BasicBlockTest.scala | Scala | mit | 13,324 |
import scala.collection.mutable.ArrayBuffer
class Person(val name:String) extends Serializable {
val friends = new ArrayBuffer[Person]
}
object Main extends App {
val persons = Array(new Person("Amy"), new Person("Bob"), new Person("Cathy"))
persons(0).friends += persons(1)
persons(1).friends += persons(2)
p... | Gerhut/scala-for-the-impatient | Chapter9/10.scala | Scala | unlicense | 782 |
package strd.dynaschema
import java.io.FileOutputStream
import java.util.jar.{JarEntry, JarOutputStream, Attributes, Manifest}
import org.apache.commons.lang.StringUtils
/**
*
* User: light
* Date: 16/04/14
* Time: 16:00
*/
case class ResEntry(path :String, data : Array[Byte])
class DynaSchemaBuilder {
var ... | onerinvestments/strd | strd-cluster/src/main/scala/strd/dynaschema/DynaSchemaBuilder.scala | Scala | apache-2.0 | 3,644 |
package drt.client.components
import diode.data.Pot
import drt.client.components.FlightComponents._
import drt.client.services.JSDateConversions.SDate
import drt.client.services.RootModel
import drt.shared.CrunchApi.MillisSinceEpoch
import drt.shared.Terminals.Terminal
import drt.shared._
import drt.shared.api.Arrival... | UKHomeOffice/drt-scalajs-spa-exploration | client/src/main/scala/drt/client/components/BigSummaryBoxes.scala | Scala | apache-2.0 | 4,296 |
package com.twitter.finagle.context
/**
* A context contains a number of let-delimited bindings. Bindings
* are indexed by type Key[A] in a typesafe manner. Later bindings
* shadow earlier ones.
*
* Note that the implementation of context maintains all bindings
* in a linked list; context lookup requires a linea... | twitter/finagle | finagle-core/src/main/scala/com/twitter/finagle/context/Context.scala | Scala | apache-2.0 | 2,689 |
package com.bgfurfeature.util
import java.text.SimpleDateFormat
import java.util.{Calendar, Date}
/**
* Created by Administrator on 2016/1/8.
*/
object TimeUtil {
def getDay: String = {
val sdf: SimpleDateFormat = new SimpleDateFormat("yyyy-MM-dd")
val date: String = sdf.format(new Date)
date
}
... | bgfurfeature/AI | src/main/scala/com/bgfurfeature/util/TimeUtil.scala | Scala | apache-2.0 | 711 |
package viper.api
import viper.silver.ast._
import scala.collection.JavaConverters._
import scala.collection.JavaConverters._
import viper.silver.verifier.{Failure, Success, AbortedExceptionally, VerificationError}
import java.util.List
import java.util.Properties
import java.util.SortedMap
import scala.math.BigInt.in... | sccblom/vercors | viper/silver/src/main/scala/viper/api/Prog.scala | Scala | mpl-2.0 | 750 |
package org.redsimulator
import org.scalatest._
import org.scalatest.mock.MockitoSugar
trait UnitSpec
extends WordSpecLike
with Matchers
with OptionValues
with Inspectors
with MockitoSugar {
}
| simonecarriero/red-simulator | src/test/scala/org/redsimulator/UnitSpec.scala | Scala | mit | 205 |
package com.owlandrews.nescala.ui
import javax.sound.sampled._
import scala.util.Try
object Audio {
private val sampleRate = 44100f
private val format = new AudioFormat(
sampleRate,
16, //bit
2, //channel
true, //signed
false //little endian
)
private val samplesPerFrame = Math.c... | hywelandrews/nescala | src/main/scala/com/owlandrews/nescala/ui/Audio.scala | Scala | gpl-2.0 | 1,416 |
package libs
import scala.collection.mutable.Map
class WorkerStore() {
val store = Map[String, Any]()
def get[T](key: String): T = {
store(key).asInstanceOf[T]
}
def put(key: String, value: Any) = {
store += (key -> value)
}
}
| amplab/SparkNet | src/main/scala/libs/WorkerStore.scala | Scala | mit | 249 |
package pregnaware.user
import java.time.LocalDate
import pregnaware.user.entities.{WrappedFriend, WrappedUser}
import pregnaware.utils.ExecutionWrapper
import scala.concurrent.Future
trait UserPersistence extends ExecutionWrapper {
/** Add a new user */
def addUser(displayName: String, email: String, passwordH... | jds106/pregnaware | service/src/main/scala/pregnaware/user/UserPersistence.scala | Scala | mit | 1,564 |
package org.bitcoins.core.script.crypto
import org.bitcoins.core.script.ScriptOperationFactory
import org.bitcoins.core.script.constant.ScriptOperation
/**
* Created by chris on 1/6/16.
* Represents an operation where a cryptographic function is applied
*/
sealed trait CryptoOperation extends ScriptOperation
/** ... | Christewart/bitcoin-s-core | src/main/scala/org/bitcoins/core/script/crypto/CryptoOperations.scala | Scala | mit | 3,165 |
/***********************************************************************
* 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-convert/geomesa-convert-shp/src/main/scala/org/locationtech/geomesa/convert/shp/ShapefileFunctionFactory.scala | Scala | apache-2.0 | 2,372 |
/*
* 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 | core/src/main/scala/org/apache/spark/partial/PartialResult.scala | Scala | apache-2.0 | 5,278 |
package com.mentatlabs.nsa
package scalac
package dsl
package experimental
trait ScalacYRangeposDSL
extends ScalacExperimentalDSL {
object Yrangepos {
val unary_- = options.ScalacYRangepos
}
}
| mentat-labs/sbt-nsa | nsa-dsl/src/main/scala/com/mentatlabs/nsa/scalac/dsl/experimental/private/ScalacYRangeposDSL.scala | Scala | bsd-3-clause | 207 |
/*
*
* Copyright (c) 2017 Radicalbit
*
* This file is part of flink-JPMML
*
* flink-JPMML 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 option) ... | maocorte/flink-jpmml | project/Commons.scala | Scala | agpl-3.0 | 1,064 |
package jp.kenichi.lrcon
package server
import java.nio.file.Paths
object ServerConf { // TODO: make it a class
val workDir = Paths.get("work") // TODO: read a conf file
}
| ken1ma/lrcon | server/src/main/scala/jp.kenichi.lrcon/server/ServerConf.scala | Scala | apache-2.0 | 175 |
package com.datastax.spark.connector
package object testkit {
final val DefaultHost = "127.0.0.1"
val dataSeq = Seq (
Seq("1first", "1round", "1words"),
Seq("2second", "2round", "2words"),
Seq("3third", "3round", "3words"),
Seq("4fourth", "4round", "4words")
)
val data = dataSeq.head
}
| shashwat7/spark-cassandra-connector | spark-cassandra-connector/src/test/scala/com/datastax/spark/connector/testkit/package.scala | Scala | apache-2.0 | 316 |
package ee.cone.c4actor
import ee.cone.c4actor.Types.{ClName, SrcId}
import ee.cone.c4assemble.Types.{Index, Values}
import ee.cone.c4assemble.{AssembledKey, Getter, IndexUtil, Single, Types}
import ee.cone.c4di.Types.ComponentFactory
import ee.cone.c4di.{c4, provide}
@c4("RichDataCompApp") final class SwitchOrigKeyF... | conecenter/c4proto | base_lib/src/main/scala/ee/cone/c4actor/KeyFactoryImpl.scala | Scala | apache-2.0 | 789 |
package bryghts.benchmarks
import play.api.libs.json.Json
class PlayJson_Benchmarking extends Benchmarking
{
protected val parseOther: String => Any = js => Json.parse(js)
protected val otherTitle: String = "PlayJson"
}
| marcesquerra/KissJson | src/test/scala/bryghts/benchmarks/PlayJson_Benchmarking.scala | Scala | mit | 228 |
package com.example.api
import com.example.api.models.exceptions.{ ModelFormatException, ModelNotFoundException }
import org.scalatest.concurrent.ScalaFutures
import org.scalatestplus.play.{ OneAppPerSuite, PlaySpec }
import play.api.data.validation.ValidationError
import play.api.http.MimeTypes.JSON
import play.api.i... | jtescher/play-api | test/com/example/api/ErrorHandlerSpec.scala | Scala | mit | 2,140 |
package test
import dotty.tools.dotc._
import core._, ast._
import Trees._
import Contexts.Context
object parsePackage extends ParserTest {
import ast.untpd._
var nodes = 0
val transformer = new UntypedTreeMap {
override def transform(tree: Tree)(implicit ctx: Context): Tree = {
nodes += 1
tr... | AlexSikia/dotty | test/test/parsePackage.scala | Scala | bsd-3-clause | 2,688 |
package org.reactivebird
import org.reactivebird.http._
import org.reactivebird.api._
import org.reactivebird.models.ModelFactory
import akka.actor.ActorSystem
import com.typesafe.config.ConfigFactory
import spray.caching.Cache
import spray.http.HttpResponse
import spray.caching.LruCache
import java.util.concurrent.Ti... | benoitguigal/reactive-bird | src/main/scala/org/reactivebird/TwitterApi.scala | Scala | mit | 1,200 |
/*
* Copyright (c) 2014-2021 by The Monix Project Developers.
* See the project homepage at: https://monix.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... | monixio/monix | monix-execution/js/src/main/scala/monix/execution/internal/FutureUtilsForPlatform.scala | Scala | apache-2.0 | 851 |
package ml.combust.mleap.bundle.ops.sklearn
import ml.combust.bundle.BundleContext
import ml.combust.bundle.dsl._
import ml.combust.bundle.op.OpModel
import ml.combust.mleap.bundle.ops.MleapOp
import ml.combust.mleap.core.feature.BinarizerModel
import ml.combust.mleap.runtime.MleapContext
import ml.combust.mleap.runti... | combust/mleap | mleap-runtime/src/main/scala/ml/combust/mleap/bundle/ops/sklearn/BinarizerOp.scala | Scala | apache-2.0 | 1,533 |
import sbt._
import sbt.Keys._
import java.io.PrintWriter
import java.io.File
import play.Play.autoImport._
import play.sbt.PlayImport._
import sbtbuildinfo._
import sbtbuildinfo.BuildInfoKeys._
import play.sbt.routes.RoutesKeys._
import com.typesafe.sbt.packager.Keys._
import com.typesafe.sbt.SbtScalariform
import com... | dbuschman7/collection-of-things | playground/project/Build.scala | Scala | apache-2.0 | 2,966 |
/*
* Copyright 2019 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... | nicf82/play-ui | src/test/scala/uk/gov/hmrc/play/views/layouts/FooterSpec.scala | Scala | apache-2.0 | 2,223 |
package io.seldon.spark.rdd
import java.util.zip.GZIPOutputStream
import org.apache.spark.rdd.RDD
import java.io._
object FileUtils {
import DataSourceMode._
def toSparkResource(location:String, mode:DataSourceMode): String = {
mode match {
case LOCAL => return location.replace("local:/","")... | curtiszimmerman/seldon-server | offline-jobs/spark/src/main/scala/io/seldon/spark/rdd/FileUtils.scala | Scala | apache-2.0 | 3,576 |
package ml.combust.mleap.core.regression
import ml.combust.mleap.core.types.{ScalarType, StructField, TensorType}
import org.scalatest.FunSpec
import org.apache.spark.ml.linalg.Vectors
/**
* Created by hwilkins on 1/21/16.
*/
class LinearRegressionModelSpec extends FunSpec {
val linearRegression = LinearRegress... | combust/mleap | mleap-core/src/test/scala/ml/combust/mleap/core/regression/LinearRegressionModelSpec.scala | Scala | apache-2.0 | 901 |
package core.stress
import akka.actor.{Address, ActorLogging, Actor}
import akka.cluster.Cluster
import akka.cluster.ClusterEvent._
import core.stress.SimpleClusterListener.IsRemoved
import scala.collection.mutable.ListBuffer
class SimpleClusterListener extends Actor with ActorLogging {
val cluster = Cluster(cont... | kciesielski/akka-journal-stress | src/main/scala/core/stress/SimpleClusterListener.scala | Scala | apache-2.0 | 1,374 |
/**
* A simple class that can act as a spellchecker
* - could be extended to autocomplete
*
* The basic principle here is that words forming the dictionary are stored in a tree structure,
* with unique values [a-z] at each node. Children of each node are also unique in the set [a-z].
* In this way, words are stor... | jaimeguzman/learning | spellchecker.scala | Scala | apache-2.0 | 2,708 |
////////////////////////////////////////////////////////////////////////////////
// //
// OpenSolid is a generic library for the representation and manipulation //
// of geometric objects such as points, curves, surfaces, and volumes. ... | ianmackenzie/opensolid-core | src/main/scala/org/opensolid/core/Triangle3d.scala | Scala | mpl-2.0 | 3,911 |
package gapt.formats.llk
import gapt.proofs._
import gapt.expr._
import gapt.expr.formula.All
import gapt.expr.formula.And
import gapt.expr.formula.Atom
import gapt.expr.formula.Ex
import gapt.expr.formula.Imp
import gapt.expr.formula.Neg
import gapt.expr.formula.NonLogicalConstant
import gapt.expr.formula.Or
import g... | gapt/gapt | core/src/main/scala/gapt/formats/llk/LLKExporter.scala | Scala | gpl-3.0 | 16,451 |
package io.eels.component.orc
import java.util.concurrent.atomic.AtomicBoolean
import com.sksamuel.exts.OptionImplicits._
import com.sksamuel.exts.io.Using
import io.eels._
import io.eels.datastream.{DataStream, Publisher, Subscriber, Subscription}
import io.eels.schema.StructType
import org.apache.hadoop.conf.Config... | sksamuel/eel-sdk | eel-orc/src/main/scala/io/eels/component/orc/OrcSource.scala | Scala | apache-2.0 | 2,888 |
package scray.cassandra.tools
import org.junit.runner.RunWith
import com.typesafe.scalalogging.LazyLogging
import org.junit.runner.RunWith
import org.scalatest.WordSpec
import org.scalatest.junit.JUnitRunner
import scray.querying.description.TableIdentifier
@RunWith(classOf[JUnitRunner])
class CassandraIndexStatemen... | scray/scray | scray-cassandra/src/test/scala/scray/cassandra/tools/CassandraIndexStatementGeneratorImplSpecs.scala | Scala | apache-2.0 | 1,151 |
package systems.opalia.commons.identifier
import org.scalatest._
class UniversallyUniqueIdTest
extends FlatSpec
with Matchers {
val list =
(for (i <- 1 to 1000) yield UniversallyUniqueId.getNew).toList
it should "be uniqueness" in {
list.distinct.size should be(list.size)
}
it should "have ... | OpaliaSystems/commons | src/test/scala/systems/opalia/commons/identifier/UniversallyUniqueIdTest.scala | Scala | apache-2.0 | 1,578 |
package gapt.expr.formula
import gapt.expr.formula.constants.ForallC
object All extends QuantifierHelper( ForallC )
| gapt/gapt | core/src/main/scala/gapt/expr/formula/All.scala | Scala | gpl-3.0 | 118 |
/*
* 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 ... | apache/ignite | modules/spark-2.4/src/main/scala/org/apache/ignite/spark/impl/IgniteSqlRDD.scala | Scala | apache-2.0 | 2,125 |
package scorex.wallet
import java.io.File
import com.google.common.primitives.{Bytes, Ints}
import org.h2.mvstore.{MVMap, MVStore}
import scorex.account.PrivateKeyAccount
import scorex.crypto.encode.Base58
import scorex.crypto.hash.SecureCryptographicHash
import scorex.utils.ScorexLogging
import scala.collection.Jav... | alexeykiselev/WavesScorex | scorex-basics/src/main/scala/scorex/wallet/Wallet.scala | Scala | cc0-1.0 | 4,529 |
package shredzzz.kirkwood.junit.tests.vector.booleans
import org.junit.Test
import shredzzz.kirkwood.cumath.CuValue
import shredzzz.kirkwood.cumath.tensor.CuVector
import shredzzz.kirkwood.junit._
class CuVectorBinaryOpsTest extends BooleanCuVectorTester
{
@Test def testVal_unary_:!@() {
withCuContext(
im... | shredzzz/kirkwood | src/test/scala/shredzzz/kirkwood/junit/tests/vector/booleans/CuVectorBinaryOpsTest.scala | Scala | apache-2.0 | 5,293 |
// Copyright (C) 2017 Laurent Sarrazin & other authors
// 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.
// You may ... | lsarrazin/HTools | src/main/scala/org/edma/hbase/HConfiguration.scala | Scala | apache-2.0 | 3,367 |
package org.mitre.jcarafe.dparser
import org.scalatest.Spec
import org.mitre.jcarafe.crf.AbstractInstance
class TestMstInference extends Spec {
def processInputGraph(sm: Array[Array[Double]]) = {
val mstCrf = new org.mitre.jcarafe.dparser.ProjectiveMstCrf(10,1.0) with org.mitre.jcarafe.crf.CondLogLikelihoodL... | wellner/jcarafe | jcarafe-ext/src/test/scala/org/mitre/jcarafe/dparser/TestMstInference.scala | Scala | bsd-3-clause | 3,658 |
import org.scalameter.api._
import org.buttercoin.jersey._
import org.buttercoin.common._
import org.buttercoin.common.models.currency._
object CurrencyBenchmark
extends PerformanceTest.Quickbenchmark {
val sizes: Gen[Int] = Gen.range("size")(10000, 90000, 40000)
val ranges: Gen[Range] = for {
size <- sizes
... | buttercoin/engine | perf-testing/src/test/scala/CurrencyBenchmark.scala | Scala | mit | 1,851 |
/**
* Copyright 2015, deepsense.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 applicable law or agreed ... | deepsense-io/seahorse-workflow-executor | deeplang/src/main/scala/io/deepsense/deeplang/params/exceptions/ParamValueNotProvidedException.scala | Scala | apache-2.0 | 769 |
/*
* 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 | tests/src/test/scala/org/apache/openwhisk/core/containerpool/test/ContainerPoolTests.scala | Scala | apache-2.0 | 56,474 |
package net.shiroka.tools.ofx.conversions
import com.typesafe.config.ConfigFactory
import org.specs2.mutable._
import net.shiroka.tools.ofx._
class SmbcFixedSpec extends SpecificationLike {
"SmbcFixedConversion" >> {
"#apply" >> {
"it generates OFX statement" in {
val config = ConfigFactory.load()... | ikuo/ofx-tools | src/test/scala/net/shiroka/tools/ofx/conversions/SmbcFixedSpec.scala | Scala | mit | 925 |
package wvlet.log
/**
*
*/
class JSConsoleLogHandlerTest extends Spec {
"JSConsoleLogHandler" should {
Logger.setDefaultHandler(JSConsoleLogHandler())
error("error message")
warn("warn message")
info("info message")
debug("debug message")
trace("trace message")
}
}
| wvlet/log | wvlet-log/js/src/test/scala/wvlet/log/JSConsoleLogHandlerTest.scala | Scala | apache-2.0 | 302 |
package mypipe.mysql
import scala.util.Try
case class BinaryLogFilePosition(filename: String, pos: Long) {
override def toString(): String = s"$filename:$pos"
override def equals(o: Any): Boolean = {
o != null &&
filename.equals(o.asInstanceOf[BinaryLogFilePosition].filename) &&
pos.equals(o.asIns... | tramchamploo/mypipe | mypipe-api/src/main/scala/mypipe/mysql/BinaryLogFilePosition.scala | Scala | apache-2.0 | 581 |
import BIDMat.{CMat,CSMat,DMat,Dict,FMat,FND,GMat,GDMat,GIMat,GLMat,GSMat,GSDMat,HMat,IDict,Image,IMat,LMat,Mat,SMat,SBMat,SDMat}
import BIDMat.MatFunctions._
import BIDMat.SciFunctions._
import BIDMat.Solvers._
import BIDMat.Plotting._
import BIDMach.Learner
import BIDMach.models.{FM,GLM,KMeans,KMeansw,LDA,LDAgibbs,Mo... | yanqingmen/BIDMach | lib/bidmach_init.scala | Scala | bsd-3-clause | 652 |
// Based on sbt-protobuf's Protobuf Plugin
// https://github.com/sbt/sbt-protobuf
package com.trueaccord.scalapb
import java.io.File
import com.trueaccord.scalapb.compiler.{PosixProtocDriver, WindowsProtocDriver, ProtocDriver}
import sbt.Keys._
import sbt._
import sbtprotobuf.{ProtobufPlugin => PB}
@deprecated("Ple... | trueaccord/sbt-scalapb | src/main/scala/com/trueaccord/scalapb/ScalaPbPlugin.scala | Scala | apache-2.0 | 4,197 |
package com.twitter.finagle.context
import com.twitter.finagle.service.DeadlineOnlyToggle
import com.twitter.finagle.tracing.Trace
import com.twitter.finagle.util.ByteArrays
import com.twitter.io.Buf
import com.twitter.util.Duration
import com.twitter.util.Return
import com.twitter.util.Throw
import com.twitter.util.T... | twitter/finagle | finagle-core/src/main/scala/com/twitter/finagle/context/Deadline.scala | Scala | apache-2.0 | 3,617 |
package com.kumar.wordfinder
import java.io.FileInputStream
import org.apache.commons.compress.compressors.gzip.GzipCompressorInputStream
object Dictionary {
val bs = scala.io.Source.fromInputStream(new GzipCompressorInputStream(new FileInputStream("words.txt.gz")))
val set = scala.collection.mutable.HashSet[Stri... | skumargithub/Stuff | src/main/scala/com/kumar/wordfinder/Dictionary.scala | Scala | gpl-3.0 | 529 |
/*
* Copyright (c) 2011-14 Miles Sabin
*
* 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 ag... | mandubian/shapeless | core/src/test/scala/shapeless/conversions.scala | Scala | apache-2.0 | 2,808 |
package controllers.application
import controllers.Application
import uk.gov.homeoffice.drt.auth.Roles.ArrivalsAndSplitsView
import drt.shared._
import drt.shared.redlist.RedList
import play.api.mvc.{Action, AnyContent}
import services.graphstages.Crunch
import services.{AirportToCountry, SDate}
trait WithAirportInf... | UKHomeOffice/drt-scalajs-spa-exploration | server/src/main/scala/controllers/application/WithAirportInfo.scala | Scala | apache-2.0 | 1,474 |
package com.faacets.qalg
package algos
import scala.{specialized => sp}
import spire.algebra._
import algebra._
trait PackEuclideanRingMutable[@sp(Double, Long) A] extends Any with PackEuclideanRing[A] with PackRingMutable[A] {
implicit def MGramSchmidt: MutableMGramSchmidt[M]
implicit def MPrime: MutablePrime[... | denisrosset/qalg | core/src/main/scala/qalg/algos/PackEuclideanRingMutable.scala | Scala | mit | 620 |
package com.wixpress.petri.petri
import java.util
import java.util.UUID
import com.wixpress.petri.experiments.domain.{Experiment, ExperimentSpec}
/**
* @author Dalias
* @since 3/22/15
*/
trait PetriDeveloperApi {
def getFullUserState(userGuid: UUID): UserState
def migrateStartEndDates(): Unit
def addSpec... | wix/petri | petri-server-core/src/main/java/com/wixpress/petri/petri/PetriDeveloperApi.scala | Scala | bsd-3-clause | 449 |
package DAO
import scala.concurrent.{Future => ScalaFuture}
import com.websudos.phantom.Implicits._
import scala.concurrent.Await
import scala.concurrent.duration._
case class PageRow(
address: String,
title: Option[String],
rank: Int,
cacheID: Option[java.util.UUID]
)
sealed class PageTable extends Cassandr... | gafiatulin/scala-search-engine | Crawler/src/main/scala/DAO/Pages.scala | Scala | mit | 2,112 |
package SMART
import Chisel._
class InvcArbiter extends Module {
val io = new Bundle {
val flitInValid = Vec.fill(NUM_OF_DIRS) {Vec.fill(NUM_OF_VC) {Bool(INPUT)}}
val flitIn = Vec.fill(NUM_OF_DIRS) {Vec.fill(NUM_OF_VC) {new Flit().asInput}}
val flitOutValid = Vec.fill(NUM_OF_DIRS... | hyoukjun/OpenSMART | Backend/Chisel/InvcArbiter.scala | Scala | mit | 2,331 |
/*
* Copyright 2015 ligaDATA
*
* 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 ... | traytonwhite/Kamanja | trunk/Storage/src/main/scala/com/ligadata/keyvaluestore/KeyValueCassandra.scala | Scala | apache-2.0 | 9,366 |
package mu.node.echod.grpc
import java.io.File
import com.typesafe.config.Config
import io.grpc.ServerInterceptors
import io.grpc.internal.ServerImpl
import io.grpc.netty.{GrpcSslContexts, NettyServerBuilder}
import io.netty.handler.ssl.ClientAuth
import mu.node.echo.EchoServiceGrpc
import mu.node.echo.EchoServiceGrp... | vyshane/grpc-scala-microservice-kit | app/src/main/scala/grpc/EchoServer.scala | Scala | apache-2.0 | 1,338 |
package mesosphere.marathon
package core.plugin
import scala.reflect.ClassTag
trait PluginManager {
def plugins[T](implicit ct: ClassTag[T]): Seq[T]
def definitions: PluginDefinitions
}
object PluginManager {
lazy val None = new PluginManager {
override def plugins[T](implicit ct: ClassTag[T]): Seq[T] =... | guenter/marathon | src/main/scala/mesosphere/marathon/core/plugin/PluginManager.scala | Scala | apache-2.0 | 394 |
package controllers
import org.scalatestplus.play._
import play.api.test._
import play.api.test.Helpers._
/**
* Add your spec here.
* You can mock out a whole application including requests, plugins etc.
*
* For more information, see https://www.playframework.com/documentation/latest/ScalaTestingWithScalaTest
*/... | marchpig/stocking | test/controllers/HomeControllerSpec.scala | Scala | mit | 1,454 |
package com.github.gdefacci.briscola.presentation.player
object Input {
final case class Player(name: String, password: String)
} | gdefacci/briscola | ddd-briscola-web/src/main/scala/com/github/gdefacci/briscola/presentation/player/Input.scala | Scala | bsd-3-clause | 138 |
package test
import language.experimental.genericNumberLiterals
import scala.util.FromDigits
import scala.quoted.*
case class BigFloat(mantissa: BigInt, exponent: Int) {
override def toString = s"${mantissa}e${exponent}"
}
object BigFloat extends App {
def apply(digits: String): BigFloat = {
val (mantissaDig... | dotty-staging/dotty | tests/run-macros/BigFloat/BigFloat_1.scala | Scala | apache-2.0 | 1,444 |
/*
* Copyright (C) 2009-2014 Typesafe Inc. <http://www.typesafe.com>
*/
package play.api.cache
import javax.inject._
import play.api.test._
import java.util.concurrent.atomic.AtomicInteger
import play.api.mvc.{ Results, Action }
import play.api.http
import scala.concurrent.duration._
import scala.util.Random
impo... | jyotikamboj/container | pf-framework/src/play-cache/src/test/scala/play/api/cache/CachedSpec.scala | Scala | mit | 9,138 |
/*
* Distributed as part of Scalala, a linear algebra library.
*
* Copyright (C) 2008- Daniel Ramage
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the ... | scalala/Scalala | src/main/scala/scalala/tensor/generic/TensorBuilder.scala | Scala | lgpl-2.1 | 1,155 |
/*
* Copyright 2017 Spotify AB.
*
* 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 ... | spotify/featran | core/src/test/scala/com/spotify/featran/transformers/HashOneHotEncoderSpec.scala | Scala | apache-2.0 | 1,922 |
package ru.reo7sp.wave
import javax.swing.{JPanel, JTextField, JLabel, JCheckBox}
import java.awt.event.{ActionListener, ActionEvent}
class WaveController(_viewModel: WaveViewModel) extends JPanel with ActionListener {
add(new JLabel("A="))
private val aTextField = new JTextField(_viewModel.a.toString, 3)
aText... | reo7sp/WaveTest | src/main/scala/ru/reo7sp/wave/WaveConfigView.scala | Scala | mit | 2,502 |
package org.squeryl.test
import org.squeryl.framework._
abstract class LeftJoinTest extends SchemaTester with RunTestsInsideTransaction{
import org.squeryl.PrimitiveTypeMode._
val schema = LeftJoinSchema
import LeftJoinSchema._
override def prePopulate {
months.insert(new Month(1, "Jan"))
... | takezoux2/squeryl-experimental | src/test/scala/org/squeryl/test/LeftJoinTest.scala | Scala | apache-2.0 | 2,821 |
package x7c1.linen.repository.loader.crawling
import x7c1.wheat.macros.reify.HasConstructor
import x7c1.wheat.modern.formatter.ThrowableFormatter.format
sealed trait CrawlerFateError {
def cause: Throwable
def detail: String
}
object CrawlerFateError {
implicit object unknown extends HasConstructor[Throwable =... | x7c1/Linen | linen-repository/src/main/scala/x7c1/linen/repository/loader/crawling/CrawlerFateError.scala | Scala | mit | 535 |
package picasso.model.pi
import picasso.utils.{LogCritical, LogError, LogWarning, LogNotice, LogInfo, LogDebug, Logger, Misc}
import picasso.math._
import picasso.math.WellPartialOrdering._
/*
object PiProgram {
def isConfiguration(p: PiProcess): Boolean = p match {
case Composition(processes) => processe... | dzufferey/picasso | core/src/main/scala/picasso/model/pi/Pi.scala | Scala | bsd-2-clause | 5,174 |
package objektwerks
import java.sql.Timestamp
import java.time.LocalDateTime
import java.time.format.DateTimeFormatter
import java.util.Locale
import java.util.regex.Pattern
import org.apache.spark.sql.{ForeachWriter, Row}
case class LogEntry(ip: String,
client: String,
user: ... | objektwerks/spark | src/main/scala/objektwerks/LogEntry.scala | Scala | apache-2.0 | 2,270 |
package sampleclean.api
import org.apache.spark.SparkContext
import org.apache.spark.sql.SchemaRDD
import org.apache.spark.sql.Row
import org.apache.spark.rdd.RDD
import org.apache.spark.sql.SQLContext
/**
* This class defines a sampleclean query object
*
* The Sample Clean Query algorithm follows a cleaning
* pr... | sjyk/sampleclean-async | src/main/scala/sampleclean/api/SampleCleanQuery.scala | Scala | apache-2.0 | 2,174 |
package controllers
import play.api.mvc.{AnyContent, Request}
sealed trait RequestType
object RequestType {
def requestType(implicit request:Request[AnyContent]) = apply(request)
private[this] def acc(t: String)(implicit request: Request[AnyContent]): Boolean =
request.accepts("application/" + t) || request... | sayon/simple-rest-app | app/controllers/RequestType.scala | Scala | mit | 756 |
/*
* 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/feature/dataset/Sample.scala | Scala | apache-2.0 | 17,858 |
import leon.annotation._
import leon.lang._
import leon.lang.synthesis._
object Complete {
sealed abstract class List
case class Cons(head: Int, tail: List) extends List
case object Nil extends List
def size(l: List) : Int = (l match {
case Nil => 0
case Cons(_, t) => 1 + size(t)
}) ensuring(res... | ericpony/scala-examples | testcases/synthesis/oopsla2013/SortedList/Insert1.scala | Scala | mit | 1,252 |
/*******************************************************************************
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 2013,2014 by Peter Pilgrim, Addiscombe, Surrey, XeNoNiQUe UK
*
* All rights reserved. This program and the accompanying materials
* are made available under... | peterpilgrim/digital-scala-javaone-2014 | src/test/scala/uk/co/xenonique/digitalone/simple/HelloTest.scala | Scala | gpl-3.0 | 1,915 |
package mqfiletransfercoordinator.actors
import akka.actor.ActorSystem
import akka.actor.Actor
import akka.actor.Props
import akka.testkit.TestKit
import org.scalatest.WordSpecLike
import org.scalatest.Matchers
import org.scalatest.BeforeAndAfterAll
import akka.testkit.ImplicitSender
import scala.concurrent.duration._... | antongerbracht/MQFileTransfer | MQFileTransferCoordinator/src/test/scala/mqfiletransfercoordinator/actors/CommandQueueConsumerSpec.scala | Scala | apache-2.0 | 897 |
package com.alvin.niagara.model
import java.io.ByteArrayOutputStream
import java.util
import com.sksamuel.avro4s.AvroSchema
import org.apache.avro.Schema
import org.apache.avro.generic.{GenericData, GenericDatumReader, GenericDatumWriter, GenericRecord}
import org.apache.avro.io.{DecoderFactory, EncoderFactory}
impo... | AlvinCJin/Niagara | src/main/scala/com/alvin/niagara/model/Business.scala | Scala | apache-2.0 | 3,505 |
package com.aristocrat.mandrill.requests.Tags
import com.aristocrat.mandrill.requests.MandrillRequest
case class AllTimeSeries(key: String) extends MandrillRequest
| aristocratic/mandrill | src/main/scala/com/aristocrat/mandrill/requests/Tags/AllTimeSeries.scala | Scala | mit | 166 |
package org.openapitools.models
import io.circe._
import io.finch.circe._
import io.circe.generic.semiauto._
import io.circe.java8.time._
import org.openapitools._
/**
*
* @param Underscoreclass
*/
case class NullSCM(Underscoreclass: Option[String]
)
object NullSCM {
/**
* Creates the c... | cliffano/swaggy-jenkins | clients/scala-finch/generated/src/main/scala/org/openapitools/models/NullSCM.scala | Scala | mit | 500 |
package org.bfn.ninetynineprobs
object P40 {
// TODO
}
| bfontaine/99Scala | src/main/scala/P40.scala | Scala | mit | 60 |
package au.com.intelix.evt.testkit
import org.scalatest.matchers.{MatchResult, Matcher}
import au.com.intelix.evt._
import scala.util.matching.Regex
trait EvtMatchers {
class ContainsAllFields(e: EvtSelection, count: Option[Range], values: Seq[EvtFieldValue]) extends Matcher[List[RaisedEvent]] {
def apply(all... | intelix/reactiveservices | tools/evt/src/main/scala/au/com/intelix/evt/testkit/EvtMatchers.scala | Scala | apache-2.0 | 1,513 |
package lila.game
import chess.Color.{ White, Black }
import chess.format.UciMove
import chess.Pos.piotr, chess.Role.forsyth
import chess.variant.Variant
import chess.{ History => ChessHistory, CheckCount, Castles, Role, Board, Move, Pos, Game => ChessGame, Clock, Status, Color, Piece, Mode, PositionHash }
import org.... | samuel-soubeyran/lila | modules/game/src/main/Game.scala | Scala | mit | 18,655 |
/*
* 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/core/src/main/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetFileFormat.scala | Scala | apache-2.0 | 28,500 |
package breeze.stats.distributions
/*
Copyright 2009 David Hall, Daniel Ramage
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 a... | scalanlp/breeze | math/src/test/scala/breeze/stats/distributions/PoissonTest.scala | Scala | apache-2.0 | 1,621 |
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.