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 dhg.ccg.parse.scg.mcmc
import org.junit.Test
import org.junit.Assert._
import dhg.ccg.parse._
import dhg.ccg.prob._
import dhg.ccg.cat._
import dhg.ccg.parse.pcfg._
import dhg.ccg.parse.scg._
import dhg.ccg.tagdict.StartEndTags
import dhg.util._
import dhg.ccg.tagdict._
import dhg.ccg.test.TestUtil.DoubleItera... | dhgarrette/2015-ccg-parsing | src/test/scala/dhg/ccg/parse/scg/mcmc/ScgContextAcceptanceSamplerTests.scala | Scala | apache-2.0 | 9,490 |
/**
* (c) Copyright 2013 Robert Chu.
*
* 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 th... | robotoer/ast-java | src/main/scala/robert/ProtoBufServeJava.scala | Scala | apache-2.0 | 8,046 |
package org.mbari.smith
import com.google.inject.Injector
import vars.annotation.ui.{StateLookup, ToolBelt}
import vars.annotation.ui.imagepanel.Measurement
import scala.collection.JavaConverters._
import scala.util.{Failure, Success, Try}
/**
* Created by brian on 8/6/14.
*/
object FindBogusMeasurementAssociation... | hohonuuli/vars | vars-standalone/src/main/scala/org/mbari/smith/FindBogusMeasurementAssociations.scala | Scala | lgpl-2.1 | 1,154 |
package unfiltered.response.link
object Param {
/** Predefined parameter types as specified in
[[http://tools.ietf.org/html/rfc5988#section-5 section-5]]. Note that
`rev` is omitted as it has been deprecated by the specification. */
sealed abstract class Type(val name: String)
case object Rel extends... | omarkilani/unfiltered | library/src/main/scala/response/link/Param.scala | Scala | mit | 7,789 |
/*
* 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 ... | chenc10/Spark-PAF | sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetQuerySuite.scala | Scala | apache-2.0 | 19,967 |
package io.buoyant.linkerd.protocol.http
import java.util.{TimeZone, logging => javalog}
import com.twitter.finagle.Service
import com.twitter.finagle.http._
import com.twitter.logging._
import com.twitter.util.{Future, Promise, Time, TimeFormat}
import io.buoyant.test.Awaits
import org.scalatest.FunSuite
class Acces... | linkerd/linkerd | linkerd/protocol/http/src/test/scala/io/buoyant/linkerd/protocol/http/AccessLoggerTest.scala | Scala | apache-2.0 | 1,909 |
/*
* Copyright 2013 - 2020 Outworkers 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... | outworkers/phantom | phantom-finagle/src/test/scala/com/outworkers/phantom/finagle/SpoolBenchmarkPerformanceTest.scala | Scala | apache-2.0 | 1,812 |
/*
* 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/optim/PredictionService.scala | Scala | apache-2.0 | 14,476 |
/*
* Copyright 2016 Dennis Vriend
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed t... | dnvriend/sbt-scaffold-play | src/main/scala/com/github/dnvriend/scaffold/play/enabler/lagom/LagomEnabler.scala | Scala | apache-2.0 | 1,428 |
package com.zengularity.trollbot
import akka.stream._
import akka.stream.io._
import akka.stream.scaladsl._
import akka.actor._
import akka.http.scaladsl.model._
import akka.http.scaladsl._
import akka.util.ByteString
import scala.concurrent.duration._
import scala.concurrent._
object Main {
def main(args: Array[... | vdebergue/trollbot | src/main/scala/com/zengularity/trollbot/Main.scala | Scala | mit | 2,305 |
package org.scalacoin.script
import org.scalacoin.crypto.{TransactionSignatureComponentFactory, TransactionSignatureComponent}
import org.scalacoin.protocol.script.{ScriptSignature, ScriptPubKey}
import org.scalacoin.protocol.transaction.Transaction
import org.scalacoin.script.constant._
import org.scalacoin.script.er... | TomMcCabe/scalacoin | src/main/scala/org/scalacoin/script/ScriptProgram.scala | Scala | mit | 18,775 |
package org.scalajs.testsuite.javalib
import java.{util => ju}
abstract class AbstractSetTest[F <: AbstractSetFactory](val factory: F) extends SetTest {
describe(factory.implementationName) {
testApi()
}
def testApi(): Unit = {
testSetApi(factory)
}
}
object AbstractSetFactory {
def allFactories:... | doron123/scala-js | test-suite/src/test/scala/org/scalajs/testsuite/javalib/AbstractSetTest.scala | Scala | bsd-3-clause | 469 |
package fpinscala.errorhandling
import scala.{Option => _, Some => _, Either => _, _} // hide std library `Option`, `Some` and `Either`, since we are writing our own in this chapter
sealed trait Option[+A] {
def map[B](f: A => B): Option[B] = this match {
case Some(a) => Some(f(a))
case None => None
}
... | everyevery/fpinscala | exercises/src/main/scala/fpinscala/errorhandling/Option.scala | Scala | mit | 2,357 |
package com.twitter.util
import com.twitter.util._
import org.scalatest.FunSuite
import org.scalatest.junit.JUnitRunner
import org.junit.runner.RunWith
import scala.collection.mutable
import java.util.concurrent.atomic.AtomicReference
import scala.collection.immutable.VectorBuilder
@RunWith(classOf[JUnitRunner])
cla... | mosesn/util | util-core/src/test/scala/com/twitter/util/EventTest.scala | Scala | apache-2.0 | 6,468 |
/*
* Copyright 2016 HM Revenue & Customs
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or a... | ahudspith-equalexperts/ct-calculations | src/main/scala/uk/gov/hmrc/ct/ct600/v3/B315.scala | Scala | apache-2.0 | 978 |
package breeze.linalg
import org.scalatest.FunSuite
/**
* TODO
*
* @author dlwh
**/
class squaredDistanceTest extends FunSuite {
test("simple squared distance test") {
assert(squaredDistance(DenseVector(3.0, 4.0), DenseVector.zeros[Double](2)) === 25.0)
assert(squaredDistance(DenseVector(3.0, 4.0), Spar... | wavelets/breeze | src/test/scala/breeze/linalg/squaredDistanceTest.scala | Scala | apache-2.0 | 363 |
import _root_.sbt._
trait JUnitXMLReport extends BasicScalaProject {
//create a listener that writes to the normal output directory
def junitXmlListener: TestReportListener = new eu.henkelmann.sbt.JUnitXmlTestsListener(outputPath.toString)
//add the new listener to the already configured ones
override def tes... | jrudolph/junit_xml_listener | src/main/scala/JUnitXMLReport.scala | Scala | mit | 405 |
/***********************************************************************
* Copyright (c) 2013-2022 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... | locationtech/geomesa | geomesa-index-api/src/main/scala/org/locationtech/geomesa/index/utils/SplitArrays.scala | Scala | apache-2.0 | 1,116 |
package org.gtri.util.scala.xmlbuilder
import org.gtri.util.xsddatatypes._
import org.gtri.util.xsddatatypes.XsdQName._
trait XmlNamespaceContext extends NamespaceURIToPrefixResolver with PrefixToNamespaceURIResolver {
def prefixToNamespaceURIMap : Map[XsdNCName, XsdAnyURI]
def optPrefixesOrder : Option[Seq[(Xs... | gtri-iead/org.gtri.util.scala | xmlbuilder/src/main/scala/org/gtri/util/scala/xmlbuilder/XmlNamespaceContext.scala | Scala | gpl-3.0 | 1,403 |
package scala.collection.scalatest
import org.scalatest._
trait IntBagBehaviours extends BagBehaviours with Matchers {
this: FlatSpec =>
def intBagBehaviour(bag: scala.collection.Bag[Int]) {
it should "grow by 1 with +(elem) operation" in {
assertResult(bag.size + 1) {
val newBag = bag + 1
... | sageserpent-open/multisets | src/test/scala/scala/collection/scalatest/IntBagBehaviours.scala | Scala | bsd-3-clause | 1,973 |
/*
* 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/core/src/main/scala/org/apache/spark/sql/execution/python/AggregateInPandasExec.scala | Scala | apache-2.0 | 5,981 |
package com.sksamuel.elastic4s.cluster
import org.elasticsearch.cluster.health.ClusterHealthStatus
import org.elasticsearch.common.Priority
import com.sksamuel.exts.OptionImplicits._
import org.elasticsearch.action.admin.cluster.settings.ClusterUpdateSettingsRequestBuilder
trait ClusterApi {
def clusterState(): Cl... | aroundus-inc/elastic4s | elastic4s-core/src/main/scala/com/sksamuel/elastic4s/cluster/ClusterApi.scala | Scala | apache-2.0 | 2,989 |
package com.gilt.thehand.rules.logical
import com.gilt.thehand.{AbstractContext, AbstractRuleParser, Rule}
/**
* Used to statically evaluate a Rule as true, and parse values to a true
*/
case object True extends Rule with AbstractRuleParser {
/**
* Extractor for rule matching. Since this is a True, always retu... | gilt/the-hand | src/main/scala/com/gilt/thehand/rules/logical/True.scala | Scala | apache-2.0 | 632 |
package part2actors
import akka.actor.{Actor, ActorLogging, ActorSystem, Props}
import akka.event.Logging
/**
* Logging is done asynchronously.
*/
object ActorLogging extends App {
/**
* An explicit logger can be used for logging.
*/
class ActorWithExplicitLogger extends Actor {
val logger = Loggi... | guhemama/moocs | RockAkka/src/main/scala/part2actors/ActorLogging.scala | Scala | bsd-3-clause | 958 |
/* Copyright 2017-18, 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless ... | eaplatanios/tensorflow | tensorflow/scala/api/src/main/scala/org/platanios/tensorflow/api/ops/Math.scala | Scala | apache-2.0 | 246,188 |
package com.datastax.spark.connector.mapper
import java.lang.reflect.Method
import com.datastax.driver.core.ProtocolVersion
import com.datastax.spark.connector.ColumnRef
import com.datastax.spark.connector.cql.TableDef
import scala.reflect.ClassTag
class JavaBeanColumnMapper[T : ClassTag](columnNameOverride: Map[St... | shashwat7/spark-cassandra-connector | spark-cassandra-connector/src/main/scala/com/datastax/spark/connector/mapper/JavaBeanColumnMapper.scala | Scala | apache-2.0 | 2,376 |
package vggames.shared.vraptor
import java.io.{ FileInputStream, File }
import java.util.Properties
import br.com.caelum.vraptor.ioc.{ Component, ApplicationScoped }
@Component
@ApplicationScoped
class Secrets {
val awsSecrets = readSecrets("aws_secrets")
def awsAccessKey = key(awsSecrets.getProperty("access.ke... | vidageek/games | web/src/main/scala/vggames/shared/vraptor/Secrets.scala | Scala | gpl-3.0 | 707 |
package grasshopper.geocoder.api.geocode
trait ParallelismFactor {
val numCores = Runtime.getRuntime.availableProcessors()
}
| cfpb/grasshopper | geocoder/src/main/scala/grasshopper/geocoder/api/geocode/ParallelismFactor.scala | Scala | cc0-1.0 | 128 |
package is.hail.annotations
import is.hail.asm4s._
import is.hail.types.physical.PType
object UnsafeUtils {
def arrayElementSize(t: PType): Long = roundUpAlignment(t.byteSize, t.alignment)
def roundUpAlignment(offset: Long, alignment: Long): Long = {
assert(alignment > 0)
assert((alignment & (alignment -... | danking/hail | hail/src/main/scala/is/hail/annotations/UnsafeUtils.scala | Scala | mit | 759 |
/*
* 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 ... | rednaxelafx/apache-spark | core/src/main/scala/org/apache/spark/SparkContext.scala | Scala | apache-2.0 | 124,727 |
/*******************************************************************************
Copyright (c) 2013, S-Core, KAIST.
All rights reserved.
Use is subject to license terms.
This distribution may include materials developed by third parties.
***************************************************************... | darkrsw/safe | src/main/scala/kr/ac/kaist/jsaf/analysis/typing/models/DOMCore/DOMNotation.scala | Scala | bsd-3-clause | 2,521 |
package com.phosphene.kafkastorm.storm
import backtype.storm.topology.base.BaseBasicBolt
import backtype.storm.topology.{BasicOutputCollector, OutputFieldsDeclarer}
import backtype.storm.tuple.{Fields, Tuple, Values}
import com.google.common.base.Throwables
import com.twitter.bijection.avro.SpecificAvroCodecs
import c... | phosphene/kafka-storm-test-demo | src/main/scala/com/phosphene/kafkastorm/storm/AvroDecoderBolt.scala | Scala | apache-2.0 | 4,348 |
package org.clulab.odin.impl
import org.clulab.struct.Interval
import org.clulab.processors.Document
import org.clulab.odin._
trait GraphPattern {
def arguments: Seq[ArgumentPattern]
// separate the required and optional arguments
protected val (required, optional) = arguments.partition(_.required)
type Arg... | sistanlp/processors | main/src/main/scala/org/clulab/odin/impl/GraphPattern.scala | Scala | apache-2.0 | 5,656 |
package simx.components.ai.atn.aspects
import simx.components.ai.atn.ontology.{types => local}
import simx.core.entity.description.{EntityAspect, NamedSValSet, SValSet}
import simx.core.entity.typeconversion.ConvertibleTrait
import simx.core.ontology.{EntityDescription, Symbols}
case class StateDescription(id: Symbo... | simulator-x/atn | src/simx/components/ai/atn/aspects/StateAspect.scala | Scala | apache-2.0 | 941 |
package controllers.api.singer
import controllers.actions.{WithSinger, WithDBSession}
import models.{SessionSongId, SongId, SessionSongFormatter}
import play.api.db.slick.DBAction
import play.api.libs.json.{JsError, JsSuccess, Json}
import play.api.mvc.{Action, Controller}
import repositories.{SessionRepositoryCompon... | nagirrab/Karaoke | app/controllers/api/singer/SessionSongController.scala | Scala | mit | 2,853 |
/*
* Copyright 2010-2014 Benjamin Lings
*
* 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... | codingwell/scala-guice | src/test/scala/net/codingwell/scalaguice/ScalaMultibinderSpec.scala | Scala | apache-2.0 | 12,257 |
/*
* Copyright 2016 Dennis Vriend
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed t... | wwwiiilll/akka-persistence-jdbc | src/test/scala/akka/persistence/jdbc/configuration/AkkaPersistenceConfigTest.scala | Scala | apache-2.0 | 6,633 |
package de.hyronx.matter.library
import org.scalatest._
case class TreeImpl(val value: Int) extends MutableTree[TreeImpl]
class TreeTest extends FlatSpec with Matchers {
val tree = MutableTree(
new TreeImpl(0),
MutableTree(
new TreeImpl(1),
new TreeImpl(2), new TreeImpl(3)),
MutableTree(
... | hyronx/matter | src/test/scala/de/hyronx/matter/library/TreeTest.scala | Scala | apache-2.0 | 2,400 |
package eu.stratosphere.procrustes.datagen.spark
import eu.stratosphere.procrustes.datagen.util.Distributions._
import eu.stratosphere.procrustes.datagen.util.RanHash
import org.apache.spark.{SparkConf, SparkContext}
class SparkIntGenerator(master: String, numTasks: Int, tuplesPerTask: Long, keyDist: Distribution, ou... | stratosphere/tamara-msc-thesis | tamaras-msc-thesis-spark-datagens/src/main/scala/eu/stratosphere/procrustes/datagen/spark/SparkIntGenerator.scala | Scala | apache-2.0 | 2,692 |
trait Functor[F[_]] {
def fmap[A,B](fun: A=>B, arg:F[A]): F[B]
}
object Functor{
implicit val ListFunctor: Functor[List] = new Functor[List] {
def fmap[A, B](f: A => B, arg: List[A]):List[B] = arg map f
}
final class OOFunctor[F[_],A](arg:F[A])(implicit ftr: Functor[F]) {
def fmap[B](fun: A=>B):F[B] =... | dotty-staging/dotty | tests/pos/tcpoly_infer_ticket716.scala | Scala | apache-2.0 | 792 |
/*
* 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 ... | hortonworks-spark/shc | core/src/main/scala/org/apache/spark/sql/execution/datasources/hbase/HBaseTableCatalog.scala | Scala | apache-2.0 | 12,421 |
package lila.api
import play.api.libs.json._
import reactivemongo.bson._
import chess.format.pgn.Pgn
import lila.analyse.{ AnalysisRepo, Analysis }
import lila.common.paginator.{ Paginator, PaginatorJson }
import lila.common.PimpedJson._
import lila.db.api._
import lila.db.Implicits._
import lila.db.paginator.{ BSONA... | JimmyMow/lila | modules/api/src/main/GameApi.scala | Scala | mit | 5,945 |
package ru.pavkin.todoist.api.core
import java.util.{TimeZone, Date}
import cats.Functor
import cats.syntax.functor._
import ru.pavkin.todoist.api
import ru.pavkin.todoist.api.core.model._
import ru.pavkin.todoist.api.core.tags.syntax._
import ru.pavkin.todoist.api.utils.Produce
import shapeless.{Inl, Inr}
import Fro... | vpavkin/scalist | core/src/main/scala/ru/pavkin/todoist/api/core/FromDTO.scala | Scala | mit | 8,063 |
package chana.jpql
import chana.avro
import chana.avro.Insertlog
import chana.avro.UpdateAction
import chana.jpql
import chana.jpql.nodes._
import org.apache.avro.Schema
import org.apache.avro.generic.GenericData
import org.apache.avro.generic.IndexedRecord
import org.codehaus.jackson.JsonNode
import org.codehaus.jack... | hustnn/chana | src/main/scala/chana/jpql/JPQLMapperInsert.scala | Scala | apache-2.0 | 5,597 |
package se.marcuslonnberg.scaladocker.remote.api
import java.io.File
import java.nio.file.Files
import java.nio.file.attribute.PosixFilePermission
import scala.collection.convert.wrapAsScala._
object FileUtils {
def listFilesRecursive(base: File): Map[String, File] = {
def traverse(source: File, baseDestinatio... | marcuslonnberg/scala-docker | src/main/scala/se/marcuslonnberg/scaladocker/remote/api/FileUtils.scala | Scala | mit | 1,611 |
package spire
import spire.algebra._
import spire.algebra.partial._
import spire.optional.partialIterable._
import spire.optional.mapIntIntPermutation._
import spire.std.int._
import org.scalatest.{FunSuite, Matchers, NonImplicitAssertions}
import org.scalatest.prop.Checkers
import org.scalacheck.{Arbitrary, Gen}
im... | woparry/spire | tests/src/test/scala/spire/PartialSyntaxTest.scala | Scala | mit | 2,223 |
package com.nrinaudo.fetch
import java.util.Locale
/** Tools for creating instances of [[Language]]. */
object Language {
/** Represents a global language, regardless of regional versions.
*
* English, for example, is a global language, as opposed to American English which is specific to the US.
*
*... | nrinaudo/fetch | core/src/main/scala/com/nrinaudo/fetch/Language.scala | Scala | mit | 2,386 |
object Test extends App {
object Foo
val foo = "foo"
implicitly[ValueOf[1]]
implicitly[ValueOf[1L]]
implicitly[ValueOf[1.0]]
implicitly[ValueOf[1.0F]]
implicitly[ValueOf[true]]
implicitly[ValueOf['f']]
implicitly[ValueOf["foo"]]
implicitly[ValueOf['foo]]
implicitly[ValueOf[Unit]]
implicitly[Val... | jastice/intellij-scala | scala/scala-impl/testdata/annotator/literalTypes/sip23ValueOf.scala | Scala | apache-2.0 | 811 |
/*
* FILE: JoinQueryDetector.scala
* Copyright (c) 2015 - 2019 GeoSpark Development Team
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE... | Sarwat/GeoSpark | sql/src/main/scala/org/apache/spark/sql/geosparksql/strategy/join/JoinQueryDetector.scala | Scala | mit | 6,451 |
import scala.quoted._
object Bar {
Foo.myMacro() // error
}
| som-snytt/dotty | tests/neg-macros/macros-in-same-project-6/Bar.scala | Scala | apache-2.0 | 63 |
package org.jetbrains.plugins.hocon.editor
import com.intellij.codeInsight.editorActions.JoinLinesHandlerDelegate
import com.intellij.codeInsight.editorActions.JoinLinesHandlerDelegate.CANNOT_JOIN
import com.intellij.openapi.editor.Document
import com.intellij.psi.PsiFile
import com.intellij.util.text.CharArrayUtil
im... | ghik/intellij-hocon | src/org/jetbrains/plugins/hocon/editor/HoconCommentJoinLinesHandler.scala | Scala | apache-2.0 | 1,551 |
package reactivemongo.core.protocol
import akka.actor.ActorRef
import reactivemongo.io.netty.channel.{
ChannelHandlerContext,
ChannelDuplexHandler,
ChannelPromise
}
import reactivemongo.io.netty.handler.timeout.IdleStateEvent
import reactivemongo.core.actors.{ ChannelConnected, ChannelDisconnected }
import re... | ReactiveMongo/ReactiveMongo | driver/src/main/scala/core/protocol/MongoHandler.scala | Scala | apache-2.0 | 4,149 |
package com.twitter.finagle.context
import com.twitter.finagle.netty3.ChannelBufferBuf
import com.twitter.io.Buf
import com.twitter.util.{Local, Try, Return, Throw}
import scala.collection.mutable
/**
* A context contains a number of let-delimited bindings. Bindings
* are indexed by type Key[A] in a typesafe manner... | jay-johnson/finagle | finagle-core/src/main/scala/com/twitter/finagle/context/Context.scala | Scala | apache-2.0 | 9,959 |
trait FooBase {
type Bar >: Null <: BarBase { type This <: FooBase.this.Bar }
type This >: this.type <: FooBase { type This <: FooBase.this.This }
def derived(bar: Bar): This = ???
}
trait BarBase {
type This >: Null <: BarBase { type This <: BarBase.this.This }
}
object Test {
def bad(foo: FooBase): FooBa... | dotty-staging/dotty | tests/pos/i2941.scala | Scala | apache-2.0 | 442 |
/*
* 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 ... | windeye/spark | core/src/test/scala/org/apache/spark/rdd/RDDSuite.scala | Scala | apache-2.0 | 18,359 |
/***********************************************************************
* Copyright (c) 2013-2017 Commonwealth Computer Research, Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Apache License, Version 2.0
* which accompanies this distribution and... | geomesa/geomesa-tutorials | geomesa-examples-spark/src/main/scala/com/example/geomesa/spark/ShallowJoin.scala | Scala | apache-2.0 | 11,448 |
package varys.framework.master
import java.util.concurrent.atomic.AtomicLong
import scala.collection.mutable.HashSet
import varys.framework.FlowDescription
private[varys] class FlowInfo(
val desc: FlowDescription) {
var source = desc.originHost
var destClient:ClientInfo = null
var currentBps = 0.0
va... | frankfzw/varys | core/src/main/scala/varys/framework/master/FlowInfo.scala | Scala | apache-2.0 | 1,095 |
import sbt._
object Idea {
// quick 'n dirty way to add Android Facet to IDEA projects
val command: Command = Command.command("gen-idea-android") { state =>
val base = Project.extract (state).currentProject.base
transform(base / ".." / ".idea_modules" / "cloudr.iml", "app")
transform(base / ".." / ".id... | sdb/cloudr | project/Idea.scala | Scala | gpl-3.0 | 2,972 |
package controllers
import api.StreamHelper
import play.api.mvc._
import scala.collection.immutable._
import helper.ImageHelper
/**
* Stream object controller.
*/
object Stream extends Controller {
import ControllerHelper._
val AcceptsPng = Accepting("image/png")
/**
* Stream root index page.
*
* ... | Blotre/blotre | app/controllers/StreamController.scala | Scala | mit | 2,778 |
package actors
import akka.actor._
import com.bryzek.apidoc.api.v0.models.{Application, Organization, Publication, Subscription, User, Visibility}
import db.{ApplicationsDao, Authorization, MembershipsDao, SubscriptionsDao}
import javax.inject.{Inject, Singleton}
import lib.{Config, Email, Pager, Person}
import play.a... | movio/apidoc | api/app/actors/Emails.scala | Scala | mit | 3,984 |
package december2016
import java.security.MessageDigest
import scala.util.Random
/**
* Created by Chongguang on 2016/12/17.
*/
object Day17 {
def md5(s: String): String = {
MessageDigest.getInstance("MD5").digest(s.getBytes).map("%02X" format _).mkString.toLowerCase
}
val passcode = "pxxbnzuo"
def ... | chongguang/adventofcode | src/main/scala/december2016/Day17.scala | Scala | mit | 1,755 |
package net.itadinanta.rnkr.engine
import net.itadinanta.rnkr.core.arbiter.Arbiter
import akka.pattern._
import akka.actor._
import net.itadinanta.rnkr.core.arbiter.ActorArbiter
import net.itadinanta.rnkr.core.arbiter.ActorGateWrapper
import Leaderboard._
import net.itadinanta.rnkr.core.arbiter.Gate
/**
* Implements ... | itadinanta/rnkr | rnkr-engine/src/main/scala/net/itadinanta/rnkr/engine/ConcurrentLeaderboard.scala | Scala | gpl-2.0 | 1,180 |
package com.github.etacassiopeia.s99.arithmetic
/**
* <h1>P39</h1>
* Compare the two methods of calculating Euler's totient function
* Use the solution of problems P34 and P37 to compare the algorithm. Try to calculate Phi(10090) as an example
*
* @author Mohsen Zainalpour
* @version 1.0
* @since 16/05/1... | EtaCassiopeia/S-99 | src/main/scala/com/github/etacassiopeia/s99/arithmetic/P38.scala | Scala | apache-2.0 | 602 |
package org.ausdigital.apecconnect.db.model
import play.api.libs.functional.syntax._
import play.api.libs.json.Reads._
import play.api.libs.json._
import play.api.mvc.PathBindable
import scala.language.implicitConversions
import scalaz.Equal
/**
* Container for persisted piece of data, its id and metadata.
* @para... | TeamAusDigital/apec-connect | server/modules/db/src/main/scala/org/ausdigital/apecconnect/db/model/Record.scala | Scala | apache-2.0 | 3,453 |
package blended.itestsupport.http
import scala.concurrent.Await
import scala.concurrent.duration._
import akka.actor.ActorSystem
import akka.http.scaladsl.Http
import akka.http.scaladsl.server.Route
import blended.util.logging.Logger
object TestServer {
private[this] val log = Logger[TestServer.type]
def withS... | woq-blended/blended | blended.itestsupport/src/test/scala/blended/itestsupport/http/TestServer.scala | Scala | apache-2.0 | 802 |
/*
* (c) Copyright 2016 Hewlett Packard Enterprise Development LP
*
* 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 b... | hpe-cct/cct-core | src/main/scala/cogx/compiler/codegenerator/opencl/hyperkernels/MagnitudePhaseToComplexHyperKernel.scala | Scala | apache-2.0 | 3,250 |
/*
* Copyright 2015 Avira Operations GmbH
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agre... | Avira/sparser | test/src/main/scala/com/avira/ds/sparser/test/deprecated/ParserTestSuite.scala | Scala | apache-2.0 | 3,291 |
/*
* This program is licensed to you under the Apache License Version 2.0,
* and you may not use this file except in compliance with the Apache License Version 2.0.
* You may obtain a copy of the Apache License Version 2.0 at http://www.apache.org/licenses/LICENSE-2.0.
*
* Unless required by applicable law or agre... | mate1/camus2kafka | src/main/scala/com/mate1/camus2kafka/C2KJobConfig.scala | Scala | apache-2.0 | 8,040 |
package sangria.execution.deferred
import scala.collection.mutable.{Map => MutableMap, Set => MutableSet}
import scala.concurrent.Future
class Fetcher[Ctx, Res, RelRes, Id](
val idFn: Res => Id,
val fetch: (FetcherContext[Ctx], Seq[Id]) => Future[Seq[Res]],
val fetchRel: (FetcherContext[Ctx], RelationIds[... | OlegIlyenko/sangria | modules/core/src/main/scala/sangria/execution/deferred/Fetcher.scala | Scala | apache-2.0 | 13,219 |
package zzb.rest
import shapeless._
import zzb.rest.unmarshalling.MalformedContent
trait ConjunctionMagnet[L <: HList] {
type Out
def apply(underlying: Directive[L]): Out
}
object ConjunctionMagnet {
implicit def fromDirective[L <: HList, R <: HList](other: Directive[R])(implicit p: Prepender[L, R]) =
new ... | stepover/zzb | zzb-rest/src/main/scala/zzb/rest/Directive.scala | Scala | mit | 4,268 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | maropu/spark | sql/core/src/test/scala/org/apache/spark/sql/DateFunctionsSuite.scala | Scala | apache-2.0 | 37,164 |
package dotty.tools
package dotc
package fromtasty
import core._
import Decorators._
import Contexts.Context
import Symbols.{Symbol, ClassSymbol}
import SymDenotations.ClassDenotation
import NameOps._
import ast.Trees.Tree
import Phases.Phase
/** Load trees from TASTY files */
class ReadTasty extends Phase {
def ... | som-snytt/dotty | compiler/src/dotty/tools/dotc/fromtasty/ReadTasty.scala | Scala | apache-2.0 | 3,049 |
package info.hupel.isabelle.tests
import java.nio.file.Files
import org.specs2.Specification
import org.specs2.specification.core.Env
import info.hupel.isabelle.Platform
import info.hupel.isabelle.setup._
class SetupSpec(val specs2Env: Env) extends Specification with DefaultSetup { def is = s2"""
Isabelle setup
... | larsrh/libisabelle | tests/offline/src/test/scala/SetupSpec.scala | Scala | apache-2.0 | 1,004 |
/*
* Copyright © 2014 TU Berlin (emma@dima.tu-berlin.de)
*
* 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 app... | aalexandrov/emma | emma-language/src/main/scala/org/emmalanguage/ast/CommonAST.scala | Scala | apache-2.0 | 12,237 |
/*
* Copyright 2011 Delving B.V.
*
* 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... | delving/culture-hub | web-core/app/controllers/Logger.scala | Scala | apache-2.0 | 6,776 |
package com.github.wakfudecrypt.types.data
import com.github.wakfudecrypt._
@BinaryDecoder
case class WorldLootList(
_0_int32: Int,
_1_float64: Double,
_2_int16: Short,
_3_int16: Short,
_4_str: String,
_5_int16: Short,
_6_array_composite: Array[WorldLootList_6_array_composite]
)
object WorldLootList ex... | jac3km4/wakfudecrypt | types/src/main/scala/com/github/wakfudecrypt/types/data/WorldLootList.scala | Scala | mit | 625 |
package autolift.algebird
import autolift.LiftFlatMap
import com.twitter.algebird.{Functor, Monad}
trait AlgeLiftFlatMap[Obj, Fn] extends LiftFlatMap[Obj, Fn]
object AlgeLiftFlatMap extends LowPriorityAlgeLiftFlatMap {
def apply[Obj, Fn](implicit lift: AlgeLiftFlatMap[Obj, Fn]): Aux[Obj, Fn, lift.Out] = lift
im... | wheaties/AutoLifts | autolift-algebird/src/main/scala/autolift/algebird/LiftFlatMap.scala | Scala | apache-2.0 | 1,707 |
package pl.touk.nussknacker.engine.flink.util.transformer.aggregate
import org.apache.flink.api.common.functions.RuntimeContext
import org.apache.flink.configuration.Configuration
import org.apache.flink.streaming.api.scala.function.ProcessWindowFunction
import org.apache.flink.streaming.api.windowing.windows.TimeWind... | TouK/nussknacker | engine/flink/components/base/src/main/scala/pl/touk/nussknacker/engine/flink/util/transformer/aggregate/EnrichingWithKeyFunction.scala | Scala | apache-2.0 | 1,595 |
object GraphSonatype extends Sonatype {
def projectUrl = "http://subversion.assembla.com/svn/scala-graph/trunk"
def licenseName = "The Apache Software License, Version 2.0"
def licenseUrl = "http://www.apache.org/licenses/LICENSE-2.0.txt"
def developerId = "peter"
def developerName = "Peter Emp... | Calavoow/scala-graph | project/GraphSonatype.scala | Scala | bsd-3-clause | 428 |
package com.artclod.mathml
import org.junit.runner.RunWith
import org.scalatestplus.play._
import play.api.test.Helpers._
import org.junit.runner.RunWith
import scala.xml._
import play.api.test._
import play.api.test.Helpers._
import com.artclod.mathml.scalar._
import com.artclod.mathml.scalar.apply._
import com.artcl... | kristiankime/calc-tutor | test/com/artclod/mathml/MathMLCheckEqExponentialSpec.scala | Scala | mit | 1,897 |
package com.robocubs4205.oauth.grant
import java.time.Instant
/**
* Created by trevor on 9/16/17.
*/
case class Grant(accessToken:String,
refreshToken:Option[String],
scopes:Seq[String],
expires:Option[Instant])
| robocubs4205/cubscout-server | api-server/app/com/robocubs4205/oauth/grant/Grant.scala | Scala | mit | 269 |
package com.github.aselab.activerecord
import com.github.aselab.activerecord.dsl._
package models {
case class Model1(value: Int) extends ActiveRecord
object Model1 extends ActiveRecordCompanion[Model1]
case class Model2(value: Int) extends ActiveRecord
object Model2 extends ActiveRecordCompanion[Model2]
... | aselab/scala-activerecord | specs/src/test/scala/ActiveRecordSpecificationSpec.scala | Scala | mit | 1,278 |
/*
* Copyright (C) Lightbend Inc. <https://www.lightbend.com>
*/
package play.sbt
import sbt._
import xsbti.Problem
import play.api._
object PlayExceptions {
private def filterAnnoyingErrorMessages(message: String): String = {
val overloaded = """(?s)overloaded method value (.*) with alternatives:(.*)cannot ... | mkurz/playframework | dev-mode/sbt-plugin/src/main/scala/play/sbt/PlayExceptions.scala | Scala | apache-2.0 | 1,799 |
package com.draugrsoft.integration.helper.constants
private [integration] object JobStatus {
sealed abstract class JobStatusEnum(name:String){
override def toString = name
}
case object INITIALIZING extends JobStatusEnum("INITIALIZING") // Initial State when Integration boots up
case object RUNNING e... | yfayman/integration-helper-scala | core/src/main/scala/com/draugrsoft/integration/helper/constants/JobStatus.scala | Scala | mit | 800 |
package scodec
package examples
import scalaz.\\/-
import scalaz.std.anyVal.unitInstance
import shapeless._
import scodec.bits.{ BitVector, ByteVector }
import scodec.codecs._
// Define MPEG codecs
object MpegCodecs {
// Define case classes that describe MPEG packets and define an HList iso for each
case class... | ceedubs/scodec | src/test/scala/scodec/examples/MpegPacketExample.scala | Scala | bsd-3-clause | 3,741 |
/*
* Copyright (c) Microsoft. All rights reserved.
* Licensed under the MIT license. See LICENSE file in the project root for full license information.
*/
package org.apache.spark.csharp
import org.apache.spark.internal.Logging
import org.scalatest.{FunSuite, Outcome}
/**
* Base abstract class for all unit tests ... | hebinhuang/Mobius | scala/src/test/scala/org/apache/spark/csharp/SparkCLRFunSuite.scala | Scala | mit | 1,148 |
package controllers
import play.api._
import play.api.mvc._
/**
* Project IntelliJ IDEA
* Module controllers
* User: Gyuhyeon
* Date: 2014. 2. 6.
* Time: 오전 2:14
*/
object Authentication extends Controller {
}
| wingleess/EZOne-server | app/controllers/Authentication.scala | Scala | lgpl-3.0 | 223 |
// Generated by the Scala Plugin for the Protocol Buffer Compiler.
// Do not edit!
//
// Protofile syntax: PROTO3
package scalapb.perf.protos
/** @param rep
* [(scalapb.field).collection_type="List"];
*/
@SerialVersionUID(0L)
final case class MessageContainer(
opt: _root_.scala.Option[scalapb.perf.protos.Si... | scalapb/ScalaPB | docs/src/main/scala/generated/scalapb/perf/protos/MessageContainer.scala | Scala | apache-2.0 | 8,508 |
/**
* The MIT License (MIT)
*
* Copyright (c) 2018 Israel Freitas(israel.araujo.freitas@gmail.com)
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including with... | ifreitas/AimlToXml | src/main/scala/ifreitas/scalaaiml/elements/TopicStar.scala | Scala | mit | 1,339 |
package taczombie.model.util
import scala.language.implicitConversions
import spray.json.DefaultJsonProtocol
import spray.json.JsValue
import spray.json.pimpAny
import taczombie.model.Game
import taczombie.model.GameFieldCell
import taczombie.model.Human
import taczombie.model.Zombie
object JsonHelper {
case class... | mahieke/TacZombie | model/src/main/scala/taczombie/model/util/JsonHelper.scala | Scala | gpl-2.0 | 5,955 |
/*
* Copyright (C) 2009-2017 Lightbend Inc. <https://www.lightbend.com>
*/
package play.api.inject
import java.util.concurrent.Executor
import javax.inject.{ Inject, Provider, Singleton }
import akka.actor.ActorSystem
import akka.stream.Materializer
import com.typesafe.config.Config
import play.api._
import play.ap... | hagl/playframework | framework/src/play/src/main/scala/play/api/inject/BuiltinModule.scala | Scala | apache-2.0 | 4,403 |
package com.stefansavev.core.string2id
import java.io.{InputStream, OutputStream}
import com.stefansavev.core.serialization.{StringSerializer, IntSerializer, TypedSerializer}
import com.stefansavev.core.serialization.StringSerializer
object String2IdHasherSerialization {
implicit object String2IdHasherSerializer ... | stefansavev/random-projections-at-berlinbuzzwords | src/main/scala/com/stefansavev/core/string2id/String2IdHasherSerializer.scala | Scala | apache-2.0 | 2,486 |
package controllers
import com.thetestpeople.trt.service.Service
import com.thetestpeople.trt.utils.HasLogger
import play.api.data.Form
import play.api.mvc._
import routes.ImportSpecController
import viewModel._
import views.html
/**
* Controller for TeamCity config screen
*/
class TeamCityController(service: Serv... | thetestpeople/trt | app/controllers/TeamCityController.scala | Scala | mit | 1,350 |
package org.bitcoins.core.script.interpreter
import org.bitcoins.core.consensus.Consensus
import org.bitcoins.core.crypto.{BaseTransactionSignatureComponent, WitnessV0TransactionSignatureComponent}
import org.bitcoins.core.currency.{CurrencyUnit, CurrencyUnits}
import org.bitcoins.core.protocol.CompactSizeUInt
import ... | SuredBits/bitcoin-s-sidechains | src/main/scala/org/bitcoins/core/script/interpreter/ScriptInterpreter.scala | Scala | mit | 32,742 |
/*
* 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/main/scala/uk/gov/hmrc/ct/computations/formats/Cars.scala | Scala | apache-2.0 | 984 |
package views
package html.puzzle
import controllers.routes
import lila.api.Context
import lila.app.templating.Environment._
import lila.app.ui.ScalatagsTemplate._
import lila.puzzle.PuzzleTheme
object theme {
def list(themes: List[(lila.i18n.I18nKey, List[PuzzleTheme.WithCount])])(implicit ctx: Context) =
vi... | luanlv/lila | app/views/puzzle/theme.scala | Scala | mit | 2,172 |
package sgl
package analytics
import sgl.util.LoggingProvider
/** A GameStateComponent that automates analytics.
*
* This extends default game state implementation with
* an implementation that automatically tracks game screen
* navigation.
*
* If you want to use it, make sure to mix it in AFTER mixin the... | regb/scala-game-library | core/src/main/scala/sgl/analytics/GameStateAutoAnalyticsComponent.scala | Scala | mit | 1,240 |
/*
* ____ ____ _____ ____ ___ ____
* | _ \\ | _ \\ | ____| / ___| / _/ / ___| Precog (R)
* | |_) | | |_) | | _| | | | | /| | | _ Advanced Analytics Engine for NoSQL Data
* | __/ | _ < | |___ | |___ |/ _| | | |_| | Copyright (C) 2010 - 2013 SlamData, In... | precog/platform | yggdrasil/src/main/scala/com/precog/yggdrasil/actor/ProjectionsActor.scala | Scala | agpl-3.0 | 2,252 |
/*
* 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 ... | trueyao/spark-lever | mllib/src/test/scala/org/apache/spark/mllib/stat/HypothesisTestSuite.scala | Scala | apache-2.0 | 7,001 |
/*
* Copyright (C) 2005 - 2019 Schlichtherle IT Services.
* All rights reserved. Use is subject to license terms.
*/
package global.namespace.truelicense.tests.swing
import global.namespace.truelicense.api.{ConsumerLicenseManager, License, LicenseManagementException}
import global.namespace.truelicense.swing.Licens... | christian-schlichtherle/truelicense | tests/src/test/scala/global/namespace/truelicense/tests/swing/LicenseManagementWizardITLike.scala | Scala | apache-2.0 | 8,144 |
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.