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 com.alvinalexander.breakandcontinue
import util.control.Breaks._
import org.apache.spark.SparkContext._
import org.apache.spark.rdd._
import org.apache.spark._
import scala.collection.immutable.Set
import java.text.SimpleDateFormat
import java.util.Date
import java.io._
/*
REF: http://wanghuanming.com/2014/10... | heming621/postgraduate- | sparkAprioriV7E/src/main/scala/Sapriori.scala | Scala | mit | 7,191 |
package serialization
import com.mongodb.DBObject
import com.mongodb.casbah.commons.Implicits._
import com.mongodb.casbah.commons.MongoDBObject
import com.novus.salat.transformers.CustomTransformer
import models._
trait Bson {
object SourceTransformer extends CustomTransformer[Source, DBObject] {
def deserial... | fernando-romero/salat-test | app/serialization/Bson.scala | Scala | mit | 885 |
/*
* 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 ... | pgandhi999/spark | resource-managers/kubernetes/core/src/test/scala/org/apache/spark/scheduler/cluster/k8s/ExecutorPodsPollingSnapshotSourceSuite.scala | Scala | apache-2.0 | 3,106 |
/*
* Copyright 2021 HM Revenue & Customs
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or a... | hmrc/amls-frontend | test/models/moneyservicebusiness/MostTransactionsSpec.scala | Scala | apache-2.0 | 3,872 |
package de.choffmeister.akkavsnode.models
import reactivemongo.api.collections.default.BSONCollection
import reactivemongo.api.indexes._
import reactivemongo.bson._
import scala.concurrent._
case class User(
id: BSONObjectID = BSONObjectID("00" * 12),
name: String,
description: String) extends BaseModel
class... | choffmeister/akka-vs-node | akka/src/main/scala/de/choffmeister/akkavsnode/models/User.scala | Scala | mit | 1,059 |
import quoted._
import scala.quoted.staging._
object Test {
given Toolbox = Toolbox.make(getClass.getClassLoader)
def main(args: Array[String]): Unit = withQuoteContext {
val q = '{
type T[X] = List[X]
val x = "foo"
${
val y = 'x
'{ val z: T[String] = List($y) }
}
... | som-snytt/dotty | tests/run-staging/quote-nested-6.scala | Scala | apache-2.0 | 356 |
package TwentyOneToThirty
/**
* Created by Farrell on 5/21/15.
*/
object P22 {
}
| Spinlocks/99Problems | src/TwentyOneToThirty/P22.scala | Scala | apache-2.0 | 85 |
/*
* Copyright (C) 2016-2017 Lightbend Inc. <https://www.lightbend.com>
*/
package com.lightbend.lagom.javadsl.persistence.cassandra
import java.util.concurrent.{ CompletableFuture, CompletionStage }
import java.util.function.BiFunction
import java.util.{ Collections, Optional, UUID, List => JList }
import com.data... | edouardKaiser/lagom | persistence-cassandra/javadsl/src/main/scala/com/lightbend/lagom/javadsl/persistence/cassandra/CassandraReadSideProcessor.scala | Scala | apache-2.0 | 4,227 |
package akashic.storage
import akashic.storage.admin.User
import org.apache.commons.codec.binary.Base64
import org.apache.http.client.entity.EntityBuilder
import org.apache.http.client.methods.{HttpPut, HttpGet, HttpPost}
import org.apache.http.impl.client.HttpClients
import org.apache.http.message.BasicHeader
import... | akiradeveloper/fss3 | src/test/scala/akashic/storage/AdminTest.scala | Scala | apache-2.0 | 2,441 |
package com.gh.helper.domain
// import slick.driver.MySQLDriver.simple._
import slick.model.ForeignKeyAction
import slick.driver.MySQLDriver.api._
import scala.concurrent.ExecutionContext.Implicits.global
import java.sql.Timestamp
case class PersonList(id: Option[Long], userId: String, listId: Long, isOwner: Boolean... | saetar/grocery-backend | src/main/scala/com/gh/helper/domain/PersonsLists.scala | Scala | unlicense | 926 |
package com.evojam.mongodb.client.cursor
import scala.concurrent.ExecutionContext
import com.mongodb.ReadPreference
import org.bson.codecs.{ Codec, Encoder }
import com.evojam.mongodb.client.ObservableOperationExecutor
import com.evojam.mongodb.client.model.operation.ListCollectionOperation
private[client] case cla... | evojam/mongodb-driver-scala | src/main/scala/com/evojam/mongodb/client/cursor/ListCollectionsCursor.scala | Scala | apache-2.0 | 2,216 |
package com.cloudera.hue.livy.server
import javax.servlet.ServletContext
import com.cloudera.hue.livy.{Utils, Logging, LivyConf, WebServer}
import org.scalatra._
import org.scalatra.servlet.ScalatraListener
object Main {
val SESSION_KIND = "livy-server.session.kind"
val THREAD_SESSION = "thread"
val PROCESS_S... | dulems/hue | apps/spark/java/livy-server/src/main/scala/com/cloudera/hue/livy/server/Main.scala | Scala | apache-2.0 | 2,096 |
package mesosphere.marathon.core.flow.impl
import akka.actor.ActorSystem
import akka.testkit.TestActorRef
import mesosphere.marathon.MarathonSpec
import mesosphere.marathon.core.flow.LaunchTokenConfig
import mesosphere.marathon.core.matcher.manager.OfferMatcherManager
import mesosphere.marathon.core.task.bus.{
TaskS... | EasonYi/marathon | src/test/scala/mesosphere/marathon/core/flow/impl/OfferMatcherLaunchTokensActorTest.scala | Scala | apache-2.0 | 2,866 |
package scala.tools.nsc
package symtab
import org.junit.Assert._
import org.junit.Test
import org.junit.runner.RunWith
import org.junit.runners.JUnit4
import scala.tools.testing.BytecodeTesting
@RunWith(classOf[JUnit4])
class FlagsTest extends BytecodeTesting {
object symbolTable extends SymbolTableForUnitTesting
... | felixmulder/scala | test/junit/scala/tools/nsc/symtab/FlagsTest.scala | Scala | bsd-3-clause | 4,357 |
package scorex.network
import java.net.{InetAddress, InetSocketAddress}
import org.scalacheck.Gen
import org.scalatest.prop.{GeneratorDrivenPropertyChecks, PropertyChecks}
import org.scalatest.{Matchers, PropSpec}
import play.api.libs.json.{JsObject, Json}
import scorex.network.peer.{PeerDatabaseImpl, PeerInfo}
impor... | alexeykiselev/WavesScorex | scorex-basics/src/test/scala/scorex/network/PeerDatabaseSpecification.scala | Scala | cc0-1.0 | 1,380 |
import scala.math.pow
object main extends App{
/*
* Foreach.
*/
val someNumber = List(-11, -10, -5, 0, 5, 10, 11)
someNumber.foreach((x: Int) => println(pow(x, 2)))
/*
* Partially applied function
* 1st version:
*/
someNumber.foreach(println(_))
// 2nd version
someNumber.foreach(println _... | arcyfelix/Courses | 18-10-18-Programming-in-Scala-by-Martin-Odersky-Lex-Spoon-and-Bill-Venners/27-ForeachAndFilterAndPartiallyAppliedFunctions/src/main.scala | Scala | apache-2.0 | 533 |
class MotherClass extends MixinWithSymbol {
def foo = 'sym1
}
object Test {
def main(args: Array[String]): Unit = {
(new MotherClass).symbolFromTrait
}
}
| yusuke2255/dotty | tests/run/t8933b/Test.scala | Scala | bsd-3-clause | 165 |
import sbt._
object Dependencies {
object Versions {
val akka = "2.3.4"
val apacheCommonsEmail = "1.3.2"
val aspectj = "1.7.4"
val scalajHttp = "0.3.16"
val typesafeConfig = "1.2.0"
val scalaTest = "2.2.0"
val scalaMock = "3.1.RC1"
... | Coiney/akka-mailer | project/Dependencies.scala | Scala | bsd-3-clause | 1,625 |
/***********************************************************************
* Copyright (c) 2013-2019 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... | elahrvivaz/geomesa | geomesa-spark/geomesa-spark-core/src/main/scala/org/locationtech/geomesa/spark/api/java/JavaGeoMesaSpark.scala | Scala | apache-2.0 | 3,784 |
/*
* 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 ... | mahmoudhanafy/spark-testing-base | src/main/1.3/scala/com/holdenkarau/spark/testing/StreamingSuiteBase.scala | Scala | apache-2.0 | 7,367 |
package uima.rs.en
import org.apache.uima.jcas.JCas
import uima.rs.MultiLingualQuestion
import us.feliscat.m17n.English
import us.feliscat.types.Question
import us.feliscat.util.uima.JCasID
/**
* <pre>
* Created on 2017/03/21.
* </pre>
*
* @author K.Sakamoto
*/
class EnglishQuestion(casId: JCasID,
... | ktr-skmt/FelisCatusZero-multilingual | src/main/scala/uima/rs/en/EnglishQuestion.scala | Scala | apache-2.0 | 455 |
/*
* 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 ... | mkolod/incubator-spark | core/src/main/scala/org/apache/spark/deploy/master/ApplicationInfo.scala | Scala | apache-2.0 | 2,988 |
/*
* 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 ... | DieBauer/flink | flink-libraries/flink-table/src/main/scala/org/apache/flink/table/plan/nodes/dataset/DataSetConvention.scala | Scala | apache-2.0 | 1,536 |
package com.twitter.finagle
import com.twitter.finagle.dispatch.{GenSerialClientDispatcher, SerialClientDispatcher, SerialServerDispatcher}
import com.twitter.finagle.netty3.transport.ChannelTransport
import com.twitter.finagle.stats.StatsReceiver
import com.twitter.finagle.tracing.TraceInitializerFilter
import com.tw... | spockz/finagle | finagle-core/src/main/scala/com/twitter/finagle/Codec.scala | Scala | apache-2.0 | 4,888 |
/*
* 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 ... | jasonpet/openwhisk | core/controller/src/main/scala/org/apache/openwhisk/core/loadBalancer/LeanBalancer.scala | Scala | apache-2.0 | 4,338 |
/*
* 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/main/scala/org/apache/spark/deploy/history/FsHistoryProvider.scala | Scala | apache-2.0 | 30,167 |
package fpinscala.exercises.ch04errorhandling
import org.scalatest.FunSuite
/**
* Created by hjmao on 17-3-3.
*/
class EitherTest extends FunSuite {
test("testMap with right value") {
val me = Right(1)
val f = (x: Int) => x + 1
val expected = Right(2)
val actual = me.map(f)
assert(actual == ex... | huajianmao/fpinscala | src/test/scala/fpinscala/exercises/ch04errorhandling/EitherTest.scala | Scala | mit | 2,869 |
/*
* 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 ... | guoxiaolongzte/spark | core/src/main/scala/org/apache/spark/ui/jobs/JobPage.scala | Scala | apache-2.0 | 16,115 |
package samples
import akka.actor.ActorSystem
import akka.stream.ActorMaterializer
import org.scalatest.concurrent.ScalaFutures
import org.scalatest.{Matchers, Suite, BeforeAndAfterAll}
trait TestBase extends BeforeAndAfterAll with Matchers with ScalaFutures {
this: Suite =>
implicit val actorSystem = ActorSyste... | fsat/akka-http-messing-about | src/test/scala/samples/TestBase.scala | Scala | mit | 470 |
/*
* 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 ... | andrewor14/iolap | external/kafka/src/main/scala/org/apache/spark/streaming/kafka/ReliableKafkaReceiver.scala | Scala | apache-2.0 | 11,289 |
/*
* 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 collecti... | martijnhoekstra/scala | src/library/scala/collection/immutable/Vector.scala | Scala | apache-2.0 | 51,747 |
/* Copyright 2009-2016 EPFL, Lausanne */
import leon.annotation._
object IfExpr1 {
@pure
def foo(): Int = {
var a = 1
var b = 2
if({a = a + 1; a != b})
a = a + 3
else
b = a + b
a
} ensuring(_ == 2)
}
| epfl-lara/leon | src/test/resources/regression/verification/xlang/valid/IfExpr1.scala | Scala | gpl-3.0 | 241 |
package fpinscala.parsing
import language.higherKinds
import language.implicitConversions
trait JSON
object JSON {
case object JNull extends JSON
case class JNumber(get: Double) extends JSON
case class JString(get: String) extends JSON
case class JBool(get: Boolean) extends JSON
case class JArray(get: Inde... | Tillaert/fpinscala | exercises/src/main/scala/fpinscala/parsing/JSON.scala | Scala | mit | 1,027 |
package bank
import vdf.VDF
class Link(val id: ID, var shape: Array[GeoPos], val from: Node, val to: Node, var function: VDF,
var atts: scala.collection.mutable.Map[String, Any]) extends NetworElement {
def network = from.network
} | frohfroh/SPARCAS | src/main/scala/bank/Link.scala | Scala | gpl-3.0 | 239 |
object Test {
def main(args: Array[String]) {
val gs = for (x <- (1 to 5)) yield { if (x % 2 == 0) List(1).seq else List(1).par }
println(gs.flatten)
println(gs.transpose)
val s = Stream(Vector(1).par, Vector(2).par)
println(s.flatten.toList)
println(s.transpose.map(_.toList).toList)
}
}
| felixmulder/scala | test/files/run/t4761.scala | Scala | bsd-3-clause | 318 |
package com.sksamuel.elastic4s.requests.searches.queries
import com.sksamuel.elastic4s.ElasticDsl._
import com.sksamuel.elastic4s.requests.common.DistanceUnit
import com.sksamuel.elastic4s.requests.searches.queries.geo.GeoDistanceQuery
import com.sksamuel.elastic4s.requests.searches.sort.{GeoDistanceSort, SortOrder}
i... | sksamuel/elastic4s | elastic4s-core/src/test/scala/com/sksamuel/elastic4s/requests/searches/queries/SearchBodyBuilderFnTest.scala | Scala | apache-2.0 | 2,343 |
package org.dbpedia.spotlight.db
import opennlp.tools.chunker.{ChunkerME, ChunkerModel}
import opennlp.tools.namefind.{NameFinderME, TokenNameFinderModel}
import opennlp.tools.util.Span
import org.dbpedia.spotlight.db.model.SurfaceFormStore
import org.dbpedia.spotlight.model._
/**
* @author Joachim Daiber
*
* Ope... | Skunnyk/dbpedia-spotlight-model | core/src/main/scala/org/dbpedia/spotlight/db/OpenNLPSpotter.scala | Scala | apache-2.0 | 1,970 |
package io.fintrospect.parameters
import io.fintrospect.util.{Extracted, Extraction, Extractor}
sealed trait FormFieldExtractor {
def apply(fields: Seq[Extractor[Form, _]], f: Form): Extraction[Form]
}
object WebFormFieldExtractor extends FormFieldExtractor {
override def apply(fields: Seq[Extractor[Form, _]], t... | daviddenton/fintrospect | core/src/main/scala/io/fintrospect/parameters/FormFieldExtractor.scala | Scala | apache-2.0 | 581 |
package io.stored.server.common
import io.viper.core.server.router.JsonResponse
import collection.mutable.ListBuffer
import org.json.{JSONObject, JSONArray}
object JsonUtil {
def toJsonArray[A,B](list: List[A]) : JSONArray = {
val arr = new JSONArray
list.foreach{x: A => arr.put(x)}
arr
}
def toJs... | briangu/stored.io | src/main/scala/io/stored/server/common/JsonUtil.scala | Scala | apache-2.0 | 1,056 |
package asobu.distributed
import akka.actor.ActorSystem
import scala.collection.JavaConverters._
/**
* Validate if the distributed data is configured correctly.
*/
object SystemValidator {
def validate(system: ActorSystem): Either[String, Unit] = {
val cfg = system.settings.config
val rolePath = "akka.clu... | iheartradio/asobu | distributed/src/main/scala/asobu/distributed/SystemValidator.scala | Scala | apache-2.0 | 747 |
package org.scalajs.core.compiler.test.util
import java.io._
import scala.tools.nsc._
import reporters.{Reporter, ConsoleReporter}
import org.junit.Assert._
import scala.util.matching.Regex
trait TestHelpers extends DirectTest {
private[this] val errBuffer = new CharArrayWriter
override def newReporter(setti... | lrytz/scala-js | compiler/src/test/scala/org/scalajs/core/compiler/test/util/TestHelpers.scala | Scala | bsd-3-clause | 2,436 |
package rest
import scala.concurrent.duration._
import akka.util.Timeout
import spray.http.StatusCodes._
import spray.http.MediaTypes._
import spray.json._
import spray.httpx.SprayJsonSupport
import scala.concurrent.Future
import concurrent.ExecutionContext.Implicits.global
import util.transform.json.DemonstratorProto... | javierg1975/Datamation | src/main/scala/rest/Routes.scala | Scala | mit | 2,199 |
/*
* Copyright 2014-2021 Netflix, 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... | brharrington/atlas | atlas-eval/src/main/scala/com/netflix/atlas/eval/stream/FinalExprEval.scala | Scala | apache-2.0 | 9,499 |
/*
* 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 reflect
... | scala/scala | src/reflect/scala/reflect/internal/AnnotationCheckers.scala | Scala | apache-2.0 | 6,512 |
package org.jetbrains.plugins.scala.testingSupport.scalatest.staticStringTest
import org.jetbrains.plugins.scala.testingSupport.IntegrationTest
/**
* @author Roman.Shein
* @since 26.06.2015.
*/
trait FunSuiteStaticStringTest extends IntegrationTest {
val funSuiteClassName = "FunSuiteStringTest"
val funSuiteFil... | triggerNZ/intellij-scala | test/org/jetbrains/plugins/scala/testingSupport/scalatest/staticStringTest/FunSuiteStaticStringTest.scala | Scala | apache-2.0 | 1,355 |
package com.twitter.finagle.http2
import com.twitter.finagle.Stack
import com.twitter.finagle.http2.transport.server.H2ServerFilter
import com.twitter.finagle.netty4.http.handler.UriValidatorHandler
import com.twitter.finagle.netty4.transport.ChannelTransport
import com.twitter.finagle.param.Timer
import io.netty.chan... | twitter/finagle | finagle-http2/src/main/scala/com/twitter/finagle/http2/Http2PipelineInitializer.scala | Scala | apache-2.0 | 1,628 |
package KeYmaeraD
/*
abstract class Rational
case class ExactInt(n) extends Rational
case class
*/
// exact nums are either rationals or integers. Is this worth it?
object Exact {
val zero : Num = Integer(0);
val one : Num = Integer(1);
val negone : Num = Integer(-1);
trait Num {
de... | keymaerad/KeYmaeraD | rational.scala | Scala | bsd-3-clause | 4,659 |
import scala.reflect.runtime.universe._
import scala.reflect.runtime.{currentMirror => cm}
import scala.reflect.ClassTag
object R { override def toString = "R" }
class Foo{
import Test._
def foo = {
val classTag = implicitly[ClassTag[R.type]]
val sym = cm.moduleSymbol(classTag.runtimeClass)
val cls = cm.refle... | yusuke2255/dotty | tests/pending/run/reflection-modulemirror-toplevel-good.scala | Scala | bsd-3-clause | 441 |
/*
* ecalogic: a tool for performing energy consumption analysis.
*
* Copyright (c) 2013, J. Neutelings, D. Peelen, M. Schoolderman
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* R... | jangroothuijse/ecalogic-c | src/main/scala/nl/ru/cs/ecalogic/util/ErrorHandler.scala | Scala | bsd-3-clause | 8,094 |
package app.flashcard.service
import java.util.UUID
import akka.NotUsed
import akka.stream.FlowShape
import akka.stream.scaladsl.{Broadcast, Flow, GraphDSL, Sink, Source, ZipWith}
import app.flashcard.repository.UserRepository
import app.flashcard.repository.UserRepository.User
import app.flashcard.service.MailServic... | mateuszjancy/intro-to-akka-stream | service/src/main/scala/app/flashcard/service/UserService.scala | Scala | apache-2.0 | 1,961 |
/*
* Copyright 2016-2020 Daniel Urban and contributors listed in 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... | durban/seals | examples/invariant/src/main/scala/com/example/invariant/main.scala | Scala | apache-2.0 | 1,591 |
package org.bitcoins.testkitcore.gen
import org.scalacheck.Gen
import org.bitcoins.core.hd._
import scala.util.Try
/** Generators related to HD wallet functionality
*/
object HDGenerators {
/** Generates a BIP 32 path segment
*/
def bip32Child: Gen[BIP32Node] = Gen.oneOf(softBip32Child, hardBip32Child)
... | bitcoin-s/bitcoin-s | testkit-core/src/main/scala/org/bitcoins/testkitcore/gen/HDGenerators.scala | Scala | mit | 4,518 |
/*
* 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 ... | graphframes/graphframes | src/test/scala/org/graphframes/GraphFrameSuite.scala | Scala | apache-2.0 | 10,874 |
package org.scalafmt.config
import metaconfig._
case class SortSettings(
order: List[SortSettings.ModKey]
)
object SortSettings {
implicit val SortSettingsModKeyReader: ConfCodec[ModKey] =
ReaderUtil.oneOfIgnoreBackticks[ModKey](
`implicit`,
`final`,
`sealed`,
`abstract`,
`ov... | olafurpg/scalafmt | scalafmt-core/shared/src/main/scala/org/scalafmt/config/SortSettings.scala | Scala | apache-2.0 | 1,826 |
/*
* Copyright 2001-2013 Artima, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agre... | dotty-staging/scalatest | common-test.dotty/src/main/scala/org/scalatest/SharedHelpers.scala | Scala | apache-2.0 | 100,095 |
/*
* Copyright 2013-2015 Websudos, Limited.
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* - Redistributions of source code must retain the above copyright notice,
* this list of c... | levinson/phantom | phantom-dsl/src/test/scala/com/websudos/phantom/builder/serializers/CreateQuerySerialisationTest.scala | Scala | bsd-2-clause | 2,233 |
/*
* 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... | asorianostratio/incubator-toree | kernel/src/test/scala/org/apache/toree/magic/builtin/AddJarSpec.scala | Scala | apache-2.0 | 8,466 |
package skuber.batch
import skuber.ResourceSpecification.{Names, Scope}
import skuber.{ObjectReference, LabelSelector, NonCoreResourceSpecification, ObjectMeta, ObjectResource, Pod, ResourceDefinition, Timestamp}
/**
* @author David O'Riordan
*/
case class CronJob(kind: String ="CronJob",
override val apiVersio... | doriordan/skuber | client/src/main/scala/skuber/batch/CronJob.scala | Scala | apache-2.0 | 1,945 |
package org.datacleaner.beans.valuedist
import org.datacleaner.result.html.{FlotChartLocator, HeadElement, HtmlRenderingContext}
/**
* Defines reusable script parts for value distribution results
*/
object ValueDistributionReusableScriptHeadElement extends HeadElement {
override def toHtml(context: HtmlRenderingC... | kaspersorensen/DataCleaner | components/value-distribution/src/main/scala/org/datacleaner/beans/valuedist/ValueDistributionReusableScriptHeadElement.scala | Scala | lgpl-3.0 | 1,922 |
package spire
package optional
import scala.collection.IterableLike
import scala.collection.generic.CanBuildFrom
import spire.algebra.{Semigroup, Group}
import spire.algebra.partial.{Semigroupoid, Groupoid}
import spire.util._
final class IterableSemigroupoid[A, SA <: IterableLike[A, SA]](implicit cbf: CanBuildFrom[... | tixxit/spire | core/shared/src/main/scala/spire/optional/partialIterable.scala | Scala | mit | 1,932 |
package temportalist.esotericraft.emulation.common.ability
import net.minecraft.entity.EntityLivingBase
import net.minecraft.nbt.NBTTagByte
import net.minecraft.potion.Potion
import net.minecraft.util.ResourceLocation
import temportalist.esotericraft.api.emulation.IAbility
import temportalist.esotericraft.api.emulatio... | TheTemportalist/EsoTeriCraft | src/main/scala/temportalist/esotericraft/emulation/common/ability/AbilityResistanceWither.scala | Scala | apache-2.0 | 992 |
/*
* 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 ... | lhaiesp/samza | samza-core/src/main/scala/org/apache/samza/metrics/reporter/Metrics.scala | Scala | apache-2.0 | 1,961 |
package chandu0101.scalajs.react.components
package materialui
import chandu0101.macros.tojs.JSMacro
import japgolly.scalajs.react._
import japgolly.scalajs.react.raw.React
import japgolly.scalajs.react.vdom.VdomNode
import scala.scalajs.js
/**
* This file is generated - submit issues instead of PR against it
*/... | rleibman/scalajs-react-components | core/src/main/scala/chandu0101/scalajs/react/components/materialui/MuiDialog.scala | Scala | apache-2.0 | 4,426 |
import sbt._
class ScuartzBuild(info : ProjectInfo) extends DefaultProject(info) {
val quartz = "org.quartz-scheduler" % "quartz" % "1.8.4"
val specs = "org.scala-tools.testing" % "specs" % "1.6.2.1"
val slf4j = "org.slf4j" % "slf4j-simple" % "1.6.1"
}
| dchenbecker/Scuartz | project/build/ScuartzBuild.scala | Scala | apache-2.0 | 260 |
package uk.gov.gds.ier.transaction.ordinary.otherAddress
import uk.gov.gds.ier.test.FormTestSuite
import uk.gov.gds.ier.model.OtherAddress
class OtherAddressFormTests
extends FormTestSuite
with OtherAddressForms {
it should "error out on empty json" in {
val js = JsNull
otherAddressForm.bind(js).fold(... | alphagov/ier-frontend | test/uk/gov/gds/ier/transaction/ordinary/otherAddress/OtherAddressFormTests.scala | Scala | mit | 3,164 |
/*
Collector is a tool for obtaining bioactivity data from the Open PHACTS platform.
Copyright (C) 2013 UPF
Contributed by Manuel Pastor(manuel.pastor@upf.edu) and Oriol López-Massaguer(oriol.lopez@upf.edu).
This file is part of Collector.
Collector is free software: you can redistribute i... | OriolLopezMassaguer/Collector | app/es/imim/phi/collector/compounds/CompoundFilterValidAtoms.scala | Scala | gpl-3.0 | 1,227 |
package sangria.validation.rules
import sangria.ast
import sangria.ast.AstVisitorCommand
import sangria.validation._
import scala.collection.mutable.{ListBuffer, Set => MutableSet}
/** No unused fragments
*
* A GraphQL document is only valid if all fragment definitions are spread within operations, or
* spread... | OlegIlyenko/sangria | modules/core/src/main/scala/sangria/validation/rules/NoUnusedFragments.scala | Scala | apache-2.0 | 1,492 |
/*
* Copyright 2017 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... | pncampbell/ct-calculations | src/main/scala/uk/gov/hmrc/ct/ct600/v3/B165.scala | Scala | apache-2.0 | 949 |
/*
* Copyright 2014 IBM Corp.
*
* 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... | yeghishe/spark-kernel | protocol/src/main/scala/com/ibm/spark/kernel/protocol/v5/content/package.scala | Scala | apache-2.0 | 2,739 |
/*
* 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... | uncleGen/aliyun-emapreduce-sdk | external/emr-logservice/src/main/scala/org/apache/spark/streaming/aliyun/logservice/LoghubInputDStream.scala | Scala | artistic-2.0 | 5,097 |
/*
* Copyright 2011-2017 Chris de Vreeze
*
* 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 agree... | dvreeze/yaidom | jvm/src/test/scala/eu/cdevreeze/yaidom/queryapitests/indexed/SubtypeAwareElemLikeQueryTest.scala | Scala | apache-2.0 | 1,373 |
package dotty.tools.scaladoc
package tasty
package comments
import scala.quoted._
import org.junit.{Test, Rule}
import org.junit.Assert.{assertSame, assertTrue, assertEquals}
import dotty.tools.scaladoc.tasty.util._
import dotty.tools.scaladoc.tasty.TastyParser
class CommentExpanderTests {
def check(using Quotes)(... | dotty-staging/dotty | scaladoc/test/dotty/tools/scaladoc/tasty/comments/CommentExpanderTests.scala | Scala | apache-2.0 | 1,499 |
/**
*Person.scala
* @author Andrew Hanes ahanes@csh.rit.edu
*
* Written for Programming Language Concepts
*
* This program demos hello world in scala
*/
object HelloWorld {
/**
* Main method
* @param args Command line arguments
*/
def main(args: Array[String]) {
println("Hello World");
... | AndrewHanes/Scala-Presentation | Examples/HelloWorld/HelloWorld.scala | Scala | mit | 325 |
package me.yingrui.segment.concept
import org.junit.Assert
import org.junit.Test
class ConceptTest {
val rootNounConcept: Concept = new Concept(100000, "noun")
buildTestData()
@Test
def should_have_children() {
val children = rootNounConcept.getChildren()
Assert.assertEquals(4, children.size); //多余
... | yingrui/mahjong | lib-segment/src/test/scala/me/yingrui/segment/concept/ConceptTest.scala | Scala | gpl-3.0 | 1,608 |
/**
* Copyright 2015 Thomson Reuters
*
* 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... | e-orz/CM-Well | tools/export-neptune-tool/src/main/scala/cmwell/tools/neptune/export/PropertiesStore.scala | Scala | apache-2.0 | 4,263 |
/*
* 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 ... | ptkool/spark | sql/core/src/test/scala/org/apache/spark/sql/execution/benchmark/TPCDSQueryBenchmark.scala | Scala | apache-2.0 | 6,554 |
/**
* 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... | mihbor/kafka | core/src/test/scala/unit/kafka/integration/MetricsDuringTopicCreationDeletionTest.scala | Scala | apache-2.0 | 6,053 |
package ai.akka.service.client
import ai.akka.service.client.Model.ClientDetails
/**
* Trait of client details service
*/
trait ClientDetailsService {
/**
* The method finds client details by client identity
* @param clientId client identity
* @return client details
*/
def findClientDetailsByClientI... | andrew--i/spray-oauth2 | src/main/scala/ai/akka/service/client/ClientDetailsService.scala | Scala | apache-2.0 | 750 |
package fr.ramiro.sfuzzy.dsl
/**
* Created by Ramiro on 12/05/2017.
*/
object Rule {
def IF(condition: Condition): IfClause = ???
def NOT(clause: Condition): Condition = ???
}
| rrramiro/sFuzzyLogic | src/main/scala/fr/ramiro/sfuzzy/dsl/Rule.scala | Scala | apache-2.0 | 184 |
package filodb.prometheus.ast
/**
* Time durations are specified as a number
* followed immediately by one of the following units:
* s - seconds
* m - minutes
* h - hours
* d - days
* w - weeks
* y - years
* i - factor of step (aka interval)
* */
sealed trait TimeUnit {
def millis(step: Long): ... | filodb/FiloDB | prometheus/src/main/scala/filodb/prometheus/ast/TimeUnits.scala | Scala | apache-2.0 | 1,525 |
def isPrime(num: Int) = {
Stream.range(2, math.sqrt(num.toDouble).toInt + 1).forall(num % _ != 0)
}
val results = (2 until 2000000).filter(isPrime).map(BigInt(_)).sum
println(results)
| brandonhorst/project-euler-scala | 010.scala | Scala | mit | 188 |
package lib.gitgithub
import com.madgag.scalagithub.GitHub._
import com.madgag.scalagithub.model.{PullRequest, Repo}
import lib.{Bot, Delayer, LabelledState, RepoSnapshot}
import play.api.Logger
import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.Future
object IssueUpdater {
val logge... | guardian/prout | app/lib/gitgithub/IssueUpdater.scala | Scala | apache-2.0 | 2,621 |
/*
* 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/test/scala/uk/gov/hmrc/ct/computations/CP8Spec.scala | Scala | apache-2.0 | 3,069 |
package ch.ethz.dalab.dissolve.classification
import ch.ethz.dalab.dissolve.regression.LabeledObject
import breeze.linalg._
import ch.ethz.dalab.dissolve.optimization.SolverOptions
import org.apache.spark.SparkContext
import org.apache.spark.rdd.RDD
import java.io.FileWriter
import ch.ethz.dalab.dissolve.optimization.... | dalab/dissolve-struct | dissolve-struct-lib/src/main/scala/ch/ethz/dalab/dissolve/classification/StructSVMWithDBCFW.scala | Scala | apache-2.0 | 2,271 |
package mesosphere.marathon.core.task.tracker.impl
import javax.inject.Inject
import mesosphere.marathon.MarathonSchedulerDriverHolder
import mesosphere.marathon.Protos.MarathonTask
import mesosphere.marathon.core.base.Clock
import mesosphere.marathon.core.task.tracker.{ TaskStatusUpdateProcessor, TaskStatusUpdateSte... | Kosta-Github/marathon | src/main/scala/mesosphere/marathon/core/task/tracker/impl/TaskStatusUpdateProcessorImpl.scala | Scala | apache-2.0 | 3,286 |
package dao.postgres.common
import java.sql.Connection
trait ConnectionPool {
def fetchConnection(): Connection
def withConnection[T](f: Connection => T) = {
val connection = fetchConnection()
connection.setAutoCommit(false)
try {
f(connection)
} finally {
connection.close()
}
}
... | gilt/sundial | app/dao/postgres/common/ConnectionPool.scala | Scala | mit | 322 |
package org.qirx.cms.construction
sealed trait System[T]
case class Return[ReturnType](result: ReturnType) extends System[ReturnType]
trait DirectAction[ReturnType] extends System[ReturnType] {
def result:ReturnType
}
| EECOLOR/play-cms | cms/src/main/scala/org/qirx/cms/construction/System.scala | Scala | mit | 223 |
package com.twitter.finagle.client
import com.twitter.finagle.socks.SocksProxyFlags
import com.twitter.finagle.Stack
import com.twitter.finagle.transport.Transport
import com.twitter.util.Duration
import com.twitter.util.Future
import java.net.SocketAddress
/**
* Transporters are simple functions from a `SocketAddre... | kingtang/finagle | finagle-core/src/main/scala/com/twitter/finagle/client/Transporter.scala | Scala | apache-2.0 | 3,067 |
package org.jetbrains.plugins.scala.lang.formatting.settings.inference
import com.intellij.application.options.codeStyle.CodeStyleSchemesModel
import com.intellij.ide.startup.StartupManagerEx
import com.intellij.openapi.components.{PersistentStateComponent, _}
import com.intellij.openapi.diagnostic.Logger
import com.i... | JetBrains/intellij-scala | scala/scala-impl/src/org/jetbrains/plugins/scala/lang/formatting/settings/inference/CodeStyleSettingsInferService.scala | Scala | apache-2.0 | 3,971 |
package com.gilt.thehand.rules.typed
import com.gilt.thehand.{Context, AbstractRuleSpec}
class LongEqSpec extends AbstractRuleSpec {
val testCases = Map(
LongEq(54) -> (
Set(Context(54), Context(BigDecimal("54")), Context(54.0)),
// '6' is important here because its char code is 54.
Set(Contex... | gilt/the-hand | src/test/scala/com/gilt/thehand/rules/typed/LongEqSpec.scala | Scala | apache-2.0 | 1,035 |
package play.api.libs {
/**
* The Iteratee monad provides strict, safe, and functional I/O.
*/
package object iteratee {
type K[E, A] = Input[E] => Iteratee[E, A]
}
}
package play.api.libs.iteratee {
private[iteratee] object internal {
import scala.concurrent.ExecutionContext
import java... | noel-yap/setter-for-catan | play-2.1.1/framework/src/iteratees/src/main/scala/play/api/libs/iteratee/package.scala | Scala | apache-2.0 | 1,253 |
/*
* Copyright 2015 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... | keithhall/ct-calculations | src/main/scala/uk/gov/hmrc/ct/computations/CP111.scala | Scala | apache-2.0 | 839 |
/**
* Licensed to Big Data Genomics (BDG) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The BDG licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use ... | massie/adam | adam-core/src/test/scala/org/bdgenomics/adam/algorithms/consensus/ConsensusGeneratorFromKnownsSuite.scala | Scala | apache-2.0 | 2,296 |
import sbt._
import sbt.Keys._
import less.Plugin._
import sbtlivescript.SbtLiveScriptPlugin._
import LiveScriptKeys._
import sbtclosure.SbtClosurePlugin._
import spray.revolver.RevolverPlugin._
import sbtassembly.Plugin.AssemblyKeys._
import sbtassembly.Plugin._
import com.mojolly.scalate.ScalatePlugin._
import Scala... | AitorATuin/UnfilteredM | project/BuildSettings.scala | Scala | mit | 4,258 |
package models
import java.util.UUID
import org.joda.time.DateTime
import play.api.libs.json.Json
/**
* Created by Biacco42 on 2016/04/19.
*/
case class MailToken(
id: UUID,
userId: UUID,
expirationDate: DateTime,
tokenKind: String)
object MailToken {
/**
* Create MailToken instance easily.
*... | Biacco42/play-silhouette-mail-confirm-seed | app/models/MailToken.scala | Scala | apache-2.0 | 734 |
package monocle.function
import monocle.MonocleSuite
import monocle.law.discipline.function.EmptyTests
class EmptySpec extends MonocleSuite {
implicit val slistEmpty: Empty[CList] = Empty.fromIso(CList.toList)
checkAll("fromIso", EmptyTests[CList])
}
| NightRa/Monocle | test/src/test/scala/monocle/function/EmptySpec.scala | Scala | mit | 261 |
package skinny.orm.feature
import org.joda.time.DateTime
import org.scalatest.{ Matchers, fixture }
import scalikejdbc.scalatest.AutoRollback
import skinny.dbmigration.DBSeeds
import skinny.orm._
import scalikejdbc._
class TimestampsFeatureSpec extends fixture.FunSpec with Matchers
with Connection
with DBSeed... | holycattle/skinny-framework | orm/src/test/scala/skinny/orm/feature/TimestampsFeatureSpec.scala | Scala | mit | 4,068 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | ron8hu/spark | sql/core/src/main/scala/org/apache/spark/sql/execution/columnar/compression/compressionSchemes.scala | Scala | apache-2.0 | 28,330 |
package scalaprops
import scalaz._
import scalaz.Id.Id
import scalaz.Maybe.Just
import scalaz.std.anyVal._
import scalaz.syntax.equal._
import Property.forAll
import ScalapropsScalaz._
object IMapTest extends Scalaprops {
val testLaws =
Properties.list(
scalazlaws.bind.all[({ type l[a] = Int ==>> a })#l],... | scalaprops/scalaprops | scalaz/src/test/scala/scalaprops/IMapTest.scala | Scala | mit | 8,086 |
package org.joda.time.field
import org.joda.time.Chronology
import org.joda.time.DateTimeField
import org.joda.time.DateTimeFieldType
import org.joda.time.IllegalFieldValueException
@SerialVersionUID(-8869148464118507846L)
class SkipDateTimeField(private val chronology: Chronology,
field: Date... | mdedetrich/soda-time | shared/src/main/scala/org/joda/time/field/SkipDateTimeField.scala | Scala | bsd-2-clause | 1,580 |
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.