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.twitter.finagle.stats.exp
import com.fasterxml.jackson.annotation.JsonSubTypes.Type
import com.fasterxml.jackson.annotation.{JsonSubTypes, JsonTypeInfo}
/**
* Thresholds are specified per-expression. The default is Unbounded.
*/
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERT... | twitter/util | util-stats/src/main/scala/com/twitter/finagle/stats/exp/Bounds.scala | Scala | apache-2.0 | 1,840 |
package progscala2.traits.ui2
import progscala2.traits.observer._
/**
* Created by younggi on 11/12/16.
*/
trait ObservableClicks extends Clickable with Subject[Clickable] {
// super.click() 이 호출하는 updateUI()가 정의되어 있지 않으므로
// abstract keyword 사용 (현재 실제 instance가 없음)
abstract override def click(): Unit = {
... | younggi/books | programming_scala/progscala2/src/main/scala/progscala2/traits/ui2/ObservableClicks.scala | Scala | mit | 468 |
/*
* 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 ... | 1haodian/spark | sql/core/src/main/scala/org/apache/spark/sql/execution/python/FlatMapGroupsInPandasExec.scala | Scala | apache-2.0 | 4,326 |
/**
* 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-http/src/main/scala/com/excilys/ebi/gatling/http/request/builder/PostHttpRequestBuilder.scala | Scala | gpl-2.0 | 1,600 |
/*
* 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 ... | ueshin/apache-spark | mllib/src/test/scala/org/apache/spark/ml/clustering/GaussianMixtureSuite.scala | Scala | apache-2.0 | 12,678 |
/*
* 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 ... | maropu/spark | sql/core/src/main/scala/org/apache/spark/sql/streaming/ui/StreamingQueryTab.scala | Scala | apache-2.0 | 1,562 |
package deploymentzone.actor
import deploymentzone.actor.validation.StatsDBucketValidator
abstract class Metric[+T](val bucket: String, val samplingRate: Double)(val value: T) {
val symbol: String
protected[this] val renderValue: String = value.toString
require(bucket != null)
require(StatsDBucketValidator(b... | jamesmulcahy/akka-actor-statsd | src/main/scala/deploymentzone/actor/Protocol.scala | Scala | mit | 2,855 |
package im.tox.toktok.app.contacts
import android.support.v7.widget.RecyclerView
import android.widget.RelativeLayout
import im.tox.toktok.TR
import im.tox.toktok.TypedResource._
final class FileSendActivityViewHolder(itemView: RelativeLayout) extends RecyclerView.ViewHolder(itemView) {
val mIcon = itemView.findVi... | vassad/toktok | src/main/scala/im/tox/toktok/app/contacts/FileSendActivityViewHolder.scala | Scala | agpl-3.0 | 473 |
package com.eevolution.context.dictionary.domain.api.service
import com.eevolution.context.dictionary.api
import com.eevolution.context.dictionary.domain.model.Message
/**
* Copyright (C) 2003-2017, e-Evolution Consultants S.A. , http://www.e-evolution.com
* This program is free software: you can redistribute it ... | adempiere/ADReactiveSystem | dictionary-api/src/main/scala/com/eevolution/context/dictionary/domain/api/service/MessageService.scala | Scala | gpl-3.0 | 1,208 |
/*
ASIB - A Scala IRC Bot
Copyright (C) 2012 Iain Cambridge
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later versio... | icambridge-old/asib | src/test/scala/asib/tests/util/MessageTest.scala | Scala | gpl-3.0 | 1,910 |
/* Copyright 2009-2021 EPFL, Lausanne */
import stainless.lang._
object Unap2 {
def unapply[A, B](i: (Int, B, A)): Option[(A, B)] =
if (i._1 == 0) None() else Some((i._3, i._2))
}
object Unapply2 {
sealed abstract class Bool
case class True() extends Bool
case class False() extends Bool
def bar: B... | epfl-lara/stainless | frontends/benchmarks/verification/unchecked/Unapply2.scala | Scala | apache-2.0 | 455 |
package com.twitter.server.handler
import com.twitter.conversions.DurationOps._
import com.twitter.finagle.http.{Request, Status}
import com.twitter.util.{Await, Awaitable, Promise}
import java.util.concurrent.locks.ReentrantLock
import org.scalatest.concurrent.Eventually
import org.scalatest.funsuite.AnyFunSuite
impo... | twitter/twitter-server | server/src/test/scala/com/twitter/server/handler/ContentionHandlerTest.scala | Scala | apache-2.0 | 2,026 |
object PowerInlined {
import PowerMacro._
power(1, 5.0) // 1 quotes to unpickle
} | som-snytt/dotty | bench/tests/power-macro/PowerInlined.scala | Scala | apache-2.0 | 86 |
/* sbt -- Simple Build Tool
* Copyright 2009 Mark Harrah
*/
package sbt
package internal
package scripted
import java.io.{ BufferedReader, File, InputStreamReader }
import scala.util.parsing.combinator._
import scala.util.parsing.input.Positional
import Character.isWhitespace
import sbt.io.IO
/*
statement*
stateme... | Duhemm/util | internal/util-scripted/src/main/scala/sbt/internal/scripted/TestScriptParser.scala | Scala | bsd-3-clause | 3,097 |
package com.dys.chatwork4s
import com.dys.chatwork4s.beans._
import com.dys.chatwork4s.beans.rooms.RoomInfo
import com.dys.chatwork4s.beans.users.Member
import com.dys.chatwork4s.http.HttpMethod
import com.dys.chatwork4s.http.parameters._
import scala.concurrent.{ExecutionContext, Future}
/**
* チャットルームにひもづくメッセージ、... | kado-yasuyuki/chatwork4s | src/main/scala/com/dys/chatwork4s/ChatWorkRoomAsync.scala | Scala | apache-2.0 | 5,420 |
/*
* DARWIN Genetic Algorithms Framework Project.
* Copyright (c) 2003, 2005, 2007, 2009, 2011, 2016, 2017. Phasmid Software
*
* Originally, developed in Java by Rubecula Software, LLC and hosted by SourceForge.
* Converted to Scala by Phasmid Software and hosted by github at https://github.com/rchillyard/Darwin
... | rchillyard/Darwin | src/main/scala/com/phasmid/darwin/genetics/Adapter.scala | Scala | gpl-3.0 | 2,807 |
/*
* Copyright 2020 ABSA Group Limited
*
* 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... | AbsaOSS/spline | producer-model/src/main/scala/za/co/absa/spline/producer/model/v1_2/ExecutionEvent.scala | Scala | apache-2.0 | 1,211 |
package piotr
import com.backtype.hadoop.pail.Pail
import com.backtype.hadoop.pail.PailStructure
import org.apache.hadoop.fs.FileSystem
import org.apache.hadoop.conf.Configuration
import piotr.swa.Data
import piotr.pail.{SplitDataPailStructure, DataPailStructure}
/**
* Created by bela on 27.03.14.
*/
class CreatePa... | piotrbelina/swa-scalding | src/main/scala/piotr/CreatePail.scala | Scala | apache-2.0 | 754 |
/**
* Generated by apidoc - http://www.apidoc.me
* Service version: 0.0.12
* apidoc:0.11.28 http://www.apidoc.me/kli/hot-potato/0.0.12/play_2_4_client
*/
package com.kli.hot.potato.v0.models {
/**
* A hot potato player
*/
case class Player(
name: String,
port: Int
)
/**
* A hot potato
... | yuanl1/hot-potato | scala-player/app/clients/KliHotPotatoV0Client.scala | Scala | mit | 15,531 |
/*
* Copyright 2012 IL <iron9light AT gmali DOT 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 applicabl... | iron9light/ideacolorschemes-plugin | src/main/scala/com/ideacolorschemes/ideacolor/ColorSchemeManager.scala | Scala | apache-2.0 | 833 |
package io.hydrosphere.mist.worker.runners.python
import java.io.File
import io.hydrosphere.mist.Messages.JobMessages.JobParams
import io.hydrosphere.mist.utils.Logger
import io.hydrosphere.mist.worker.NamedContext
import io.hydrosphere.mist.worker.runners.JobRunner
import py4j.GatewayServer
import wrappers._
import... | KineticCookie/mist | src/main/scala/io/hydrosphere/mist/worker/runners/python/PythonRunner.scala | Scala | apache-2.0 | 2,169 |
package com.eevolution.context.dictionary.infrastructure.repository
import java.util.UUID
import com.eevolution.context.dictionary.domain._
import com.eevolution.context.dictionary.domain.model.PrintColor
import com.eevolution.context.dictionary.infrastructure.db.DbContext._
import com.eevolution.utils.PaginatedSeque... | adempiere/ADReactiveSystem | dictionary-impl/src/main/scala/com/eevolution/context/dictionary/infrastructure/repository/PrintColorRepository.scala | Scala | gpl-3.0 | 2,742 |
/*
* 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 ... | kevinyu98/spark | resource-managers/yarn/src/main/scala/org/apache/spark/deploy/yarn/Client.scala | Scala | apache-2.0 | 65,792 |
/**
* Copyright 2011-2016 GatlingCorp (http://gatling.io)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by appli... | thkluge/gatling | src/sphinx/session/code/SessionSpec.scala | Scala | apache-2.0 | 1,179 |
package com.equalinformation.poc.akka.scala.track1.wordcount.actors
import akka.actor.{Props, Actor}
//import akka.routing.RoundRobinRouter // TODO find how to include this
import com.equalinformation.poc.akka.scala.track1.wordcount._
/**
* Created by bpupadhyaya on 2/10/16.
*/
class MasterActor extends Actor {... | bpupadhyaya/AkkaPOC | src/main/scala/com/equalinformation/poc/akka/scala/track1/wordcount/actors/MasterActor.scala | Scala | mit | 1,075 |
/*
* Copyright 2017 PayPal
*
* 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 ... | anilgursel/squbs | squbs-unicomplex/src/test/scala/org/squbs/stream/UnicomplexActorPublisherJSpec.scala | Scala | apache-2.0 | 2,272 |
package com.arcusys.valamis.course.exception
class UserNotFoundException(message: String = null) extends RuntimeException(message)
| arcusys/Valamis | valamis-course/src/main/scala/com/arcusys/valamis/course/exception/UserNotFoundException.scala | Scala | gpl-3.0 | 132 |
package akka.persistence.eventstore.journal
import akka.persistence.eventstore.EventStorePluginSpec
import akka.persistence.journal.JournalPerfSpec
import com.typesafe.config.ConfigFactory
import scala.concurrent.duration._
class JournalPerfIntegrationSpec extends JournalPerfSpec(ConfigFactory.load()) with EventStore... | EventStore/EventStore.Akka.Persistence | src/it/scala/akka/persistence/eventstore/journal/JournalPerfIntegrationSpec.scala | Scala | bsd-3-clause | 492 |
/*
* 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 ... | jongwook/incubator-s2graph | s2core/src/test/scala/org/apache/s2graph/core/types/InnerValTest.scala | Scala | apache-2.0 | 4,558 |
package com.twitter.finagle.netty3.codec
import com.twitter.finagle.Failure
import com.twitter.finagle.framer.Framer
import com.twitter.io.Buf
import org.jboss.netty.channel._
/**
* Frames Bufs into protocol frames
*/
private[finagle] class FrameDecoderHandler(
framer: Framer) extends SimpleChannelUpstreamHandler... | adriancole/finagle | finagle-core/src/main/scala/com/twitter/finagle/netty3/codec/FrameDecoderHandler.scala | Scala | apache-2.0 | 820 |
/*
* Scala.js (https://www.scala-js.org/)
*
* Copyright EPFL.
*
* Licensed under Apache License 2.0
* (https://www.apache.org/licenses/LICENSE-2.0).
*
* See the NOTICE file distributed with this work for
* additional information regarding copyright ownership.
*/
/**
* All doc-comments marked as "MDN" are by... | nicolasstucki/scala-js | library/src/main/scala/scala/scalajs/js/JSArrayOps.scala | Scala | apache-2.0 | 11,192 |
package net.liftweb.util
/*
* Copyright 2006-2009 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 requir... | beni55/liftweb | lift-util/src/main/scala/net/liftweb/util/Log.scala | Scala | apache-2.0 | 9,570 |
package pl.jozwik.mvn2sbt
import org.maven.{Build, Model}
class MavenSbtPluginMapperSpec extends AbstractSpec {
"MavenSbtPluginMapper " should {
"Return None " in {
val model = Model()
MavenSbtPluginMapper(model).plugins should be('empty)
}
"Without plugins " in {
val build = Build()... | ajozwik/mvn2sbt | converter/src/test/scala/pl/jozwik/mvn2sbt/MavenSbtPluginMapperSpec.scala | Scala | apache-2.0 | 422 |
package suql.parser
import suql.errors.SuqlThrowable
// ParseError below doesn't currently derive from the Exception hierarchy, and Position is common that it can be moved
// out to somewhere else and used between the AST and parse error modules.
case class Position(line: Int, column: Int)
case class ParseError(posit... | rmuch/suql | src/main/scala/suql/parser/ParseExceptions.scala | Scala | mit | 434 |
package scheduled
import javax.inject.{Inject, Named, Singleton}
import scala.concurrent.duration._
import akka.actor.ActorSystem
import uk.ac.ncl.openlab.intake24.services.systemdb.pairwiseAssociations.{PairwiseAssociationsService, PairwiseAssociationsServiceConfiguration}
import scala.concurrent.ExecutionContext
... | digitalinteraction/intake24 | ApiPlayServer/app/scheduled/PairwiseAssociationsRefresher.scala | Scala | apache-2.0 | 1,013 |
/*
* 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/spark/src/test/scala/org/apache/carbondata/spark/testsuite/dataload/TestDataLoadWithFileName.scala | Scala | apache-2.0 | 3,866 |
/*
* Copyright 2016 The BigDL Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agr... | qiuxin2012/BigDL | spark/dl/src/main/scala/com/intel/analytics/bigdl/nn/BinaryThreshold.scala | Scala | apache-2.0 | 13,353 |
package nyaya.util
object ScalaVerSpecificUtil {
object Implicits {
}
} | japgolly/nyaya | util/shared/src/main/scala-3/nyaya/util/ScalaVerSpecificUtil.scala | Scala | lgpl-2.1 | 78 |
// Copyright 2020 Foursquare Labs Inc. All Rights Reserved.
package io.fsq.rogue.adapter.twitter
import com.mongodb.MongoInterruptedException
import com.mongodb.reactivestreams.client.{Success => MongoSuccess}
import com.twitter.util.{Future, Promise}
import io.fsq.rogue.RogueException
import java.lang.{StringBuilder... | foursquare/fsqio | src/jvm/io/fsq/rogue/adapter/twitter/TwitterAsyncUtil.scala | Scala | apache-2.0 | 4,867 |
package graffiti
import com.typesafe.config.Config
import graffiti.boilerplate.BoilerplateService
import graffiti.ioc.Injector
/**
* @author Alexander De Leon <me@alexdeleon.name>
*/
case class Context(config: Config, injector: Injector, service: Service = BoilerplateService()) {
def withConfig(c: Config) = copy(... | devialab/graffiti | core/src/main/scala/graffiti/Context.scala | Scala | mit | 430 |
/*
*************************************************************************************
* Copyright 2011 Normation SAS
*************************************************************************************
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero Ge... | jooooooon/rudder | rudder-core/src/main/scala/com/normation/rudder/domain/servers/NodeConfigurationDiff.scala | Scala | agpl-3.0 | 2,626 |
package pl.pholda.malpompaaligxilo.dsl.form
class DslFormSection {
}
| pholda/MalpompaAligxilo | dsl/shared/src/main/scala/pl/pholda/malpompaaligxilo/dsl/form/DslFormSection.scala | Scala | gpl-3.0 | 71 |
package pimpathon
import scala.util.Properties
object properties {
implicit class PropertiesCompanionPimps(val self: Properties.type) extends AnyVal {
def propEnvOrElse(key: String, alt: String): String = propEnvOrNone(key).getOrElse(alt)
def propEnvOrNone(key: String): Option[String] = Properties.propOrNo... | stacycurl/pimpathon | src/main/scala/pimpathon/properties.scala | Scala | apache-2.0 | 368 |
import sbt._
import Keys._
object FPInScalaBuild extends Build {
val opts = Project.defaultSettings ++ Seq(
scalaVersion := "2.11.4",
resolvers += "Typesafe Repository" at "http://repo.typesafe.com/typesafe/releases/",
libraryDependencies += "junit" % "junit" % "4.10" % "test",
libraryDependencies +=... | conor10/fpinscala | project/Build.scala | Scala | mit | 1,438 |
package com.overviewdocs.searchindex
import akka.actor.{Actor,ActorRef,Props}
import scala.collection.immutable
import scala.concurrent.Future
import scala.util.{Success,Failure}
import com.overviewdocs.database.{DocumentIdListDeleter,DocumentFinder}
import com.overviewdocs.messages.{DocumentSetReadCommands,DocumentS... | overview/overview-server | worker/src/main/scala/com/overviewdocs/searchindex/Indexer.scala | Scala | agpl-3.0 | 2,506 |
package utils
object Utils{
def last(lst: List[Int]) = lst.reverse.head
def penultimate(lst: List[Int]) = lst.reverse.tail.head
def nth(n: Int, lst: List[Int]): Int = {
if (n == 0){
return lst.head
}
else{
return nth(n-1, lst.tail)
}
}
def length(lst: List[Int]): Int = {
if... | sakabar/ninetyNineScala | src/main/scala/Utils.scala | Scala | gpl-3.0 | 2,227 |
package org.scaladebugger.api.virtualmachines
import org.scaladebugger.api.utils.JDITools
import org.scaladebugger.test.helpers.ParallelMockFunSpec
import org.scalatest.concurrent.Eventually
import test.{ApiTestUtilities, VirtualMachineFixtures}
/** Specific to Scala 2.11 */
class ScalaVirtualMachine211IntegrationSpe... | chipsenkbeil/scala-debugger | scala-debugger-api/src/it/scala-2.11/org/scaladebugger/api/virtualmachines/ScalaVirtualMachine211IntegrationSpec.scala | Scala | apache-2.0 | 1,447 |
import org.scalatest._
class RobotNameSpecs extends FunSpec with Matchers {
val nameRegex = """\\w{2}\\d{3}"""
it ("has a name") {
new Robot().name should fullyMatch regex (nameRegex)
}
it ("does not change its name") {
pending
val robot = new Robot
val name = robot.name
robot.name should... | nlochschmidt/xscala | robot-name/src/test/scala/robot_name_test.scala | Scala | mit | 690 |
package rpgboss
import org.scalatest._
import org.scalatest.matchers._
class UnitSpec extends FlatSpec with Matchers {
/**
* This exists so we can correctly compare case classes with array members.
* TODO: Investigate if we can do this without using json4s, which might not
* be always accurate.
*/
cla... | rpgboss/rpgboss | core/src/test/scala/rpgboss/UnitSpec.scala | Scala | agpl-3.0 | 2,256 |
package com.prealpha.pipe.math
case class ParseException[T](msg: String, input: T, next: T) extends Exception("Parse failed with message: " + msg)
| TyOverby/Pipe | math/src/main/scala/com/prealpha/pipe/math/ParseException.scala | Scala | mpl-2.0 | 148 |
/*
* Copyright 2011-2014 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... | EBPI/yaidom | src/main/scala/nl/ebpi/yaidom/convert/YaidomToStaxEventsConversions.scala | Scala | apache-2.0 | 9,536 |
package chen.guo.ittests
import java.io._
import java.util.concurrent._
import chen.guo.dagexe.config.SleepNode
import chen.guo.dagexe.util.MessageBuilder
import org.slf4j.{Logger, LoggerFactory}
import scala.util.Try
class SleepWriteNode(id: String, sleepTimeMillis: String, outputFilePath: String) extends SleepNod... | enjoyear/Simple-DAG-Execution | sde/src/it/scala/chen/guo/ittests/SleepWriteNode.scala | Scala | apache-2.0 | 1,260 |
import org.scalatest.{FunSuite, Matchers}
import ZebraPuzzle._
class ZebraPuzzleTest extends FunSuite with Matchers {
test("solve the Zebra Puzzle") {
ZebraPuzzle.solve should be (
Solution(waterDrinker = Norwegian,
zebraOwner = Japanese))
}
}
| daewon/til | exercism/scala/zebra-puzzle/src/test/scala/ZebraPuzzleTest.scala | Scala | mpl-2.0 | 279 |
/*
* Copyright 2015 data Artisans GmbH
*
* 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... | dataArtisans/blogposts | event-time-windows/src/main/scala/com/dataartisans/blogpost/eventtime/scala/SampleDataGenerator.scala | Scala | apache-2.0 | 2,753 |
package de.ummels.dijkstra
/** Some utility functions. */
object Util {
/** Builds up a list from the right using the given start value.
*
* Returns the list `(..., f(f(f(x).get).get).get, f(f(x).get).get, f(x).get, x)`,
* where the head element h fulfills `f(h) = None`.
*
* Does not terminate if... | ummels/dijkstra-in-scala | src/main/scala/de/ummels/dijkstra/Util.scala | Scala | isc | 1,241 |
class A {
def no: List[Nothing] = Nil
}
| dotty-staging/dotty | tests/pos-java-interop/i8936/A.scala | Scala | apache-2.0 | 42 |
/*
* Copyright 2010-2011 Vilius Normantas <code@norma.lt>
*
* This file is part of Crossbow library.
*
* Crossbow is free software: you can redistribute it and/or modify it under the terms of the GNU
* General Public License as published by the Free Software Foundation, either version 3 of the
* License, or (at ... | ViliusN/Crossbow | crossbow-core/test/lt/norma/crossbow/indicators/OptionsChainTest.scala | Scala | gpl-3.0 | 3,295 |
/* Copyright 2009-2016 EPFL, Lausanne */
import leon.lang._
import leon.collection._
import leon._
object RemainderByZero {
def remByZero(x: BigInt): Boolean = {
(x % BigInt(0) == BigInt(10))
}
}
| regb/leon | src/test/resources/regression/verification/purescala/invalid/RemainderByZero.scala | Scala | gpl-3.0 | 208 |
/*
* 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 | streaming/src/main/scala/org/apache/gearpump/streaming/sink/DataSinkProcessor.scala | Scala | apache-2.0 | 1,764 |
package spire.random
import scala.annotation.tailrec
import scala.reflect.ClassTag
import spire.algebra._
import spire.std.float._
import spire.std.double._
import spire.std.bigDecimal._
import org.scalatest.FunSuite
class GaussianTest extends FunSuite {
import AndersonDarlingTest._
def checkGaussian[A: Field:... | lrytz/spire | tests/src/test/scala/spire/random/GaussianTest.scala | Scala | mit | 2,553 |
package scala.meta.internal
package object semanticdb {
val NoType = Type.Empty
val NoConstant = Constant.Empty
val NoSignature = Signature.Empty
implicit class XtensionSemanticdbSymbolInformation(info: SymbolInformation) {
def has(
prop: SymbolInformation.Property,
prop2: SymbolInformati... | MasseGuillaume/scalameta | semanticdb/semanticdb/src/main/scala/scala/meta/internal/semanticdb/package.scala | Scala | bsd-3-clause | 3,091 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | jkbradley/spark | external/kafka-0-10-token-provider/src/main/scala/org/apache/spark/kafka010/KafkaTokenUtil.scala | Scala | apache-2.0 | 12,404 |
/*
* Copyright (c) 2013-2014 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://... | mdavid/lessig-bigdata | lib/snowplow/3-enrich/scala-kinesis-enrich/src/main/scala/com.snowplowanalytics.snowplow.enrich/kinesis/sinks/InputType.scala | Scala | mit | 931 |
package com.atomist.rug.kind.java
import com.atomist.rug.spi.{ExportFunction, TerminalView, TypeProvider}
import com.github.javaparser.ast.body.FieldDeclaration
import scala.collection.JavaConverters._
class JavaFieldTypeProvider extends TypeProvider(classOf[JavaFieldMutableView]) {
override def description: Stri... | atomist/rug | src/main/scala/com/atomist/rug/kind/java/JavaFieldMutableView.scala | Scala | gpl-3.0 | 1,233 |
package com.cerner.beadledom.guice
import org.scalatest.{BeforeAndAfter, FunSpec, MustMatchers}
/**
* Unit tests for [[BindingAnnotations]].
*
* @author John Leacox
*/
class BindingAnnotationsSpec extends FunSpec with MustMatchers with BeforeAndAfter {
describe("BindingAnnotations") {
describe("#isBindi... | bbaugher/beadledom | guice/src/test/scala/com/cerner/beadledom/guice/BindingAnnotationsSpec.scala | Scala | apache-2.0 | 1,493 |
package com.lonelyplanet.akka.http.extensions
import akka.http.scaladsl.server.Directives._
import akka.http.scaladsl.testkit.{RouteTestTimeout, ScalatestRouteTest}
import org.scalatest.{FlatSpec, Matchers}
import scala.concurrent.duration.FiniteDuration
class PaginationSpec extends FlatSpec with PaginationDirective... | lonelyplanet/akka-http-extensions | src/test/scala/com/lonelyplanet/akka/http/extensions/PaginationSpec.scala | Scala | apache-2.0 | 887 |
/*
* Copyright 2001-2013 Artima, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this opt 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... | scalatest/scalatest | jvm/scalatest-test/src/test/scala/org/scalatest/ShouldBeDefinedLogicalAndSpec.scala | Scala | apache-2.0 | 10,464 |
/*
* Copyright (c) 2018. Fengguo Wei and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Apache License v2.0
* which accompanies this distribution, and is available at
* https://www.apache.org/licenses/LICENSE-2.0
*
* Detailed contributors ar... | arguslab/Argus-SAF | jawa/src/test/scala/hu/ssh/progressbar/replacers/TotalTimeReplacerTest.scala | Scala | apache-2.0 | 1,316 |
object Test {
@annotation.tailrec def foo() = 5 // error
}
| densh/dotty | tests/neg/tailcall/t3275.scala | Scala | bsd-3-clause | 79 |
package com.github.andyglow.relaxed
import io.circe.Decoder.Result
import io.circe._
case class CirceSupport(json: Json) extends Reader with ReaderSupport[Json] {
def isNull: (Json) => Boolean = _.isNull
def ctor: (Json) => CirceSupport = CirceSupport.apply
def get(field: String): Option[Json] = (json \\ field... | andyglow/relaxed-json-update | circe/src/main/scala-2.11/com/github/andyglow/relaxed/CirceSupport.scala | Scala | lgpl-3.0 | 899 |
/*
* Wire
* Copyright (C) 2016 Wire Swiss GmbH
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This progr... | wireapp/wire-android-sync-engine | zmessaging/src/main/scala/com/waz/service/call/Calling.scala | Scala | gpl-3.0 | 5,614 |
package dotty.tools
package dotc
package reporting
import org.junit.Test
import core.Contexts._
class TestMessageLaziness extends DottyTest {
ctx = ctx.fresh.setReporter(new NonchalantReporter)
class NonchalantReporter(using Context) extends Reporter
with UniqueMessagePositions with HideNonSensicalMessages {
... | dotty-staging/dotty | compiler/test/dotty/tools/dotc/reporting/TestMessageLaziness.scala | Scala | apache-2.0 | 791 |
package org.helgoboss.scala_osgi_metatype.builders
import org.helgoboss.scala_osgi_metatype.interfaces.{ObjectClassDefinition, AttributeDefinition}
/**
* Convenient builder for object class definitions.
*
* == Examples ==
*
* {{{
* // Minimum (though I strongly advise to provide a name as well)
* ObjectClass(
... | helgoboss/scala-osgi-metatype | src/main/scala/org/helgoboss/scala_osgi_metatype/builders/ObjectClass.scala | Scala | mit | 2,503 |
package com.codacy.client.bitbucket.client
import play.api.libs.oauth.{ConsumerKey, OAuthCalculator, RequestToken}
import play.api.libs.ws.{WSAuthScheme, WSRequest}
/**
* Handles request authentication.
* Provides several different authentication options.
*
* @author - Robertas Zamblauskas
*/
object Authent... | rtfpessoa/bitbucket-scala-client | src/main/scala/com/codacy/client/bitbucket/client/Authentication.scala | Scala | apache-2.0 | 2,194 |
package org.bitcoins.spvnode
import org.bitcoins.core.protocol.blockchain.TestNetChainParams
import org.bitcoins.spvnode.constant.Constants
import org.bitcoins.spvnode.modelsd.BlockHeaderTable
import org.bitcoins.spvnode.networking.sync.BlockHeaderSyncActor
import slick.driver.PostgresDriver.api._
import scala.concur... | bitcoin-s/bitcoin-s-spv-node | src/main/scala/org/bitcoins/spvnode/Main.scala | Scala | mit | 1,054 |
package controllers
import play.api._
import play.api.mvc._
import play.api.db.slick._
import play.api.data.{ Form }
import play.api.data.Forms._
import models.Sample
import models.SampleFile
import models.FileRetrival
import models.SampleLIMSInfo
import models.FTPCredentials
import models.persistance.SampleDAO
import... | seqprodbio/restoule | app/controllers/XMLGeneration.scala | Scala | gpl-3.0 | 16,505 |
package client.modals
import japgolly.scalajs.react._
import japgolly.scalajs.react.extra.OnUnmount
import japgolly.scalajs.react.vdom.prefix_<^._
import client.components.Bootstrap._
import client.components.Icon
import client.components.Icon._
import client.components._
import client.css.{ DashBoardCSS, HeaderCSS, P... | LivelyGig/ProductWebUI | client/src/main/scala/client/modalpopups/UserPreferences.scala | Scala | apache-2.0 | 4,357 |
//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
/** @author John Miller
* @version 1.3
* @date Tue May 29 14:45:32 EDT 2012
* @see LICENSE (MIT style license file).
*/
package scalation.analytics.clusterer
import scalation.linalgebra.{MatrixD, VectorD, VectorI}
//::::::... | NBKlepp/fda | scalation_1.3/scalation_modeling/src/main/scala/scalation/analytics/clusterer/Clusterer.scala | Scala | mit | 3,062 |
package com.thetestpeople.trt.webdriver.screens
import org.openqa.selenium.WebDriver
import org.openqa.selenium._
import com.thetestpeople.trt.webdriver.screens.RichSelenium._
import org.openqa.selenium.WebElement
import org.openqa.selenium.By
import org.openqa.selenium.By._
import com.thetestpeople.trt.utils.Utils
im... | thetestpeople/trt | test/com/thetestpeople/trt/webdriver/screens/TestsScreen.scala | Scala | mit | 4,776 |
/*
* Copyright 2017 Google Inc. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by ... | GoogleCloudPlatform/cloud-bigtable-examples | scala/spark-wordcount/src/main/scala/com/example/bigtable/spark/wordcount/WordCount.scala | Scala | apache-2.0 | 6,443 |
package deburnat.transade.core.loaders
import xml.{Elem, XML}
import XML.loadFile
import collection.mutable.{ListBuffer, Map}
import java.io.File
import deburnat.transade.core.admins.{PdfCreator, CoreAdmin}
import CoreAdmin._
import deburnat.transade.core.conc.Concurrency
/**
* Project name: transade
* @author Patr... | deburnatshazem/transade | core/src/main/scala/deburnat/transade/core/loaders/ScalaFileLoader.scala | Scala | apache-2.0 | 3,922 |
package integration
import org.junit.Before
import org.junit.Assert
import org.junit.Test
import web.EstateServer
import com.typesafe.config.ConfigFactory
import akka.actor.ActorSystem
import akka.actor.Props
import interactor.Master
import interactor.CrawlerProcessStart
class DownloadTest {
val URL_COUNT = 100;
... | tiborbotos/domino | domino-crawler/src/test/scala/integration/DownloadTest.scala | Scala | lgpl-3.0 | 832 |
/*
* Copyright (C) Lightbend Inc. <https://www.lightbend.com>
*/
package play.sbt
import java.nio.file.Path
import com.typesafe.sbt.web.SbtWeb.autoImport._
import play.sbt.PlayInternalKeys._
import sbt.Keys._
import sbt._
object PlayCommands {
val playReloadTask = Def.task {
playCompileEverything.value.redu... | marcospereira/playframework | dev-mode/sbt-plugin/src/main/scala/play/sbt/PlayCommands.scala | Scala | apache-2.0 | 4,129 |
package com.xenopsconsulting.gamedayapi
import org.scalatest.junit.AssertionsForJUnit
import org.junit.Test
import org.junit.Assert._
import org.junit.Before
import java.text.SimpleDateFormat
import java.util.Date
class LineScoreTest extends AssertionsForJUnit {
var game: Game = _
var lineScore: LineScore = _
v... | ecopony/scala-gameday-api | src/test/scala/com/xenopsconsulting/gamedayapi/LineScoreTest.scala | Scala | mit | 7,635 |
package io.scalding.approximations
import java.io._
/**
* A utility package object for serializing approximation data structures to disk
*/
object Utils {
// Serialize a Bloom Filter in a byte array
def serialize(dataStructure: Any): Array[Byte] = {
val stream = new ByteArrayOutputStream()
val out = ne... | LeeRisk/social-media-analytics | src/main/scala/io/scalding/approximations/Utils.scala | Scala | apache-2.0 | 1,035 |
/*
* 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 ... | LantaoJin/spark | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/Optimizer.scala | Scala | apache-2.0 | 73,457 |
/*
* Copyright 2021 HM Revenue & Customs
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or a... | hmrc/ct-calculations | src/main/scala/uk/gov/hmrc/ct/computations/covidSupport/CP126.scala | Scala | apache-2.0 | 1,334 |
package org.example1.usage
import org.example1.declaration.data.{A, B, C, X}
trait Usage_MergeToExisting_Imports_1_3 {
val a: A = ???
val b: B = ???
val c: C = ???
val x: X = ???
}
| JetBrains/intellij-scala | scala/scala-impl/testdata/move/allInOne/after/org/example1/usage/Usage_MergeToExisting_Imports_1_3.scala | Scala | apache-2.0 | 192 |
package org.yotchang4s.yapix
import org.yotchang4s.pixiv.Config
import org.yotchang4s.pixiv.auth.AuthResult
import android.content.SharedPreferences
object YapixConfig {
private val httpProxyHostKey = "httpProxyHostKey"
private val httpProxyPortKey = "httpProxyPort"
private val httpProxyUserKey = "httpProxyUser... | yotchang4s/yapix | src/org/yotchang4s/yapix/YapixConfig.scala | Scala | bsd-3-clause | 2,640 |
/*
* 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 ... | shuangshuangwang/spark | sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkSQLSessionManager.scala | Scala | apache-2.0 | 3,752 |
package org.tearne.crosser.output
import org.scalatest.mock.MockitoSugar
import org.tearne.crosser.cross.Cross
import org.mockito.Mockito._
import org.mockito.Matchers._
import org.tearne.crosser.plant.Plant
import sampler.data.Samplable
import org.tearne.crosser.plant.ConcretePlant
import org.tearne.crosser.plant.Roo... | tearne/Crosser | src/test/scala/org/tearne/crosser/output/OutputTest.scala | Scala | apache-2.0 | 2,272 |
package com.github.pheymann.scala.bft.util
import akka.actor.{Actor, ActorLogging}
trait ActorLoggingUtil extends ActorLogging { this: Actor =>
def logError(cause: Throwable, msg: => String): Unit = {
log.error(cause, msg)
}
def logWarn(msg: => String): Unit = {
if (log.isWarningEnabled)
log.war... | pheymann/scala.bft | bft-replica/src/main/scala/com/github/pheymann/scala/bft/util/ActorLoggingUtil.scala | Scala | mit | 429 |
package com.awesomesauce.minecraft.forge.openautomation.common.oc.oalang
class OAlangInterpreter(val components: ComponentInterface) {
components.interpreter = this
val script = scala.collection.mutable.ArrayBuffer[ScriptPart]()
val variableMap = scala.collection.mutable.HashMap[String, AnyRef]()
var index = 0... | AwesomeSauceMods/OpenAutomation | main/scala/com/awesomesauce/minecraft/forge/openautomation/common/oc/oalang/OAlangInterpreter.scala | Scala | mit | 1,786 |
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you ... | StephanEwen/incubator-flink | flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/planner/plan/nodes/physical/stream/StreamPhysicalWindowAggregate.scala | Scala | apache-2.0 | 4,569 |
package org.kokho.scheduling.rts.multicritical
import org.kokho.scheduling.{PeriodicJob, PeriodicTask}
/**
* Created with IntelliJ IDEA on 6/4/15.
* @author: Mikhail Kokho
*/
/**
*
* @param period - period of execution
* @param loExecution - execution time of a job in low-critical mode
* @param hiExecution - ... | mkokho/dynoslack | old_sources/main/scala/kokho/scheduling/rts/multicritical/HiCriticalTaskDefault.scala | Scala | apache-2.0 | 941 |
/*
* 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 ... | javalovelinux/SparkGroovyScript | core/src/main/scala/org/apache/spark/rdd/PipedRDD.scala | Scala | apache-2.0 | 8,501 |
/**
* Copyright (C) 2013 Orbeon, Inc.
*
* This program is free software; you can redistribute it and/or modify it under the terms of the
* GNU Lesser General Public License as published by the Free Software Foundation; either version
* 2.1 of the License, or (at your option) any later version.
*
* This program i... | brunobuzzi/orbeon-forms | form-runner/jvm/src/main/scala/org/orbeon/oxf/fr/persistence/relational/rest/RequestResponse.scala | Scala | lgpl-2.1 | 2,963 |
/*
* Copyright 2016 The BigDL Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agr... | intel-analytics/BigDL | scala/dllib/src/main/scala/com/intel/analytics/bigdl/dllib/feature/text/TextFeature.scala | Scala | apache-2.0 | 5,679 |
package cromwell.engine.backend.mock
import akka.actor.{ActorRef, Props}
import cromwell.backend.BackendJobExecutionActor.{BackendJobExecutionResponse, JobSucceededResponse}
import cromwell.backend._
import cromwell.core.{CallOutputs, NoIoFunctionSet}
import wom.expression.IoFunctionSet
import wom.graph.TaskCallNode
... | ohsu-comp-bio/cromwell | engine/src/test/scala/cromwell/engine/backend/mock/DefaultBackendJobExecutionActor.scala | Scala | bsd-3-clause | 2,459 |
/* Copyright (C) 2008-2014 University of Massachusetts Amherst.
This file is part of "FACTORIE" (Factor graphs, Imperative, Extensible)
http://factorie.cs.umass.edu, http://github.com/factorie
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with... | hlin117/factorie | src/main/scala/cc/factorie/app/nlp/Section.scala | Scala | apache-2.0 | 5,470 |
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.