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 troy
package cql.parser.dml
import troy.cql.ast.CqlParser._
import troy.cql.ast.InsertStatement
import troy.cql.ast.dml.Insert
trait InsertStatementParser {
def insertStatement: Parser[InsertStatement] = {
import Insert._
def into = "INTO" ~> tableName
def insertClause: Parser[InsertClause] = ... | schemasafe/troy | cql-parser/src/main/scala/troy/cql/parser/dml/InsertStatementParser.scala | Scala | apache-2.0 | 984 |
package eu.timepit.refined.scalacheck
import eu.timepit.refined.W
import eu.timepit.refined.api.Refined
import eu.timepit.refined.collection.NonEmpty
import eu.timepit.refined.scalacheck.any._
import eu.timepit.refined.string.MatchesRegex
import org.scalacheck.Properties
class AnyArbitrarySpec extends Properties("Any... | fthomas/refined | modules/scalacheck/shared/src/test/scala-3.0-/eu/timepit/refined/scalacheck/AnyArbitrarySpec.scala | Scala | mit | 523 |
/*
* 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 ... | nchammas/spark | sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/optimizer/UnwrapCastInBinaryComparisonSuite.scala | Scala | apache-2.0 | 16,448 |
package play.api.libs.json
import concurrent.{Await, Future, ExecutionContext}
import java.util.concurrent.Executors
import concurrent.duration.Duration
/**
* Performance test for JsValue serialization and deserialization.
*
* Very crude, but does the job. Easiest way to run this is in SBT:
*
* test:run-main pl... | michaelahlers/team-awesome-wedding | vendor/play-2.2.1/framework/src/play-json/src/test/scala/play/api/libs/json/JsonPerformanceTest.scala | Scala | mit | 3,514 |
package io.github.hamsters
import org.scalacheck.Prop.forAll
import org.scalacheck.{Arbitrary, Properties}
import scala.reflect._
class BooleanMonoidLaws extends MonoidLaws[Boolean](Monoid.booleanMonoid)
class IntMonoidLaws extends MonoidLaws[Int](Monoid.intMonoid)
class LongMonoidLaws extends MonoidLaws[Long](Monoi... | dgouyette/hamsters | shared/src/test/scala/io/github/hamsters/MonoidLaws.scala | Scala | apache-2.0 | 1,651 |
package com.sksamuel.scapegoat.inspections
import com.sksamuel.scapegoat.{Levels, Inspection, Reporter}
import scala.reflect.runtime._
/** @author Stephen Samuel */
class ParameterlessMethodReturnsUnit extends Inspection {
override def traverser(reporter: Reporter) = new universe.Traverser {
import scala.refl... | RichardBradley/scapegoat | src/main/scala/com/sksamuel/scapegoat/inspections/ParameterlessMethodReturnsUnit.scala | Scala | apache-2.0 | 715 |
package org.atnos.eff.concurrent
import scala.concurrent.Future
import scala.concurrent.duration.FiniteDuration
import scala.scalajs.js.timers._
trait Schedulers {
/**
* Default Scheduler for JavaScript
*/
def default: Scheduler = new Scheduler {
def schedule(timedout: =>Unit, duration: FiniteDuration)... | etorreborre/eff-cats | js/src/main/scala/org/atnos/eff/concurrent/Schedulers.scala | Scala | mit | 621 |
package mypipe.snapshotter
import akka.util.Timeout
import com.github.mauricio.async.db.Connection
import mypipe.{ Queries, ActorSystemSpec, DatabaseSpec, UnitSpec }
import org.scalatest.BeforeAndAfterAll
import org.slf4j.LoggerFactory
import scala.concurrent.duration._
import scala.concurrent.Await
class Snapshotte... | tramchamploo/mypipe | mypipe-snapshotter/src/test/scala/mypipe/snapshotter/SnapshotterSpec.scala | Scala | apache-2.0 | 2,664 |
package shapeless.contrib.spire
import spire.math._
import spire.algebra._
import shapeless._
import shapeless.contrib._
trait Empty {
def emptyProduct = new Order[HNil] with AbGroup[HNil] with AdditiveAbGroup[HNil] with MultiplicativeAbGroup[HNil] {
override def eqv(x: HNil, y: HNil) = true
override def ... | typelevel/shapeless-contrib | spire/src/main/scala/typeclass.scala | Scala | mit | 5,910 |
/**
* Created by alix on 5/17/17.
*/
package object exceptions {
case class RippleException() extends Exception("The Ripple Network is not responding")
case class DisconnectedException() extends Exception("Connection lost to the Ripple Network")
case class MissingTagException() extends Exception("The recip... | LedgerHQ/ledger-wallet-ripple | src/main/scala/exceptions/package.scala | Scala | mit | 812 |
package controllers.circs.report_changes
import utils.WithApplication
import controllers.mappings.Mappings
import org.specs2.mutable._
class GOtherChangeInfoFormSpec extends Specification {
val otherInfo = "This is my other info"
section("unit", models.domain.CircumstancesReportChanges.id)
"Change of circumst... | Department-for-Work-and-Pensions/ClaimCapture | c3/test/controllers/circs/report_changes/GOtherChangeInfoFormSpec.scala | Scala | mit | 1,510 |
package com.larry.da.test
/**
* Created by larry on 17/2/16.
*/
import com.cloudera.spark.hbase.HBaseContext
import org.apache.hadoop.fs.Path
import org.apache.hadoop.hbase.HBaseConfiguration
import org.apache.hadoop.hbase.client.Put
import org.apache.hadoop.hbase.util.Bytes
import org.apache.spark.SparkContext
... | larry88/spark_da | src/main/scala/com/larry/da/test/HBaseBulkPutExample.scala | Scala | gpl-2.0 | 1,855 |
/*
* 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 ... | u2009cf/spark-radar | sql/core/src/main/scala/org/apache/spark/sql/catalog/Catalog.scala | Scala | apache-2.0 | 10,765 |
package com.splicemachine.spark2.splicemachine
object ThisVersionSpecificItems {
val schema = SparkVersionSpecificItems.schemaWithoutMetadata
val jdbcBadDriverNameException = SparkVersionSpecificItems.checkTheUrl
}
| splicemachine/spliceengine | splice_spark2/src/test/spark3.1/com/splicemachine/spark2/splicemachine/ThisVersionSpecificItems.scala | Scala | agpl-3.0 | 220 |
/*
* Copyright 2013 Eike Kettner
*
* 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... | eikek/publet-sharry | src/main/scala/org/eknet/publet/sharry/lib/Sharry.scala | Scala | apache-2.0 | 2,493 |
package ca.uqam.euler.nicolas
/** What is the largest prime factor of the number 600851475143 ? */
/* Answer: 6857 */
object Problem3 {
def primes = {
def primesFrom(lastPrime: Int, knownPrimes: Seq[Int]): Stream[Int] = {
val nextPrime = Stream.from(lastPrime + 1).find(n ⇒ !knownPrimes.exists(n % _ == 0))... | nicolaspayette/project-euler | src/main/scala/ca/uqam/euler/nicolas/Problem003.scala | Scala | mit | 1,049 |
package jk_5.nailed.map
import scala.collection.immutable
import java.util.concurrent.atomic.AtomicInteger
import jk_5.nailed.map.gameloop.instructions._
import jk_5.nailed.map.gameloop.IInstruction
/**
* No description given
*
* @author jk-5
*/
object InstructionManager {
private final val instructionMap = imm... | nailed/nailed-legacy | src/main/scala/jk_5/nailed/map/InstructionManager.scala | Scala | unlicense | 1,559 |
/*
* 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 ... | akopich/spark | external/docker-integration-tests/src/test/scala/org/apache/spark/util/DockerUtils.scala | Scala | apache-2.0 | 3,040 |
import java.net.InetSocketAddress
import play.sbt.PlayRunHook
import sbt._
object Webpack {
def apply(base: File): PlayRunHook = {
object WebpackHook extends PlayRunHook {
var process: Option[Process] = None
override def beforeStarted() = {
process = Option(
Process("sh -c \'./node... | bminderh/play-react-webpack | project/Webpack.scala | Scala | apache-2.0 | 692 |
/**
* Copyright (C) 2020 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 ... | orbeon/orbeon-forms | xforms-web/src/main/scala/org/orbeon/xforms/XFormsUI.scala | Scala | lgpl-2.1 | 7,167 |
package edu.uwm.cs.pir.misc
import edu.uwm.cs.pir.spark.SparkObject._
import edu.uwm.cs.pir.strategy.Strategy._
object Constants {
val DATA_ROOT = inputDataRoot
val SAMPLES_ROOT = DATA_ROOT + "samples/"
val SAMPLE_SIFT_FEATURE_ROOT = SAMPLES_ROOT + "sift/"
val SAMPLE_IMAGES_ROOT = SAMPLES_ROOT + ... | pir-dsl/pir | core/src/main/scala/edu/uwm/cs/pir/misc/Constants.scala | Scala | gpl-2.0 | 2,570 |
package keystoneml.pipelines.images.mnist
import breeze.linalg.DenseVector
import breeze.stats.distributions.{RandBasis, ThreadLocalRandomGenerator}
import keystoneml.evaluation.MulticlassClassifierEvaluator
import keystoneml.loaders.{CsvDataLoader, LabeledData}
import keystoneml.nodes.learning.BlockLeastSquaresEstima... | amplab/keystone | src/main/scala/keystoneml/pipelines/images/mnist/MnistRandomFFT.scala | Scala | apache-2.0 | 4,338 |
package com.larry.da.parse
import org.apache.spark.SparkContext
import org.apache.spark.graphx.{Graph, Edge}
import org.apache.spark.rdd.RDD
import com.google.common.hash.Hashing.md5
import scala.collection.mutable.ArrayBuffer
/**
* Created by larry on 16/11/15.
*/
object SiteClass {
var sc : SparkContext = _
... | larry88/spark_da | src/main/scala/com/larry/da/parse/SiteClass.scala | Scala | gpl-2.0 | 6,284 |
package ru.freefry.furniture_factory.core
/**
* Order for producing furniture unit.
* @author freefry
*/
trait UnitOrder {
/** Unique id of the order */
def id: String
}
/** Produced furniture unit */
trait ProducedUnit {
/** Order for the unit */
def order: UnitOrder
/** Price of unit production */
... | freefry/furniture-factory | src/main/scala/ru/freefry/furniture_factory/core/model.scala | Scala | apache-2.0 | 738 |
package org.coursera.courier.data
import javax.annotation.Generated
import com.linkedin.data.ByteString
import com.linkedin.data.DataMap
import com.linkedin.data.DataList
import com.linkedin.data.schema.MapDataSchema
import com.linkedin.data.schema.DataSchema
import com.linkedin.data.template.DataTemplate
import co... | coursera/courier | scala/runtime/src/main/scala/org/coursera/courier/data/BooleanToStringMap.scala | Scala | apache-2.0 | 4,622 |
import org.scalatest._
class ScalaDays extends FunSuite
| xeno-by/dottyhost | tests/src/test/scala/macros/ScalaDays.scala | Scala | bsd-3-clause | 57 |
package com.github.mdr.mash.ns.os
import com.github.mdr.mash.classes.MashClass
import com.github.mdr.mash.ns.core.AnyClass
import jnr.constants.platform.linux.Signal
object SignalClass extends MashClass("os.Signal") {
override def enumerationValues: Option[Seq[String]] = Some(Signals)
val Signals = Signal.value... | mdr/mash | src/main/scala/com/github/mdr/mash/ns/os/SignalClass.scala | Scala | mit | 439 |
package algorithms.GraphAlgorithms
/**
* problem description: http://rosalind.info/problems/bip/
*/
object TestingBipartiteness {
sealed trait Color
case object Red extends Color
case object Blue extends Color
object SampleData {
val sample: List[String] =
List(
"2",
... | ghostrider77/Bioinformatics | Bioinformatics/src/main/scala-2.11/algorithms/GraphAlgorithms/TestingBipartiteness.scala | Scala | mit | 4,137 |
/**
* (c) Copyright 2013 WibiData, Inc.
*
* See the NOTICE file distributed with this work for additional
* information regarding copyright ownership.
*
* 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... | kijiproject/kiji-schema-shell | src/test/scala/org/kiji/schema/shell/util/PlusFourChild.scala | Scala | apache-2.0 | 1,441 |
package com.mesosphere.universe.v3.model
import com.mesosphere.universe
import java.nio.ByteBuffer
import org.scalatest.FreeSpec
import org.scalatest.Matchers
import scala.util.Random
class V3PackageSpec extends FreeSpec with Matchers {
val input = List(
// scalastyle:off magic.number
("pkg1", Version("1.0-... | dcos/cosmos | cosmos-test-common/src/test/scala/com/mesosphere/universe/v3/model/V3PackageSpec.scala | Scala | apache-2.0 | 2,442 |
package edu.gemini.ui.workspace.scala
import edu.gemini.ui.workspace._
class RichShellContext[A](val context:IShellContext) {
def shell:RichShell[A] = context.getShell
def title:String = sys.error("Not implemented")
def title_=(s:String) = context.setTitle(s)
def actionManager = context.getActionManager ... | arturog8m/ocs | bundle/edu.gemini.ui.workspace/src/main/scala/edu/gemini/ui/workspace/scala/RichShellContext.scala | Scala | bsd-3-clause | 378 |
import scala.reflect.macros.blackbox.Context
object Impls {
def impl(c: Context) = {
import c.universe._
println(c.fresh())
println(c.fresh("qwe"))
println(c.fresh(TypeName("qwe")))
c.abort(NoPosition, "blargh")
}
}
object Macros {
def foo = macro Impls.impl
} | yusuke2255/dotty | tests/disabled/macro/run/macro-abort-fresh/Macros_1.scala | Scala | bsd-3-clause | 288 |
package org.sofa.math
import scala.language.implicitConversions
//===================================================
object Vector {
def apply(values:Double*) = {
val result = new Vector(values.size)
result.copy(values)
result
}
def apply(other:NumberSeq) = {
val resul... | Ant01n3/ReliefExtruder | src/main/scala/org/sofa/math/Vector.scala | Scala | gpl-2.0 | 8,531 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | jackylk/incubator-carbondata | integration/spark/src/test/scala/org/apache/carbondata/spark/testsuite/booleantype/BooleanDataTypesParameterTest.scala | Scala | apache-2.0 | 12,852 |
object InfixApply {
class Query[T] {
def apply(x: T): T = x
}
def foo[A] : Query[A] = null
/*start*/InfixApply foo 1/*end*/
}
//Int | ilinum/intellij-scala | testdata/typeInference/bugs5/InfixApply.scala | Scala | apache-2.0 | 145 |
package ui.shader.builder
import ui.shader.builder.types.GlType
import ui.shader.builder.value.GlValue
class GlBraces[T <: GlType](val glValue: GlValue[T]) extends GlValue[T]{
def toGlsl: String = {
s"(${glValue.toGlsl})"
}
}
object GlBraces {
def apply[T <: GlType](glValue: GlValue[T]): GlBr... | gvatn/play-scalajs-webgl-spark | client/src/main/scala/ui/shader/builder/GlBraces.scala | Scala | mit | 368 |
package spark.scheduler
import spark._
import java.io._
import util.{MetadataCleaner, TimeStampedHashMap}
import java.util.zip.{GZIPInputStream, GZIPOutputStream}
private[spark] object ResultTask {
// A simple map between the stage id to the serialized byte array of a task.
// Served as a cache for task serializ... | baeeq/incubator-spark | core/src/main/scala/spark/scheduler/ResultTask.scala | Scala | bsd-3-clause | 3,775 |
package ch.ethz.dalab.dissolve.optimization
import breeze.linalg.Vector
import ch.ethz.dalab.dissolve.classification.StructSVMModel
trait DissolveFunctions[X, Y] extends Serializable {
def featureFn(x: X, y: Y): Vector[Double]
def lossFn(yPredicted: Y, yTruth: Y): Double
// Override either `oracleFn` or `ora... | dalab/dissolve-struct | dissolve-struct-lib/src/main/scala/ch/ethz/dalab/dissolve/optimization/DissolveFunctions.scala | Scala | apache-2.0 | 689 |
package org.bitcoins.core.crypto.words
object EnglishWordsBip39 extends MnemonicWords {
override lazy val getWords: Vector[String] = Vector(
"abandon",
"ability",
"able",
"about",
"above",
"absent",
"absorb",
"abstract",
"absurd",
"abuse",
"access",
"accident",
"a... | bitcoin-s/bitcoin-s | core/src/main/scala/org/bitcoins/core/crypto/words/EnglishWordsBip39.scala | Scala | mit | 27,602 |
package controllers
import java.nio.file.Files
import akka.stream.scaladsl.FileIO
import com.google.inject.{Inject, Singleton}
import models.document.{ArchiveAddContext, ArchiveContext, _}
import net.scalytica.symbiotic.json.Implicits.{PathFormatters, lockFormat}
import no.uio.musit.MusitResults._
import no.uio.musit... | MUSIT-Norway/musit | service_document/app/controllers/DocumentArchiveController.scala | Scala | gpl-2.0 | 11,121 |
package com.itszuvalex.itszulib.gui
import scala.collection.mutable.{ArrayBuffer, ListBuffer}
/**
* Created by Christopher Harris (Itszuvalex) on 9/3/15.
*/
trait GuiPanel extends GuiElement {
var panelWidth: Int
var panelHeight: Int
override def spaceHorizontal = panelWidth
override def spaceVertical =... | BlockWorker/ItszuLib | src/main/scala/com/itszuvalex/itszulib/gui/GuiPanel.scala | Scala | gpl-2.0 | 1,967 |
// Generated by the Scala Plugin for the Protocol Buffer Compiler.
// Do not edit!
//
// Protofile syntax: PROTO3
package com.google.protobuf.struct
/** `ListValue` is a wrapper around a repeated field of values.
*
* The JSON representation for `ListValue` is JSON array.
*
* @param values
* Repeated field... | trueaccord/ScalaPB | scalapb-runtime/src/main/scalajs/com/google/protobuf/struct/ListValue.scala | Scala | apache-2.0 | 6,462 |
/*
* 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... | yiheng/BigDL | spark/dl/src/main/scala/com/intel/analytics/bigdl/nn/MapTable.scala | Scala | apache-2.0 | 5,321 |
package com.socrata.datacoordinator.common.collocation
import com.socrata.thirdparty.typesafeconfig.ConfigClass
import com.typesafe.config.Config
class CollocationConfig(config: Config, root: String) extends ConfigClass(config, root) {
private def k(field: String) = root + "." + field
val cost = new CollocationCo... | socrata-platform/data-coordinator | coordinatorlib/src/main/scala/com/socrata/datacoordinator/common/collocation/CollocationConfig.scala | Scala | apache-2.0 | 788 |
/*
* Copyright 2014 porter <https://github.com/eikek/porter>
*
* 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... | eikek/porter | app/src/main/scala/porter/app/akka/api/MutableStoreActor.scala | Scala | apache-2.0 | 4,065 |
package com.github.pedrovgs.haveaniceday.smiles
import com.github.pedrovgs.haveaniceday.utils.model.{HaveANiceDayError, QueryResult}
import org.joda.time.DateTime
object model {
type SmilesExtractionResult = Either[SmilesExtractionError, Seq[Smile]]
type SmilesGenerationResult = Either[SmilesGenerationError, Smi... | pedrovgs/HaveANiceDay | src/main/scala/com/github/pedrovgs/haveaniceday/smiles/model.scala | Scala | gpl-3.0 | 2,330 |
/*
* Copyright (C) 2018 Joan Goyeau.
*
* 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, Ver... | gf53520/kafka | streams/streams-scala/src/test/scala/org/apache/kafka/streams/scala/kstream/KTableTest.scala | Scala | apache-2.0 | 5,342 |
package tests
import abstractfactory._
/**
* AbstractFactory tests
* @author lmignot
*/
class AbstractFactoryTest extends BaseTest {
describe("An abstract factory") {
it("abstract factory should return the appropriate factory if available") {
val opt: Option[AbstractParserFactory] = ParserFactoryProd... | BBK-PiJ-2015-67/sdp-portfolio | exercises/week08/src/test/scala/tests/AbstractFactoryTest.scala | Scala | unlicense | 1,789 |
package org.ugr.sci2s.mllib.test
import org.apache.spark.rdd.RDD
import org.apache.spark.mllib.regression.LabeledPoint
import org.apache.spark.mllib.evaluation.BinaryClassificationMetrics
import org.ugr.sci2s.mllib.test.{MLExperimentUtils => MLEU}
import org.apache.spark.mllib.classification.ClassificationModel
import... | sramirez/spark-experiments | src/main/scala/org/ugr/sci2s/mllib/test/RandomForestAdapter.scala | Scala | apache-2.0 | 3,927 |
package io.circe
import scala.annotation.{ switch, tailrec }
/**
* A pretty-printer for JSON values.
*
* @author Travis Brown
* @author Tony Morris
*
* @param indent The indentation to use if any format strings contain a new line.
* @param lbraceLeft Spaces to insert to left of a left brace.
* @param lbraceRi... | alexarchambault/circe | core/shared/src/main/scala/io/circe/Printer.scala | Scala | apache-2.0 | 8,928 |
/*
* 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 ... | SparklineData/spark-datetime | src/test/scala/org/sparklinedata/spark/dateTime/IssuesTest.scala | Scala | apache-2.0 | 2,836 |
/*
* 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 ... | ueshin/apache-flink | flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/plan/nodes/CommonAggregate.scala | Scala | apache-2.0 | 2,355 |
/*
* 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/SecurityManager.scala | Scala | apache-2.0 | 21,682 |
package poly.collection.mut
import cats.implicits._
import poly.collection._
import poly.collection.factory._
import poly.collection.impl._
import poly.macroutil._
/**
* @author Tongfei Chen
*/
class SegmentTreeRangeQuery[T] private(private val data: ResizableSeq[T])(implicit val monoid: Monoid[T])
extends Abstra... | ctongfei/poly-collection | rangequery/src/main/scala/poly/collection/mut/SegmentTreeRangeQuery.scala | Scala | mit | 1,801 |
/*
* 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 ... | WindCanDie/spark | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/EliminateResolvedHint.scala | Scala | apache-2.0 | 2,374 |
/*
* MUSIT is a museum database to archive natural and cultural history data.
* Copyright (C) 2016 MUSIT Norway, part of www.uio.no (University of Oslo)
*
* 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 Softw... | kpmeen/musit | musit-models/src/main/scala/no/uio/musit/models/UserGroupMembership.scala | Scala | gpl-2.0 | 1,809 |
package org.denigma.kappa
import java.io.{File => JFile}
import java.nio.ByteBuffer
import akka.http.scaladsl.testkit.WSProbe
import better.files.File
import boopickle.DefaultBasic._
import net.ceedubs.ficus.Ficus._
import org.denigma.kappa.messages.FileResponses.UploadStatus
import org.denigma.kappa.messages.KappaMe... | antonkulaga/kappa-notebook | app/jvm/src/test/scala/org.denigma.kappa/WebSocketProjectsSuite.scala | Scala | mpl-2.0 | 4,802 |
/**
* KnuthMorrisPratt.scala --- Tail-recursive Knuth-Morris-Pratt search
*
* Copyright (C) 2014 Aaron S. Hawley
*
* 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 ... | ashawley/algs | src/main/scala/org/ninthfloor/users/ashawley/algs/search/KnuthMorrisPratt.scala | Scala | gpl-3.0 | 2,676 |
package unfiltered.oauth2
object OAuth2 {
val XAuthorizedIdentity = "X-Authorized-Identity"
val XAuthorizedClientIdentity = "X-Authorized-Client-Identity"
val XAuthorizedScopes = "X-Authorized-Scopes"
}
/** Extractor for a resource owner and the client they authorized, as well as the granted scope. */
object OA... | beni55/unfiltered | oauth2/src/main/scala/oauth2.scala | Scala | mit | 1,210 |
/*
* ******************************************************************************
* * Copyright (C) 2013 Christopher Harris (Itszuvalex)
* * Itszuvalex@gmail.com
* *
* * This program is free software; you can redistribute it and/or
* * modify it under the terms of the GNU General Public License
* * as p... | Itszuvalex/Femtocraft-alpha-1 | src/main/java/com/itszuvalex/femtocraft/industry/containers/ContainerFemtoEntangler.scala | Scala | gpl-2.0 | 4,365 |
// Copyright 2014 Foursquare Labs Inc. All Rights Reserved.
package io.fsq.twofishes.server
import com.vividsolutions.jts.geom.Geometry
import io.fsq.common.scala.Lists.Implicits._
import io.fsq.twofishes.gen.{CellGeometry, GeocodeServingFeature}
import io.fsq.twofishes.util.StoredFeatureId
import org.slf4s.Logging
c... | foursquare/fsqio | src/jvm/io/fsq/twofishes/server/HotfixableGeocodeStorageService.scala | Scala | apache-2.0 | 5,308 |
package cas.analysis.estimation
import cas.analysis.subject.Subject
import cas.analysis.subject.components.Attachments
import cas.utils.StdImplicits.RightBiasedEither
import cas.utils.Regexf
case class AttachmentsConfigs(override val weight: Double = 1.0
) extends EstimatorConfigs(weight)
class AttachmentsEstimato... | bk0606/CAS | src/main/scala/cas/analysis/estimation/AttachmentsEstimator.scala | Scala | mit | 563 |
/*
* UGenGraphBuilder.scala
* (ScalaCollider)
*
* Copyright (c) 2008-2021 Hanns Holger Rutz. All rights reserved.
*
* This software is published under the GNU Affero General Public License v3+
*
*
* For further information, please contact Hanns Holger Rutz at
* contact@sciss.de
*/
package de.sciss
pac... | Sciss/ScalaCollider | shared/src/main/scala/de/sciss/synth/impl/UGenGraphBuilder.scala | Scala | lgpl-2.1 | 10,449 |
package net.sansa_stack.inference.abstraction
/**
* @author Lorenz Buehmann
*/
trait AbstractionGenerator {
}
| SANSA-Stack/SANSA-RDF | sansa-inference/sansa-inference-common/src/main/scala/net/sansa_stack/inference/abstraction/AbstractionGenerator.scala | Scala | apache-2.0 | 116 |
package com.fsist.stream
import com.fsist.stream.run.FutureStreamBuilder
import com.fsist.util.concurrent.Func
import org.scalatest.FunSuite
import scala.concurrent.Promise
class PipeTest extends FunSuite with StreamTester {
test("Using a pipe manually with a single component") {
val data = 1 to 10
val sou... | fsist/future-streams | src/test/scala/com/fsist/stream/PipeTest.scala | Scala | apache-2.0 | 3,347 |
package service
import model.Profile._
import profile.simple._
import model.{PullRequest, Issue}
trait PullRequestService { self: IssuesService =>
import PullRequestService._
def getPullRequest(owner: String, repository: String, issueId: Int)
(implicit s: Session): Option[(Issue, PullRequest)... | mqshen/gitbucketTest | src/main/scala/service/PullRequestService.scala | Scala | apache-2.0 | 3,798 |
/**
* 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... | ArvinDevel/incubator-pulsar | pulsar-flink/src/test/scala/org/apache/flink/batch/connectors/pulsar/example/FlinkPulsarBatchSinkScalaExample.scala | Scala | apache-2.0 | 3,096 |
// scalac: -Ystop-after:parser
//
object foo {
val bar = "baz"
val xml =
<root>
<!---->
<!-- {bar} --->
</root>
}
| scala/scala | test/files/pos/xml-comments.scala | Scala | apache-2.0 | 139 |
package scalafiddle.router.cache
import scala.concurrent.Future
trait Cache {
def get(id: String, expiration: Int): Future[Option[Array[Byte]]]
def put(id: String, data: Array[Byte], expiration: Int): Future[Unit]
def clean(expiration: Int): Unit
}
| scalafiddle/scalafiddle-core | router/src/main/scala/scalafiddle/router/cache/Cache.scala | Scala | apache-2.0 | 259 |
/*
* -╥⌐⌐⌐⌐ -⌐⌐⌐⌐-
* ≡╢░░░░⌐\\░░░φ ╓╝░░░░⌐░░░░╪╕
* ╣╬░░` `░░░╢┘ φ▒╣╬╝╜ ░░╢╣Q
* ║╣╬░⌐ ` ╤▒▒▒Å` ║╢╬╣
* ╚╣╬░⌐ ╔▒▒▒▒`«╕ ╢╢╣▒
* ╫╬░░╖ .░ ╙╨╨ ╣╣╬░φ ╓φ░╢╢Å
* ╙╢░░░░⌐"░░░╜ ╙Å░░░░⌐░░░░╝`
* ``˚¬ ⌐ ˚˚⌐´
*
* ... | Flipkart/connekt | busybees/src/main/scala/com/flipkart/connekt/busybees/streams/flows/formaters/OpenWebChannelFormatter.scala | Scala | mit | 8,457 |
/**
* Copyright 2015 Yahoo Inc. Licensed under the Apache License, Version 2.0
* See accompanying LICENSE file.
*/
package models.navigation
import play.api.mvc.Call
/**
* @author hiral
*/
object QuickRoutes {
import models.navigation.BreadCrumbs._
val baseRoutes : Map[String, Call] = Map(
"Clusters" -... | vvutharkar/kafka-manager | app/models/navigation/QuickRoutes.scala | Scala | apache-2.0 | 2,030 |
package code.api
import net.liftweb.http.rest.RestHelper
import net.liftweb.json.JsonAST.JObject
import net.liftweb.util.Helpers.AsLong
import net.liftweb.json.JsonAST.JField
import net.liftweb.json.JsonAST.JString
import code.service.TaskService
import net.liftweb.json._
import net.liftweb.json.Extraction._
import co... | dodie/time-admin | src/main/scala/code/api/Endpoints.scala | Scala | apache-2.0 | 4,699 |
/*
* 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 | core/src/main/scala/org/apache/spark/scheduler/MiscellaneousProcessDetails.scala | Scala | apache-2.0 | 1,173 |
/*
* 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 ... | bwsw/sj-platform | core/sj-common/src/test/scala-2.12/com/bwsw/sj/common/si/ModuleSiTests.scala | Scala | apache-2.0 | 14,800 |
package jobs
import akka.actor.Actor
import play.api.Play
import oauth.signpost.commonshttp.CommonsHttpOAuthConsumer
import akka.actor.ActorRef
import org.apache.http.client.methods.HttpGet
import org.apache.http.client.methods.HttpPost
import models._
import akka.actor.Cancellable
import akka.actor.ActorSystem
import... | TweetAggregator/CrossTalk | app/jobs/TweetDuplicateChecker.scala | Scala | gpl-2.0 | 2,322 |
package bad.robot.radiate.config
import org.specs2.mutable.Specification
class TemplateTest extends Specification {
"Fully populated config file template" >> {
Template(new ConfigFile {
def url: Option[String] = Some("http://teamcity.com:8111")
def username: Option[String] = Some("bob")
def p... | tobyweston/radiate | src/test/scala/bad/robot/radiate/config/TemplateTest.scala | Scala | apache-2.0 | 2,956 |
object SCL5738 extends App {
val key = "a"
val foo = Some(args) collect {
case Array("1") => Map(key -> 1)
case _ => Map(key -> "unknown")
} getOrElse Map.empty
println(/*start*/foo/*end*/)
}
//Map[String, Any] | ilinum/intellij-scala | testdata/typeInference/bugs5/SCL5738.scala | Scala | apache-2.0 | 237 |
package nl.dekkr.pagefetcher.services
import akka.actor.ActorRef
import nl.dekkr.pagefetcher.model.{BackendResult, PageUrl}
trait BackendSystem {
implicit val persistence: ActorRef
def getContent(request: PageUrl, charSet: Option[String], userAgent: Option[String]): BackendResult
}
| dekkr/pagefetcher | src/main/scala/nl/dekkr/pagefetcher/services/BackendSystem.scala | Scala | mit | 291 |
package com.wavesplatform.lang
import com.wavesplatform.common.state.ByteStr
import com.wavesplatform.common.utils.Base58
import com.wavesplatform.lang.v1.parser.BinaryOperation._
import com.wavesplatform.lang.v1.parser.Expressions.Pos.AnyPos
import com.wavesplatform.lang.v1.parser.Expressions._
import com.wavesplatfo... | wavesplatform/Waves | lang/tests/src/test/scala/com/wavesplatform/lang/ScriptParserTest.scala | Scala | mit | 39,704 |
package me.axiometry.blocknet.nbt
import java.io._
class NBTInputStream(in: InputStream) extends DataInputStream(in) {
private def invalid() = throw new IOException("invalid NBT tag")
def readNBTTag(): NBT.Tag = readNBTTag(true) match {
case Some(tag) => tag
case None => invalid
}
private def readNB... | Axiometry/Blocknet | blocknet-minecraft/src/main/scala/me/axiometry/blocknet/minecraft/nbt/NBTInputStream.scala | Scala | bsd-2-clause | 1,833 |
package com.cloudwick.generator.odvs
import scala.util.Random
/**
* Description goes here
* @author ashrith
*/
class ODVSGenerator(customersMap: Map[Long, String], movieGenerator: MovieGenerator) {
private val customersSize = customersMap.size
def eventGenerate = {
val custID = Random.nextInt(customersSi... | vaagrawa/generator | src/main/scala/com/cloudwick/generator/odvs/ODVSGenerator.scala | Scala | apache-2.0 | 862 |
/*
* Copyright (C) 2016-2019 Lightbend Inc. <https://www.lightbend.com>
*/
package com.lightbend.lagom.internal.scaladsl.broker.kafka
import akka.actor.ActorSystem
import akka.stream.Materializer
import com.lightbend.lagom.internal.broker.kafka.KafkaConfig
import com.lightbend.lagom.internal.scaladsl.api.broker.Top... | ignasi35/lagom | service/scaladsl/kafka/client/src/main/scala/com/lightbend/lagom/internal/scaladsl/broker/kafka/KafkaTopicFactory.scala | Scala | apache-2.0 | 1,468 |
/*
* Copyright 2011, 2012 Johannes Rudolph
*
* 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 ap... | rintcius/sbt-dependency-graph | src/main/scala/net/virtualvoid/sbt/graph/IvyGraphMLDependencies.scala | Scala | apache-2.0 | 9,539 |
package com.arcusys.valamis.lesson.scorm.storage.sequencing
import com.arcusys.valamis.lesson.scorm.model.manifest.SequencingTracking
trait SequencingTrackingStorage {
def create(sequencingId: Long, entity: SequencingTracking)
def get(sequencingId: Long): Option[SequencingTracking]
}
| igor-borisov/valamis | valamis-scorm-lesson/src/main/scala/com/arcusys/valamis/lesson/scorm/storage/sequencing/SequencingTrackingStorage.scala | Scala | gpl-3.0 | 291 |
/*
* MUSIT is a museum database to archive natural and cultural history data.
* Copyright (C) 2016 MUSIT Norway, part of www.uio.no (University of Oslo)
*
* 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 Softw... | kpmeen/musit | service_thing_aggregate/app/services/ObjectService.scala | Scala | gpl-2.0 | 7,170 |
package ch.uzh.dyndco.algorithms.maxsum
import collection.mutable.Map
import collection.mutable.Set
import com.signalcollect.AbstractVertex
import ch.uzh.dyndco.problems.MeetingConstraints
import scala.collection.mutable.MutableList
import com.signalcollect.Graph
import com.signalcollect.StateForwarderEdge
import ch.u... | danihegglin/DynDCO | src/main/scala/ch/uzh/dyndco/algorithms/maxsum/MaxSumGraph.scala | Scala | apache-2.0 | 1,875 |
package hu.frankdavid.diss.expression
import hu.frankdavid.diss.DataTable
import hu.frankdavid.diss.types.{MatrixLike, Matrix}
case class CountTo(override val parameters: Array[HasValue]) extends Expression {
def this() = this(null)
def evaluate(implicit table: DataTable) = {
val to = operands(table)(0).asIns... | frankdavid/diss | src/main/scala/hu/frankdavid/diss/expression/CountTo.scala | Scala | apache-2.0 | 506 |
/*
* 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/keras/layers/UpSampling3D.scala | Scala | apache-2.0 | 2,690 |
package mesosphere.marathon
package core.appinfo.impl
import mesosphere.UnitTest
import mesosphere.marathon.core.appinfo.{AppInfo, GroupInfo, _}
import mesosphere.marathon.core.group.GroupManager
import mesosphere.marathon.state._
import mesosphere.marathon.test.GroupCreation
import scala.concurrent.Future
class Def... | gsantovena/marathon | src/test/scala/mesosphere/marathon/core/appinfo/impl/DefaultInfoServiceTest.scala | Scala | apache-2.0 | 12,572 |
package cn.hjmao.learning.akka.http.demo.api
/**
* Created by hjmao on 17-5-11.
*/
import akka.http.scaladsl.server.directives.{BasicDirectives, FutureDirectives, HeaderDirectives, RouteDirectives}
import akka.http.scaladsl.server.Directive1
import cn.hjmao.learning.akka.http.demo.model.UserEntity
import cn.hjmao.le... | huajianmao/learning | framework/akka-http/demo/src/main/scala/cn/hjmao/learning/akka/http/demo/api/SecurityDirectives.scala | Scala | mit | 795 |
/*
* Copyright 2021 HM Revenue & Customs
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or a... | hmrc/amls-frontend | test/views/msb/branches_or_agents_has_countriesSpec.scala | Scala | apache-2.0 | 2,816 |
package recipestore
import com.google.inject.AbstractModule
import com.google.inject.name.Names
import net.codingwell.scalaguice.ScalaModule
class CommonModule extends AbstractModule with ScalaModule {
private[recipestore] val GRAPHFRAME_DIR: String = "graphframe_dir"
final protected val graphDir: String = String... | prad-a-RuntimeException/semantic-store | src/main/scala/recipestore/CommonModule.scala | Scala | mit | 547 |
package io.hydrosphere.mist.worker
import org.apache.spark.SparkContext
object SparkUtils {
def getSparkUiAddress(sc: SparkContext): Option[String] = {
sc.uiWebUrl
}
}
| Hydrospheredata/mist | mist/worker/src/main/scala/io/hydrosphere/mist/worker/SparkUtils.scala | Scala | apache-2.0 | 181 |
/*
* 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/src/test/scala/org/apache/spark/sql/hive/execution/PrunePartitionSuiteBase.scala | Scala | apache-2.0 | 4,278 |
package nest.sparkle.time.server
import scala.concurrent.duration._
import com.typesafe.config.Config
import akka.util.Timeout
import akka.actor._
import spray.can.Http
import spray.http._
import HttpMethods._
import spray.can.Http.RegisterChunkHandler
import spray.http.HttpHeaders._
import nest.sparkle.store.Writea... | mighdoll/sparkle | protocol/src/main/scala/nest/sparkle/time/server/FileUploadService.scala | Scala | apache-2.0 | 3,181 |
/*
* Copyright (c) 2010 e.e d3si9n
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish... | Banno/scalaxb | cli/src/main/scala/scalaxb/compiler/xsd/GenSource.scala | Scala | mit | 47,196 |
/**
* Licensed to Big Data Genomics (BDG) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The BDG licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use ... | rnpandya/adam | adam-core/src/main/scala/org/bdgenomics/adam/models/ReferencePositionPair.scala | Scala | apache-2.0 | 3,543 |
package com.peterpotts.snake.coercion
import scala.language.implicitConversions
import scala.util.Try
trait Coercion[T] {
implicit def booleanToInt(value: Boolean): Int = IntCoercer(value)
implicit def booleanToLong(value: Boolean): Long = LongCoercer(value)
implicit def booleanToDouble(value: Boolean): Doubl... | peterpotts/snake | src/main/scala/com/peterpotts/snake/coercion/Coercion.scala | Scala | mit | 3,203 |
package lila.pool
import org.joda.time.DateTime
import lila.rating.RatingRange
import lila.user.User
case class PoolMember(
userId: User.ID,
socketId: lila.socket.Socket.Uid,
rating: Int,
ratingRange: Option[RatingRange],
engine: Boolean,
blocking: PoolMember.BlockedUsers,
since: DateTime... | clarkerubber/lila | modules/pool/src/main/PoolMember.scala | Scala | agpl-3.0 | 1,176 |
package org.finra.datagenerator.scaffolding.hierarchy
/**
* Created by dkopel on 31/05/16.
*/
trait SingleParentNested extends Nested {
def getParent[T <: Nested]: T
} | FINRAOS/DataGenerator | rubber-scaffolding/rubber-commons/src/main/scala/org/finra/datagenerator/scaffolding/hierarchy/SingleParentNested.scala | Scala | apache-2.0 | 176 |
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.