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 cromwell
import akka.testkit.{EventFilter, TestActorRef}
import cromwell.engine.backend._
import cromwell.engine.backend.local.LocalBackend
import cromwell.engine.workflow.WorkflowManagerActor._
import cromwell.engine.workflow.{MaterializeWorkflowDescriptorActor, WorkflowActor, WorkflowManagerActor}
import cro... | cowmoo/cromwell | engine/src/test/scala/cromwell/RetryableCallsSpec.scala | Scala | bsd-3-clause | 5,621 |
package fs2.util
import Catenable._
/*
* Trivial catenable sequence. Supports O(1) append, and (amortized)
* O(1) `uncons`, such that walking the sequence via N successive `uncons`
* steps takes O(N). Like a difference list, conversion to a `Stream[A]`
* takes linear time, regardless of how the sequence is built ... | japgolly/scalaz-stream | core/src/main/scala/fs2/util/Catenable.scala | Scala | mit | 2,134 |
package org.hqjpa
import javax.persistence.criteria.Subquery
import javax.persistence.criteria.Selection
import javax.persistence.criteria.Expression
import javax.persistence.criteria.Order
/**
* Companion object for related class.<br/>
* <br/>
* Static members are thread safe, instance memebers are not.
*/
objec... | vejobrolis/hqjpa | hqjpa/src/org/hqjpa/SubqueryProxy.scala | Scala | lgpl-3.0 | 10,586 |
/*
* Copyright 2018 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/paac-frontend | app/service/UserJourneyService.scala | Scala | apache-2.0 | 10,159 |
package HackerRank.Training.BasicProgramming
import java.io.{ByteArrayInputStream, IOException, InputStream, PrintWriter}
import java.util.InputMismatchException
import scala.collection.generic.CanBuildFrom
import scala.collection.mutable
import scala.language.higherKinds
/**
* Copyright (c) 2017 A. Roberto Fische... | robertoFischer/hackerrank | src/main/scala/HackerRank/Training/BasicProgramming/MigratoryBirds.scala | Scala | mit | 8,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 ... | bhoppi/zen | ml/src/main/scala/com/github/cloudml/zen/ml/neuralNetwork/AdaDeltaUpdater.scala | Scala | apache-2.0 | 2,857 |
package scala.reflect
package object internal {
val Flags = scala.tools.nsc.symtab.Flags
}
| spray/twirl | twirl-compiler/src/main/scala-2.9.2/scala/reflect/internal/package.scala | Scala | apache-2.0 | 94 |
/*
* 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 ... | pronix/spark | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/mathExpressions.scala | Scala | apache-2.0 | 29,012 |
/*
* Copyright (C) 2009-2017 Lightbend Inc. <https://www.lightbend.com>
*/
package scalaguide.advanced.routing
import controllers.Assets
import org.specs2.mutable.Specification
import play.api.test.{FakeRequest, WithApplication}
class ScalaSirdRouter extends Specification {
//#imports
import play.api.mvc._
i... | wsargent/playframework | documentation/manual/working/scalaGuide/advanced/routing/code/ScalaSirdRouter.scala | Scala | apache-2.0 | 5,231 |
package util.tasks
/**
* Abstract task
* Created by CAB on 20.10.2014.
*/
abstract class Task (val priority:Int) {
def execute():Unit}
| AlexCAB/FreelanceAnalytics | src/util/tasks/Task.scala | Scala | mit | 142 |
package wav.web.muiwrapper
import scala.scalajs.js.{Object, Dynamic, native}
trait Mui extends Object {
val AppBar: ReactComponent = native
val AppCanvas: ReactComponent = native
val Avatar: ReactComponent = native
val Checkbox: ReactComponent = native
val CircularProgress: ReactComponent = native
val Cle... | dsugden/material-ui-scalajs-react | src/main/scala/wav/web/muiwrapper/Mui.scala | Scala | apache-2.0 | 2,446 |
/*
* 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... | travisbrown/scalatest | src/main/scala/org/scalatest/words/ResultOfAWordToAMatcherApplication.scala | Scala | apache-2.0 | 1,066 |
import sbt._
import Keys._
object PomTest extends Build
{
lazy val custom = config("custom")
lazy val root = Project("root", file("root")) configs(custom) settings(
TaskKey[Unit]("check-pom") <<= checkPom,
libraryDependencies ++= Seq(
"a" % "a" % "1.0",
"b" % "b" % "1.0" % "runtime,optional",
"c" % "c" ... | kuochaoyi/xsbt | sbt/src/sbt-test/dependency-management/pom-scope/project/PomTest.scala | Scala | bsd-3-clause | 1,822 |
package com.peterpotts.snake.mapreduce
import com.peterpotts.snake.predicate.Extractor
case class ExtractorMap[T](keyExtractor: Map[String, Extractor[T]], valueExtractor: Extractor[T])
extends MapFunction[T, Map[String, Any], Any] {
def apply(argument: T) = Traversable(keyExtractor.mapValues(_(argument)) -> value... | peterpotts/snake | src/main/scala/com/peterpotts/snake/mapreduce/ExtractorMap.scala | Scala | mit | 408 |
package com.raquo.xstream
class TupleStreamWith3And1[+A, +B, +C, +D] (
val tupleStream: XStream[((A, B, C), D)]
) extends AnyVal {
@inline def map4[U](project: (A, B, C, D) => U): XStream[U] = {
tupleStream.jsMap((tuple: ((A, B, C), D)) => project(tuple._1._1, tuple._1._2, tuple._1._3, tuple._2))
}
@inli... | raquo/XStream.scala | src/main/scala/com/raquo/xstream/TupleStreamWith3And1.scala | Scala | mit | 712 |
package com.github.britter.restfulpersons.scalafinatra
import com.twitter.finatra.{Controller, FinatraServer}
import com.twitter.util.Future
import org.json4s.JValue
import org.json4s.JsonAST.{JObject, JString}
import org.json4s.native.JsonMethods._
class PersonController(repository: PersonRepository) extends Control... | britter/restful-persons | scala-finatra/src/main/scala/com/github/britter/restfulpersons/scalafinatra/App.scala | Scala | mit | 1,556 |
/*
* Distributed as part of Scalala, a linear algebra library.
*
* Copyright (C) 2008- Daniel Ramage
*
* This library 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 ... | scalala/Scalala | src/main/scala/scalala/tensor/generic/TensorPairsMonadic.scala | Scala | lgpl-2.1 | 3,620 |
implicit def stateMonad[S] = new Monad[State[S, ?]] {
def flatMap[A, B](sa: State[S, A])(k: A => State[S, B]): State[S, B] =
State { s =>
val (a, s1) = runState(sa)(s)
runState(k(a))(s1)
}
def pure[A](a: A): State[S, A] = State(s => (a, s))
} | hmemcpy/milewski-ctfp-pdf | src/content/3.5/code/scala/snippet19.scala | Scala | gpl-3.0 | 269 |
package com.gu.notifications.worker.delivery.fcm.oktransport
import com.google.api.client.http.{HttpTransport, LowLevelHttpRequest}
import okhttp3.{Dns, OkHttpClient}
import scala.jdk.CollectionConverters._
import scala.util.Random
class OkGoogleHttpTransport extends HttpTransport {
private val okHttpClient = new... | guardian/mobile-n10n | notificationworkerlambda/src/main/scala/com/gu/notifications/worker/delivery/fcm/oktransport/OkGoogleHttpTransport.scala | Scala | apache-2.0 | 807 |
package no.uio.musit.repositories
import no.uio.musit.MusitResults.{MusitDbError, MusitResult, MusitValidationError}
import no.uio.musit.models.MusitSlickClientError
import play.api.Logger
import scala.util.control.NonFatal
trait DbErrorHandlers {
private val logger = Logger(classOf[DbErrorHandlers])
def nonFa... | MUSIT-Norway/musit | musit-service/src/main/scala/no/uio/musit/repositories/DbErrorHandlers.scala | Scala | gpl-2.0 | 740 |
package org.openmole.tool.collection
case class DoubleRange(low: Double, high: Double, step: Double, inclusive: Boolean) extends Iterable[Double] {
def by(ns: Double) = copy(step = ns)
override def iterator: Iterator[Double] =
if (inclusive) BigDecimal(low) to high by step map (_.toDouble) iterator
else B... | openmole/openmole | openmole/third-parties/org.openmole.tool.collection/src/main/scala/org/openmole/tool/collection/DoubleRange.scala | Scala | agpl-3.0 | 530 |
package com.github.sparkfy.util
import java.util.regex.Pattern
/**
* Created by yellowhuang on 2015/10/14.
*/
class MapConfWrapper(val conf: Map[String, String]) {
private final val avroNamespace = "avro.schema."
/** Get a parameter; throws a NoSuchElementException if it's not set */
private[this] def get(k... | sparkfy/sparkfy | sparkfy-common/src/main/scala/com/github/sparkfy/util/MapConfWrapper.scala | Scala | apache-2.0 | 4,751 |
package composing_methods
/**
* Created by lingx on 2015/10/27.
*/
class RemoveAssignmentsToParameters {
}
| zj-lingxin/refactoring | src/main/scala/composing_methods/RemoveAssignmentsToParameters.scala | Scala | mit | 111 |
package au.gov.dva.sopapi.veaops
import java.time.LocalDate
import java.time.format.DateTimeFormatter
import scala.collection.immutable
import scala.util.matching.Regex
object VeaDeserialisationUtils {
def specifiedAreas(specifiedAreasNode: scala.xml.Node): List[SpecifiedArea] =
(specifiedAreasNode \\ "speci... | govlawtech/dva-sop-api | app/src/main/scala/au/gov/dva/sopapi/veaops/VeaDeserialisationUtils.scala | Scala | apache-2.0 | 4,799 |
package mr.merc.map.objects
import mr.merc.map.objects.view.{MapObjectView, OneImageMapObjectView}
abstract class MapObject(val name:String) {
val view:MapObjectView
}
abstract class OneImageMapObject(name: String) extends MapObject(name) {
@transient override lazy val view: MapObjectView = new OneImageMapObjectV... | RenualdMarch/merc | src/main/scala/mr/merc/map/objects/MapObject.scala | Scala | gpl-3.0 | 337 |
/* DO NOT EDIT THIS FILE - it is machine generated */
/* Copyright 2017-19, Emmanouil Antonios Platanios. 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
*
* h... | eaplatanios/tensorflow_scala | modules/jni/src/main/scala/org/platanios/tensorflow/jni/generated/tensors/Math.scala | Scala | apache-2.0 | 10,313 |
package org.hibernate.cache.rediscala.serializer
import java.util.Date
import org.hibernate.cache.rediscala.domain.{Event, Person}
import org.scalameter.{Gen, PerformanceTest}
import org.scalatest.junit.AssertionsForJUnit
/**
* SerializerBenchmark
* @author Sunghyouk Bae
*/
object SerializerBenchmark extends Perf... | debop/debop4s | hibernate-rediscala/src/test/scala/org/hibernate/cache/rediscala/serializer/SerializerBenchmark.scala | Scala | apache-2.0 | 1,989 |
package truerss.clients
import scalaj.http.{Http, MultiPart}
import zio.Task
class OpmlApiHttpClient(baseUrl: String) extends BaseHttpClient(baseUrl) {
import JsonSupport._
protected val opmlUrl = s"$baseUrl/$api/opml"
protected val defaultName = "import"
protected val defaultFileName = "import"
def imp... | truerss/truerss | clients/src/main/scala/truerss/clients/OpmlApiHttpClient.scala | Scala | mit | 577 |
package com.twitter.finagle.toggle
/**
* `Toggles` are used for modifying behavior without changing code.
*
* @see [[http://martinfowler.com/articles/feature-toggles.html Feature Toggles]]
* for detailed discussion on the topic.
* @see [[ToggleMap]]
*/
abstract class Toggle[-T] extends PartialFunction[T, Bo... | sveinnfannar/finagle | finagle-toggle/src/main/scala/com/twitter/finagle/toggle/Toggle.scala | Scala | apache-2.0 | 3,641 |
/**
* Copyright (C) 2015-2016 DANS - Data Archiving and Networked Services (info@dans.knaw.nl)
*
* 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/license... | vesaakerman/easy-sword2 | src/main/scala/nl/knaw/dans/api/sword2/servlets/StatementServletImpl.scala | Scala | apache-2.0 | 1,073 |
package uk.gov.homeoffice.spray
import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.Future
import scala.pickling.Defaults._
import scala.pickling.json._
import scala.util.{Failure, Success, Try}
import spray.http.MediaTypes._
import spray.http.StatusCodes._
import spray.http.{HttpEntity, ... | UKHomeOffice/rtp-akka-lib | src/main/scala/uk/gov/homeoffice/spray/Marshallers.scala | Scala | mit | 2,863 |
package org.jetbrains.plugins.scala
package annotator
import org.intellij.lang.annotations.Language
import org.jetbrains.plugins.scala.base.SimpleTestCase
import org.jetbrains.plugins.scala.extensions._
import org.jetbrains.plugins.scala.lang.psi.api.ScalaFile
import org.jetbrains.plugins.scala.lang.psi.api.base.ScCon... | triggerNZ/intellij-scala | test/org/jetbrains/plugins/scala/annotator/ConstructorAnnotatorTest.scala | Scala | apache-2.0 | 3,570 |
package at.logic.gapt.utils.executionModels
import at.logic.gapt.utils.logging.Logger
import scala.concurrent._
import scala.concurrent.duration._
package timeout {
class TimeOutException( cause: Throwable, val duration: Duration )
extends Exception( s"Timeout of $duration exceeded.", cause )
/**
* runs f... | loewenheim/gapt | src/main/scala/at/logic/gapt/utils/executionModels/timeout.scala | Scala | gpl-3.0 | 1,776 |
/** Copyright 2015 TappingStone, 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 ... | nvoron23/PredictionIO | core/src/main/scala/controller/Params.scala | Scala | apache-2.0 | 1,288 |
/***********************************************************************
* Copyright (c) 2013-2018 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... | jahhulbert-ccri/geomesa | geomesa-utils/src/main/scala/org/locationtech/geomesa/utils/stats/TopK.scala | Scala | apache-2.0 | 2,393 |
package com.whisk.docker
import com.whisk.docker.scalatest.DockerTestKit
import org.scalatest._
import org.scalatest.concurrent.ScalaFutures
import org.scalatest.time._
class Neo4jServiceSpec extends FlatSpec with Matchers with BeforeAndAfterAll with GivenWhenThen with ScalaFutures
with DockerTestKit with DockerN... | AdAgility/docker-it-scala | scalatest/src/test/scala/com/whisk/docker/Neo4jServiceSpec.scala | Scala | mit | 1,216 |
/*
* 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 ... | actuaryzhang/spark | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala | Scala | apache-2.0 | 137,822 |
/* * 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 agree... | dotty-staging/scalatest | examples/src/test/scala/org/scalatest/examples/funspec/note/SetSpec.scala | Scala | apache-2.0 | 1,116 |
object Test {
def main(args: Array[String]): Unit = {
import java.io._
val bytes = new ByteArrayOutputStream()
val out = new ObjectOutputStream(bytes)
out.writeObject(())
out.close()
val buf = bytes.toByteArray
val in = new ObjectInputStream(new ByteArrayInputStream(buf))
val unit = i... | folone/dotty | tests/pending/run/t6935.scala | Scala | bsd-3-clause | 364 |
/*
* Copyright 2017 Datamountaineer.
*
* 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... | datamountaineer/stream-reactor | kafka-connect-cassandra/src/test/scala/com/datamountaineer/streamreactor/connect/cassandra/sink/Output.scala | Scala | apache-2.0 | 2,660 |
package io.skyfii.mandrill.service
import java.util.UUID
import io.skyfii.mandrill.model.{Message, Recipient, ToType}
import org.joda.time.DateTime
import org.scalatest._
import scala.concurrent.duration._
import scala.concurrent.{Await, Future}
class MandrillApiV1Test extends FunSpec with ShouldMatchers {
trait... | skyfii/skyfii-mandrill | src/test/scala/io/skyfii/mandrill/service/MandrillApiV1Test.scala | Scala | apache-2.0 | 5,102 |
package at.bioinform.webapp.db
trait TableDefinitions {
import slick.jdbc.H2Profile.api._
import slick.lifted.Tag
val sequences = TableQuery[Sequences]
val insertLuceneIndex = sequences returning sequences.map(e => e.id) into ((index, id) => index.copy(_1 = id))
val schema = DBIO.seq(sequences.schema.cre... | peri4n/bIO | subprojects/webapp/src/main/scala/at/bioinform/webapp/db/TableDefinitions.scala | Scala | apache-2.0 | 601 |
/*****************************************
Emitting Generated Code
*******************************************/
class Snippet extends ((java.lang.String)=>(Unit)) {
def apply(x0:java.lang.String): Unit = {
val x1 = println("Phrase,Year,MatchCount,VolumeCount")
val x2 = new scala.lms.tutorial.Scanner(x0)
v... | RomanTsegelskyi/lms-truffle | src/out/query_t1gram1.check.scala | Scala | gpl-2.0 | 698 |
package amphip.stoch
import org.junit.Assert._
import org.junit.Test
import amphip.dsl._
import amphip.model.syntax.{ model => smodel } // `model' method clashes with package `amphip.model'
import amphip.model.ast._
class TestSeparate {
@Test
def test(): Unit = {
val gen = newGen
val S = set("S")
... | gerferra/amphip | core/src/test/scala/amphip/stoch/TestSeparate.scala | Scala | mpl-2.0 | 6,646 |
/**
* Copyright (c) 2013, The National Archives <digitalpreservation@nationalarchives.gov.uk>
* https://www.nationalarchives.gov.uk
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://moz... | adamretter/csv-validator | csv-validator-core/src/test/scala/uk/gov/nationalarchives/csv/validator/schema/v1_0/SchemaParserColumnDefinitionsSpecs.scala | Scala | mpl-2.0 | 10,141 |
package com.datastax.driver.spark.writer
import java.nio.ByteBuffer
import java.util.Date
import org.junit.Assert._
import org.junit.Test
class ObjectSizeEstimatorTest {
@Test
def testFunctionality() {
val size0 = ObjectSizeEstimator.measureSerializedSize(Array(1))
val size1 = ObjectSizeEstimator.measur... | bovigny/cassandra-driver-spark | src/test/scala/com/datastax/driver/spark/writer/ObjectSizeEstimatorTest.scala | Scala | apache-2.0 | 1,062 |
package services
import models.{Task, Work}
import scala.concurrent.Future
import scala.util.Try
/**
* Performs a tranformation job.
*/
trait Worker {
def log(offset: Int): Seq[String]
def process(tryJob: Try[Task]): Future[Try[Work]]
def addStopHook(callback: () => Unit): Unit
}
case class ProcessorEx... | kuhnuri/kuhnuri-worker | common/app/services/Worker.scala | Scala | apache-2.0 | 374 |
package com.codeseq
import spray.json._
object Spray extends JsonParser {
def parseToString(jsonStr: String): String = jsonStr.asJson.compactPrint
}
| derekwyatt/spray-json-vs-argonaut | src/main/scala/com/codeseq/Spray.scala | Scala | apache-2.0 | 153 |
package japgolly.microlibs.utils
/**
* Format a set of ints into a concise textual description.
*
* Example:
* "2, 5, 7-14, 20"
*/
object ConciseIntSetFormat {
private sealed trait Tmp
private final case class N(n: Int) extends Tmp
private final case class R(from: Int, to: Int) extends Tmp
def apply(i... | japgolly/microlibs-scala | utils/shared/src/main/scala/japgolly/microlibs/utils/ConciseIntSetFormat.scala | Scala | apache-2.0 | 1,017 |
/*
* Copyright 2021 HM Revenue & Customs
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or a... | hmrc/ct-calculations | src/test/scala/uk/gov/hmrc/ct/accounts/frs102/boxes/AC130Spec.scala | Scala | apache-2.0 | 1,002 |
package com.esri.spark
/**
* http://en.wikipedia.org/wiki/Algorithms_for_calculating_variance#On-line_algorithm
*/
class WeightedStatCounter(values: TraversableOnce[WeightedValue]) extends Serializable {
private var sumWeights: Double = 0.0
private var mu: Double = 0.0
private var m2: Double = 0.0
private v... | mraad/spark-stat | src/main/scala/com/esri/spark/WeightedStatCounter.scala | Scala | apache-2.0 | 2,131 |
package scalan
trait Monoids { self: Scalan =>
case class RepMonoid[A](opName: String, zero: Rep[A], append: Rep[((A, A)) => A], isCommutative: Boolean)(implicit val eA: Elem[A]) {
override def toString = repMonoid_toString(this)
// avoids having to write monoid.append((x, y))
def append(x: Rep[A], y: Re... | PCMNN/scalan-ce | core/src/main/scala/scalan/Monoids.scala | Scala | apache-2.0 | 2,082 |
/*
This file is part of Octetoscope.
Copyright (C) 2013, 2015 Octetoscope contributors (see /AUTHORS.txt)
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... | SpecLad/Octetoscope | presentation/src/main/scala/ru/corrigendum/octetoscope/presentation/DialogBoxerImpl.scala | Scala | gpl-3.0 | 1,019 |
/***********************************************************************
* Copyright (c) 2013-2019 Commonwealth Computer Research, Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Apache License, Version 2.0
* which accompanies this distribution and... | elahrvivaz/geomesa | geomesa-kafka/geomesa-kafka-datastore/src/main/scala/org/locationtech/geomesa/kafka/index/KafkaFeatureCacheImpl.scala | Scala | apache-2.0 | 5,629 |
/* __ *\\
** ________ ___ / / ___ Scala API **
** / __/ __// _ | / / / _ | (c) 2003-2018, LAMP/EPFL **
** __\\ \\/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\\___/_/... | ashawley/scala-xml | shared/src/main/scala/scala/xml/parsing/MarkupParserCommon.scala | Scala | bsd-3-clause | 8,337 |
package skinny.oauth2.client.github
import skinny.logging.LoggerProvider
import skinny.oauth2.client._
import skinny.json.JSONStringOps
import scala.util.control.NonFatal
/**
* GitHub API client.
*/
trait GitHubAPI extends LoggerProvider {
def user(token: OAuth2Token): Option[GitHubUser] = {
try {
val ... | holycattle/skinny-framework | oauth2/src/main/scala/skinny/oauth2/client/github/GitHubAPI.scala | Scala | mit | 773 |
/**
* 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/UnlabeledLoadStatistics.scala | Scala | mit | 594 |
package scommons.client.ui.select
case class SelectData(value: String, label: String)
| viktor-podzigun/scommons | ui/src/main/scala/scommons/client/ui/select/SelectData.scala | Scala | apache-2.0 | 87 |
/*
* Copyright 2017 Exon IT
*
* 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 w... | exon-it/redmine-scala-client | client-core/src/main/scala/by/exonit/redmine/client/managers/impl/RedmineManagerImpl.scala | Scala | apache-2.0 | 2,432 |
package com.chobostudy.datastructure
/**
* @author loustler
* @since 09/07/2017 00:01
*/
sealed trait Tree[+A]
case class Leaf[A](value: A) extends Tree[A]
case class Branch[A](left: Tree[A], right: Tree[A]) extends Tree[A]
object Tree
| codechobostudy/FPIS | src/main/scala/com/chobostudy/datastructure/Tree.scala | Scala | apache-2.0 | 244 |
package worker
import java.util.UUID
import scala.concurrent.duration._
import akka.actor.Actor
import akka.actor.ActorLogging
import akka.actor.ActorRef
import akka.actor.Props
import akka.actor.ReceiveTimeout
import akka.actor.Terminated
import akka.contrib.pattern.ClusterClient.SendToAll
import akka.actor.OneForOne... | alanktwong/typesafe_activators | akka-distributed-workers/src/main/scala/worker/Worker.scala | Scala | mit | 3,158 |
package io.youi.stream.delta
import io.youi.stream.{HTMLStream, Selector, Tag}
class InsertBefore(val selector: Selector, val content: () => String) extends Delta {
override def apply(streamer: HTMLStream, tag: Tag.Open): Unit = {
streamer.insert(tag.start, content())
}
}
| outr/youi | stream/src/main/scala/io/youi/stream/delta/InsertBefore.scala | Scala | mit | 283 |
package pattern.math
import pattern.{Pattern, P2}
/*
+1>> This source code is licensed as GPLv3 if not stated otherwise.
>> NO responsibility taken for ANY harm, damage done
>> to you, your data, animals, etc.
>>
+2>>
>> Last modified: 2013-10-29 :: 20:37
>> Origin: patterns
>>
+3... | lodsb/patterns | src/main/scala/pattern/math/Div.scala | Scala | gpl-3.0 | 753 |
package org.orbeon.oxf.xforms.event
import java.{util => ju}
import cats.Eval
import org.orbeon.dom.io.XMLWriter
import org.orbeon.oxf.common.OXFException
import org.orbeon.oxf.externalcontext.{ExternalContext, URLRewriter}
import org.orbeon.oxf.externalcontext.ExternalContext.Response
import org.orbeon.oxf.http.{Http... | orbeon/orbeon-forms | xforms-runtime/shared/src/main/scala/org/orbeon/oxf/xforms/event/XFormsServer.scala | Scala | lgpl-2.1 | 31,833 |
package models.queries
import java.util.UUID
import jdub.async.{ FlatSingleRowQuery, Row, Statement }
import jdub.async.queries.BaseQueries
import models.contests.{ Submission }
import org.joda.time.LocalDate
object SubmissionQueries extends BaseQueries[Submission] {
override protected val tableName = "submissio... | rynmccrmck/thunderdome | app/models/queries/SubmissionQueries.scala | Scala | apache-2.0 | 2,081 |
package vggames.scala.specs.whileloop
import vggames.scala.specs.GameSpecification
import vggames.scala.code.RestrictedFunction0
import vggames.scala.specs.TestRun
class SomaArray extends GameSpecification[RestrictedFunction0[Int]] {
def runSignature = ":Int"
def extendsType = "RestrictedFunction0[Int]"
ov... | rustaeja/rustaeja-project-8273 | games/scala/src/main/scala/vggames/scala/specs/whileloop/SomaArray.scala | Scala | gpl-3.0 | 1,062 |
package cpup.mc.lib.content
import net.minecraft.block.Block
import cpup.mc.lib.{CPupModHolder, CPupModRef, CPupMod}
trait CPupBlock[MOD <: CPupMod[_ <: CPupModRef]] extends Block { self: CPupModHolder[MOD] =>
protected var _name: String = null
def name = _name
def name_=(newName: String) = {
setName(newName)
... | CoderPuppy/cpup-mc | src/main/scala/cpup/mc/lib/content/CPupBlock.scala | Scala | mit | 713 |
package org.http4s
package headers
object `Access-Control-Request-Headers` extends HeaderKey.Default
| ZizhengTai/http4s | core/src/main/scala/org/http4s/headers/Access-Control-Request-Headers.scala | Scala | apache-2.0 | 103 |
/*
* 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/deploy/master/MasterArguments.scala | Scala | apache-2.0 | 3,772 |
/*
* Copyright (C) 2014 - 2016 Softwaremill <http://softwaremill.com>
* Copyright (C) 2016 - 2019 Lightbend Inc. <http://www.lightbend.com>
*/
package akka.kafka
import akka.NotUsed
import org.apache.kafka.clients.producer.{ProducerRecord, RecordMetadata}
import scala.collection.immutable
import scala.jdk.Collect... | softwaremill/reactive-kafka | core/src/main/scala/akka/kafka/ProducerMessage.scala | Scala | apache-2.0 | 9,006 |
/*
* 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 ... | spark-test/spark | sql/catalyst/src/main/scala/org/apache/spark/sql/connector/catalog/CatalogV2Implicits.scala | Scala | apache-2.0 | 5,082 |
package scala.tools.escape
import scala.util.escape._
import scala.offheap._
import org.junit.Test
import org.junit.Assert.assertEquals
class RegionMallocSuite extends CompilerTesting {
trait Data[T] {
def size: Long
def apply(i: Long)(implicit @local cc: T): Long
def update(i: Long, x:Long)(implicit @... | TiarkRompf/scala-escape | library/src/test/scala/scala/tools/escape/Offheap.scala | Scala | bsd-3-clause | 5,932 |
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2015-2021 Andre White.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE... | adarro/ddo-calc | subprojects/common/ddo-core/src/main/scala/io/truthencode/ddo/model/feats/EnlargeSpell.scala | Scala | apache-2.0 | 1,176 |
case class One() derives CanEqual
case class Two() derives CanEqual
given CanEqual[One, Two] = CanEqual.derived
enum Lst[T] derives CanEqual {
case Cons(x: T, xs: Lst[T])
case Nil()
}
case class Triple[S, T, U]() derives CanEqual
object Test extends App {
implicitly[CanEqual[Lst[Lst[One]], Lst[Lst[Two]]]]
... | dotty-staging/dotty | tests/neg/derive-eq.scala | Scala | apache-2.0 | 638 |
/**
* 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... | martinluther/orbeon-forms | src/main/scala/org/orbeon/oxf/fr/FormRunnerHome.scala | Scala | lgpl-2.1 | 12,187 |
/*
* 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/test/scala/com/intel/analytics/bigdl/torch/BatchNormalizationSpec.scala | Scala | apache-2.0 | 14,343 |
package org.corecdd.example
import org.cddcore.engine.Project
import org.cddcore.example.customerCategorisation.CategorisePerson
import org.cddcore.example.processCheque_DM_Xml.ProcessChequeXml
import org.cddcore.example.tennisScore.TennisScorer
import org.corecdd.website.AbstractWebsiteTest
import org.corecdd.websi... | phil-rice/cddexamples | src/test/scala/org/corecdd/example/ExampleWebsiteTest.scala | Scala | bsd-2-clause | 3,412 |
/* Copyright 2009-2015 EPFL, Lausanne
*
* Author: Ravi
* Date: 20.11.2013
**/
import leon.lang._
import leon.collection._
object Heaps {
sealed abstract class Heap {
val rank : BigInt = this match {
case Leaf() => 0
case Node(_, l, r) =>
1 + max(l.rank, r.rank)
}
def content :... | regb/leon | testcases/synt2016/repair/Heap/Heap8.scala | Scala | gpl-3.0 | 2,976 |
/*
* RequestHandler.scala
*
* Updated: Oct 23, 2014
*
* Copyright (c) 2014, CodeMettle
*/
package com.codemettle.akkasolr
package client
import java.{lang => jl}
import org.apache.solr.client.solrj.impl.{BinaryResponseParser, StreamingBinaryResponseParser, XMLResponseParser}
import org.apache.solr.client.solrj.... | CodeMettle/akka-solr | src/main/scala/com/codemettle/akkasolr/client/RequestHandler.scala | Scala | apache-2.0 | 12,371 |
/*
* Copyright (C) 2010 Mikhail Vorozhtsov
*
* 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... | mvv/beans-scalac-plugin | src/BeansPlugin.scala | Scala | apache-2.0 | 7,882 |
class C(var a: Any) {
/*resolved: true*/a = 0
} | ilinum/intellij-scala | testdata/resolve2/bug2/SCL3104.scala | Scala | apache-2.0 | 49 |
package ozmi.lambda_core
import org.kiama.util.TreeNode
/** Base trait for expression tree nodes.
*
* Implements Kiama's TreeNode which is mostly used for attribution.
*/
sealed abstract class Expr extends TreeNode
trait Value extends Expr
/** Lookup is used to refer to any external resources in the execution... | ozmi/lambda_core | src/main/scala/ozmi/lambda_core/Expr.scala | Scala | mit | 4,588 |
package io.flow.lint
import io.apibuilder.spec.v0.models._
import org.scalatest.funspec.AnyFunSpec
import org.scalatest.matchers.should.Matchers
class ProxyQueryParametersSpec extends AnyFunSpec with Matchers {
private[this] val linter = linters.ProxyQueryParameters
def buildService(
paramName: String
): ... | flowcommerce/api-lint | src/test/scala/io/flow/lint/ProxyQueryParametersSpec.scala | Scala | mit | 1,374 |
/*
* Copyright (C) 2017 Vincibean <Andrea Bessi>
*
* 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.
*
* Thi... | Vincibean/ScalaForTheImpatient-Solutions | src/main/scala/org/vincibean/scala/impatient/chapter14/exercise1/package.scala | Scala | gpl-3.0 | 2,110 |
import sbt._
import Keys._
import PlayProject._
object ApplicationBuild extends Build {
val appName = "helloworld"
val appVersion = "1.0"
val appDependencies = Seq()
val main = PlayProject(appName, appVersion, appDependencies, mainLang = JAVA)
}
| trask/glowroot | agent/plugins/play-plugin/src/test/app-2.0.x-java/project/Build.scala | Scala | apache-2.0 | 279 |
package feh.tec.util
class NumericProxy[N: Numeric, T](extract: T => N, build: N => T) extends Numeric[T]{
val underlying = implicitly[Numeric[N]]
def plus(x: T, y: T): T = build(underlying.plus(extract(x), extract(y)))
def minus(x: T, y: T): T = build(underlying.minus(extract(x), extract(y)))
def times(x: T, ... | fehu/agent-tareas | agent/src/main/scala/feh/tec/util/NumericProxy.scala | Scala | mit | 808 |
/*
* Copyright 2015 IBM Corp.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed ... | yeghishe/spark-kernel | kernel/src/main/scala/com/ibm/spark/kernel/protocol/v5/handler/InputRequestReplyHandler.scala | Scala | apache-2.0 | 2,886 |
package models
import java.sql.Timestamp
import com.github.rjeschke.txtmark
import org.joda.time.DateTime
case class Post(
id: Long,
title: String,
slug: String,
content: String,
publishDate: Timestamp
) {
lazy val html = txtmark.Processor.process(content)
lazy val month: Int = new DateTime(publishDate... | vjousse/play2-blog | app/models/Models.scala | Scala | mit | 544 |
import spray.http.HttpHeaders.RawHeader
import spray.http.{MediaType, MediaTypes}
import spray.routing.directives.HeaderDirectives.headerValuePF
/**
* Created by ivannagy on 4/9/15.
*/
package object logreceiver {
val `application/logplex-1` = MediaTypes.register(MediaType.custom("application", "logplex-1", true,... | vonnagy/log-receiver | src/main/scala/logreceiver/package.scala | Scala | apache-2.0 | 818 |
package org.janzhou.LSH
/**
* Abstract LSH. Take Iterable data as input. Generate a Long HASH value.
* Implemented by [[HyperplaneLSH]], [[RepeatingLSH]] and [[MappingLSH]].
*/
abstract class LSH[T <% Number[T]] {
def apply(data:Iterable[T]):Long
}
/**
* Abstract SignatureLSH. Take Iterable data as input. Gener... | janzhou/scala-lsh | src/main/scala/org/janzhou/lsh/AbstractLSH.scala | Scala | mit | 581 |
/**
* Created by Chongguang on 2016/12/16.
*/
import org.scalatest._
import december2016.Day16._
class Day10Spec extends FlatSpec with Matchers {
"generateData: 1" should "become 100" in {
generateData(List(1),3) === List(1,0,0)
}
"generateData: 0" should "become 001" in {
generateData(List(0),3) ... | chongguang/adventofcode | src/test/scala/Day16Spec.scala | Scala | mit | 1,216 |
package com.rasterfoundry.database
import com.rasterfoundry.database.Implicits._
import com.rasterfoundry.datamodel._
import doobie._
import doobie.implicits._
import doobie.postgres.implicits._
import java.util.UUID
object TileLayerDao extends Dao[TileLayer] {
val tableName = "tiles"
override val fieldNames =... | raster-foundry/raster-foundry | app-backend/db/src/main/scala/TileLayerDao.scala | Scala | apache-2.0 | 1,949 |
/*
* Licensed to Elasticsearch under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this fi... | huangll/elasticsearch-hadoop | spark/core/itest/scala/org/elasticsearch/spark/integration/AbstractScalaEsSpark.scala | Scala | apache-2.0 | 14,598 |
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2015-2021 Andre White.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE... | adarro/ddo-calc | subprojects/common/ddo-core/src/main/scala/io/truthencode/ddo/model/feats/NimbleFingers.scala | Scala | apache-2.0 | 1,298 |
/*
* 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/responsiblepeople/address/AdditionalExtraAddressController.scala | Scala | apache-2.0 | 4,705 |
/*
* Copyright 2014 Frédéric Cabestre
*
* 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... | butaji/JetMQ | core/src/main/scala/net/sigusr/mqtt/impl/frames/RemainingLengthCodec.scala | Scala | mit | 2,073 |
package slick.migration
/**
* Created by Iliya Tryapitsin on 28/01/15.
*/
class CanConcatMigrationsLow {
implicit def default[A <: Migration, B <: Migration]: CanConcatMigrations[A, B, MigrationSeq] =
new CanConcatMigrations({
case (MigrationSeq(as @ _*), b) => MigrationSeq(as :+ b: _*)
case (a, b)... | itryapitsin/slick-migration | core/src/main/scala/slick/migration/CanConcatMigrationsLow.scala | Scala | apache-2.0 | 372 |
package chrome.webRequest.bindings
import scala.scalajs.js
import scala.scalajs.js.annotation.JSName
@js.native
trait ResourceRequest extends js.Object {
val url: String = js.native
/**
* The ID of the request. Request IDs are unique within a browser session. As a result, they could be used to
* relate ... | lucidd/scala-js-chrome | bindings/src/main/scala/chrome/webRequest/bindings/ResourceRequest.scala | Scala | mit | 1,428 |
/**
* Created on February 26, 2011
* Copyright (c) 2011, Wei-ju Wu
* 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
* ... | weiju/adf-tools | adf-core/src/main/scala/org/dmpp/adf/logical/FileHeaderBlock.scala | Scala | bsd-3-clause | 4,238 |
package redis.commands
import redis._
import scala.concurrent.Await
import redis.actors.{InvalidRedisReply, ReplyErrorException}
import redis.api.NOSAVE
class ServerSpec extends RedisStandaloneServer {
sequential
"Server commands" should {
"BGSAVE" in {
Await.result(redis.bgsave(), timeOut) mustEqual... | etaty/rediscala | src/test/scala/redis/commands/ServerSpec.scala | Scala | apache-2.0 | 3,622 |
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.