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 link.naicode.utils.math
/**
* Created by naicode on 8/31/14.
*
*/
import org.junit.runner.RunWith
import org.specs2.mutable.Specification
import org.specs2.runner.JUnitRunner
@RunWith(classOf[JUnitRunner])
class TestClamp extends Specification {
"Clamp.range" should {
"clamp to big numbers" in {
... | naicode/DHmacAuth | src/test/scala/link/naicode/utils/math/TestClamp.scala | Scala | apache-2.0 | 1,535 |
package com.github.agourlay.cornichon.steps.regular
import cats.data.NonEmptyList
import cats.syntax.either._
import com.github.agourlay.cornichon.core._
import com.github.agourlay.cornichon.core.Engine._
import monix.eval.Task
import scala.concurrent.duration.Duration
case class DebugStep(message: Session ⇒ Either... | OlegIlyenko/cornichon | cornichon-core/src/main/scala/com/github/agourlay/cornichon/steps/regular/DebugStep.scala | Scala | apache-2.0 | 1,019 |
/*
* Copyright ixias.net All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license
* For the full copyright and license information,
* please view the LICENSE file that was distributed with this source code.
*/
package ixias.security
import scala.util.Try
import com.typesafe.config.Co... | sp1rytus/ixias | framework/ixias-core/src/main/scala/ixias/security/TokenSigner.scala | Scala | mit | 1,647 |
package com.cleawing.akka.curator
import java.nio.file.Paths
import akka.actor._
import com.cleawing.akka.LikeActorRefExtension
import org.apache.curator.RetryPolicy
import org.apache.curator.ensemble.EnsembleProvider
import org.apache.curator.ensemble.exhibitor.{DefaultExhibitorRestClient, ExhibitorEnsembleProvider,... | Cleawing/united | akka-extensions/src/main/scala/com/cleawing/akka/curator/Curator.scala | Scala | apache-2.0 | 4,661 |
package mr.merc.politics
import mr.merc.politics.Economy._
import mr.merc.politics.ForeignPolicy._
import mr.merc.politics.Migration._
import mr.merc.politics.Regime._
import mr.merc.politics.SocialPolicy._
import mr.merc.politics.VotersPolicy._
import scalafx.scene.paint.Color
case class Party(name: String,
... | RenualdMarch/merc | src/main/scala/mr/merc/politics/Party.scala | Scala | gpl-3.0 | 4,152 |
/**
* (C) Copyright IBM Corp. 2015 - 2017
*
* 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 applicabl... | SparkTC/spark-bench | cli/src/main/scala/com/ibm/sparktc/sparkbench/workload/sql/SQLWorkload.scala | Scala | apache-2.0 | 3,269 |
/*
* 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 ... | eyalbenivri/amaterasu | leader/src/main/scala/org/apache/amaterasu/leader/utilities/DataLoader.scala | Scala | apache-2.0 | 3,841 |
package org.openurp.edu.eams.system.report.web.action
import org.beangle.commons.collection.Order
import org.beangle.data.jpa.dao.OqlBuilder
import org.beangle.data.model.Entity
import org.openurp.edu.eams.system.report.ReportTemplate
import org.openurp.edu.eams.web.action.common.ProjectSupportAction
class ReportTe... | openurp/edu-eams-webapp | web/src/main/scala/org/openurp/edu/eams/system/report/web/action/ReportTemplateAction.scala | Scala | gpl-3.0 | 984 |
/*
* 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/http-verbs | http-verbs-common/src/main/scala/uk/gov/hmrc/play/http/ws/WSHttpResponse.scala | Scala | apache-2.0 | 1,736 |
package org.jetbrains.plugins.scala.worksheet
import java.io.File
import com.intellij.openapi.module.Module
import org.jetbrains.annotations.ApiStatus
import org.jetbrains.plugins.scala.ExtensionPointDeclaration
import org.jetbrains.plugins.scala.worksheet.actions.topmenu.TopComponentAction
/**
* NOTE: do not use i... | JetBrains/intellij-scala | scala/worksheet/src/org/jetbrains/plugins/scala/worksheet/WorksheetCompilerExtension.scala | Scala | apache-2.0 | 1,071 |
package models.util
/**
* Author: matthijs
* Created on: 30 Dec 2013.
*/
object StringUtils {
implicit class StringImprovements(val s: String) {
import scala.util.control.Exception._
def toIntOpt = catching(classOf[NumberFormatException]) opt s.toInt
}
} | plamola/FeedR-V1 | app/models/util/StringUtils.scala | Scala | gpl-2.0 | 271 |
/**
* Copyright 2011-2012 eBusiness Information, Groupe Excilys (www.excilys.com)
*
* 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
*
*... | Tjoene/thesis | Case_Programs/gatling-1.4.0/gatling-core/src/main/scala/com/excilys/ebi/gatling/core/config/GatlingConfiguration.scala | Scala | gpl-2.0 | 6,777 |
package com.rasterfoundry.datamodel
import io.circe._
import cats.syntax.either._
sealed abstract class FileType(val repr: String) {
override def toString = repr
}
object FileType {
case object Geotiff extends FileType("GEOTIFF")
case object GeotiffWithMetadata extends FileType("GEOTIFF_WITH_METADATA")
case ... | azavea/raster-foundry | app-backend/datamodel/src/main/scala/FileType.scala | Scala | apache-2.0 | 863 |
/***********************************************************************
* Copyright (c) 2013-2022 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... | locationtech/geomesa | geomesa-convert/geomesa-convert-common/src/test/scala/org/locationtech/geomesa/convert2/transforms/PredicateTest.scala | Scala | apache-2.0 | 8,188 |
package chapter03
import scala.collection.mutable
object Mapimplementation {
def main(args: Array[String]): Unit = {
val roman = mutable.Map[Int, String]() //Map declaration
//Map Initialization
roman += (1 -> "I")
roman += (2 -> "II")
roman += (3 -> "III")
roman += (4 -> "IV")
roman +=... | aakashmathai/ScalaTutorial | src/main/scala/chapter03/Mapimplementation.scala | Scala | apache-2.0 | 728 |
/**
* 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... | crashlytics/kafka | core/src/main/scala/kafka/consumer/SimpleConsumer.scala | Scala | apache-2.0 | 6,568 |
package com.github.kimutansk.akka.exercise.message
import akka.actor.Actor
/**
* メッセージ送受信確認用子Actor
*
* @author kimutansk
*/
class ChildActor(name: String) extends Actor {
/** メッセージ受信時処理 */
def receive = {
case msg: String => {
val message = "ChildActor: Received String " + msg + " My name is " + na... | togusafish/kimutansk-_-scala-exercise | akka-exercise/src/main/scala/com/github/kimutansk/akka/exercise/message/ChildActor.scala | Scala | mit | 432 |
/**
* TABuddy-Model - a human-centric K,V framework
*
* Copyright (c) 2012-2014 Alexey Aksenov ezh@ezh.msk.ru
*
* 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.apach... | digimead/digi-TABuddy-model | src/main/scala/org/digimead/tabuddy/model/graph/Graph.scala | Scala | apache-2.0 | 11,294 |
package org.pico.atomic.syntax.std
import java.util.concurrent.atomic.AtomicReference
import scala.annotation.tailrec
package object atomicReference {
implicit class AtomicReferenceOps_YYKh2cf[A](val self: AtomicReference[A]) extends AnyVal {
/** Repeatedly attempt to update the reference using the update f... | pico-works/pico-atomic | pico-atomic/src/main/scala/org/pico/atomic/syntax/std/atomicReference/package.scala | Scala | bsd-3-clause | 1,875 |
package advancedScala.chapter1
// pull in the typeclass
import cats.Show
// pull in the implicits for the Int type
import cats.instances.int._
import cats.instances.string._
// pull in
import cats.syntax.show._
object ShowableInstances {
implicit val catShow: Show[Cat] = {
// Show.show(cat => s"${cat.name.... | mikegehard/advanced-scala-with-cats-exercises | src/main/scala/advancedScala/chapter1/Show.scala | Scala | mit | 1,529 |
package io.mediachain.rpc.client
import java.util.concurrent.TimeUnit
import java.util.logging.Logger
import io.grpc.{ManagedChannel, ManagedChannelBuilder, StatusRuntimeException}
import io.mediachain.protos.Services._
import io.mediachain.protos.Services.LSpaceServiceGrpc.LSpaceServiceBlockingStub
import io.mediach... | mediachain/L-SPACE | rpc/src/main/scala/io/mediachain/rpc/client/LSpaceClient.scala | Scala | mit | 2,922 |
import java.util.zip.CRC32
import java.nio.ByteBuffer
import com.jimjh.merkle.spec.UnitSpec
import com.jimjh.merkle._
/** Spec for [[com.jimjh.merkle.MerkleTree]].
*
* This spec was left outside the package on purpose to verify the public interface.
*
* @author Jim Lim - jim@jimjh.com
*/
class UsageSpec ext... | jimjh/merkle-trees-impl | src/test/scala/UsageSpec.scala | Scala | mit | 669 |
package beam.agentsim.infrastructure.taz
import beam.router.BeamRouter.Location
import beam.sim.common.GeoUtils
import org.matsim.api.core.v01.{Coord, Id}
import org.matsim.core.utils.collections.QuadTree
import scala.collection.JavaConverters._
/**
* represents a Traffic Analysis Zone
* @param tazId unique identi... | colinsheppard/beam | src/main/scala/beam/agentsim/infrastructure/taz/TAZ.scala | Scala | gpl-3.0 | 3,364 |
/*
* 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 ... | Intel-bigdata/OAP | oap-native-sql/core/src/test/scala/org/apache/spark/sql/streaming/StreamingQuerySuite.scala | Scala | apache-2.0 | 48,144 |
/*
* 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 | sql/core/src/main/scala/org/apache/spark/sql/RelationalGroupedDataset.scala | Scala | apache-2.0 | 25,328 |
package com.lunatic.mlx.kddcup99.ml
import org.apache.spark.ml.Transformer
import org.apache.spark.ml.feature.VectorAssembler
import org.apache.spark.ml.param._
import org.json4s.JsonAST._
import org.json4s.jackson.Serialization
import org.json4s.jackson.Serialization._
import org.json4s.{CustomSerializer, NoTypeHints... | tupol/sparx-mllib | src/main/scala/com/lunatic/mlx/kddcup99/ml/TestJson1.scala | Scala | apache-2.0 | 5,676 |
package com.tsukaby.bean_validation_scala
import org.hibernate.validator.constraints.Length
import scala.annotation.meta.field
class LengthValidatorForOptionSpec extends BaseSpec {
private[this] case class TestBean(
@(Length@field)(min = 1, max = 1)
... | bean-validation-scala/bean-validation-scala | src/test/scala/com/tsukaby/bean_validation_scala/LengthValidatorForOptionSpec.scala | Scala | mit | 603 |
package com.aidan.chapter10
import java.beans.PropertyChangeEvent
import java.beans.PropertyChangeListener
import java.beans.PropertyChangeSupport
import scala.Array.canBuildFrom
object Chapter10 {
}
trait RectangleLike {
def setFrame(x: Double, y: Double, w: Double, h: Double)
def getX: Double
def getY: Dou... | aidanwhiteley/scala_impatient | src/main/scala/com/aidan/chapter10/Chapter10.scala | Scala | apache-2.0 | 4,244 |
package com.github.mdr.mash.ns.git.branch
import com.github.mdr.mash.functions.{ BoundParams, MashFunction, ParameterModel }
import com.github.mdr.mash.ns.git.remote.RemoteNameClass
import com.github.mdr.mash.ns.git.{ CommitHashClass, GitCommon, GitHelper }
import com.github.mdr.mash.runtime.{ MashList, MashObject, Ma... | mdr/mash | src/main/scala/com/github/mdr/mash/ns/git/branch/ListRemoteFunction.scala | Scala | mit | 1,598 |
package hr.element.etb
package object io {
import sys.process._
import sys.process.BasicIO.transferFully
import java.io.{ File, ByteArrayInputStream, ByteArrayOutputStream }
import java.lang.{ Thread, Runnable, InterruptedException }
implicit val WaitPeriod = 60000L
implicit val WorkingDir = new File("."... | melezov/etb | util/src/main/scala/hr/element/etb/Runner.scala | Scala | unlicense | 1,395 |
package ca.hyperreal.avconv
import java.awt.{Graphics2D}
import java.awt.Color._
import java.awt.image.{BufferedImage}
import javax.imageio.ImageIO
import java.io.{InputStream, OutputStream, File}
import sys.process.{Process, ProcessIO}
class Avconv( rate: String, video: String )
{
var in: OutputStream = _
var ou... | edadma/avconv | src/main/scala/Avconv.scala | Scala | gpl-3.0 | 973 |
package io.swagger.client.api
import io.swagger.client.model.Inline_response_200_9
import io.swagger.client.model.Credential
import io.swagger.client.model.Inline_response_200_10
import io.swagger.client.model.Inline_response_200_2
import io.swagger.client.core._
import io.swagger.client.core.CollectionFormats._
impor... | QuantiModo/QuantiModo-SDK-Akka-Scala | src/main/scala/io/swagger/client/api/CredentialApi.scala | Scala | gpl-2.0 | 3,830 |
package sbtandroid
import java.util.Properties
import proguard.{Configuration=>ProGuardConfiguration, ProGuard, ConfigurationParser, ConfigurationWriter}
import sbt._
import Keys._
import AndroidPlugin._
import AndroidHelpers._
import java.io.{File => JFile}
object AndroidInstall {
/**
* Task that installs a ... | jberkel/android-plugin | src/main/scala/AndroidInstall.scala | Scala | bsd-3-clause | 9,315 |
import org.apache.spark.SparkContext
import org.apache.spark.sql.SQLContext
/** Lazily instantiated singleton instance of SQLContext */
object SQLContextSingleton {
@transient private var instance: SQLContext = null
// Instantiate SQLContext on demand
def getInstance(sparkContext: SparkContext): SQLContext = sy... | faganpe/KafkaStreamingPOC | src/main/scala/SQLContextSingleton.scala | Scala | apache-2.0 | 431 |
class Foo[+CC[X]] { type Coll = CC[_] }
| felixmulder/scala | test/files/neg/t8265.scala | Scala | bsd-3-clause | 40 |
package org.jetbrains.plugins.scala
package lang
package surroundWith
package surrounders
package expression
import com.intellij.lang.ASTNode
import com.intellij.openapi.util.TextRange
import com.intellij.psi.PsiElement
import org.jetbrains.plugins.scala.lang.psi.ScalaPsiUtil
import org.jetbrains.plugins.scala.lang.ps... | JetBrains/intellij-scala | scala/scala-impl/src/org/jetbrains/plugins/scala/lang/surroundWith/surrounders/expression/ScalaWithTryCatchFinallySurrounder.scala | Scala | apache-2.0 | 1,581 |
package com.sksamuel.scapegoat.inspections.imports
import com.sksamuel.scapegoat.PluginRunner
import org.scalatest.{ FreeSpec, Matchers, OneInstancePerTest }
/** @author Stephen Samuel */
class WildcardImportTest extends FreeSpec with Matchers with PluginRunner with OneInstancePerTest {
override val inspections = ... | pwwpche/scalac-scapegoat-plugin | src/test/scala/com/sksamuel/scapegoat/inspections/imports/WildcardImportTest.scala | Scala | apache-2.0 | 652 |
package akka.cluster.client
import akka.actor.{ActorSystem, Props}
import akka.cluster.{AkkaCuratorClient, ZookeeperClusterSeedSettings}
import com.typesafe.config.{Config, ConfigValueFactory}
import org.apache.curator.framework.CuratorFramework
import org.apache.curator.framework.recipes.locks.{LockInternals, LockInt... | sclasen/akka-zk-cluster-seed | src/main/scala/akka/cluster/client/ZookeeperClusterClientSettings.scala | Scala | apache-2.0 | 2,159 |
package io.youi.layout
case class HorizontalLayout(spacing: Double = 0.0, initialSpacing: Double = 0.0) extends Layout {
override def connect(container: Component): Unit = {
update(container, Vector.empty)
}
override def disconnect(container: Component): Unit = Component.childrenFor(container).foreach { c =... | outr/youi | ui/js/src/main/scala/io/youi/layout/HorizontalLayout.scala | Scala | mit | 1,021 |
package org.jetbrains.sbt.shell
import java.io.File
import java.util
import java.util.UUID
import com.intellij.build.events.impl._
import com.intellij.build.{BuildViewManager, DefaultBuildDescriptor}
import com.intellij.compiler.impl.CompilerUtil
import com.intellij.execution.Executor
import com.intellij.execution.ex... | triplequote/intellij-scala | scala/scala-impl/src/org/jetbrains/sbt/shell/SbtProjectTaskRunner.scala | Scala | apache-2.0 | 10,270 |
package inloopio.util.nls
import java.util.Locale
import java.util.MissingResourceException
import java.util.ResourceBundle
import inloopio.util.ClassVar
/**
* Base class for all translation bundles that provides injection of translated
* texts into public String fields.
*/
abstract class TranslationBundle {
pr... | dcaoyuan/inloopio-libs | inloopio-util/src/main/scala/inloopio/util/nls/TranslationBundle.scala | Scala | bsd-3-clause | 2,521 |
package io.atal.butterfly.action
import io.atal.butterfly.{Editor, Clipboard, Cursor}
import org.scalatest._
import Matchers._
/** RemoveCursor action unit test
*/
class RemoveCursorTest extends FlatSpec {
"The RemoveCursor action" should "remove a cursor to the editor" in {
val action = new RemoveCursor((0,... | Matthieu-Riou/Butterfly | src/test/scala/io/atal/butterfly/action/RemoveCursorTest.scala | Scala | mit | 477 |
package com.sksamuel.elastic4s.searches.suggestions
import com.sksamuel.elastic4s.searches.suggestion.TermSuggestionDefinition
import org.elasticsearch.search.suggest.SuggestBuilders
import org.elasticsearch.search.suggest.term.TermSuggestionBuilder
object TermSuggestionBuilderFn {
def apply(sugg: TermSuggestionDe... | aroundus-inc/elastic4s | elastic4s-tcp/src/main/scala/com/sksamuel/elastic4s/searches/suggestions/TermSuggestionBuilderFn.scala | Scala | apache-2.0 | 1,144 |
/*
* 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 | sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/CsvExpressionsSuite.scala | Scala | apache-2.0 | 8,725 |
package com.sksamuel.scapegoat.inspections.collections
import com.sksamuel.scapegoat.{ Inspection, InspectionContext, Inspector, Levels }
/** @author Stephen Samuel */
class AvoidSizeNotEqualsZero extends Inspection {
def inspector(context: InspectionContext): Inspector = new Inspector(context) {
override def ... | jasonchaffee/scalac-scapegoat-plugin | src/main/scala/com/sksamuel/scapegoat/inspections/collections/AvoidSizeNotEqualsZero.scala | Scala | apache-2.0 | 997 |
package scala.collection.scalameter.immutable.TreeBag
import org.scalameter.api._
object TreeBag_exists extends TreeBagBenchmark {
def sizes = Gen.range("size")(20000, 200000, 20000)
def funName: String = "exists{result:=false}"
def fun(bag: TreeBag_product.Bag[BigInt]): Unit = bag.exists(_ => false)
def ... | sageserpent-open/multisets | src/test/scala/scala/collection/scalameter/immutable/TreeBag/TreeBag_exists.scala | Scala | bsd-3-clause | 400 |
/*
* 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... | kapil-malik/incubator-toree | protocol/src/main/scala/org/apache/toree/kernel/protocol/v5/HeaderBuilder.scala | Scala | apache-2.0 | 1,526 |
package com.github.sonenko.elastichelper
package helper
import java.io.File
import org.joda.time.DateTime
import org.specs2.mutable.Specification
import org.specs2.specification.Scope
import org.specs2.mock.Mockito
import scala.util.{Success, Failure, Try}
import com.sksamuel.elastic4s.mappings.FieldType._
import com... | sonenko/elastic-helper | helper/src/test/scala/com/github/sonenko/elastichelper/helper/ElasticHelperTest.scala | Scala | apache-2.0 | 4,922 |
package controllers
import java.io.{BufferedOutputStream, File, FileOutputStream}
import java.util.zip.Deflater
import akka.actor.ActorSystem
import akka.stream.Materializer
import com.mohiva.play.silhouette.api.Silhouette
import com.scalableminds.util.accesscontext.{DBAccessContext, GlobalAccessContext}
import com.s... | scalableminds/webknossos | app/controllers/AnnotationIOController.scala | Scala | agpl-3.0 | 25,188 |
package com.github.log0ymxm
import org.scalatest._
import scala.math.BigDecimal.RoundingMode
import org.scalacheck.Properties
import org.scalacheck.Prop.forAll
class OverpunchSpec extends FunSuite with Matchers {
test("decode no decimal positive") {
Overpunch.decode("12345{") shouldEqual BigDecimal("1234.50")
... | log0ymxm/scala-overpunch | src/test/scala/com/github/log0ymxm/OverpunchSpec.scala | Scala | mit | 2,546 |
package sri.universal.navigation.reducer
import scala.scalajs.js
@js.native
trait NavigationFindReducer extends js.Object{
def apply(reducers : js.Array[NavigationReducer],action : js.Object = ???) : NavigationReducer = js.native
}
| chandu0101/sri | universal/src/main/scala/sri/universal/navigation/reducer/NavigationFindReducer.scala | Scala | apache-2.0 | 238 |
package com.datastax.spark.connector.cql
import java.io.IOException
import java.net.InetAddress
import scala.collection.JavaConversions._
import scala.language.reflectiveCalls
import org.apache.spark.SparkConf
import com.datastax.driver.core.{Cluster, Host, Session}
import com.datastax.spark.connector.cql.Cassandra... | ponkin/spark-cassandra-connector | spark-cassandra-connector/src/main/scala/com/datastax/spark/connector/cql/CassandraConnector.scala | Scala | apache-2.0 | 11,369 |
package asobu.dsl
import akka.actor.ActorSystem
import akka.stream.ActorMaterializer
import scala.concurrent.Await
import org.specs2.specification.{After, Scope}
import scala.concurrent.duration.Duration
trait WithSystem extends Scope with After {
implicit val system = ActorSystem()
implicit val mat = ActorMateri... | kailuowang/asobu | dsl/src/test/scala/asobu/dsl/WithSystem.scala | Scala | apache-2.0 | 392 |
package io.mpjsons.impl.serializer
import io.mpjsons.JsonTypeSerializer
import io.mpjsons.impl.SerializerFactory
import io.mpjsons.impl.util.{Context, TypesUtil}
import scala.reflect.runtime.universe._
class EitherSerializer[L, R](serializerFactory: SerializerFactory, tpe: Type, context: Context) extends JsonTypeSer... | marpiec/mpjsons | src/main/scala/io/mpjsons/impl/serializer/EitherSerializer.scala | Scala | apache-2.0 | 1,021 |
package applicant.ml.regression
import applicant.nlp.LuceneTokenizer
import applicant.ml.score._
import applicant.ml.regression._
import applicant.ml.naivebayes._
import applicant.etl._
import scala.collection.mutable.{ListBuffer, Map, HashMap}
import java.io.File
import java.util.regex
import scopt.OptionParser
imp... | dataworks/internship-2016 | etl/src/scala/applicant/ml/MlModelGenerator.scala | Scala | apache-2.0 | 9,803 |
package scala
package reflect
package macros
/**
* <span class="badge badge-red" style="float: right;">EXPERIMENTAL</span>
*
* A slice of [[scala.reflect.macros.blackbox.Context the Scala macros context]] that
* provides facilities to communicate with the compiler's front end
* (emit warnings, errors and other... | felixmulder/scala | src/reflect/scala/reflect/macros/FrontEnds.scala | Scala | bsd-3-clause | 1,614 |
package com.lucaswilkins.newtonfractals
import java.awt.event.{MouseListener, MouseEvent}
/**
* Neatened version of mouse listener for just mouse releases
*
* @param onRelease
*/
class MouseReleasedListener(onRelease: MouseEvent ⇒ Unit) extends MouseListener {
def mouseClicked(e: MouseEvent): Unit = {}
... | drlucaswilkins/newtonfractal | NewtonFractal/src/main/scala/com/lucaswilkins/newtonfractals/MouseReleasedListener.scala | Scala | gpl-2.0 | 525 |
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2015-2021 Andre White.
*
* 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
*
* https://www.apache.org/licenses/LICENSE-2.0
*
... | adarro/ddo-calc | subprojects/common/ddo-core/src/test/scala/io/truthencode/ddo/support/JoinAbleMap.scala | Scala | apache-2.0 | 1,665 |
/**
* Generated by API Builder - https://www.apibuilder.io
* Service version: 0.15.4
* apibuilder 0.15.3 app.apibuilder.io/apicollective/apibuilder-spec/latest/play_2_8_client
*/
package io.apibuilder.spec.v0.models {
sealed trait ResponseCode extends _root_.scala.Product with _root_.scala.Serializable
/**
... | gheine/apidoc | generated/app/ApicollectiveApibuilderSpecV0Client.scala | Scala | mit | 79,099 |
package com.wavesplatform.state.diffs.smart
import com.wavesplatform.common.state.ByteStr
import com.wavesplatform.common.utils.{Base64, EitherExt2}
import com.wavesplatform.lang.directives.DirectiveSet
import com.wavesplatform.lang.directives.values._
import com.wavesplatform.lang.utils._
import com.wavesplatform.lan... | wavesplatform/Waves | node/src/test/scala/com/wavesplatform/state/diffs/smart/predef/package.scala | Scala | mit | 9,723 |
package org.kirhgoff.morphoid.engine
import java.util.concurrent.atomic.AtomicLong
import scala.util.Random
/**
* Created by <a href="mailto:kirill.lastovirya@gmail.com">kirhgoff</a> on 2/9/17.
*/
object Dice {
def randomOne() = if (random.nextBoolean()) 1 else 0
val idCounter = new AtomicLong()
val tickC... | kirhgoff/morphoid | morphoid-engine/src/main/scala/org/kirhgoff/morphoid/engine/Dice.scala | Scala | lgpl-2.1 | 658 |
package dialectic.micro
import org.scalacheck._
import org.scalacheck.Arbitrary._
import org.specs2._
import scalaz.{ IMap, Order }
import scalaz.std.anyVal.intInstance
import scalaz.scalacheck.ScalazArbitrary.Arbitrary_==>>
import scalaz.scalacheck.ScalazProperties.equal
class GoalStateTest extends Specification w... | adelbertc/dialectic | micro/src/test/scala/dialectic/micro/GoalStateTest.scala | Scala | bsd-3-clause | 743 |
/*
* Copyright 2015 University of Basel, Graphics and Vision Research Group
*
* 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
*
* Unl... | unibas-gravis/scalismo | src/main/scala/scalismo/registration/MeanSquaresMetric.scala | Scala | apache-2.0 | 1,727 |
package us.theatr.spray.nozzle
/*
Copyright 2012 Yann Ramin
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 ... | theatrus/spray-nozzle | src/main/scala/us/theatr/spray/nozzle/PasswordUtil.scala | Scala | apache-2.0 | 3,035 |
package util.chrome
import scala.scalajs.js
@js.native
object api extends js.GlobalScope {
def chrome: Chrome = js.native
@js.native
trait Chrome extends js.Object {
def storage: ChromeStorage = js.native
def runtime: Runtime = js.native
}
@js.native
trait ChromeStorage extends js.Object {
... | felixgborrego/simple-docker-ui | chromeapp/src/main/scala/util/ChromeApi.scala | Scala | mit | 1,089 |
package ghtorrent.models
case class User(id: Int, login: String)
| PRioritizer/PRioritizer-analyzer | src/main/scala/ghtorrent/models/User.scala | Scala | mit | 66 |
package com.harrys.hyppo.worker.proto
import com.harrys.hyppo.executor.proto.com.CreateIngestionTasksCommand
import com.harrys.hyppo.executor.proto.res.CreateIngestionTasksResult
import com.harrys.hyppo.worker.{ProcessedDataStub, TestObjects}
import scala.concurrent.duration._
/**
* Created by jpetty on 7/23/15.
*... | harrystech/hyppo-worker | worker/src/test/scala/com/harrys/hyppo/worker/proto/CreateTasksCommandTest.scala | Scala | mit | 1,132 |
/*
* Skylark
* http://skylark.io
*
* Copyright 2012-2017 Quantarray, LLC
*
* 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
*
* Unl... | quantarray/skylark | skylark-measure/src/main/scala/com/quantarray/skylark/measure/CanDivideMeasure.scala | Scala | apache-2.0 | 986 |
package chapter11
object Exercise6 {
} | amolnayak311/functional-programming-in-scala | src/chapter11/Exercise6.scala | Scala | unlicense | 47 |
package haru.dao
import haru.util.RedisKeyGenerator
import com.redis.RedisClient
import com.redis.RedisClientPool
object SchemaDao {
val clients = new RedisClientPool("stage.haru.io", 6400)
def getClasses(appid: String): Option[Set[Option[String]]] = {
clients.withClient {
client =>
{
... | haruio/haru-admin | src/main/scala/haru/dao/SchemaDao.scala | Scala | mit | 1,101 |
package com.github.unisay.mockserver.scala
import java.util.concurrent.TimeUnit
import com.github.unisay.mockserver.scala.DSL.Headers._
import com.github.unisay.mockserver.scala.DSL.Statuses._
import com.github.unisay.mockserver.scala.DSL._
import org.mockserver.client.server.{ForwardChainExpectation, MockServerClien... | Unisay/mockserver-client-scala | src/test/scala/com/github/unisay/mockserver/scala/DSLTest.scala | Scala | mit | 8,965 |
/**
* 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... | Digsolab/kafka_2.10 | core/src/main/scala/kafka/server/TopicConfigManager.scala | Scala | apache-2.0 | 6,147 |
/*
* 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 ... | mylog00/flink | flink-libraries/flink-table/src/test/scala/org/apache/flink/table/plan/QueryDecorrelationTest.scala | Scala | apache-2.0 | 4,971 |
/*
* 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/rules/dataSet/DataSetLogicalWindowAggregateRule.scala | Scala | apache-2.0 | 4,066 |
package se.nimsa.sbx.forwarding
import akka.actor.{Actor, ActorRef, ActorSystem, Props}
import akka.testkit.{ImplicitSender, TestKit}
import akka.util.Timeout
import org.scalatest.{BeforeAndAfterAll, BeforeAndAfterEach, Matchers, WordSpecLike}
import se.nimsa.sbx.anonymization.{AnonymizationProfile, ConfidentialityOpt... | slicebox/slicebox | src/test/scala/se/nimsa/sbx/forwarding/ForwardingServiceActorTest.scala | Scala | apache-2.0 | 16,832 |
/*
* Copyright 2014, by Vladimir Kostyukov and Contributors.
*
* This file is a part of a Finch library that may be found at
*
* https://github.com/finagle/finch
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
* You may... | penland365/finch | core/src/test/scala/io/finch/FilterOpsSpec.scala | Scala | apache-2.0 | 1,760 |
/*
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 use this f... | transcendent-ai-labs/DynaML | dynaml-examples/src/main/scala/io/github/mandar2812/dynaml/examples/DaisyPowerPlant.scala | Scala | apache-2.0 | 5,475 |
/*
Copyright 2013 Josh Conrad
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
di... | jmconrad/scala-groupcache | src/main/scala/groupcache/Implicits.scala | Scala | apache-2.0 | 1,599 |
import org.sbtidea.test.util.AbstractScriptedTestBuild
import sbt._
import sbt.Keys._
import org.sbtidea.SbtIdeaPlugin._
object ScriptedTestBuild extends AbstractScriptedTestBuild("with-extra-tests") {
lazy val root = Project("main", file("."), settings = Defaults.defaultSettings ++ scriptedTestSettings ++ Seq(
... | mpeltonen/sbt-idea | src/sbt-test/sbt-idea/with-extra-tests/project/Build.scala | Scala | bsd-3-clause | 803 |
package com.cloudray.scalapress.account.controller.admin
import org.springframework.stereotype.Controller
import org.springframework.web.bind.annotation.{PathVariable, ModelAttribute, RequestMethod, RequestMapping}
import scala.Array
import org.springframework.ui.ModelMap
import com.cloudray.scalapress.section.Section... | vidyacraghav/scalapress | src/main/scala/com/cloudray/scalapress/account/controller/admin/AccountTypeEditController.scala | Scala | apache-2.0 | 1,407 |
/*
* 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... | monix/monix | monix-reactive/shared/src/test/scala/monix/reactive/internal/operators/UncancelableSuite.scala | Scala | apache-2.0 | 1,908 |
package tastytest
object Refinements {
trait Foo {
type T
type U
def foo: (T, U)
}
class Bar[A, B] {
def bar[F <: Foo { type T = A; type U = B }](member: F): (member.T, member.U) = {
member.foo
}
}
class Baz[A, B, F <: Foo { type T = A; type U = B }] {
def baz(member: F): (me... | lrytz/scala | test/tasty/neg/src-3/Refinements.scala | Scala | apache-2.0 | 372 |
package org.bitcoins.spvnode.messages.data
import org.bitcoins.core.protocol.transaction.Transaction
import org.bitcoins.core.util.Factory
import org.bitcoins.spvnode.messages._
import org.bitcoins.spvnode.serializers.messages.data.RawTransactionMessageSerializer
/**
* Created by chris on 6/2/16.
* Companion fact... | Christewart/bitcoin-s-spv-node | src/main/scala/org/bitcoins/spvnode/messages/data/TransactionMessage.scala | Scala | mit | 798 |
package eu.execom.FabutPresentation.rest
import javax.servlet.http.{HttpServletRequest, HttpServletResponse}
import org.joda.time.DateTime
import org.joda.time.format.DateTimeFormat
trait CacheControlSupport {
implicit def request: HttpServletRequest
implicit def response: HttpServletResponse
val RFC1123_PA... | idostanic/FabutPresentation | src/main/scala/eu/execom/FabutPresentation/rest/CacheControlSupport.scala | Scala | apache-2.0 | 789 |
/*
* Copyright 2019 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/scio | scio-google-cloud-platform/src/main/scala/com/spotify/scio/spanner/SpannerIO.scala | Scala | apache-2.0 | 3,942 |
package org.rovak.steamclient.steam3
object MsgUtils {
val ProtoMask = 0x80000000
val EMsgMask = ~ProtoMask
def ToMsg(msg: Int) = msg & EMsgMask
def IsProtoBuf(msg: Int) = (msg & 0xffffffffL & ProtoMask) > 0
}
| Rovak/scala-steamkit | steamkit/src/main/scala/org/rovak/steamclient/steam3/MsgUtils.scala | Scala | mit | 222 |
/*
* 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 | test/services/mocks/IncorpIdServiceMock.scala | Scala | apache-2.0 | 1,660 |
sealed trait Option[+A]{
def map[B](f: A => B): Option[B] = {
this match {
case None => None
case Some(x) => Some(f(x))
}
}
//TODO: Return here and implement without using pattern matching
def flatMap[B](f: A => Option[B]): Option[B] = this match {
case None => None
case Some(x) => f(x)
}
def getO... | wkimeria/fp_scala_for_mortals | chapter_4/exercises/exercise_3.scala | Scala | mit | 1,493 |
class C {
val func = Seq { x += 1; 42 } apply _
}
class D {
var i = 0
def f(n: Unit)(j: Int): Int = ???
val g = x => f(y += 1)(x)
}
class E {
var i = 0
def f(n: Unit)(j: Int): Int = ???
val g = x => f(x += 1)(x)
}
class Convo {
def f(i: Int)(z: Any): Int = ???
val g = (x, y) => f(42)(x, y)
}
| scala/scala | test/files/neg/t9745.scala | Scala | apache-2.0 | 314 |
/*
* Copyright (C) 2011 Romain Reuillon
*
* This program 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) any later version.
*
* This progra... | ISCPIF/PSEExperiments | openmole-src/openmole/core/org.openmole.core.tools/src/main/scala/org/openmole/core/tools/io/StringBuilderOutputStream.scala | Scala | agpl-3.0 | 942 |
/*
* 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 ... | apache/flink | flink-table/flink-table-planner/src/test/scala/org/apache/flink/table/planner/plan/batch/sql/PartitionableSourceTest.scala | Scala | apache-2.0 | 5,577 |
package com.twitter.finagle.service
import com.twitter.conversions.time._
import com.twitter.finagle._
import com.twitter.finagle.stats.StatsReceiver
import com.twitter.finagle.util.Proc
import com.twitter.util.{Future, Duration, Time, Throw, Return, Timer, TimerTask}
import scala.util.Random
private[finagle] object ... | yancl/finagle-6.22.0 | finagle-core/src/main/scala/com/twitter/finagle/service/FailFastFactory.scala | Scala | apache-2.0 | 5,522 |
package com.redhat.samples.camel
import org.apache.camel.builder.RouteBuilder
import org.apache.camel.test.junit4.CamelTestSupport
import org.junit.Test
class BasicTest extends CamelTestSupport {
override def createRouteBuilder = new RouteBuilder {
override def configure: Unit = {
from("direct:in").to("m... | tadayosi/samples-camel | basic/src/test/scala/com/redhat/samples/camel/BasicTest.scala | Scala | apache-2.0 | 567 |
package org.jetbrains.plugins.scala
package codeInspection
package syntacticSimplification
import com.intellij.codeInspection._
import com.intellij.openapi.project.Project
import com.intellij.psi.PsiElement
import org.jetbrains.plugins.scala.extensions.PsiElementExt
import org.jetbrains.plugins.scala.lang.psi.api.expr... | ilinum/intellij-scala | src/org/jetbrains/plugins/scala/codeInspection/syntacticSimplification/RemoveRedundantReturnInspection.scala | Scala | apache-2.0 | 1,477 |
package org.deepdive.inference
import org.deepdive.settings.FactorFunctionVariable
import org.deepdive.calibration._
import org.deepdive.settings._
import java.io.File
trait InferenceRunner {
/* Initializes the data store. This method must be called before any other methods in this class. */
def init() : Un... | sai16vicky/deepdive | src/main/scala/org/deepdive/inference/InferenceRunner.scala | Scala | apache-2.0 | 1,651 |
trait SCL10006 {
import cats._
val x: /*start*/Unapply.Aux2Right[Applicative, Either[String, Int], Either, String, Int]#M[List[Unapply.Aux2Right[Applicative, Either[String, Int], Either, String, Int]#A]]/*end*/
}
/*
trait SCL10006 {
import cats._
val x: Either[String, List[Int]]
}
*/ | ilinum/intellij-scala | testdata/adjustTypes/SCL10006.scala | Scala | apache-2.0 | 296 |
/*
* Copyright (c) 2014-2018 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.apache.... | snowplow/iglu | 2-repositories/iglu-server/src/test/scala/com.snowplowanalytics.iglu.server/service/SchemaServiceSpec.scala | Scala | apache-2.0 | 34,071 |
package edu.gemini.phase2.template.factory.impl.gmos
import edu.gemini.pot.sp.{ISPObservation, ISPGroup}
import edu.gemini.spModel.gemini.gmos.blueprint.SpGmosSBlueprintIfuNs
import edu.gemini.spModel.gemini.gmos.GmosSouthType.FPUnitSouth._
import edu.gemini.spModel.gemini.gmos.GmosSouthType.FilterSouth._
import edu.g... | arturog8m/ocs | bundle/edu.gemini.phase2.skeleton.servlet/src/main/scala/edu/gemini/phase2/template/factory/impl/gmos/GmosSIfuNs.scala | Scala | bsd-3-clause | 3,622 |
/*
* 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
* distrib... | fusepoolP3/p3-silk | silk-learning/src/main/scala/de/fuberlin/wiwiss/silk/learning/active/linkselector/JensenShannonDivergenceSelector.scala | Scala | apache-2.0 | 3,532 |
package fr.unice.polytech.ogl.championships.library
import eu.ace_design.island.bot.IExplorerRaid
trait Teams {
def players: Map[String, IExplorerRaid]
def playerNames: String = players.map { case (n,_) => n.toUpperCase }.toSeq.sorted mkString ", "
}
trait SI3 extends Teams {
def players: Map[String, IExplo... | mosser/ogl-2015 | src/main/scala/fr/unice/polytech/ogl/championships/library/Teams.scala | Scala | lgpl-3.0 | 1,785 |
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.