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 |
|---|---|---|---|---|---|
/*
* Copyright 2012 Twitter Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed t... | netconstructor/zipkin | zipkin-scrooge/src/main/scala/com/twitter/zipkin/adapter/ThriftQueryAdapter.scala | Scala | apache-2.0 | 4,871 |
package org.bizzle.astar
import
org.bizzle.pathfinding.{ coordinate, pathingmap, PathingStatus },
coordinate.{ BadCoordinate2D, Coordinate2D },
pathingmap.PathingMapString
import
base.{ AStarBase, HeuristicLib }
/**
* Created by IntelliJ IDEA.
* User: Jason
* Date: 12/4/11
* Time: 10:40 PM
*/
// Ba... | TheBizzle/PathFinding | AStar/src/main/org/bizzle/astar/BiDirAStar.scala | Scala | bsd-3-clause | 1,789 |
package codeboy.mapreduce.simple
abstract class Mapper[inputType,outPutKeyType,outPutValueType] {
//ignore the input key
def map (input: inputType):List[(outPutKeyType,outPutValueType)]
} | codeboyyong/scala-sample | my_sample/src/main/scala/codeboy/mapreduce/simple/Mapper.scala | Scala | apache-2.0 | 196 |
/*
* 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 ... | ravipesala/incubator-carbondata | integration/spark2/src/test/scala/org/apache/carbondata/spark/testsuite/allqueries/InsertIntoCarbonTableSpark2TestCase.scala | Scala | apache-2.0 | 1,530 |
/*
* 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 ... | zzcclp/carbondata | integration/spark/src/main/scala/org/apache/spark/sql/execution/strategy/MixedFormatHandler.scala | Scala | apache-2.0 | 16,907 |
/*
* 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 ... | himanshudhami/PredictionIO | storage/elasticsearch/src/main/scala/org/apache/predictionio/data/storage/elasticsearch/ESSequences.scala | Scala | apache-2.0 | 3,012 |
package chapter.fifteen
import ExerciseFour._
import org.scalatest._
import org.scalatest.junit.JUnitRunner
import org.junit.runner.RunWith
@RunWith(classOf[JUnitRunner])
class ExerciseFourSpec extends FlatSpec with Matchers {
"function" should "" in {
}
}
| deekim/impatient-scala | src/test/scala/chapter/fifteen/ExerciseFourSpec.scala | Scala | apache-2.0 | 265 |
package net.warpgame.engine.core.context.loader.service
import java.lang.invoke.{MethodHandle, MethodHandles}
import java.lang.reflect.{AnnotatedElement, Constructor, Parameter}
import net.warpgame.engine.core.context.service.ServiceBuilder
import net.warpgame.engine.core.context.service.{Qualified, ServiceBuilder}
i... | WarpOrganization/warp | core/src/main/scala/net/warpgame/engine/core/context/loader/service/ServiceResolver.scala | Scala | lgpl-3.0 | 4,805 |
/* __ *\\
** ________ ___ / / ___ Scala API **
** / __/ __// _ | / / / _ | (c) 2002-2010, LAMP/EPFL **
** __\\ \\/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\\___/_/... | cran/rkafkajars | java/scala/Option.scala | Scala | apache-2.0 | 6,377 |
package eventstore
package akka
import scala.concurrent.{ ExecutionContext, Future }
import _root_.akka.actor.ActorRef
import _root_.akka.pattern.ask
import _root_.akka.util.Timeout
trait EsTransaction {
def transactionId: Long
def write(events: List[EventData]): Future[Unit]
def commit(): Future[Unit]
}
priva... | EventStore/EventStore.JVM | client/src/main/scala/eventstore/akka/EsTransaction.scala | Scala | bsd-3-clause | 1,293 |
/*
* Copyright (c) 2014-2021 by The Monix Project Developers.
* See the project homepage at: https://monix.io
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache... | monixio/monix | monix-catnap/jvm/src/test/scala/monix/catnap/ConcurrentQueueJVMSuite.scala | Scala | apache-2.0 | 1,807 |
/*
* 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... | jenniew/BigDL | spark/dl/src/test/scala/com/intel/analytics/bigdl/torch/SpatialDilatedConvolutionSpec.scala | Scala | apache-2.0 | 11,918 |
/*
* GE.scala
* (FScape)
*
* Copyright (c) 2001-2022 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.fscape
import de.sciss.... | Sciss/FScape-next | core/shared/src/main/scala/de/sciss/fscape/GE.scala | Scala | agpl-3.0 | 1,176 |
package cas.analysis.subject.components
case class ID(value: String) extends Component
| kell18/CAS | src/main/scala/cas/analysis/subject/components/ID.scala | Scala | gpl-2.0 | 88 |
package org.qbproject.schema
import org.specs2.mutable.Specification
import play.api.libs.json._
import play.api.libs.json.Json.toJsFieldJsValueWrapper
import scala.math.BigDecimal.long2bigDecimal
object DSLSpec extends Specification {
import QBSchema._
"DSL" should {
val schema = qbClass("time" -> qbPosix... | edgarmueller/qbproject | qbschema/src/test/scala/org/qbproject/schema/DSLSpec.scala | Scala | apache-2.0 | 987 |
/*
* Copyright (c) 2015,
* Ilya Sergey, Christopher Earl, Matthew Might and David Van Horn
* 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 t... | ilyasergey/reachability | src/org/ucombinator/lambdajs/cfa/pdcfa/LambdaJSGarbageCollector.scala | Scala | bsd-3-clause | 2,110 |
/*
* Copyright (C) 2016-2019 Lightbend Inc. <https://www.lightbend.com>
*/
package com.lightbend.lagom.scaladsl.api.broker
import akka.Done
import akka.stream.scaladsl.{ Flow, Source }
import scala.concurrent.Future
/**
* A Subscriber for consuming messages from a message broker.
*/
trait Subscriber[Payload] {
... | rstento/lagom | service/scaladsl/api/src/main/scala/com/lightbend/lagom/scaladsl/api/broker/Subscriber.scala | Scala | apache-2.0 | 2,957 |
package ul
trait GetArgs extends Props {
//parse array of arguments and place result to props
def argsParse(args: Array[String], sep:String = "=") {
for (a <- args) {
val as = a.split(sep)
if (as.length <= 2) {
argFind(as(0)) match {
case Som... | edartuz/meerkat | repo/src/ul/GetArgs.scala | Scala | mit | 1,077 |
package io.udash.auth
trait UserCtx {
def has(permission: Permission): Boolean
def isAuthenticated: Boolean
}
object UserCtx {
trait Unauthenticated extends UserCtx {
override def has(permission: Permission): Boolean = false
override def isAuthenticated: Boolean = false
}
} | UdashFramework/udash-core | auth/src/main/scala/io/udash/auth/UserCtx.scala | Scala | apache-2.0 | 292 |
/*
* 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 ... | gioenn/xSpark | mllib/src/main/scala/org/apache/spark/ml/classification/LogisticRegression.scala | Scala | apache-2.0 | 43,476 |
/*
* Licensed to The Apereo Foundation under one or more contributor license
* agreements. See the NOTICE file distributed with this work for additional
* information regarding copyright ownership.
*
* The Apereo Foundation licenses this file to you under the Apache License,
* Version 2.0, (the "License"); you ma... | equella/Equella | Source/Plugins/Core/com.equella.core/scalasrc/com/tle/web/api/item/SelectionApi.scala | Scala | apache-2.0 | 5,315 |
/*
* 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 ... | wgpshashank/spark | streaming/src/main/scala/spark/streaming/dstream/KafkaInputDStream.scala | Scala | apache-2.0 | 5,201 |
/**
* Copyright 2015 Adrian Hurtado (adrianhurt)
*
* 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 l... | adrianhurt/play-bootstrap3 | play25-bootstrap3/module/app/views/b3/horizontal/package.scala | Scala | apache-2.0 | 3,692 |
package org.chipmunk.value
import java.sql.{ Date => SQLDate }
import scala.language.implicitConversions
import org.joda.time.DateTime
object Date {
implicit def sqlDateAsPersistentDate(date: SQLDate): Date = new Date(date)
}
class Date(date: SQLDate) {
def asJoda: DateTime = new DateTime(date.getTime)
}
| kpjjpk/chipmunk | src/main/scala/org/chipmunk/value/Date.scala | Scala | mit | 315 |
/*
* Copyright (C) 2015 Stratio (http://stratio.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by app... | Frannie-Ludmilla/sparta | serving-core/src/main/scala/com/stratio/sparta/serving/core/constants/ActorsConstant.scala | Scala | apache-2.0 | 722 |
package com.twitter.finagle.loadbalancer
import com.twitter.util.{Duration, Stopwatch}
import scala.util.Random
import scala.io.Source
private object FailureProfile {
val rng: Random = new Random("seed".hashCode)
/** Create a failure profile using this instantiation as the start time */
def apply(): FailurePro... | luciferous/finagle | finagle-benchmark/src/main/scala/com/twitter/finagle/loadbalancer/FailureProfile.scala | Scala | apache-2.0 | 1,707 |
package org.infinispan.spark.test
import org.infinispan.client.hotrod.configuration.ConfigurationBuilder
import org.infinispan.client.hotrod.{RemoteCache, RemoteCacheManager}
import org.infinispan.spark.config.ConnectorConfiguration
import org.infinispan.spark.rdd.RemoteCacheManagerBuilder
import org.jboss.dmr.scala.M... | galderz/infinispan-spark | src/test/scala/org/infinispan/spark/test/RemoteTest.scala | Scala | apache-2.0 | 3,663 |
/*
* Copyright 2013 Sanjin Sehic
*
* 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... | tuwiendsg/CAPA | akka/test/scala/origin/RemoteBuilderSpec.scala | Scala | apache-2.0 | 1,172 |
package uk.gov.gds.ier.model
case class PostalOrProxyVote (
typeVote: WaysToVoteType,
postalVoteOption: Option[Boolean],
deliveryMethod: Option[PostalVoteDeliveryMethod]) {
def toApiMap = {
val voteMap = postalVoteOption match {
case Some(pvote) => typeVote match {
case WaysToVoteType.... | alphagov/ier-frontend | app/uk/gov/gds/ier/model/PostalOrProxyVote.scala | Scala | mit | 1,411 |
package ch.ninecode.cim
import org.apache.commons.logging.{Log, LogFactory}
import org.apache.hadoop.io.Text
import org.apache.hadoop.mapreduce.InputSplit
import org.apache.hadoop.mapreduce.RecordReader
import org.apache.hadoop.mapreduce.TaskAttemptContext
import org.apache.hadoop.mapreduce.lib.input.FileSplit
import... | derrickoswald/CIMScala | CIMReader/src/main/scala/ch/ninecode/cim/CIMRecordReader.scala | Scala | mit | 3,399 |
package com.rklaehn.interval
import org.scalatest.FunSuite
import spire.implicits._
import spire.math.Interval
class IntervalMapTest extends FunSuite {
test("IntervalMap[Int, Bool]") {
val a = IntervalMap.FromBool.above(1, true)
val b = IntervalMap.FromBool.below(1, true)
val c = a | b
val d = ~a
... | rklaehn/intervalset | src/test/scala/com/rklaehn/interval/IntervalMapTest.scala | Scala | apache-2.0 | 2,703 |
/*
* 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/cloud-integration | spark-cloud-integration/src/main/scala/com/cloudera/spark/cloud/ObjectStoreOperations.scala | Scala | apache-2.0 | 17,237 |
/**
* 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... | twitter/heron | heron/api/src/scala/org/apache/heron/streamlet/scala/StreamletBase.scala | Scala | apache-2.0 | 1,921 |
package org.junit.runners.model
class FrameworkMethod {
// Dummy for classOf[...]
}
| nicolasstucki/scala-js-junit | runtime/src/main/scala/org/junit/runners/model/FrameworkMethod.scala | Scala | bsd-3-clause | 87 |
package chapter.twentyone
object ExerciseNine extends App {
}
| deekim/impatient-scala | src/main/scala/chapter/twentyone/ExerciseNine.scala | Scala | apache-2.0 | 65 |
package uk.gov.dvla.vehicles.presentation.common.model
final case class DisposeModel(vehicleMake: String,
vehicleModel: String,
dealerName: String,
dealerAddress: AddressModel,
transactionId: Option[... | dvla/vehicles-presentation-common | app/uk/gov/dvla/vehicles/presentation/common/model/DisposeModel.scala | Scala | mit | 394 |
/*
* 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 ... | likithkailas/StreamingSystems | mesos/src/main/scala/org/apache/spark/scheduler/cluster/mesos/MesosClusterScheduler.scala | Scala | apache-2.0 | 30,007 |
/*
* Copyright (C) 2014 - 2017 Contributors as noted in the AUTHORS.md file
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option)... | Tensei-Data/tensei-agent | benchmarks/src/main/scala/com/wegtam/tensei/agent/ParserDataContainerTimestampMemoryUsage.scala | Scala | agpl-3.0 | 2,298 |
package gapt.provers.spass
import gapt.examples.CountingEquivalence
import gapt.expr._
import gapt.expr.formula.Bottom
import gapt.expr.formula.Top
import gapt.expr.formula.fol.{ naive, thresholds }
import gapt.proofs.context.mutable.MutableContext
import gapt.proofs.resolution.{ AvatarComponent, AvatarNegNonGroundCom... | gapt/gapt | tests/src/test/scala/gapt/provers/spass/SpassTest.scala | Scala | gpl-3.0 | 3,035 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | tophua/spark1.52 | sql/core/src/main/scala/org/apache/spark/sql/execution/joins/HashOuterJoin.scala | Scala | apache-2.0 | 9,414 |
package com.twitter.algebird.statistics
import com.twitter.algebird.CheckProperties
import org.scalacheck.Arbitrary
import org.scalacheck.Gen._
import org.scalatest.{ Matchers, _ }
class StatisticsRingLaws extends CheckProperties with Matchers {
import com.twitter.algebird.BaseProperties._
val statsRing = new St... | nvoron23/algebird | algebird-test/src/test/scala/com/twitter/algebird/statistics/StatisticsTests.scala | Scala | apache-2.0 | 2,100 |
/* sbt -- Simple Build Tool
* Copyright 2008, 2009 Mark Harrah
*/
package sbt
import jline.{ConsoleReader, History}
import java.io.{File, InputStream, PrintWriter}
import complete.Parser
import java.util.concurrent.atomic.AtomicBoolean
abstract class JLine extends LineReader
{
protected[this] val handleCONT: ... | olove/xsbt | util/complete/src/main/scala/sbt/LineReader.scala | Scala | bsd-3-clause | 4,401 |
package org.jetbrains.plugins.scala.lang.completion.postfix.templates
import com.intellij.psi.PsiElement
import org.jetbrains.plugins.scala.lang.completion.postfix.templates.selector.{SelectorConditions, AncestorSelector}
import org.jetbrains.plugins.scala.lang.completion.postfix.templates.selector.SelectorType._
/**... | loskutov/intellij-scala | src/org/jetbrains/plugins/scala/lang/completion/postfix/templates/ScalaPrintlnPostfixTemplate.scala | Scala | apache-2.0 | 645 |
/*
* 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/test/scala/com/intel/analytics/bigdl/nn/ops/SubstrSpec.scala | Scala | apache-2.0 | 1,757 |
package chess
final case class LagTracker(
quotaGain: Centis,
quota: Centis,
quotaMax: Centis,
lagEstimator: DecayingRecorder,
uncompStats: Stats = Stats.empty,
lagStats: Stats = Stats.empty,
// We can remove compEst fields after tuning estimate.
compEstSqErr: Int = 0,
compEstOvers:... | ornicar/scalachess | src/main/scala/LagTracker.scala | Scala | mit | 2,471 |
package com.sksamuel.avro4s.schema
import com.sksamuel.avro4s.AvroSchema
import org.scalatest.funsuite.AnyFunSuite
import org.scalatest.matchers.should.Matchers
class NamespaceSchemaTest extends AnyFunSuite with Matchers {
test("use package name for top level class") {
val expected = new org.apache.avro.Schema... | sksamuel/avro4s | avro4s-core/src/test/scala/com/sksamuel/avro4s/schema/NamespaceSchemaTest.scala | Scala | apache-2.0 | 1,596 |
package org.jetbrains.plugins.scala
package codeInspection.recursion
import com.intellij.codeInspection.ProblemsHolder
import com.intellij.openapi.project.Project
import org.jetbrains.plugins.scala.codeInspection.{AbstractFixOnPsiElement, AbstractInspection}
import org.jetbrains.plugins.scala.lang.psi.api.statements.{... | triggerNZ/intellij-scala | src/org/jetbrains/plugins/scala/codeInspection/recursion/NoTailRecursionAnnotationInspection.scala | Scala | apache-2.0 | 1,043 |
package org.apache.spark.ml.classification
import breeze.linalg.{Vector => BV}
import org.apache.spark.SparkException
import org.apache.spark.ml.Estimator
import org.apache.spark.ml.param.ParamMap
import org.apache.spark.ml.util.{Identifiable, SchemaUtils}
import org.apache.spark.ml.{Estimator, Model, Predictor}
impor... | arun4av/Spark_KNN | spark-knn/src/main/scala/org/apache/spark/ml/classification/KNN.scala | Scala | apache-2.0 | 9,975 |
package geotrellis.test.singleband.file
import geotrellis.config.Dataset
import geotrellis.raster.Tile
import geotrellis.spark._
import geotrellis.spark.io._
import geotrellis.test.FileTest
import geotrellis.test.singleband.load.S3Load
import geotrellis.vector.ProjectedExtent
import geotrellis.util.S3Support
import o... | geotrellis/geotrellis-integration-tests-tool | src/main/scala/geotrellis/test/singleband/file/S3IngestTest.scala | Scala | apache-2.0 | 638 |
object Solution {
def movs(arr:Array[Long]) = {
def go(mid:Int,lefts:Long,rights:Long,mov:Int,lo:Int,hi:Int,le:Int):Int = {
if(lo > hi) return mov
if(lefts < rights && mid < hi) {
if(le == -1) return mov
go(mid+1,lefts+arr(mid),rights-arr(mid),mov,lo,hi,1)
} else if(lefts > right... | marcos-sb/hacker-rank | algorithms/dynamic-programming/nikita-and-the-game/Solution.scala | Scala | apache-2.0 | 1,534 |
package main.scala.projectEulerScala
import scala.collection.mutable
// 4782
object P25_1000DigitFibonacciNumber {
var memo = mutable.Map[Int, BigInt]()
def f(n: Int): BigInt = {
if (n <= 2)
return 1
else if (memo.contains(n))
return memo(n)
val result: BigInt = f(n - 1) + f(n - 2)
me... | rck109d/projectEuler | src/main/scala/projectEulerScala/P25_1000DigitFibonacciNumber.scala | Scala | lgpl-3.0 | 535 |
package dsentric.contracts
import dsentric.failure.ClosedContractFailure
import dsentric.{DObject, Dsentric, PathEnd}
import org.scalatest.EitherValues
import org.scalatest.funspec.AnyFunSpec
import org.scalatest.matchers.should.Matchers
class ContractLensSpec extends AnyFunSpec with Matchers with EitherValues {
i... | HigherState/dsentric | maps/src/test/scala/dsentric/contracts/ContractLensSpec.scala | Scala | apache-2.0 | 2,221 |
package sgl.android.util
import sgl.util.JsonProvider
import org.json._
import scala.language.implicitConversions
trait AndroidJsonProvider extends JsonProvider {
object AndroidJson extends Json {
type JValue = Any
override def parse(raw: String): JValue = new JSONTokener(raw).nextValue()
class A... | regb/scala-game-library | android/core/src/main/scala/sgl/android/util/AndroidJsonProvider.scala | Scala | mit | 2,939 |
package es.uvigo.ei.sing.sds
package controller
import scala.concurrent.Future
import play.api.Play
import play.api.libs.json.{ Json, JsValue }
import play.api.libs.concurrent.Execution.Implicits.defaultContext
import play.api.mvc._
import entity._
import annotator._
object AnnotatorController extends Controller wi... | agjacome/smart-drug-search | src/main/scala/controller/AnnotatorController.scala | Scala | mit | 857 |
/*
* Copyright (C) 2009-2018 Lightbend Inc. <https://www.lightbend.com>
*/
package play.api.mvc
import java.io.IOException
import akka.actor.ActorSystem
import akka.stream.ActorMaterializer
import akka.stream.scaladsl.Source
import akka.util.ByteString
import org.specs2.mutable.Specification
import play.core.test.... | Shenker93/playframework | framework/src/play/src/test/scala/play/api/mvc/MultipartBodyParserSpec.scala | Scala | apache-2.0 | 1,899 |
package org.powlab.jeye.decode.corrector
import org.junit.Assert._
import org.junit.Test
import org.powlab.jeye.decode.TestUtils.makeNopOpcode
import org.powlab.jeye.decode.TestUtils.makeOpcode
import org.powlab.jeye.decode.graph.OpcodeNode
import org.powlab.jeye.decode.corrector.TryCatchFinallyCorrector.isSameNode
im... | powlab/jeye | src/test/scala/org/powlab/jeye/decode/corrector/TryCatchFinallyCorrectorTest.scala | Scala | apache-2.0 | 911 |
package dhg.ccg.tag.learn
import org.junit.Test
import dhg.util.CollectionUtil._
import dhg.util.StringUtil._
import org.junit.Assert._
import dhg.ccg.tag._
/*
* TODO: Test with unrestricted tag dictionary
*/
class SupHmmDistributionTests {
@Test
def test_tr_unsmoothed() {
val sentences = Vector(
"th... | dhgarrette/2014-ccg-supertagging | src/test/scala/dhg/ccg/tag/learn/SupHmmDistributionerTests.scala | Scala | apache-2.0 | 17,211 |
/*******************************************************************************
Copyright (c) 2012-2014, 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/cfg/CapturedVariableCollector.scala | Scala | bsd-3-clause | 8,666 |
/*
Copyright 2013 Stephen K Samuel
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to i... | carlosFattor/scrimage | scrimage-filters/src/main/scala/com/sksamuel/scrimage/filter/ChromeFilter.scala | Scala | apache-2.0 | 1,059 |
package org.scalaide.core.internal.hyperlink
import org.eclipse.jface.text.IRegion
import org.eclipse.jface.text.ITextViewer
import org.eclipse.jface.text.hyperlink.AbstractHyperlinkDetector
import org.eclipse.jface.text.hyperlink.IHyperlink
import org.eclipse.ui.texteditor.ITextEditor
import org.scalaide.core.compile... | scala-ide/scala-ide | org.scala-ide.sdt.core/src/org/scalaide/core/internal/hyperlink/BaseHyperlinkDetector.scala | Scala | bsd-3-clause | 2,721 |
def a(using i: => Int ) = () // ok
def b(using => Int ) = () // ok
| dotty-staging/dotty | tests/pos/i11997.scala | Scala | apache-2.0 | 71 |
package com.scalableQuality.quick.core.valueMapping
case object Trim extends ValueMapperFunction {
override def apply(value: Option[String]) = value.map(_.trim)
def apply(shouldInclude: Boolean): List[ValueMapperFunction] =
if (shouldInclude) List(Trim) else Nil
}
| MouslihAbdelhakim/Quick | src/main/scala/com/scalableQuality/quick/core/valueMapping/Trim.scala | Scala | apache-2.0 | 275 |
package rere.ql.types
trait PrimaryKey {
type Reql <: ReqlDatum
type Scala
}
object PrimaryKey {
type Int = PrimaryKey {
type Reql = ReqlInteger
type Scala = scala.Int
}
type Long = PrimaryKey {
type Reql = ReqlInteger
type Scala = scala.Long
}
type String = PrimaryKey {
type Reql ... | pbaun/rere | modules/ql/src/main/scala/rere/ql/types/PrimaryKey.scala | Scala | apache-2.0 | 559 |
package pl.writeonly.son2.vaadin.complexes
import com.vaadin.ui.TextArea
import pl.writeonly.son2.vaadin.util.UIUtil
class ComplexIO {
val input = inputTextArea
val output = ComplexIO.outputLabel
def inputTextArea: TextArea = ComplexIO.inputTextArea("Input json:")
}
object ComplexIO extends UIUtil {
}
| writeonly/scalare | scalare-adin/src/main/scala/pl/writeonly/son2/vaadin/complexes/ComplexIO.scala | Scala | artistic-2.0 | 314 |
/*
* Copyright 2022 HM Revenue & Customs
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or a... | hmrc/pbik-frontend | app/controllers/actions/MinimalAuthAction.scala | Scala | apache-2.0 | 1,838 |
package org.openapitools.client.model
case class PipelineBranchesitemlatestRun (
_durationInMillis: Option[Integer],
_estimatedDurationInMillis: Option[Integer],
_enQueueTime: Option[String],
_endTime: Option[String],
_id: Option[String],
_organization: Option[String],
_pipeline: Option[S... | cliffano/swaggy-jenkins | clients/scala-gatling/generated/src/gatling/scala/org/openapitools/client/model/PipelineBranchesitemlatestRun.scala | Scala | mit | 1,378 |
/*
* Copyright 2001-2009 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... | kevinwright/scalatest | src/main/scala/org/scalatest/AppendClueMethod.scala | Scala | apache-2.0 | 3,708 |
package sclib.io
import java.nio.file.{Path, Paths}
import sclib.ops.all._
import scala.util.Try
/**
* working with files and directories
*
* ===get a file / directory handle===
*
* to get a file handle, use any of the following functions:
* - [[fs.file(name:String)* file(name: String): Try[FSFile]... | j-keck/sclib | src/main/scala/sclib/io/fs/package.scala | Scala | mit | 4,400 |
/*
* 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... | liquidarmour/ct-calculations | src/main/scala/uk/gov/hmrc/ct/ct600/v3/B940.scala | Scala | apache-2.0 | 1,191 |
import com.darrenxyli.krypton.libs.{BaderBetweennessCentrality}
import org.apache.spark.hyperx.HypergraphLoader
import org.apache.spark.{SparkConf, SparkContext}
import scala.compat.Platform.currentTime
object Krypton {
def main(args: Array[String]) {
val logFile = args{0}
val partitionNum = args{1... | cube2matrix/Krypton | Krypton/src/main/scala/Krypton.scala | Scala | gpl-2.0 | 761 |
package frdomain.ch8
package cqrs
package memrepo
import org.joda.time.DateTime
import scalaz._
import Scalaz._
import scalaz.concurrent.Task
import Task._
import collection.concurrent.TrieMap
import common._
import spray.json._
import JSONProtocols._
trait Event[A] {
def at: DateTime
}
case class Opened(no: Str... | debasishg/frdomain | src/main/scala/frdomain/ch8/cqrs/memrepo/AccountService.scala | Scala | apache-2.0 | 6,260 |
package io.eels.component.hive
import org.apache.hadoop.hive.ql.io.orc.{OrcInputFormat, OrcOutputFormat, OrcSerde}
import org.apache.hadoop.hive.ql.io.parquet.{MapredParquetInputFormat, MapredParquetOutputFormat}
import org.apache.hadoop.hive.ql.io.parquet.serde.ParquetHiveSerDe
trait HiveFormat {
def serde: String... | stheppi/eel | eel-hive/src/main/scala/io/eels/component/hive/HiveFormat.scala | Scala | apache-2.0 | 2,361 |
package actors.routing.minutes
import actors.routing.minutes.MinutesActorLike.{ManifestLookup, ManifestsUpdate}
import actors.persistent.QueueLikeActor.UpdatedMillis
import drt.shared.CrunchApi.MillisSinceEpoch
import drt.shared.dates.UtcDate
import passengersplits.parsing.VoyageManifestParser.{VoyageManifest, VoyageM... | UKHomeOffice/drt-scalajs-spa-exploration | server/src/test/scala/actors/routing/minutes/MockManifestsLookup.scala | Scala | apache-2.0 | 1,318 |
object Test {
def main(args: Array[String]): Unit = {
J_2.main(args)
}
}
| som-snytt/dotty | tests/run/t3452a/S_3.scala | Scala | apache-2.0 | 81 |
package Yosemite.framework
private[Yosemite] object DataType extends Enumeration {
type DataType = Value
val FAKE, INMEMORY, ONDISK = Value
}
private[Yosemite] case class DataIdentifier(
dataId: String,
coflowId: String)
private... | zhanghan1990/Yosemite | core/src/main/scala/Yosemite/framework/DataDescription.scala | Scala | apache-2.0 | 3,079 |
package com.twitter.finagle.httpx
import com.twitter.finagle.httpx.netty.Bijections
import com.twitter.finagle.netty3.{ChannelBufferBuf, BufChannelBuffer}
import com.twitter.util.Base64StringEncoder
import com.twitter.io.Buf
import java.net.URL
import org.jboss.netty.buffer.{ChannelBuffer, ChannelBuffers}
import org.j... | yancl/finagle-6.22.0 | finagle-httpx/src/main/scala/com/twitter/finagle/httpx/RequestBuilder.scala | Scala | apache-2.0 | 15,829 |
package controllers.priv
import com.google.inject.Inject
import uk.gov.dvla.vehicles.presentation.common.clientsidesession.ClientSideSessionFactory
import utils.helpers.Config
class SuppressedV5C @Inject()()(implicit clientSideSessionFactory: ClientSideSessionFactory,
config: Config)
... | dvla/vehicles-online | app/controllers/priv/SuppressedV5C.scala | Scala | mit | 732 |
package dotty.tools.benchmarks.tuples
import org.openjdk.jmh.annotations._
@State(Scope.Thread)
class Zip {
@Param(Array("0"))
var size: Int = _
var tuple1: Tuple = _
var tuple2: Tuple = _
var array1: Array[Object] = _
var array2: Array[Object] = _
@Setup
def setup(): Unit = {
tuple1 = Tuple()
... | lampepfl/dotty | bench-run/src/main/scala/dotty/tools/benchmarks/tuples/Zip.scala | Scala | apache-2.0 | 684 |
package org.jetbrains.plugins.scala
package lang
package psi
package api
package base
import org.jetbrains.plugins.scala.lang.psi.api.statements.params._
import org.jetbrains.plugins.scala.lang.psi.api.toplevel.typedef._
import org.jetbrains.plugins.scala.lang.psi.impl.ScalaPsiElementFactory
import org.jetbrains.plugi... | jastice/intellij-scala | scala/scala-impl/src/org/jetbrains/plugins/scala/lang/psi/api/base/ScPrimaryConstructor.scala | Scala | apache-2.0 | 4,990 |
package sampler.abc.actor.children
import org.scalatest.FreeSpecLike
import akka.testkit.TestKit
import akka.actor.ActorSystem
class BroadcastActorTest extends TestKit(ActorSystem("ABC-test")) with FreeSpecLike {
"TODO" in fail("TODO")
} | tearne/Sampler | sampler-abc/src/test/scala/sampler/abc/actor/children/BroadcastActorTest.scala | Scala | apache-2.0 | 241 |
package thangiee.riotapi.currentgame
case class Participant(
bot: Boolean = false,
championId: Long = 0,
masteries: List[Mastery] = Nil,
profileIconId: Long = 0,
runes: List[Rune] = Nil,
spell1Id: Long = 0,
spell2Id: Long = 0,
summonerId: Long = 0 ,
summonerName: String = "",
teamId: Long = 0
)
| Thangiee/Riot-API-Scala | src/main/scala/thangiee/riotapi/currentgame/Participant.scala | Scala | mit | 319 |
package akashic.storage.admin
object Error {
trait t
case class Exception(e: t) extends RuntimeException
case class NotFound() extends t
def interpret(e: t): (Int, String) = e match {
case NotFound() => (404, "account not found")
case _ => (500, "unknown error")
}
def failWith(e: t) = throw Excepti... | akiradeveloper/akashic-storage | src/main/scala/akashic/storage/admin/Error.scala | Scala | apache-2.0 | 328 |
package org.danielnixon.progressive
import org.danielnixon.progressive.facades.virtualdom._
import shared.Wart
import scala.scalajs.js
@SuppressWarnings(Array(Wart.AsInstanceOf))
object Global {
val virtualDom: VirtualDom = js.Dynamic.global.virtualDom.asInstanceOf[VirtualDom]
val vdomParser: VDomParser = js.Dyn... | danielnixon/progressive | client/src/main/scala/org/danielnixon/progressive/Global.scala | Scala | gpl-3.0 | 370 |
package actors.queues
import actors.DateRange
import drt.shared.dates.{DateLike, LocalDate, UtcDate}
import org.specs2.mutable.Specification
import services.SDate
import services.graphstages.Crunch
class DateRangeSpec extends Specification {
"Concerning BST dates" >> {
"Given a start date of 2020-05-01T00:00+1 ... | UKHomeOffice/drt-scalajs-spa-exploration | server/src/test/scala/actors/queues/DateRangeSpec.scala | Scala | apache-2.0 | 2,737 |
/*
* 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 ... | gyfora/flink | flink-table/flink-table-planner-blink/src/test/scala/org/apache/flink/table/planner/plan/utils/FlinkRelOptUtilTest.scala | Scala | apache-2.0 | 7,998 |
/**
* Copyright 2015 Mohiva Organisation (license at mohiva dot com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless req... | mohiva/play-silhouette | silhouette/app/com/mohiva/play/silhouette/api/crypto/AuthenticatorEncoder.scala | Scala | apache-2.0 | 1,725 |
package akka.dispatch.verification
import akka.actor.{Cell, ActorRef, ActorSystem, Props}
import akka.dispatch.Envelope
import scala.collection.mutable.ListBuffer
import scala.collection.generic.Growable
import scala.collection.mutable.ArrayBuffer
import scala.collection.mutable.HashMap
import scala.collection.mutabl... | NetSys/demi | src/main/scala/verification/EventTrace.scala | Scala | bsd-2-clause | 19,960 |
/* __ *\\
** ________ ___ / / ___ Scala API **
** / __/ __// _ | / / / _ | (c) 2002-2013, LAMP/EPFL **
** __\\ \\/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\\___/_/... | scala-js/scala-js | scalalib/overrides-2.11/scala/runtime/ScalaRunTime.scala | Scala | apache-2.0 | 15,545 |
package forimpatient.chapter10
import java.io.{BufferedInputStream, FileInputStream, InputStream}
/**
* Created by Iryna Kharaborkina on 8/8/16.
*
* Solution to the Chapter 10 Exercise 08 'Scala for the Impatient' by Horstmann C.S.
*
* In the java.io library, you add buffering to an input stream with a Buf... | Kiryna/Scala-for-the-Impatient | src/forimpatient/chapter10/Exercise08.scala | Scala | apache-2.0 | 852 |
/*
* OpenURP, Agile University Resource Planning Solution
*
* Copyright (c) 2014-2015, OpenURP Software.
*
* OpenURP is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the Licens... | openurp/edu-core | grade/core/src/main/scala/org/openurp/edu/grade/course/domain/GradeFilter.scala | Scala | gpl-3.0 | 997 |
/*
Copyright 2013 Twitter, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software... | zirpins/summingbird | summingbird-online/src/main/scala/com/twitter/summingbird/planner/OnlinePlan.scala | Scala | apache-2.0 | 11,604 |
package sjs.react.bootstrap
import japgolly.scalajs.react._
import scala.scalajs.js
import japgolly.scalajs.react.vdom.prefix_<^._
object ButtonToolbar /* mixins: BootstrapMixin*/ {
val component = ReactComponentB[Props]("ButtonToolbar")
.render(
(P, C) => {
<.div(^.role := "toolbar", ^.classS... | aparo/scalajs-react-extra | react-bootstrap/src/main/scala/sjs/react/bootstrap/ButtonToolbar.scala | Scala | apache-2.0 | 866 |
package se.ramn.bottfarmen.util
object Timer extends Logging {
def time[T](message: String, thunk: => T): T = {
val start = System.nanoTime
val result = thunk
val durationMs = (System.nanoTime - start) / 1E6
logger.debug(s"$message, duration: $durationMs ms")
result
}
}
| ramn/bottfarmen | common/src/main/scala/util/Timer.scala | Scala | gpl-3.0 | 297 |
package dotty.tools.dotc
package transform
import MegaPhase._
import core.DenotTransformers._
import core.Symbols._
import core.Contexts._
import core.Flags._
import core.Decorators._
import core.StdNames.nme
import core.Names._
import core.NameKinds.TempResultName
import core.Constants._
import util.Store
import dott... | dotty-staging/dotty | compiler/src/dotty/tools/dotc/transform/CapturedVars.scala | Scala | apache-2.0 | 6,439 |
//package io.soheila.um.vos.accounts
//
//import java.util.Locale
//
//import io.soheila.um.entities.User
//import io.soheila.um.types.UserRole
//
//case class UserUpdateVO(
// firstName: String,
// middleName: String = "",
// lastName: String,
// email: String,
// avatarURL: Option[String],
// roles:... | esfand-r/soheila-um | src/main/scala/io/soheila/um/vos/accounts/UserUpdateVO.scala | Scala | apache-2.0 | 865 |
/**
* Copyright (c) 2013, The National Archives <digitalpreservation@nationalarchives.gov.uk>
* http://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://mozi... | valydia/csv-validator | csv-validator-core/src/test/scala/uk/gov/nationalarchives/csv/validator/schema/v1_1/SchemaSpec.scala | Scala | mpl-2.0 | 2,156 |
package org.psesd.srx.shared.core.sif
import org.json4s._
import org.psesd.srx.shared.core.exceptions.ArgumentNullException
import org.psesd.srx.shared.core.extensions.TypeExtensions._
import org.psesd.srx.shared.core.sif.SifContentType.SifContentType
import org.psesd.srx.shared.core.sif.SifMessageType.SifMessageType
... | PSESD/srx-shared-core | src/main/scala/org/psesd/srx/shared/core/sif/SifResponse.scala | Scala | mit | 3,980 |
/*
* Copyright 2014–2018 SlamData Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agr... | jedesah/Quasar | marklogic/src/main/scala/quasar/physical/marklogic/qscript/StructuralPlanner.scala | Scala | apache-2.0 | 11,372 |
// Generated by the Scala Plugin for the Protocol Buffer Compiler.
// Do not edit!
//
// Protofile syntax: PROTO3
package com.google.protobuf.wrappers
/** Wrapper message for `uint32`.
*
* The JSON representation for `UInt32Value` is JSON number.
*
* @param value
* The uint32 value.
*/
@SerialVersionUID... | trueaccord/ScalaPB | scalapb-runtime/src/main/scalajs/com/google/protobuf/wrappers/UInt32Value.scala | Scala | apache-2.0 | 5,561 |
/*
Copyright 2016-17, Hasso-Plattner-Institut fuer Softwaresystemtechnik 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 applicab... | bpn1/ingestion | src/test/scala/de/hpi/ingestion/framework/JobRunnerTest.scala | Scala | apache-2.0 | 3,141 |
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.