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 ... | shaneknapp/spark | sql/core/src/main/scala/org/apache/spark/sql/package.scala | Scala | apache-2.0 | 2,661 |
import dispatch.classic.{Request, Http, NoLogging, StatusCode, ConfiguredHttpClient, url}
import spray.json.{JsNull, JsonParser, DefaultJsonProtocol, JsValue}
import RichJsValue._
import org.apache.commons.codec.digest.DigestUtils
import org.apache.commons.codec.binary.{Hex, Base64}
import java.io.{IOException, File, F... | jan-j/functional-programming-principles-in-scala | week-7/project/CourseraHttp.scala | Scala | mit | 10,364 |
/**
* Licensed to Gravity.com under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. Gravity.com licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this fil... | davidyanez/goose | src/main/scala/com/gravity/goose/Configuration.scala | Scala | apache-2.0 | 5,370 |
package graffiti
import spray.routing.{Directives, Route}
/**
* @author Alexander De Leon <me@alexdeleon.name>
*/
abstract class Service(path: Option[String] = None) extends (() => Route) with Directives {
def this(path: String) = this(Some(path))
private var serviceRoute: Route = reject()
override def app... | devialab/graffiti | core/src/main/scala/graffiti/Service.scala | Scala | mit | 686 |
package com.workday.esclient.unit
import com.google.gson.{Gson, JsonObject}
import com.workday.esclient._
import com.workday.esclient.unit.EsClientSpec.EsClientWithMockedEs
import io.searchbox.client.JestClient
import io.searchbox.core.{Bulk, DeleteByQuery}
import io.searchbox.indices.{Analyze, Flush}
import org.mocki... | Workday/escalar | src/test/scala/com/workday/esclient/unit/EsIndexingDocsSpec.scala | Scala | mit | 16,610 |
package com.twitter.finagle.ssl
import javax.net.ssl.SSLEngine
case class Engine(self: SSLEngine, handlesRenegotiation: Boolean = false)
| enachb/finagle_2.9_durgh | finagle-core/src/main/scala/com/twitter/finagle/ssl/Engine.scala | Scala | apache-2.0 | 139 |
package com.github.oetzi.echo.core.test
import org.specs._
import com.github.oetzi.echo.Echo._
import com.github.oetzi.echo.Control._
import com.github.oetzi.echo.core.test.help.TestEvent
import com.github.oetzi.echo.core.{Switcher, Behaviour}
object SwitcherSpec extends Specification {
devMode()
"Switcher" sh... | seadowg/echo | src/spec/scala/com/github/oetzi/echo/core/test/SwitcherSpec.scala | Scala | mit | 1,355 |
package at.logic.gapt.prooftool
import at.logic.gapt.expr._
import swing._
import scala.swing.event.{ MouseClicked, MouseEntered, MouseExited }
import java.awt.{ Color, Font }
import java.awt.event.MouseEvent
import at.logic.gapt.proofs.expansion._
import org.scilab.forge.jlatexmath.{ TeXConstants, TeXFormula }
impo... | gebner/gapt | core/src/main/scala/at/logic/gapt/prooftool/DrawExpansionTree.scala | Scala | gpl-3.0 | 19,464 |
package cas.analysis.subject.components
case class Article(id: String, brief: String, body: String = "") extends Component | bk0606/CAS | src/main/scala/cas/analysis/subject/components/Article.scala | Scala | mit | 123 |
package twatcher.actors
import twatcher.models.{Account, Script}
import twatcher.logics.BatchLogic
import play.api.Logger
import akka.actor._
/**
* Actor of assign and manage
* 1. Executing scripts
* 2. Twitter API Action
*/
class BatchActor extends Actor {
def receive = {
case ScriptList(scriptList) ... | srd7/twatcher | app/actors/BatchActor.scala | Scala | mit | 1,684 |
package com.twitter.finatra.thrift.routing
import com.twitter.inject.thrift.utils.ThriftMethodUtils._
import com.twitter.scrooge.Request
import com.twitter.scrooge.Response
import com.twitter.scrooge.ThriftMethod
import com.twitter.util.Await
import com.twitter.util.Stopwatch
import com.twitter.util.Try
import com.twi... | twitter/finatra | thrift/src/main/scala/com/twitter/finatra/thrift/routing/ThriftWarmup.scala | Scala | apache-2.0 | 4,384 |
/*
* Copyright (C) 2011 Mathias Doenitz
*
* 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... | backchatio/http-parsers | src/main/scala/io/backchat/http/HttpContent.scala | Scala | apache-2.0 | 3,728 |
/*
* Copyright 2022 HM Revenue & Customs
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or a... | hmrc/vat-registration-frontend | test/controllers/registration/applicant/FormerNameControllerSpec.scala | Scala | apache-2.0 | 4,845 |
package sangria.schema
import language.postfixOps
import sangria.ast
import sangria.ast.{OperationType, TypeDefinition}
import sangria.renderer.QueryRenderer
import scala.collection.concurrent.TrieMap
class AstSchemaMaterializer[Ctx] private (document: ast.Document, builder: AstSchemaBuilder[Ctx]) {
import AstSche... | PhilAndrew/JumpMicro | JMSangriaGraphql/src/main/scala/sangria/schema/AstSchemaMaterializer.scala | Scala | mit | 18,975 |
package com.avsystem.commons
package mongo.typed
import com.avsystem.commons.meta.OptionLike
import com.avsystem.commons.misc.{AbstractValueEnum, AbstractValueEnumCompanion, EnumCtx}
import com.avsystem.commons.mongo.text.TextSearchLanguage
import org.bson.{BsonType, BsonValue}
import java.util.regex.Pattern
import s... | AVSystem/scala-commons | commons-mongo/jvm/src/main/scala/com/avsystem/commons/mongo/typed/QueryOperatorsDsl.scala | Scala | mit | 5,837 |
package org.salgo.geometry.hulls
import org.salgo.geometry.structures.Point3D
trait HullScan3D extends HullScan[Point3D] {
}
| ascensio/salgo | src/org.salgo/geometry/hulls/HullScan3D.scala | Scala | apache-2.0 | 127 |
/*
* Copyright (c) 2014-2021 by The Monix Project Developers.
* See the project homepage at: https://monix.io
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache... | monixio/monix | monix-reactive/shared/src/main/scala/monix/reactive/internal/builders/StateActionObservable.scala | Scala | apache-2.0 | 2,785 |
package breeze.linalg
import breeze.numerics.isNonfinite
import org.netlib.blas.Ddot
import org.scalacheck._
import org.scalatest._
import org.scalatest.junit._
import org.scalatest.prop._
import org.junit.runner.RunWith
import breeze.math._
import breeze.stats.mean
import java.util
import breeze.stats.distributions.... | crealytics/breeze | math/src/test/scala/breeze/linalg/DenseVectorTest.scala | Scala | apache-2.0 | 17,546 |
package dotty.tools
package dotc
package reporting
import core.Contexts.Context
import scala.collection.mutable
import org.junit.Assert._
trait ErrorMessagesTest extends DottyTest {
private def newContext = {
val rep = new StoreReporter(null)
with UniqueMessagePositions with HideNonSensicalMessag... | som-snytt/dotty | compiler/test/dotty/tools/dotc/reporting/ErrorMessagesTest.scala | Scala | apache-2.0 | 1,509 |
/**
* Swaggy Jenkins
* Jenkins API clients generated from Swagger / Open API specification
*
* The version of the OpenAPI document: 1.1.2-pre.0
* Contact: blah@cliffano.com
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not ed... | cliffano/swaggy-jenkins | clients/scala-lagom-server/generated/src/main/scala/io/swagger/client/model/CauseUserIdCause.scala | Scala | mit | 711 |
/*
* 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/play-ui | src/main/scala/uk/gov/hmrc/play/binders/PositiveInteger.scala | Scala | apache-2.0 | 1,478 |
/*
* DirectedBrowserTransmitterImpl.scala
* (ScalaOSC)
*
* Copyright (c) 2008-2021 Hanns Holger Rutz. All rights reserved.
*
* This software is published under the GNU Lesser General Public License v2.1+
*
*
* For further information, please contact Hanns Holger Rutz at
* contact@sciss.de
*/
package de.scis... | Sciss/ScalaOSC | js/src/main/scala/de/sciss/osc/impl/DirectedBrowserTransmitterImpl.scala | Scala | lgpl-2.1 | 1,411 |
package edu.ncrn.cornell.xml
import edu.ncrn.cornell.xml.Util._
import edu.ncrn.cornell.xml.XpathEnumerator.{NodeFilterGeneric, NodeFilters}
import org.specs2._
import scala.xml.{Node, XML}
/**
* @author Brandon Barker
* 9/8/2016
*/
class DdiCodebookSpec extends Specification { def is = s2"""
Test... | ncrncornell/XPathEnumerator | src/test/scala/edu/ncrn/cornell/xml/DdiCodebookSpec.scala | Scala | apache-2.0 | 2,744 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | apache-spark-on-k8s/spark | resource-managers/kubernetes/core/src/test/scala/org/apache/spark/deploy/k8s/SecretVolumeUtils.scala | Scala | apache-2.0 | 1,395 |
trait T {
def i: Int = 1_024
def j: Long = 1_024L * 1_024
//def k = 1'024
def f = 3_14e-2
def d = 3_14E-2_1
def z = 0
}
| scala/scala | test/files/pos/t6124.scala | Scala | apache-2.0 | 135 |
/*
* 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 ... | aljoscha/flink | flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/codegen/ExprCodeGenerator.scala | Scala | apache-2.0 | 32,478 |
package com.sstwitterprocessor.model
case class Tweet(
contributors: Option[Seq[Contributor]],
coordinates: Option[Coordinates],
created_at: String,
current_user_retweet: Option[Map[String, String]],
entities: Entities,
favorite_count: Option[Int],
favorited: Option[Boolean],
filter_level: String,
id: Long,
... | simonsaffer/sstwitterprocessor | src/main/scala/com/sstwitterprocessor/model/Tweet.scala | Scala | gpl-2.0 | 4,411 |
package org.deepdive.inference
import org.deepdive.Logging
import org.deepdive.settings._
import java.io._
class BinarySerializer(weightsOutput: OutputStream, variablesOutput: OutputStream,
factorsOutput: OutputStream, edgesOutput: OutputStream, metaDataOutput: OutputStream)
extends Serializer with Logging {
... | gaapt/deepdive | src/main/scala/org/deepdive/inference/serialization/BinarySerializer.scala | Scala | apache-2.0 | 2,704 |
package com.sksamuel.elastic4s.http.search.aggs
import com.sksamuel.elastic4s.searches.aggs.TopHitsAggregation
import com.sksamuel.elastic4s.searches.sort.{FieldSort, SortMode}
import org.scalatest.{FunSuite, Matchers}
class TopHitsAggregationBuilderTest extends FunSuite with Matchers {
test("top hits aggregation s... | Tecsisa/elastic4s | elastic4s-http/src/test/scala/com/sksamuel/elastic4s/http/search/aggs/TopHitsAggregationBuilderTest.scala | Scala | apache-2.0 | 696 |
package com.mogproject.mogami.core.io.kif
import org.scalatestplus.scalacheck.ScalaCheckDrivenPropertyChecks
import org.scalatest.flatspec.AnyFlatSpec
import org.scalatest.matchers.must.Matchers
class KifStateReaderSpec extends AnyFlatSpec with Matchers with ScalaCheckDrivenPropertyChecks {
object TestKifStateRead... | mogproject/mog-core-scala | shared/src/test/scala/com/mogproject/mogami/core/io/kif/KifStateReaderSpec.scala | Scala | apache-2.0 | 370 |
package metal
object PtrVersions {
type Base = AnyVal
}
| denisrosset/ptrcoll | core/src/main/scala_2.12/metal/PtrVersions.scala | Scala | mit | 61 |
package com.github.cuzfrog.scmd.internal
import scala.annotation.StaticAnnotation
import scala.meta._
import scala.collection.immutable
private[scmd] class AppInfoMacro extends StaticAnnotation {
inline def apply(defn: Any): Any = meta {
defn match {
case Term.Block(
Seq(q"..$mods class $tname ..$ct... | cuzfrog/simple-cmd | internalMacros/src/main/scala/com/github/cuzfrog/scmd/internal/AppInfoMacro.scala | Scala | apache-2.0 | 1,097 |
/*
* 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 ... | ing-bank/scruid | src/main/scala/com/ing/wbaa/druid/client/HttpStatusException.scala | Scala | apache-2.0 | 2,377 |
package per.harenp.Hedgehog
import java.time.Instant
import java.time.ZoneId
/**
* @author patrick.haren@yahoo.com
*/
/* US equity pricing data */
case class PriceData(epochTime : Long, open : Double, close : Double, high : Double, low: Double, volume: Long, adjuster: Double)
{
def tradingTime(tz: String) = Inst... | lasttruffulaseed/quant-spark | scala/per/harenp/Hedgehog/PriceData.scala | Scala | apache-2.0 | 856 |
/* __ *\\
** ________ ___ / / ___ Scala API **
** / __/ __// _ | / / / _ | (c) 2003-2013, LAMP/EPFL **
** __\\ \\/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\\___/_/... | felixmulder/scala | src/library/scala/collection/GenSeqLike.scala | Scala | bsd-3-clause | 19,119 |
/*
* 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/test/scala/uk/gov/hmrc/ct/computations/CP78Spec.scala | Scala | apache-2.0 | 1,186 |
package com.ing.bakery.baker
import akka.actor.ActorSystem
import cats.effect.{ContextShift, IO, Resource, Timer}
import com.ing.baker.runtime.akka.internal.DynamicInteractionManager
import com.ing.bakery.interaction.RemoteInteractionClient
import com.typesafe.config.Config
import com.typesafe.scalalogging.LazyLogging... | ing-bank/baker | bakery/state/src/main/scala/com/ing/bakery/baker/LocalhostInteractions.scala | Scala | mit | 1,590 |
package clean.lib
/*
active-learning-scala: Active Learning library for Scala
Copyright (c) 2014 Davi Pereira dos Santos
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 ... | active-learning/active-learning-scala | src/main/scala/clean/lib/CM.scala | Scala | gpl-2.0 | 3,016 |
/**
* This file is part of the TA Buddy project.
* Copyright (c) 2013-2014 Alexey Aksenov ezh@ezh.msk.ru
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Affero General Global License version 3
* as published by the Free Software Foundation with the addition... | digimead/digi-TABuddy-desktop | part-view-modification/src/main/scala/org/digimead/tabuddy/desktop/view/modification/operation/OperationModifySorting.scala | Scala | agpl-3.0 | 6,926 |
/*
Copyright 2012 Georgia Tech Research Institute
Author: lance.gatlin@gtri.gatech.edu
This file is part of org.gtri.util.scala.xmlbuilder library.
org.gtri.util.scala.xmlbuilder library is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License a... | gtri-iead/org.gtri.util.scala | xmlbuilder/src/main/scala/org/gtri/util/scala/xmlbuilder/XmlElement.scala | Scala | gpl-3.0 | 4,628 |
package sprawler.crawler.actor
import akka.actor.{ Props, PoisonPill }
import akka.routing.{ RouterConfig, Broadcast, SmallestMailboxRouter, DefaultResizer }
import sprawler.crawler.url.CrawlerUrl
import scala.concurrent.ExecutionContext
import spray.can.client.{ HostConnectorSettings, ClientConnectionSettings }
cl... | daniel-trinh/sprawler | src/main/scala/sprawler/crawler/actor/LinkQueueMaster.scala | Scala | mit | 1,123 |
package wandou.math.algebra
import wandou.collection.ArrayList
import wandou.math.CardinalityException
import wandou.math.IndexException
import scala.collection.mutable
/**
* Doubly sparse matrix. Implemented as a Map of RandomAccessSparseVector rows
* Construct a matrix of the given cardinality with the given row ... | wandoulabs/wandou-math | wandou-math/src/main/scala/wandou/math/algebra/SparseMatrix.scala | Scala | apache-2.0 | 4,602 |
/*
* 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 ... | tlby/mxnet | scala-package/core/src/main/scala/org/apache/mxnet/util/OptionConversion.scala | Scala | apache-2.0 | 932 |
/*
# Copyright 2016 Georges Lipka
#
# 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 wri... | glipka/Easy-React-With-ScalaJS | src/main/scala/com/glipka/easyReactJS/reactRedux/InferableComponentDecorator.scala | Scala | apache-2.0 | 1,083 |
package vegas.data
import org.scalatest.{FlatSpec, Matchers}
class FieldExtractorSpec extends FlatSpec with Matchers {
case class Ex(a: Int, b: String, c: Double)
"FieldExtractor" should "extract fields from a case class into a Map[String, Any]" in {
val ex = Ex(2, "UK", 3.14)
val fields = FieldExtracto... | aishfenton/Vegas | core/src/test/scala/vegas/data/FieldExtractorSpec.scala | Scala | mit | 415 |
package thesis.orderings
import thesis.matrixTypes._
import thesis.utils._
import thesis.rectangles._
/** Starts from lineStep rows, reorders them and then iteratively adds lineStep rows
* followed by the ordering until the full matrix is selected
*
* @param isCanceled: returns true to stop the deph search
* @param ... | GLeurquin/Faithful-visualization-of-categorical-datasets | src/main/scala/Orderings/DepthSearch.scala | Scala | mit | 2,086 |
package org.jetbrains.plugins.scala
package codeInsight.intention.expression
import com.intellij.codeInsight.hint.HintManager
import com.intellij.codeInsight.intention.PsiElementBaseIntentionAction
import com.intellij.openapi.application.ApplicationManager
import com.intellij.openapi.editor.Editor
import com.intellij.... | triggerNZ/intellij-scala | src/org/jetbrains/plugins/scala/codeInsight/intention/expression/RemoveApplyIntention.scala | Scala | apache-2.0 | 7,952 |
/**
* Copyright 2013 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 agreed to i... | srvaroa/RxJava | language-adaptors/rxjava-scala/src/main/scala/rx/lang/scala/ImplicitFunctionConversions.scala | Scala | apache-2.0 | 4,908 |
package be.objectify.deadbolt.scala.test.controllers.composed
import be.objectify.deadbolt.scala.{DeadboltActions, anyOf, allOf, allOfGroup}
import play.api.mvc.{AbstractController, ControllerComponents}
import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.Future
/**
* @author Steve Ch... | schaloner/deadbolt-2-scala | test-app-compile-time-di/app/be/objectify/deadbolt/scala/test/controllers/composed/Restrict.scala | Scala | apache-2.0 | 1,500 |
/*
* -╥⌐⌐⌐⌐ -⌐⌐⌐⌐-
* ≡╢░░░░⌐\\░░░φ ╓╝░░░░⌐░░░░╪╕
* ╣╬░░` `░░░╢┘ φ▒╣╬╝╜ ░░╢╣Q
* ║╣╬░⌐ ` ╤▒▒▒Å` ║╢╬╣
* ╚╣╬░⌐ ╔▒▒▒▒`«╕ ╢╢╣▒
* ╫╬░░╖ .░ ╙╨╨ ╣╣╬░φ ╓φ░╢╢Å
* ╙╢░░░░⌐"░░░╜ ╙Å░░░░⌐░░░░╝`
* ``˚¬ ⌐ ˚˚⌐´
*
* ... | Flipkart/connekt | commons/src/main/scala/com/flipkart/connekt/commons/iomodels/WACallbackEvent.scala | Scala | mit | 3,956 |
package example
import org.apache.spark.SparkConf
import org.apache.spark.SparkContext
import org.apache.spark.rdd.RDD
/**
* @author xiafan
*/
object SparkInteractiveExapmle {
def main(args: Array[String]): Unit = {
}
class ClosureClass(val message: String) extends Serializable {
def transform(line: Str... | xiafan68/sparkcourse | src/main/scala/example/SparkInteractiveExapmle.scala | Scala | lgpl-3.0 | 2,367 |
package com.agapep.model
/**
* Created by slovic on 17.02.14.
*/
object MeasureTime {
def time[R](block: => R): R = {
val t0 = System.nanoTime()
val result = block // call-by-name
val t1 = System.nanoTime()
println("Elapsed time: " + (t1 - t0) + "ns")
result
}
}
| agapep/audiobible-scala | Audiobible/modelProj/src/main/scala/com/agapep/model/MeasureTime.scala | Scala | apache-2.0 | 293 |
package org.bitcoins.core.serializers.p2p.messages
import org.bitcoins.core.serializers.RawBitcoinSerializer
import org.bitcoins.core.p2p.{GetDataMessage, InventoryMessage}
import scodec.bits.ByteVector
/**
* @see https://bitcoin.org/en/developer-reference#getdata
*/
trait RawGetDataMessageSerializer extends RawB... | bitcoin-s/bitcoin-s-core | core/src/main/scala/org/bitcoins/core/serializers/p2p/messages/RawGetDataMessageSerializer.scala | Scala | mit | 941 |
package mesosphere.marathon
package core.task.update.impl.steps
import akka.event.EventStream
import mesosphere.UnitTest
import mesosphere.marathon.test.SettableClock
import mesosphere.marathon.core.condition.Condition
import mesosphere.marathon.core.event.{InstanceHealthChanged, MarathonEvent}
import mesosphere.marat... | gsantovena/marathon | src/test/scala/mesosphere/marathon/core/task/update/impl/steps/PostToEventStreamStepImplTest.scala | Scala | apache-2.0 | 4,991 |
package lila.setup
import chess.{ Mode, Speed }
import lila.rating.RatingRange
case class FilterConfig(
variant: List[chess.variant.Variant],
mode: List[Mode],
speed: List[Speed],
ratingRange: RatingRange) {
def >> = (
variant map (_.id),
mode map (_.id),
speed map (_.id),
ratingRan... | abougouffa/lila | modules/setup/src/main/FilterConfig.scala | Scala | mit | 2,202 |
package se.lu.nateko.cp.meta.ingestion
import java.nio.file.{Files, Paths}
import org.eclipse.rdf4j.repository.Repository
import scala.concurrent.ExecutionContext
import scala.concurrent.Future
import scala.io.Source
import se.lu.nateko.cp.meta.api.SparqlQuery
import se.lu.nateko.cp.meta.services.Rdf4jSparqlRunner
... | ICOS-Carbon-Portal/meta | src/main/scala/se/lu/nateko/cp/meta/ingestion/LocalSparqlConstructExtractor.scala | Scala | gpl-3.0 | 745 |
package athena.connector
import akka.actor._
import athena.Athena
import scala.concurrent.duration.{FiniteDuration, Duration}
import akka.actor.Terminated
import java.util.concurrent.TimeUnit
/**
* This is an actor that cleanly closes either a cluster, pool, or host connection.
*/
private[connector] class CloseActo... | vast-engineering/athena | src/main/scala/athena/connector/CloseActor.scala | Scala | apache-2.0 | 1,713 |
/*
* 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.tasty
cla... | scala/scala | src/compiler/scala/tools/tasty/UnpickleException.scala | Scala | apache-2.0 | 384 |
package com.faacets.qalg
package indup
import org.scalatest.{FunSuite, Matchers}
import org.scalatest.prop.Checkers
import algebra._
import syntax.indup.all._
object Instances {
implicit object AA extends ArrayArrayIntAlgebra
implicit object A extends ArrayIntAlgebra
}
import Instances._
abstract class Test[M,... | denisrosset/qalg | indup/src/test/scala/qalg/indup/Test.scala | Scala | mit | 1,334 |
package examples
import de.jannikarndt.datamover.DataMover
import de.jannikarndt.datamover.io.File
import play.api.libs.json.{JsValue, Json}
import scala.concurrent.duration._
import scala.io.{BufferedSource, Source}
import scala.language.postfixOps
object ExampleJob {
// Schedule an ExampleJob to run every 10... | JannikArndt/DataMover | src/test/scala/examples/ExampleJob.scala | Scala | mit | 1,347 |
package com.avsystem.commons
package annotation
/**
* Symbols annotated with this annotation can only be used in macro-generated code.
*/
class macroPrivate extends StaticAnnotation
| AVSystem/scala-commons | commons-core/src/main/scala/com/avsystem/commons/annotation/macroPrivate.scala | Scala | mit | 187 |
/*
* Copyright 2014-16 Intelix Pty Ltd
*
* 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... | intelix/reactiveservices | platform/core/src/main/scala/au/com/intelix/rs/core/services/internal/StreamDemandBinding.scala | Scala | apache-2.0 | 1,816 |
/*
* 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 agr... | howyp/http-verbs | src/test/scala/uk/gov/hmrc/play/audit/model/AuditSpec.scala | Scala | apache-2.0 | 9,236 |
package com.twitter.scalding.mathematics
class Histogram(map: Map[Double, Long], binWidth: Double) {
lazy val size = map.values.sum
lazy val sum = map.foldLeft(0.0){ case (acc, (bin, count)) => acc + bin * count }
lazy val keys = map.keys.toList.sorted
lazy val min = keys.head
lazy val max = keys.last
la... | tglstory/scalding | scalding-core/src/main/scala/com/twitter/scalding/mathematics/Histogram.scala | Scala | apache-2.0 | 1,318 |
package debop4s.core.compress
/** for Java compatibility */
abstract class AbstractCompressor extends Compressor {}
/**
* 데이터를 압축/복원을 수행합니다.
* @author 배성혁 sunghyouk.bae@gmail.com
* @since 2013. 12. 9. 오후 10:52
*/
trait Compressor {
val BUFFER_SIZE: Int = 1024
/**
* 데이터를 압축합니다.
* @param plainBytes 압축할... | debop/debop4s | debop4s-core/src/main/scala/debop4s/core/compress/Compressor.scala | Scala | apache-2.0 | 1,348 |
package com.twitter.scalding.db.macros.impl.handler
import scala.reflect.macros.Context
import com.twitter.scalding.db.macros.impl.FieldName
object ColumnFormat {
def apply(c: Context)(fAccessor: List[c.universe.MethodSymbol], fType: String, size: Option[Int])(implicit fName: FieldName,
isNullable: Boolean, de... | jzmq/scalding | scalding-db/src/main/scala/com/twitter/scalding/db/macros/impl/handler/ColumnFormat.scala | Scala | apache-2.0 | 1,070 |
import scala.language.higherKinds
trait Foo[C[_]]
object Test extends dotty.runtime.LegacyApp {
import scala.reflect.runtime.universe._
println(typeOf[Foo[({type l[X] = (Int, X)})#l]])
}
| yusuke2255/dotty | tests/pending/run/t6113.scala | Scala | bsd-3-clause | 193 |
package com.twitter.finagle.httpx.codec
import org.jboss.netty.buffer.ChannelBuffer
import org.jboss.netty.handler.codec.embedder.EncoderEmbedder
import org.jboss.netty.handler.codec.http.{HttpContentCompressor, HttpHeaders, HttpMessage}
/**
* Custom compressor that only handles text-like content-types with the defa... | bruceluo/finagle | finagle-httpx/src/main/scala/com/twitter/finagle/httpx/codec/TextualContentCompressor.scala | Scala | apache-2.0 | 1,539 |
package models.quiz.question.table
import models.quiz.question.{Question2Quiz, MultipleChoiceQuestion}
import models.quiz.table._
import play.api.db.slick.Config.driver.simple._
import play.api.templates.Html
import service.table.LoginsTable
import models.support._
import scala.slick.model.ForeignKeyAction
class Mult... | kristiankime/web-education-games | app/models/quiz/question/table/MultipleChoiceQuestionsTable.scala | Scala | mit | 1,897 |
/*
* Copyright 2014-2022 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... | Netflix-Skunkworks/iep-apps | atlas-druid/src/main/scala/com/netflix/atlas/druid/DruidSort.scala | Scala | apache-2.0 | 1,021 |
/*
* 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/iht-frontend | app/iht/controllers/application/assets/ForeignController.scala | Scala | apache-2.0 | 3,399 |
package pl.edu.agh.mplt.parser.AMPL.statements.sexpr
import org.scalatest.{Matchers, FlatSpec}
import pl.edu.agh.mplt.parser.phrase.set._
import pl.edu.agh.mplt.parser.phrase.expression.{Bin, ExpressionAMPLParser, Number}
import pl.edu.agh.mplt.parser.member._
import pl.edu.agh.mplt.parser.{KeywordAMPLParser, In... | marek1840/MPLT | src/test/scala/pl/edu/agh/mplt/parser/AMPL/statements/sexpr/SetExpressionTest.scala | Scala | mit | 8,494 |
/*
* 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 | app/controllers/asp/ServicesOfBusinessController.scala | Scala | apache-2.0 | 3,452 |
package org.greencheek.spray.cache.memcached.clientbuilder.elasticache.configparsing
import org.greencheek.spray.cache.memcached.clientbuilder.elasticache.ElastiCacheHost
import org.slf4j.{LoggerFactory, Logger}
import scala.collection.mutable.ArrayBuffer
/**
* Created by dominictootell on 22/07/2014.
*/
object De... | tootedom/spray-cache-spymemcached | src/main/scala/org/greencheek/spray/cache/memcached/clientbuilder/elasticache/configparsing/DefaultElasticacheConfigParser.scala | Scala | apache-2.0 | 1,426 |
package org.jetbrains.plugins.scala
package annotator
package quickfix
import lang.psi.api.toplevel.typedef.ScTemplateDefinition
import com.intellij.codeInsight.intention.IntentionAction
import com.intellij.openapi.project.Project
import com.intellij.openapi.editor.Editor
import com.intellij.psi.PsiFile
import lang.ps... | consulo/consulo-scala | src/org/jetbrains/plugins/scala/annotator/quickfix/ChangeTypeFix.scala | Scala | apache-2.0 | 1,550 |
package be.wegenenverkeer.atomium.server.jdbc
import be.wegenenverkeer.atomium.format.Url
case class PgJdbcFeedStore[E](feedName: String,
title: Option[String],
entryTableName: String,
ser: E => String,
... | joachimvda/atomium | modules/server-jdbc/src/main/scala/be/wegenenverkeer/atomium/server/jdbc/PgJdbcFeedStore.scala | Scala | mit | 477 |
package com.github.tyang513.batch.demo
/**
* Created by yangtao on 2017/9/13.
*/
object FlatMapDemo {
def main(args: Array[String]): Unit = {
val a1 = Array(1, 2, 3, 4)
val a2 = Array(3, 4, 5, 6)
val a = Array(a1, a2)
a.foreach(println)
a.flatMap(x => x).foreach(println)
val... | tyang513/spark-batch-example | src/main/scala/com/github/tyang513/batch/demo/FlatMapDemo.scala | Scala | gpl-3.0 | 367 |
/*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distribut... | copygrinder/copygrinder_server | src/main/scala/org/copygrinder/impure/system/SslConfig.scala | Scala | apache-2.0 | 2,006 |
/*
* Copyright (C) 2005, The OpenURP Software.
*
* 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 3 of the License, or
* (at your option) any later version.
*
* This... | openurp/api | edu/src/main/scala/org/openurp/edu/clazz/model/Exam.scala | Scala | lgpl-3.0 | 1,618 |
package Problem4
import scala.collection.immutable.HashMap
import org.apache.spark.SparkContext
import org.apache.spark.broadcast.Broadcast
import org.apache.spark.mllib.linalg.SparseVector
import org.apache.spark.mllib.linalg.Vector
import org.apache.spark.sql.DataFrame
import org.apache.spark.sql.functions
import o... | PredictionIO/open-academy | KairatAshim/pio_assignment/src/main/scala/Problem4/CategoricalBinarizer.scala | Scala | apache-2.0 | 1,890 |
package nodes.learning
import breeze.linalg._
import breeze.stats._
import nodes.stats.StandardScalerModel
import org.apache.spark.rdd.RDD
import utils.MatrixUtils
import workflow.LabelEstimator
/**
* Learns a linear model (OLS) based on training features and training labels.
* Works well when the number of feature... | tomerk/keystone | src/main/scala/nodes/learning/LocalLeastSquaresEstimator.scala | Scala | apache-2.0 | 2,026 |
package com.twitter.scalding.typed
import com.twitter.algebird.MapAlgebra
import com.twitter.scalding.TypedPipeChecker.InMemoryToListEnrichment
import org.scalacheck.{Arbitrary, Prop}
import org.scalatest.prop.{Checkers, PropertyChecks}
import org.scalatest.{FunSuite, PropSpec}
import scala.reflect.ClassTag
class No... | twitter/scalding | scalding-core/src/test/scala/com/twitter/scalding/typed/TypedPipeDiffTest.scala | Scala | apache-2.0 | 7,282 |
class B extends A {
type S <: Int
}
| som-snytt/xsbt | sbt/src/sbt-test/source-dependencies/as-seen-from-b/changes/B1.scala | Scala | bsd-3-clause | 38 |
package monocle.function
import monocle.Monocle._
import monocle._
import scalaz.Tree._
class ReverseExample extends MonocleSuite {
test("reverse creates an Iso from a List to its reversed version") {
(List(1,2,3) applyIso reverse get) shouldEqual List(3,2,1)
}
test("reverse creates an Iso from a tuple t... | malcolmgreaves/Monocle | example/src/test/scala/monocle/function/ReverseExample.scala | Scala | mit | 1,440 |
/*
* 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 | scalatest-test/src/test/scala/org/scalatest/ShouldBeReadableLogicalOrExplicitSpec.scala | Scala | apache-2.0 | 14,214 |
package pl.touk.nussknacker.engine.definition.parameter
import pl.touk.nussknacker.engine.api.component.{ParameterConfig, SingleComponentConfig}
import pl.touk.nussknacker.engine.api.definition.{Parameter, ParameterEditor, ParameterValidator}
import pl.touk.nussknacker.engine.definition.parameter.defaults.{DefaultValu... | TouK/nussknacker | interpreter/src/main/scala/pl/touk/nussknacker/engine/definition/parameter/StandardParameterEnrichment.scala | Scala | apache-2.0 | 2,268 |
package com.socrata.datacoordinator.common.soql.csvreps
import com.socrata.datacoordinator.truth.csv.CsvColumnRep
import com.socrata.soql.types.{SoQLNull, SoQLValue, SoQLFloatingTimestamp, SoQLType}
import org.joda.time.{LocalDateTime, DateTime}
import org.joda.time.format.{DateTimeFormatter, DateTimeParser, DateTimeF... | socrata-platform/data-coordinator | coordinatorlib/src/main/scala/com/socrata/datacoordinator/common/soql/csvreps/FloatingTimestampRep.scala | Scala | apache-2.0 | 1,202 |
/*
* 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 | project/SparkBuild.scala | Scala | apache-2.0 | 47,379 |
package com.rasterfoundry.backsplash
import com.rasterfoundry.datamodel.BandOverride
import cats.Applicative
import cats.implicits._
import geotrellis.vector.Extent
import io.circe.parser._
import org.http4s._
import org.http4s.dsl.io._
import scala.util.Try
import java.util.UUID
object Parameters {
final case ... | azavea/raster-foundry | app-backend/backsplash-core/src/main/scala/com/rasterfoundry/backsplash/Parameters.scala | Scala | apache-2.0 | 2,948 |
/*
* Copyright 2013 Stephan Rehfeld
*
* 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 ... | stephan-rehfeld/scaladelray | src/main/scala/scaladelray/ui/model/LambertMaterialProvider.scala | Scala | apache-2.0 | 2,034 |
package org.atl.common
class Interpreter {
}
| sayon/atl-lang | common/src/org/atl/common/Interpreter.scala | Scala | mit | 49 |
package com.dataintuitive.luciuscore
package api
import model.v4._
import genes._
import filters._
import signatures._
import correlations._
import utilities.BinningFunctions._
import lenses.CombinedPerturbationLenses.lengthLens
import org.apache.spark.rdd.RDD
import org.apache.spark.sql.Dataset
import org.apache.spa... | data-intuitive/LuciusCore | src/main/scala/com/dataintuitive/luciuscore/api/BinnedCorrelation.scala | Scala | apache-2.0 | 1,854 |
/*
* Copyright (c) 2012-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://www.apach... | bigdecisions/snowplow | 3-enrich/scala-common-enrich/src/test/scala/com.snowplowanalytics.snowplow.enrich.common/adapters/registry/SnowplowAdapterSpec.scala | Scala | apache-2.0 | 19,711 |
package domala.internal.macros.reflect.util
import scala.language.experimental.macros
import scala.reflect.macros.blackbox
object ElementUtilTestDriver {
def getTypeElement(className: String): Option[String] = macro getTypeElementImpl
def getTypeElementImpl(c: blackbox.Context)(
className: c.Expr[String]): c.... | bakenezumi/domala | core/src/main/scala/domala/internal/macros/reflect/util/ElementUtilTestDriver.scala | Scala | apache-2.0 | 558 |
/* Copyright 2009-2016 EPFL, Lausanne */
object MyTuple4 {
abstract class A
case class B(i: Int) extends A
case class C(a: A) extends A
def foo(): Int = {
val t = (1, (C(B(4)), 2), 3)
val (a1, (C(B(x)), a2), a3) = t
x
} ensuring( _ == 4)
}
| epfl-lara/leon | src/test/resources/regression/verification/purescala/valid/MyTuple4.scala | Scala | gpl-3.0 | 267 |
package com.github.kschuetz
/**
* Created by kes on 2/1/14.
*/
package object compoundsort {
class OrderBy[A](val fn: (A, A) => Boolean)
implicit def orderBy2Fn[A](orderBy: OrderBy[A]): (A, A) => Boolean = orderBy.fn
implicit def fn2OrderBy[A](fn: (A, A) => Boolean): OrderBy[A] = new OrderBy[A](fn)
/**
... | kschuetz/compound-sort-helpers | src/main/scala/com/github/kschuetz/compoundsort/package.scala | Scala | apache-2.0 | 7,503 |
package com.twitter.finagle.mux
import com.twitter.concurrent.AsyncQueue
import com.twitter.conversions.time._
import com.twitter.finagle.mux.transport.Message
import com.twitter.finagle.stats.{NullStatsReceiver, InMemoryStatsReceiver, StatsReceiver}
import com.twitter.finagle.transport.{Transport, QueueTransport}
imp... | a-manumohan/finagle | finagle-mux/src/test/scala/com/twitter/finagle/mux/ClientSessionTest.scala | Scala | apache-2.0 | 3,363 |
/*
* Copyright (c) <2015-2016>, see CONTRIBUTORS
* 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... | amanjpro/languages-a-la-carte | ooj/src/main/scala/names/StdNames.scala | Scala | bsd-3-clause | 2,375 |
package org.ferrit.core.util
object UniqueId {
def next = java.util.UUID.randomUUID().toString()
} | reggoodwin/ferrit | src/main/scala/org/ferrit/core/util/UniqueId.scala | Scala | mit | 105 |
package org.jetbrains.plugins.scala.console
import com.intellij.execution.process.{ConsoleHistoryModel, ProcessHandler}
import com.intellij.util.containers.WeakHashMap
import com.intellij.openapi.project.Project
import com.intellij.openapi.editor.Editor
import com.intellij.psi.PsiFile
/**
* @author Ksenia.Sautina
*... | consulo/consulo-scala | src/org/jetbrains/plugins/scala/console/ScalaConsoleInfo.scala | Scala | apache-2.0 | 3,049 |
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.