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 | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/collectionOperations.scala | Scala | apache-2.0 | 6,157 |
/*
* 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 ... | esi-mineset/spark | mllib/src/test/scala/org/apache/spark/ml/util/MLTest.scala | Scala | apache-2.0 | 3,784 |
/*
* 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-core/src/test/scala/com/netflix/atlas/core/util/LongHashSetSuite.scala | Scala | apache-2.0 | 3,588 |
package scalacookbook.chapter03
/**
* Created by liguodong on 2016/6/28.
*/
object UsePatternMatchInMatchExpression extends App{
//常量
// trigger the constant patterns
println(echoWhatYouGaveMe(0))
println(echoWhatYouGaveMe(true))
println(echoWhatYouGaveMe("hello"))
println(echoWhatYouGaveMe(Nil))
/... | liguodongIOT/java-scala-mix-sbt | src/main/scala/scalacookbook/chapter03/UsePatternMatchInMatchExpression.scala | Scala | apache-2.0 | 4,491 |
/*
* Copyright (c) 2014-2020 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... | alexandru/monifu | monix-execution/shared/src/test/scala/monix/execution/AsyncSemaphoreSuite.scala | Scala | apache-2.0 | 7,515 |
/*
* Copyright 2012 Twitter Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed t... | travisbrown/zipkin | zipkin-common/src/main/scala/com/twitter/zipkin/storage/RealtimeAggregates.scala | Scala | apache-2.0 | 1,669 |
package athena.connector.pipeline
/**
* Copyright (C) 2009-2013 Typesafe Inc. <http://www.typesafe.com>
*/
//This is a port of the 2.2.x Pipeline code to 2.3 - this should go away when Akka releases
//their reactive streams support.
import scala.beans.BeanProperty
import scala.util.{ Failure, Success }
import akka... | vast-engineering/athena | src/main/scala/athena/connector/pipeline/TcpPipelineHandler.scala | Scala | apache-2.0 | 7,695 |
package championships
import eu.ace_design.island.arena.Run
import eu.ace_design.island.game.{Directions, Plane}
import eu.ace_design.island.map.IslandMap
import eu.ace_design.island.stdlib.Resources._
import library.Islands
import library.SI3
object Week08 extends Run with SI3 {
override val number: String = "08... | mosser/QGL-15-16 | arena/src/main/scala/championships/Week08.scala | Scala | lgpl-3.0 | 703 |
/*
* StructuredVE.scala
* A structured variable elimination algorithm.
*
* Created By: Avi Pfeffer (apfeffer@cra.com)
* Creation Date: March 1, 2015
*
* Copyright 2015 Avrom J. Pfeffer and Charles River Analytics, Inc.
* See http://www.cra.com or email figaro@cra.com for information.
*
* See http://www... | scottcb/figaro | Figaro/src/main/scala/com/cra/figaro/algorithm/structured/algorithm/structured/StructuredMPEVE.scala | Scala | bsd-3-clause | 1,819 |
package model.services
import play.api.libs.concurrent.Execution.Implicits._
import scala.concurrent.Future
class TokenServiceImpl extends TokenService[TokenUser] {
def create (token: TokenUser): Future[Option[TokenUser]] = {
TokenUser.save(token).map(Some(_))
}
def retrieve (id: String): Future[Option[Tok... | scify/DemocracIT-Web | app/model/services/TokenServiceImpl.scala | Scala | apache-2.0 | 432 |
package com.arcusys.valamis.updaters.version320
import com.arcusys.valamis.persistence.common.DatabaseLayer
import com.arcusys.valamis.updaters.common.BaseDBUpdater
import com.arcusys.valamis.updaters.version320.schema3209.TrainingEventGoalTableComponent
class DBUpdater3209 extends BaseDBUpdater
with TrainingEventG... | arcusys/Valamis | valamis-updaters/src/main/scala/com/arcusys/valamis/updaters/version320/DBUpdater3209.scala | Scala | gpl-3.0 | 509 |
package mesosphere.marathon.integration.facades
import org.scalatest.{ Matchers, GivenWhenThen, FunSuite }
import play.api.libs.json.Json
class MesosFormatsTest extends FunSuite with Matchers with GivenWhenThen {
import MesosFacade._
import MesosFormats._
test("parse sample") {
Given("a sample state.json")... | pgkelley4/marathon | src/test/scala/mesosphere/marathon/integration/facades/MesosFormatsTest.scala | Scala | apache-2.0 | 12,360 |
/*
* 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/incubator-toree | protocol/src/test/scala/org/apache/toree/kernel/protocol/v5/content/CompleteReplySpec.scala | Scala | apache-2.0 | 2,685 |
package lila.analyse
import chess.format.pgn.Glyph
import lila.tree.Eval._
import scala.util.chaining._
sealed trait Advice {
def judgment: Advice.Judgement
def info: Info
def prev: Info
def ply = info.ply
def turn = info.turn
def color = info.color
def cp = info.cp
def mate = info.mate
def... | luanlv/lila | modules/analyse/src/main/Advice.scala | Scala | mit | 4,402 |
/**
* 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... | bryaakov/CM-Well | server/cmwell-ws/app/controllers/Health.scala | Scala | apache-2.0 | 5,897 |
/**
* Copyright (c) 2013 Saddle Development Team
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable ... | jyt109/saddle | saddle-core/src/main/scala/org/saddle/Mat.scala | Scala | apache-2.0 | 15,492 |
package suggestions
package gui
import scala.concurrent.duration._
import scala.collection.mutable.ListBuffer
import scala.collection.JavaConverters._
import scala.concurrent._
import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.duration.Duration
import scala.swing._
import scala.util.{... | foomorrow/coursera-reactive | suggestions/src/main/scala/suggestions/gui/WikipediaSuggest.scala | Scala | gpl-2.0 | 5,341 |
package scalarules.test.junit.specs2
import org.specs2.mutable.SpecWithJUnit
class SuiteWithOneFailingTest extends SpecWithJUnit {
"specs2 tests" should {
"succeed" >> success
"fail" >> failure("boom")
}
"some other suite" should {
"do stuff" >> success
}
}
| smparkes/rules_scala | test_expect_failure/scala_junit_test/specs2/SuiteWithOneFailingTest.scala | Scala | apache-2.0 | 282 |
/*
* 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 ... | publicRoman/spark | resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s/submit/submitsteps/initcontainer/BaseInitContainerConfigurationStep.scala | Scala | apache-2.0 | 2,917 |
package fpinscala.datastructures
import org.scalatest.FlatSpec
import org.scalatest.Matchers
class TreeSpec extends FlatSpec with Matchers {
import Tree._
val leaf1 = Leaf(1);
val leaf2 = Leaf(2);
val leaf3 = Leaf(3);
val leaf4 = Leaf(4);
val branch1 = Branch(leaf1, leaf2);
val branch2 = Branch(branch1... | onewheelonly/fpinscala | exercises/src/test/scala/fpinscala/datastructures/TreeSpec.scala | Scala | mit | 2,360 |
import io.hydrosphere.mist.api.{MistJob, SQLSupport}
object SimpleSQLContext extends MistJob with SQLSupport {
/** Contains implementation of spark job with ordinary [[org.apache.spark.sql.SQLContext]]
* Abstract method must be overridden
*
* @param file json file path
* @return result of the job
... | KineticCookie/mist | examples-spark1/src/main/scala/SimpleSQLContext.scala | Scala | apache-2.0 | 543 |
object Test {
def main(args: Array[String]): Unit = {
println(Index.succ["bar", "foo", ("bar", ("baz", Unit))])
}
}
| lampepfl/dotty | tests/run-macros/quote-impure-by-name/quoted_2.scala | Scala | apache-2.0 | 125 |
/*
* Copyright 2017-2022 John Snow Labs
*
* 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... | JohnSnowLabs/spark-nlp | src/main/scala/com/johnsnowlabs/nlp/annotators/classifier/dl/SentimentDLModel.scala | Scala | apache-2.0 | 11,460 |
/*
* Copyright 2016 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... | ahudspith-equalexperts/ct-calculations | src/main/scala/uk/gov/hmrc/ct/computations/CP256.scala | Scala | apache-2.0 | 1,251 |
package com.aktaion.ml.weka.randomforest
import java.io.File
import _root_.weka.core.converters.ArffSaver
import _root_.weka.core.Instances
import _root_.weka.filters.unsupervised.instance.Randomize
import _root_.weka.filters.supervised.instance.Resample
import _root_.weka.classifiers.trees.RandomForest
import _root_... | jzadeh/Aktaion | src/test/scala/com.aktaion/ml/weka/randomforest/CrossValidationExample.scala | Scala | apache-2.0 | 5,808 |
package io.protoless.fields
import io.protoless.tests.ProtolessSuite
import shapeless.test.illTyped
case class ValueClass(x: Int) extends AnyVal
case class NotValueClass(x: Int)
class ValueClassClassSuite extends ProtolessSuite {
private val bytes = Seq(0x08, 0x96, 0x01).map(_.toByte).toArray // number 150 at fi... | julien-lafont/protoless | modules/core/src/test/scala/io/protoless/fields/ValueClassSuite.scala | Scala | apache-2.0 | 1,093 |
/*
* Happy Melly Teller
* Copyright (C) 2013 - 2016, Happy Melly http://www.happymelly.com
*
* This file is part of the Happy Melly Teller.
*
* Happy Melly Teller 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 Fo... | HappyMelly/teller | app/models/database/core/payment/CreditCardTable.scala | Scala | gpl-3.0 | 2,344 |
package com.containant.casestudies.util
case class Prob(values: List[Int]) {
def apply(backlevel: Int): Double = if (backlevel == 0) 1 else if (values.length > backlevel) values(backlevel) else 0
}
class SkipList(val bottom: Int, prob: Prob) {
val rng: java.util.Random = new java.util.Random(0xDEADBEEF)
over... | zaklogician/ContainAnt-devel | src/main/scala/com/containant/casestudies/util/SkipList.scala | Scala | bsd-3-clause | 3,079 |
package com.krrrr38.play.autodoc
import java.io.File
import play.api.libs.json.Json
import play.api.libs.iteratee.{ Enumerator, Iteratee }
import play.api.mvc.{ Results, Action, Result, ResponseHeader }
import play.api.test._
import play.api.test.Helpers._
import org.scalatest._
import org.scalatestplus.play._
import... | krrrr38/play-autodoc | play-autodoc-core/src/test/scala/com/krrrr38/play/autodoc/AutodocHelpersSpec.scala | Scala | mit | 3,243 |
package io.github.hjuergens.util
import org.specs2.mutable._
class RingSpec extends Specification { override def is = s2"""
This is a specification for the 'Hello world' string
The 'Hello world' string should
contain 11 characters $e1
start with 'Hello' ... | hjuergens/date-parser | date-rule-antlr/src/integration-test/scala/io/github/hjuergens/util/RingSpec.scala | Scala | apache-2.0 | 1,849 |
/*
* Copyright 2008 WorldWide Conferencing, 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
*
* Unless required by applicable la... | wsaccaco/lift | archetypes/lift-archetype-jpa-basic/src/main/resources/archetype-resources/spa/src/main/scala/model/Genre.scala | Scala | apache-2.0 | 1,053 |
package vtpassim
import org.apache.spark.sql.SparkSession
import scala.collection.mutable.StringBuilder
import scala.util.Try
import scala.xml.pull._
object TEIPages {
def main(args: Array[String]) {
val spark = SparkSession.builder().appName("TEIPages Import").getOrCreate()
import spark.implicits._
s... | ViralTexts/vt-passim | src/main/scala/TEIPages.scala | Scala | apache-2.0 | 1,964 |
/*
* 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/self-service-time-to-pay-frontend | app/ssttparrangement/ArrangementConnector.scala | Scala | apache-2.0 | 2,469 |
/*
* 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 ... | manuzhang/incubator-gearpump | project/Dependencies.scala | Scala | apache-2.0 | 4,705 |
abstract class LIST[+T] {
def isEmpty: Boolean
def head: T
def tail: LIST[T]
def prepend [U >: T] (x: U): LIST[U] = new CONS(x, this)
def map[U](f: T => U): LIST[U] = if (isEmpty) NIL else tail.map(f).prepend(f(head))
}
object NIL extends LIST[Nothing] {
def isEmpty = true
def head = throw new Error
... | AlexSikia/dotty | tests/pos/inferred.scala | Scala | bsd-3-clause | 997 |
/*
* 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 ... | Dax1n/spark-core | core/src/main/scala/org/apache/spark/scheduler/cluster/CoarseGrainedSchedulerBackend.scala | Scala | apache-2.0 | 19,512 |
/*
* 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 ... | caneGuy/spark | core/src/main/scala/org/apache/spark/scheduler/EventLoggingListener.scala | Scala | apache-2.0 | 10,099 |
/*
* Copyright (c) 2021, salesforce.com, inc.
* All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
*/
package com.krux.hyperion.adt
import scala.language.implicitConversions
import java.time.... | realstraw/hyperion | core/src/main/scala/com/krux/hyperion/adt/HType.scala | Scala | bsd-3-clause | 5,127 |
package se.gigurra.leavu3.util
import com.twitter.util.{Duration, JavaTimer, Timer}
/**
* Created by kjolh on 3/27/2016.
*/
object DefaultTimer extends UtilTimer
case class UtilTimer(underlying: Timer = new JavaTimer(isDaemon = true)) {
def fps(fps: Int)(op: => Unit): Unit = {
require(fps > 0, "Must run w... | GiGurra/leavu3 | src/main/scala/se/gigurra/leavu3/util/UtilTimer.scala | Scala | mit | 501 |
package org.http4s
import cats.effect.IO
import fs2.Stream
import fs2.text.utf8Encode
import org.http4s.headers._
class ServerSentEventSpec extends Http4sSpec {
import ServerSentEvent._
def toStream(s: String): Stream[IO, Byte] =
Stream.emit(s).through(utf8Encode)
"decode" should {
"decode multi-line ... | reactormonk/http4s | tests/src/test/scala/org/http4s/ServerSentEventSpec.scala | Scala | apache-2.0 | 3,531 |
/*
* 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 ... | pferrel/PredictionIO | core/src/main/scala/org/apache/predictionio/controller/PAlgorithm.scala | Scala | apache-2.0 | 4,917 |
object SCL8317 {
def foo(x: Boolean): Int = 1
def foo(s: String): String = null
implicit def u(u: Unit): Boolean = false
/*start*/foo()/*end*/
}
//Int | ilinum/intellij-scala | testdata/typeInference/bugs5/SCL8317.scala | Scala | apache-2.0 | 161 |
package com.softwaremill.thegarden.mongodbtest
import org.scalatest.{ShouldMatchers, FlatSpec}
import com.mongodb.casbah.Imports._
import com.mongodb.DBCollection
class FongoSupportSpec extends FlatSpec with ShouldMatchers {
class TestClass(clearData : Boolean = false, afterAllBlock : (DBCollection) => Unit = _ =... | maciej/the-garden | mongodb-test/src/test/scala/com/softwaremill/thegarden/mongodbtest/FongoSupportSpec.scala | Scala | mit | 1,467 |
import scala.annotation.tailrec
@tailrec inline def foo() = ??? // error
| dotty-staging/dotty | tests/neg/i10970.scala | Scala | apache-2.0 | 74 |
/*
* Copyright (c) 2012 Orderly 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.org/licenses/L... | keplar/dutch | project/BuildSettings.scala | Scala | apache-2.0 | 1,976 |
/*
* 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/execution/datasources/text/WholeTextFileSuite.scala | Scala | apache-2.0 | 6,603 |
package ca.dubey.music.theory
/** Represent a note's value (duration) */
case class NoteValue(val ticksPerQuarterNote : Int) {
/** Quaiver */
val eighthNote = ticksPerQuarterNote / 2
/** Crochet */
val quarterNote = ticksPerQuarterNote
/** Dotted Crochet */
val dottedQuarterNote = ticksPerQuarterNote + e... | adubey/music | src/main/scala/theory/NoteValue.scala | Scala | gpl-2.0 | 663 |
package lila.game
import chess.Color
import lila.common.{ SecureRandom, ThreadLocalRandom }
import lila.db.dsl._
final class IdGenerator(gameRepo: GameRepo)(implicit ec: scala.concurrent.ExecutionContext) {
import IdGenerator._
def game: Fu[Game.ID] = {
val id = uncheckedGame
gameRepo.exists(id).flatMa... | luanlv/lila | modules/game/src/main/IdGenerator.scala | Scala | mit | 1,365 |
package io.flow.dependency.actors
import io.flow.dependency.api.lib._
import io.flow.dependency.v0.models._
import io.flow.dependency.v0.models.json._
import io.flow.postgresql.{OrderBy, Pager}
import db._
import akka.actor.Actor
import cache.ProjectsCache
import io.flow.akka.SafeReceive
import io.flow.log.RollbarLogg... | flowcommerce/dependency | api/app/actors/ProjectActor.scala | Scala | mit | 8,269 |
package com.twitter.inject.thrift.integration.reqrepserviceperendpoint
import com.twitter.finagle.Filter
import com.twitter.finagle.Service
import com.twitter.greeter.thriftscala.Greeter.Hello
import com.twitter.scrooge
import com.twitter.util.Future
import com.twitter.util.logging.Logging
import javax.inject.Singleto... | twitter/finatra | inject/inject-thrift-client/src/test/scala/com/twitter/inject/thrift/integration/reqrepserviceperendpoint/HelloFilter.scala | Scala | apache-2.0 | 863 |
trait LeibnizLiskov {
type A // instead of picking some concrete type, use a totally unknown, abstract one
type B
type SA <: A
type SB >: B
implicitly[A =:= B]
implicitly[B =:= A]
def aEqB: A =:= B
implicitly[A <:< SA]
implicitly[SB <:< B]
implicitly[SA <:< B]
implicitly[A <:< SB]
def A(): A
... | scala/scala | test/files/neg/leibniz-liskov.scala | Scala | apache-2.0 | 1,367 |
package rere.sasl.scram.client
import org.scalamock.scalatest.MockFactory
import org.scalatest.{Matchers, WordSpec}
import rere.sasl.scram.cache.SaltedPasswordCache
import rere.sasl.scram.crypto.ScramAuthMechanism
import rere.sasl.scram.crypto.entropy.EntropySource
class SCRAMClientTest extends WordSpec with Matchers... | pbaun/rere | modules/sasl/src/test/scala/rere/sasl/scram/client/SCRAMClientTest.scala | Scala | apache-2.0 | 676 |
package jp.kenichi.pdf
import java.io.InputStream
import java.util.zip.Inflater
/** 7.4 Filters of PDF32000_2008.pdf */
trait PdfFilter {
def decode(in: InputStream): InputStream
}
object PdfFilter {
def get(name: String) = name match {
case "FlateDecode" => flateDecoder
}
lazy val flateDecoder = new PdfFilte... | ken1ma/pades-scala-js | shared/src/main/scala/jp.kenichi/pdf/PdfFilter.scala | Scala | apache-2.0 | 1,635 |
/*
* 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 ... | jackylk/incubator-carbondata | integration/flink/src/test/scala/org/apache/carbon/flink/TestCarbonPartitionWriter.scala | Scala | apache-2.0 | 9,897 |
package mesosphere.marathon.core.task.update.impl.steps
import akka.event.EventStream
import com.google.inject.Inject
import mesosphere.marathon.core.base.Clock
import mesosphere.marathon.core.task.bus.TaskChangeObservables.TaskChanged
import mesosphere.marathon.core.task.update.TaskUpdateStep
import mesosphere.marath... | timcharper/marathon | src/main/scala/mesosphere/marathon/core/task/update/impl/steps/PostToEventStreamStepImpl.scala | Scala | apache-2.0 | 4,112 |
package util.uima
import org.apache.uima.jcas.cas.{EmptyFSList, FSList, NonEmptyFSList, TOP}
import scala.collection.mutable.ListBuffer
/**
* @author K.Sakamoto
* Created on 2016/09/25
*/
object FSListUtils {
implicit def fsListToFSListUtils[T <: TOP](repr: FSList): FSListUtils[TOP] = {
try {
... | ktr-skmt/FelisCatusZero | src/main/scala/util/uima/FSListUtils.scala | Scala | apache-2.0 | 1,108 |
package org.infinispan.spark.suites
import org.infinispan.client.hotrod.RemoteCache
import org.infinispan.spark._
import org.infinispan.spark.config.ConnectorConfiguration
import org.infinispan.spark.domain.Runner
import org.infinispan.spark.test.TestingUtil._
import org.infinispan.spark.test._
import org.scalatest._
... | infinispan/infinispan-spark | src/test/scala/org/infinispan/spark/suites/RDDFailOverSuite.scala | Scala | apache-2.0 | 2,129 |
/*
Copyright (c) 2016, Rice University
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2.... | agrippa/spark-swat | swat/src/test/scala/org/apache/spark/rdd/cl/CodeGenTests.scala | Scala | bsd-3-clause | 10,545 |
package com.example
import akka.actor.Actor
import spray.routing._
import spray.http._
import spray.json.DefaultJsonProtocol
import spray.httpx.unmarshalling._
import spray.httpx.marshalling._
import spray.httpx.SprayJsonSupport._
import MediaTypes._
// we don't implement our route structure directly in the service a... | rohshall/sprayreadings | src/main/scala/com/example/MyService.scala | Scala | mit | 1,284 |
/*
* 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 ... | ConeyLiu/spark | sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/ConjunctiveNormalFormPredicateSuite.scala | Scala | apache-2.0 | 5,934 |
/*
* 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 ... | ebruchez/darius-xml.js | xerces/shared/src/main/scala/org/orbeon/apache/xerces/impl/validation/ValidationManager.scala | Scala | apache-2.0 | 983 |
/*
* Copyright (c) 2016 Mashin (http://mashin.io). All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless ... | mashin-io/rich-spark | main/src/test/scala/io/mashin/rich/spark/RichRDDFunctionsSuite.scala | Scala | apache-2.0 | 1,792 |
package ru.pavkin.todoist.api.core.decoder
import cats.Id
import org.scalacheck.Gen
import org.scalatest.{Matchers, FunSuite}
import org.scalatest.prop.{GeneratorDrivenPropertyChecks, Checkers}
import shapeless.test.illTyped
import shapeless.{::, HNil}
import scala.util.Try
class ResponseDecoderSpec extends FunSuite... | vpavkin/scalist | tests/src/test/scala/ru/pavkin/todoist/api/core/decoder/ResponseDecoderSpec.scala | Scala | mit | 2,944 |
/*
* Copyright 2013 Folker Bernitt
*
* 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 ... | fbernitt/mailbackup | src/test/scala/de/bernitt/scalamaildir/util/TemporaryDirectory.scala | Scala | apache-2.0 | 1,671 |
/**
* Copyright (c) 2016 Intel Corporation
*
* 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... | ashaarunkumar/spark-tk | sparktk-core/src/main/scala/org/trustedanalytics/sparktk/dicom/internal/constructors/Import.scala | Scala | apache-2.0 | 6,140 |
package spbau.scala.ordian.task02
import scala.annotation.tailrec
/* WARNING: magic constants! */
object One extends App {
print(s"${squareRootDigits(2).head}.")
squareRootDigits(2).tail take 73 foreach print
def squareRootDigits(number: Int): Stream[Int] = {
def digitByDigit(remainder: BigInt, result: B... | ordian/vm_languages_course | src/main/scala/spbau/scala/ordian/task02/One.scala | Scala | gpl-3.0 | 744 |
package org.jetbrains.plugins.scala
package lang
package psi
package types
import java.util.Objects
import org.jetbrains.plugins.scala.lang.psi.types.api._
import org.jetbrains.plugins.scala.lang.psi.types.nonvalue.NonValueType
import org.jetbrains.plugins.scala.project.ProjectContext
/**
* This type works like u... | ilinum/intellij-scala | src/org/jetbrains/plugins/scala/lang/psi/types/ScAbstractType.scala | Scala | apache-2.0 | 3,071 |
/**
* Copyright (c) 2007-2011 Eric Torreborre <etorreborre@yahoo.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation
* the rights to us... | stuhood/specs | src/main/scala/org/specs/util/ExtendedString.scala | Scala | mit | 4,421 |
/*
* Copyright 2014 Adam Rosenberger
*
* 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... | arosenberger/nalloc_2.10 | optional/src/main/scala/org/nalloc/bitb/kcits/optional/OptionalFloat.scala | Scala | apache-2.0 | 1,859 |
package tu.coreservice.action.way2think.simulation
import tu.coreservice.action.way2think.Way2Think
import tu.model.knowledge.communication.{ContextHelper, ShortTermMemory}
import tu.model.knowledge.annotator.AnnotatedNarrative
import tu.model.knowledge.domain.ConceptNetwork
import tu.model.knowledge.{Constant, Resour... | keskival/2 | coreservice.action.way2think/src/main/scala/tu/coreservice/action/way2think/simulation/SimulationWay2Think.scala | Scala | gpl-3.0 | 3,747 |
package org.senkbeil.debugger.akka.messages
trait MessageLike extends Serializable
| chipsenkbeil/scala-debugger-akka | src/main/scala/org/senkbeil/debugger/akka/messages/MessageLike.scala | Scala | apache-2.0 | 84 |
/*
* 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 ... | hibayesian/spark-optim | src/main/scala/org/apache/spark/ml/optim/PerCoordinateUpdater.scala | Scala | apache-2.0 | 1,273 |
package scheme
object CPSConv {
import Util.gensym
import Ast.{mkFn, mkApp, mkIf, mkDefine, mkSet}
def isPrimitive(x: Ast): Boolean =
x match {
case SSymbol(name) =>
Evaluator.lookup(Evaluator.globalEnv, name) match {
case Some(_: SPrim) => true
case _ => false
}
cas... | einblicker/scheme | src/main/scala/CPSConv.scala | Scala | bsd-2-clause | 2,896 |
package com.gilt.storeroom.dynamodb
import com.gilt.storeroom._
import java.util.{ Map => JMap }
import java.util.concurrent.Executors
import scala.concurrent._
import scala.concurrent.ExecutionContext.Implicits.global
import scala.collection.JavaConverters._
import play.api.libs.iteratee.{Enumerator, Enumeratee}
... | gilt/storeroom | dynamodb/src/main/scala/com/gilt/storeroom/dynamodb/DynamoDB.scala | Scala | mit | 8,961 |
/*
* Copyright 2014 Treode, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to... | Treode/store | core/src/com/treode/async/io/Socket.scala | Scala | apache-2.0 | 3,746 |
package frdomain.ch6
package streams
import java.util.{ Date, Calendar }
import util.{ Try, Success, Failure }
import scalaz._
import Scalaz._
object common {
type Amount = BigDecimal
def today = Calendar.getInstance.getTime
}
import common._
case class Balance(amount: Amount = 0)
case class Account (no: Stri... | debasishg/frdomain | src/main/scala/frdomain/ch6/streams/Account.scala | Scala | apache-2.0 | 432 |
package example
import akka.actor.ActorDSL._
import org.scalatest.FlatSpec
import spray.testkit.ScalatestRouteTest
import akka.util.Timeout
import scala.concurrent.duration._
import spray.http.StatusCodes
import spray.httpx.SprayJsonSupport._
import spray.http.CacheDirectives.`max-age`
import spray.http.HttpHeaders.`C... | stig/spray-example | src/test/scala/example/ServiceSpec.scala | Scala | mit | 3,591 |
package com.twitter.finagle.exp.mysql.codec
import com.twitter.finagle.exp.mysql.protocol.{Packet, BufferReader}
import com.twitter.finagle.exp.mysql.util.BufferUtil
import java.util.logging.Logger
import org.jboss.netty.buffer.ChannelBuffer
import org.jboss.netty.channel.{Channel, ChannelHandlerContext}
import org.jb... | joshbedo/finagle | finagle-mysql/src/main/scala/com/twitter/finagle/mysql/codec/PacketFrameDecoder.scala | Scala | apache-2.0 | 1,346 |
package dotty.tools
package dotc
package reporting
import core.Contexts.Context
import collection.mutable
import Reporter.Diagnostic
import config.Printers._
/**
* This class implements a Reporter that stores all messages
*/
class StoreReporter extends Reporter {
private var infos: mutable.ListBuffer[Diagnostic]... | DarkDimius/dotty | src/dotty/tools/dotc/reporting/StoreReporter.scala | Scala | bsd-3-clause | 644 |
/*
* 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 ... | cran/rkafkajars | java/kafka/tools/ZooKeeperMainWrapper.scala | Scala | apache-2.0 | 1,334 |
/*
* 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 ... | JihongMA/incubator-carbondata | integration/spark2/src/main/scala/org/apache/carbondata/spark/rdd/CarbonDataRDDFactory.scala | Scala | apache-2.0 | 42,806 |
/***********************************************************************
* Copyright (c) 2013-2017 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... | ronq/geomesa | geomesa-accumulo/geomesa-accumulo-datastore/src/test/scala/org/locationtech/geomesa/accumulo/data/stats/usage/QueryStatTransformTest.scala | Scala | apache-2.0 | 2,908 |
package test.crawler
import org.specs2.mock.Mockito
import org.specs2.mutable.Specification
import reactivemongo.api.commands.UpdateWriteResult
import test.UtilTest
import test.crawler.CrawlerMocksUtil.HttpClientMock._
import wow.crawler.{WowCharacterCrawler, WowGuildApi, WowGuildCrawler}
import wow.dto.{WowCharacter,... | MeMpy/wow-characters | src/test/scala/test/crawler/WowGuildCrawlerSpecs.scala | Scala | gpl-3.0 | 2,150 |
package patmat
import org.scalatest.FunSuite
import org.junit.runner.RunWith
import org.scalatest.junit.JUnitRunner
import patmat.Huffman._
@RunWith(classOf[JUnitRunner])
class HuffmanSuite extends FunSuite {
trait TestTrees {
val t1 = Fork(Leaf('a',2), Leaf('b',3), List('a','b'), 5)
val t2 = Fork(Fork(Leaf('a... | masipauskas/coursera-scala | progfun/patmat/src/test/scala/patmat/HuffmanSuite.scala | Scala | unlicense | 1,498 |
package me.heaton.profun.week5
import org.junit.runner.RunWith
import org.scalatest.FunSuite
import org.scalatest.junit.JUnitRunner
@RunWith(classOf[JUnitRunner])
class PairTupleTest extends FunSuite with TestList {
test("pair") {
val pair = ("answer", 42)
val (s, n) = pair
assert(s === "answer")
a... | heaton/hello-scala | src/test/scala/me/heaton/profun/week5/PairTupleTest.scala | Scala | mit | 550 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | sryza/spark | core/src/main/scala/org/apache/spark/storage/MemoryStore.scala | Scala | apache-2.0 | 9,585 |
package net.katsstuff.chitchat.command
import java.lang.Iterable
import scala.collection.JavaConverters._
import org.spongepowered.api.command.CommandSource
import org.spongepowered.api.command.args.PatternMatchingCommandElement
import org.spongepowered.api.text.Text
import net.katsstuff.chitchat.chat.ChannelHandle... | Katrix-/ChitChat | shared/src/main/scala/net/katsstuff/chitchat/command/ChannelCommandArgument.scala | Scala | mit | 767 |
package com.realizationtime.btdogg.tcphashes
import akka.actor.{ActorRef, ActorSystem}
import akka.stream.Materializer
import akka.stream.scaladsl.{Flow, Framing, Keep, Sink, Tcp}
import akka.util.{ByteString, Timeout}
import com.realizationtime.btdogg.BtDoggConfiguration
import com.realizationtime.btdogg.BtDoggConfig... | bwrega/btdogg | src/main/scala/com/realizationtime/btdogg/tcphashes/TcpHashesServer.scala | Scala | mit | 1,957 |
package cook.target
import cook.config.ConfigRef
import cook.console.ops._
import cook.error._
import cook.meta.{ Meta, MetaHelper }
import cook.meta.db.DbProvider.{ db => metaDb }
import cook.ref.TargetRef
import cook.util.GlobScanner
object TargetStatus extends Enumeration {
type TargetStatus = Value
val Pendi... | timgreen/cook | src/cook/target/Target.scala | Scala | apache-2.0 | 3,938 |
package com.twitter.finagle.http
import org.junit.runner.RunWith
import org.scalatest.FunSuite
import org.scalatest.junit.JUnitRunner
@RunWith(classOf[JUnitRunner])
class ResponseTest extends FunSuite {
test("constructors") {
List(
Response(),
Response(Version.Http11, Status.Ok),
Response()
... | mkhq/finagle | finagle-base-http/src/test/scala/com/twitter/finagle/http/ResponseTest.scala | Scala | apache-2.0 | 450 |
/*
* 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... | alessandrolulli/reforest | src/main/scala/reforest/rf/RFEntropy.scala | Scala | apache-2.0 | 12,120 |
package com.joescii
import org.scalatest.{ShouldMatchers, WordSpec}
class ParseSpec extends WordSpec with ShouldMatchers {
"Integers" should {
"introduce pattern matching" in {
def ints(i:Int):String = i match {
case 1 => "one"
case 2 => "two"
case n if n % 2 == 0 => s"$n is even"
... | joescii/fp-renaissance | src/test/scala/com/joescii/ParseSpec.scala | Scala | apache-2.0 | 2,905 |
package autosteamgifts.contentscript.giveaway
import autosteamgifts.GameRatingDisplay
import autosteamgifts.background.options.Options
import autosteamgifts.contentscript.UserActions
import autosteamgifts.Implicits._
import org.scalajs.dom.document
import org.scalajs.dom.raw.{HTMLElement, MouseEvent}
import scala.conc... | erdavila/auto-steamgifts | src/main/scala/autosteamgifts/contentscript/giveaway/Main.scala | Scala | mit | 1,988 |
import scala.reflect.macros.Universe
def validateSyntax(u: Universe)(tree: u.Tree): (Boolean, List[u.Tree]) = {
import u._
def isLambdaParamDef(valDef: ValDef) =
valDef.mods.hasFlag(Flag.PARAM) && valDef.rhs == EmptyTree
tree match {
case _: Block | _: Select | _: Apply | _: TypeApply | _: Ident |
... | AVSystem/scex | scex-java-test/src/main/resources/syntaxValidator.scala | Scala | mit | 574 |
package pl.touk.nussknacker.engine.avro.schemaregistry
import cats.data.Validated
import pl.touk.nussknacker.engine.avro.{AvroSchemaDeterminer, RuntimeSchemaData, SchemaDeterminerError}
class BasedOnVersionAvroSchemaDeterminer(schemaRegistryClient: SchemaRegistryClient,
topic:... | TouK/nussknacker | utils/avro-components-utils/src/main/scala/pl/touk/nussknacker/engine/avro/schemaregistry/BasedOnVersionAvroSchemaDeterminer.scala | Scala | apache-2.0 | 1,026 |
package skinny.util
import scala.util.parsing.combinator.RegexParsers
/**
* LTSV Utility.
*
* http://ltsv.org/
*/
object LTSV {
def parseLine(line: String, lenient: Boolean = false): Map[String, String] = {
LTSVParser.parse(line, lenient).head
}
def parseLines(lines: String, lenient: Boolean = fal... | seratch/skinny-framework | common/src/main/scala/skinny/util/LTSV.scala | Scala | mit | 2,171 |
/*
* 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.tools.nsc
packag... | scala/scala | src/compiler/scala/tools/nsc/util/StringUtil.scala | Scala | apache-2.0 | 678 |
/*
* Copyright 2014 okumin.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
*
* Unless required by applicable law or agreed to i... | okumin/akka-persistence-sql-async | core/src/main/scala/akka/persistence/snapshot/sqlasync/ScalikeJDBCSnapshotStore.scala | Scala | apache-2.0 | 4,280 |
/**
* 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... | richhaase/kafka | core/src/main/scala/kafka/tools/ConsumerPerformance.scala | Scala | apache-2.0 | 12,788 |
package com.twitter.util.mock
import org.mockito.{ArgumentMatchersSugar, IdiomaticMockito}
/**
* Helper for Mockito Scala sugar with [[https://github.com/mockito/mockito-scala#idiomatic-mockito idiomatic stubbing]].
* Java users are encouraged to use `org.mockito.Mockito` directly.
*
* Note that the Specs2 `smart... | twitter/util | util-mock/src/main/scala/com/twitter/util/mock/Mockito.scala | Scala | apache-2.0 | 5,676 |
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.