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 2016, deepsense.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.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed ... | deepsense-io/seahorse-workflow-executor | deeplang/src/main/scala/io/deepsense/deeplang/doperations/readwritedataframe/FileScheme.scala | Scala | apache-2.0 | 2,315 |
package swallow.core
/**
* Created by zhouqihua on 2017/6/30.
*/
object KMActorMessages {
final case class TestFlow(flow: KMFlow)
final case class ClusterSuperviseFlow(flow: KMFlow)
final case class MasterSubmitNewFlow(flow: KMFlow)
final case class MasterDispatchNewFlow(flow: KMFlow)
final case cl... | kimihe/Swallow | swallow/src/main/scala/swallow/core/KMActorMessages.scala | Scala | apache-2.0 | 515 |
package org.jetbrains.plugins.scala.lang.resolve2
/**
* Pavel.Fatin, 02.02.2010
*/
class QualifierSourceMediateTest extends ResolveTestBase {
override def folderPath: String = {
super.folderPath + "qualifier/source/mediate/"
}
def testCaseClass() = doTest()
def testCaseClassObject() = doTest()
//TOD... | ilinum/intellij-scala | test/org/jetbrains/plugins/scala/lang/resolve2/QualifierSourceMediateTest.scala | Scala | apache-2.0 | 539 |
/*
* 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/datasources/v2/PartitionRecordReader.scala | Scala | apache-2.0 | 1,568 |
package wakfutcp.protocol.messages.server
import wakfutcp.protocol.{Codec, ServerMessage}
final case class ClientPublicKeyMessage(
salt: Long,
publicKey: Array[Byte]
) extends ServerMessage {
override val id = 1034
}
object ClientPublicKeyMessage {
import Codec._
import cats.syntax.apply._
implicit val ... | OpenWakfu/wakfutcp | protocol/src/main/scala/wakfutcp/protocol/messages/server/ClientPublicKeyMessage.scala | Scala | mit | 434 |
package codesample.scala.coursera.course1.week2
import scala.annotation.tailrec
object HighOrderFuncsAndCurrying {
def sum(intFunc: Int => Int, left: Int, right: Int) : Int = {
if (left > right) 0
else intFunc(left) + sum(intFunc, left + 1, right)
}
def sumTail(f: Int => Int, left: Int, right: Int): I... | aquatir/remember_java_api | code-sample-scala/scala-coursera/src/main/scala/codesample/scala/coursera/course1/week2/HighOrderFuncsAndCurrying.scala | Scala | mit | 3,869 |
/*
* 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/self-service-time-to-pay-frontend | test/pagespecs/pages/YouNeedToRequestAccessToSelfAssessmentPage.scala | Scala | apache-2.0 | 3,009 |
/*
* 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 ... | practice-vishnoi/dev-spark-1 | mllib/src/main/scala/org/apache/spark/mllib/tree/RandomForest.scala | Scala | apache-2.0 | 24,380 |
/*
* 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 ... | witgo/spark | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/json/JacksonParser.scala | Scala | apache-2.0 | 19,373 |
/* Copyright 2009-2018 EPFL, Lausanne */
package inox
package ast
import scala.collection.mutable.{Map => MutableMap, Set => MutableSet}
trait Types { self: Trees =>
trait Typed extends Printable {
def getType(implicit s: Symbols): Type
def isTyped(implicit s: Symbols): Boolean = getType != Untyped
}
... | romac/inox | src/main/scala/inox/ast/Types.scala | Scala | apache-2.0 | 12,598 |
package com.snowplowanalytics.snowplow.storage.kinesis.redshift.limiter
/**
* Created by denismo on 18/09/15.
*/
trait FlushLimiter {
def isFlushRequired: Boolean
def flushed(writeStart: Long, writeEnd: Long, flushCount: Long)
def onRecord(values: Array[String])
}
| jramos/kinesis-redshift-sink | src/main/scala/com.snowplowanalytics.snowplow.storage.kinesis/redshift/limiter/FlushLimiter.scala | Scala | apache-2.0 | 274 |
/**
* 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... | harshach/kafka | core/src/main/scala/kafka/server/KafkaApis.scala | Scala | apache-2.0 | 47,329 |
package com.anteoy.coreScala
/**
* Created by zhoudazhuang
* Date: 17-1-3
* Time: 下午3:18 函数式编程 函数 参数 返回值 回调
* Description :下面的程序将实现简单定时器的功能,负责定时的函数(function)名为:oncePerSecond,它接受一个回调函数作为参数,该回调函数的类型记为:() => Unit,代表任何无参数、无返回值的函数(Unit和C/C++中的void类似)。程序的main方法调用定时函数,作为实参传进去的回调函数timeFlies,仅仅向终端打印一句话,所以,该程序的实际功能是:每... | Anteoy/jottings | src/main/scala/com/anteoy/coreScala/Timer.scala | Scala | apache-2.0 | 945 |
/*
Stratagem is a model checker for transition systems described using rewriting
rules and strategies.
Copyright (C) 2013 - SMV@Geneva University.
Program written by Edmundo Lopez Bobeda <edmundo [at] lopezbobeda.net>.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU G... | didierbuchs/oldstratagem | src/main/scala/ch/unige/cui/smv/stratagem/ts/Sequence.scala | Scala | gpl-2.0 | 1,175 |
object Problem08 {
def myCompress[A](list: List[A]): List[A] = {
list match {
case x :: y :: xs => if (x == y) myCompress(List(x) ::: xs)
else List(x) ::: myCompress(List(y) ::: xs)
case x => x
}
}
}
| leonardi-tutorials/tutorial-scala | src/main/scala/Problem08.scala | Scala | apache-2.0 | 258 |
package scalapb
import com.google.protobuf.ExtensionRegistry
import com.google.protobuf.compiler.PluginProtos.{CodeGeneratorRequest, CodeGeneratorResponse}
import com.trueaccord.scalapb.Scalapb
import com.trueaccord.scalapb.compiler.ProtobufGenerator
import protocbridge.{ProtocCodeGenerator, Artifact}
object ScalaPb... | eiennohito/ScalaPB | compiler-plugin/src/main/scala/scalapb/ScalaPbCodeGenerator.scala | Scala | apache-2.0 | 933 |
//object Format {
// import com.typesafe.sbt.SbtScalariform._
//
// lazy val settings = defaultScalariformSettings ++ Seq(
// ScalariformKeys.preferences := formattingPreferences
// )
//
// lazy val formattingPreferences = {
// import scalariform.formatter.preferences._
// FormattingPreferences().
// ... | dmrolfs/demesne | project/Format.scala | Scala | apache-2.0 | 532 |
package org.homermultitext.edmodel
/** All possible categories for alternate readings
* are enumerated by case objects extending this trait
*
* Used by [[org.homermultitext.edmodel.AlternateReading]] and therefore also by [[org.homermultitext.edmodel.HmtToken]] and [[org.homermultitext.edmodel.TeiReader]]
*/
sealed tr... | homermultitext/edmodel | src/main/scala/org/homermultitext/edmodel/AlternateReading.scala | Scala | gpl-3.0 | 1,813 |
/*
* 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 ... | ueshin/apache-spark | sql/core/src/test/scala/org/apache/spark/sql/SQLInsertTestSuite.scala | Scala | apache-2.0 | 13,009 |
package com.wavesplatform.lang.v1
import cats.Id
import cats.syntax.applicative._
import com.wavesplatform.lang.v1.compiler.Terms._
import com.wavesplatform.lang.v1.task.TaskM
import com.wavesplatform.lang.v1.task.imports._
import scala.annotation.tailrec
import scala.collection.mutable.Queue
package object compiler... | wavesplatform/Waves | lang/shared/src/main/scala/com/wavesplatform/lang/v1/compiler/package.scala | Scala | mit | 3,020 |
package sma.eventsourcing
import akka.actor.{Actor, ActorLogging, PoisonPill}
trait Particle extends Actor with ActorLogging {
def logStarting = log.info(s"--> [${self.path.name}] actor is starting")
def logStopped = log.info(s"--> [${self.path.name}] actor stopped")
def logReceiving(text: String) = log.info... | eduardo-lago-aguilar/sma | src/main/scala/sma/eventsourcing/Particle.scala | Scala | mit | 700 |
package com.shalloui.tblite.demo.data
/**
* Created by a.reisberg on 8/30/2016.
*/
sealed trait Company
case class Department(name: String, employeeIds: List[String]) extends Company
case class Employee(_id: String, name: String, age: Int, address: Address) extends Company
case class Address(city: String, zip: ... | a-reisberg/typebase-lite | tbljavademo/src/main/scala/com/shalloui/tblite/demo/data/Company.scala | Scala | apache-2.0 | 327 |
/* Copyright (C) 2016 Tomáš Janoušek
* This file is a part of locus-rflkt-addon.
* See the COPYING and LICENSE files in the project root directory.
*/
package cz.nomi.locusRflktAddon
import android.content.SharedPreferences
import android.preference._
import android.support.v7.app.AppCompatActivity
import android.... | liskin/locus-rflkt-addon | src/main/scala/cz/nomi/locusRflktAddon/Settings.scala | Scala | gpl-3.0 | 13,116 |
package com.avsystem.commons
package redis.commands
import com.avsystem.commons.misc.{Opt => _, OptArg => _, _}
import com.avsystem.commons.redis.CommandEncoder.CommandArg
import com.avsystem.commons.redis._
import com.avsystem.commons.redis.commands.ReplyDecoders._
import com.avsystem.commons.redis.protocol.SimpleStr... | AVSystem/scala-commons | commons-redis/src/main/scala/com/avsystem/commons/redis/commands/cluster.scala | Scala | mit | 16,442 |
package slick.test.codegen
import scala.concurrent.Await
import scala.concurrent.duration.Duration
import scala.concurrent.ExecutionContext.Implicits.global
import slick.codegen.SourceCodeGenerator
import slick.driver._
/** Generates code for CodeGenRoundTripTest.
*
* This is generated using Derby currently becau... | jkutner/slick | slick-testkit/src/codegen/scala/slick/test/codegen/GenerateRoundtripSources.scala | Scala | bsd-2-clause | 12,129 |
/*
* 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 ... | Sephiroth-Lin/incubator-carbondata | examples/spark/src/main/scala/org/apache/carbondata/examples/util/ExampleUtils.scala | Scala | apache-2.0 | 3,237 |
/*
* Copyright (c) 2014-2017 Snowplow Analytics Ltd. All rights reserved.
*
* This program is licensed to you under the Apache License Version 2.0,
* and you may not use this file except in compliance with the Apache License Version 2.0.
* You may obtain a copy of the Apache License Version 2.0 at
* http://www.ap... | Propertyfinder/snowplow | 4-storage/rdb-shredder/project/Dependencies.scala | Scala | apache-2.0 | 2,181 |
package skutek_experimental
import skutek.abstraction._
import skutek.std_effects._
import org.specs2._
class CyclicMemoTest extends Specification with CanLaunchTheMissiles {
def is = graph
def graph = br ^ "CyclicMemoizer operations should work" ! {
case object FxMemo extends CyclicMemoizer[Int, Vertex]
... | marcinzh/skutek | modules/experimental/src/test/scala/skutek_experimental/CyclicMemoTest.scala | Scala | mit | 1,772 |
package dotty.tools.benchmarks.tuples
import org.openjdk.jmh.annotations._
import scala.runtime.DynamicTuple
@State(Scope.Thread)
class Apply {
@Param(Array("1 0"))
var sizeAndIndex: String = _
var tuple: NonEmptyTuple = _
var index: Int = _
@Setup
def setup(): Unit = {
val size = sizeAndIndex.split(... | som-snytt/dotty | bench-run/src/main/scala/dotty/tools/benchmarks/tuples/Apply.scala | Scala | apache-2.0 | 657 |
/*
* 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 ... | apache/flink | flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/planner/plan/rules/physical/stream/StreamPhysicalLookupJoinRule.scala | Scala | apache-2.0 | 3,468 |
package org.kokho.scheduling.multicritical.system
import org.kokho.scheduling.{PeriodicJob, Task}
/**
* Represents a job of a LowCriticalTask
*
* @author: Mikhail Kokho
* @date: 6/4/15
*/
case class LoCriticalJob(release: Int, task: LoCriticalTaskDefault) extends PeriodicJob {
override def isOfTask(thatTask:... | mkokho/dynoslack | src/main/scala/org/kokho/scheduling/multicritical/system/LoCriticalJob.scala | Scala | apache-2.0 | 423 |
package org.elasticsearch.spark.sql
import java.util.Properties
import scala.Array.fallbackCanBuildFrom
import scala.collection.JavaConverters.asScalaBufferConverter
import scala.collection.JavaConverters.propertiesAsScalaMapConverter
import scala.collection.mutable.ArrayBuffer
import org.apache.spark.sql.MapType
impo... | yonglehou/elasticsearch-hadoop | spark/sql-12/src/main/scala/org/elasticsearch/spark/sql/SchemaUtils.scala | Scala | apache-2.0 | 7,100 |
package autosteamgifts
import autosteamgifts.Implicits._
import autosteamgifts.TimeAmount._
import org.scalajs.dom.raw.{HTMLAnchorElement, HTMLElement}
import scala.scalajs.js
class Giveaway(element: HTMLElement) {
protected lazy val innerElement = element.firstElementChild
lazy val headingElement = element.query... | erdavila/auto-steamgifts | src/main/scala/autosteamgifts/Giveaway.scala | Scala | mit | 2,077 |
package picocli.examples.scala.subcommands.SubCmdsViaClasses
import java.util.Locale
import picocli.CommandLine.{Command, Parameters}
@Command(name = "language", description = Array("Resolve ISO language code (ISO 639-1 or -2, two/three letters)"))
class SubCmd2 extends Runnable {
@Parameters(arity = "1..*n", para... | remkop/picocli | picocli-examples/src/main/scala/picocli/examples/scala/subcommands/SubCmdsViaClasses/SubCmd2.scala | Scala | apache-2.0 | 626 |
/***********************************************************************
* 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-z3/src/main/scala/org/locationtech/geomesa/curve/BinnedTime.scala | Scala | apache-2.0 | 10,241 |
package models
import io.postman.generator.attributes.v0.models.AttributeName
import _root_.play.api.libs.json.{JsError, JsSuccess, JsValue, Reads}
import _root_.play.api.Logging
import io.apibuilder.spec.v0.models.Attribute
import scala.reflect.{ClassTag, classTag}
object AttributeValueReader extends Logging {
d... | mbryzek/apidoc-generator | postman-generator/src/main/scala/models/AttributeValueReader.scala | Scala | mit | 1,016 |
/*
* 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 ... | hequn8128/flink | flink-scala/src/main/scala/org/apache/flink/api/scala/utils/package.scala | Scala | apache-2.0 | 8,246 |
import scala.math.Ordering
import scala.reflect.ClassTag
trait MonoSam { def apply(x: Int): String }
trait SamP[U] { def apply(x: Int): U }
class OverloadedFun[T](x: T) {
// def foo(f: T => String): String = f(x) Can't unify - need just type equality
def foo(f: Any => String): String = f(x)
def foo(f: Any =>... | som-snytt/dotty | tests/pos/overloaded_ho_fun.scala | Scala | apache-2.0 | 3,336 |
/*
* Copyright (c) 2013-14 Miles Sabin
*
* 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 ag... | mandubian/shapeless | core/src/main/scala/shapeless/package.scala | Scala | apache-2.0 | 2,677 |
package razie.hosting
import play.api.mvc.{Request, RequestHeader}
import razie.OR._
import razie.cdebug
import razie.wiki.Services
import razie.wiki.model._
import razie.wiki.util.{DslProps, PlayTools}
/**
* Multihosting - website settings - will collect website properties from the topic if it has a 'website' secti... | razie/wikireactor | common/app/razie/hosting/Website.scala | Scala | apache-2.0 | 6,172 |
package com.dominikgruber.fpinscala.chapter05
import org.scalatest._
class Exercise14Spec extends FlatSpec with Matchers {
"startsWith" should "return true" in {
Stream(1, 2, 3).startsWith(Stream(1, 2)) should be (true)
}
it should "return false (I)" in {
Stream(1, 2, 3).startsWith(Stream(1, 2, 3, 4))... | TheDom/functional-programming-in-scala | src/test/scala/com/dominikgruber/fpinscala/chapter05/Exercise14Spec.scala | Scala | mit | 446 |
/*
* 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 | examples/scala-parallel-similarproduct/add-rateevent/src/main/scala/ALSAlgorithm.scala | Scala | apache-2.0 | 8,348 |
/*
* 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... | wangyixiaohuihui/spark2-annotation | sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/PartitioningUtils.scala | Scala | apache-2.0 | 19,664 |
/*
* La Trobe University - Distributed Deep Learning System
* Copyright 2016 Matthias Langer ([email protected])
*
* 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.apa... | bashimao/ltudl | blaze/src/main/scala/edu/latrobe/blaze/modules/jvm/ZeroMean_JVM.scala | Scala | apache-2.0 | 8,078 |
/***********************************************************************
* Copyright (c) 2013-2016 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 is ... | nagavallia/geomesa | geomesa-kafka/geomesa-kafka-datastore/geomesa-kafka-08-datastore/src/main/scala/org/locationtech/geomesa/kafka08/consumer/Broker.scala | Scala | apache-2.0 | 1,370 |
/*
* @author Philip Stutz
*
* Copyright 2014 University of Zurich
*
* 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
*
* U... | uzh/triplerush | src/test/scala/com/signalcollect/triplerush/QueryIdEmbeddingSpec.scala | Scala | apache-2.0 | 1,362 |
package play.utils
import java.sql._
import java.util.logging.Logger
class ProxyDriver(proxied: Driver) extends Driver {
def acceptsURL(url: String) = proxied.acceptsURL(url)
def connect(user: String, properties: java.util.Properties) = proxied.connect(user, properties)
def getMajorVersion() = proxied.getMajor... | michaelahlers/team-awesome-wedding | vendor/play-2.2.1/framework/src/play/src/main/scala/play/utils/ProxyDriver.scala | Scala | mit | 580 |
package scalabpe.core
import java.util.concurrent.ArrayBlockingQueue
import java.util.concurrent.ConcurrentHashMap
import java.util.concurrent.RejectedExecutionException
import java.util.concurrent.ThreadFactory
import java.util.concurrent.ThreadPoolExecutor
import java.util.concurrent.TimeUnit
import java.util.concurr... | bruceran/scalabpe | src/scalabpe/core/actor_flow.scala | Scala | apache-2.0 | 31,408 |
package dbpedia.dataparsers
import java.lang.StringBuilder
import dbpedia.dataparsers.util.{RdfNamespace, StringUtils}
import dbpedia.dataparsers.util.StringUtils.{escape, replacements}
class DBpediaNamespace(namespace: String) extends RdfNamespace(null, namespace, true) {
override protected def append(sb: S... | FnOio/dbpedia-parsing-functions-scala | src/main/scala/dbpedia/dataparsers/DBpediaNamespace.scala | Scala | gpl-2.0 | 1,024 |
class C1(p: Int)
class C2 extends C1(1) {
println(/* resolved: false */ p)
} | ilinum/intellij-scala | testdata/resolve2/inheritance/element/ClassParameter.scala | Scala | apache-2.0 | 79 |
package com.twitter.util
import org.specs.SpecificationWithJUnit
class RingBufferSpec extends SpecificationWithJUnit {
"RingBuffer" should {
"empty" in {
val buf = new RingBuffer[String](4)
buf.length mustEqual 0
buf.size mustEqual 0
buf.isEmpty mustEqual true
buf(0) must throwA[In... | mosesn/util | util-core/src/test/scala/com/twitter/util/RingBufferSpec.scala | Scala | apache-2.0 | 1,547 |
/*
* 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 ... | andrewor14/iolap | core/src/main/scala/org/apache/spark/scheduler/cluster/YarnSchedulerBackend.scala | Scala | apache-2.0 | 5,585 |
package rpg
import org.specs2._
class CharacterChecksSpec extends Specification { def is = s2"""
Character Check Specification
simple checks should work in
simple attribute checks $e1
simple skill checks ... | wookietreiber/arpgt | src/test/scala/CharacterChecksSpec.scala | Scala | gpl-3.0 | 1,250 |
/*
* Copyright 2015 eleflow.com.br.
*
* 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 ... | eleflow/uberdata | iuberdata_core/src/main/scala/org/apache/spark/ml/ForecastBestModel.scala | Scala | apache-2.0 | 4,929 |
package at.logic.gapt.proofs.lk.algorithms
import at.logic.gapt.expr._
import BetaReduction._
import at.logic.gapt.proofs.lk._
import at.logic.gapt.proofs.lk.algorithms.ProofTransformationUtils.computeMap
import at.logic.gapt.proofs.lk.base._
import at.logic.gapt.proofs.occurrences._
object applySubstitution {
// ... | gisellemnr/gapt | src/main/scala/at/logic/gapt/proofs/lk/algorithms/substitution.scala | Scala | gpl-3.0 | 13,803 |
package com.twitter.zipkin.hadoop
import org.specs.Specification
import com.twitter.zipkin.hadoop.sources.Util
import com.twitter.zipkin.gen
import com.twitter.zipkin.gen.{AnnotationType, Annotation}
import scala.collection.JavaConverters._
class UtilSpec extends Specification {
"Util.getServiceName" should {
... | dsias/zipkin | zipkin-hadoop/src/test/scala/com/twitter/zipkin/hadoop/UtilSpec.scala | Scala | apache-2.0 | 3,939 |
package lila.relation
import akka.actor.ActorSelection
import scala.util.Success
import lila.db.api._
import lila.db.Implicits._
import lila.game.GameRepo
import lila.hub.actorApi.relation.ReloadOnlineFriends
import lila.hub.actorApi.timeline.{ Propagate, Follow => FollowUser }
import lila.user.tube.userTube
import l... | danilovsergey/i-bur | modules/relation/src/main/RelationApi.scala | Scala | mit | 3,556 |
/*
* 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 ... | sryza/spark | core/src/test/scala/org/apache/spark/util/NextIteratorSuite.scala | Scala | apache-2.0 | 2,606 |
import scala.quoted.*
import scala.deriving.*
case class Foo(i: Int)
case class Box[A](x: A)
object Macro {
inline def foo[T]: String =
${ fooImpl[T] }
def fooImpl[T](implicit t: Type[T], qctx: Quotes): Expr[String] = {
import quotes.reflect.*
val sym = TypeTree.of[T].symbol
if sym.isClassDef the... | dotty-staging/dotty | tests/run-macros/no-symbol/1.scala | Scala | apache-2.0 | 420 |
package com.ergodicity.marketdb
import model.{TradePayload, Security, Market}
import org.scalatest.WordSpec
import org.joda.time.DateTime
import sbinary._
import Operations._
import com.ergodicity.marketdb.model.TradeProtocol._
import org.slf4j.LoggerFactory
class TradeProtocolSpec extends WordSpec {
val log = Logg... | ezhulenev/marketdb | marketdb-api/src/test/scala/com/ergodicity/marketdb/TradeProtocolSpec.scala | Scala | mit | 1,957 |
package hr.element.geom
case class Parallelogram(p1: Point, p2: Point, p3: Point) extends Shape {
val p4 = p3 + p1 - p2
def points = IndexedSeq(p1, p2, p3, p4)
}
| melezov/ocd-transform | src/main/scala/hr/element/geom/Parallelogram.scala | Scala | bsd-3-clause | 167 |
package org.apache.kafka.cep
import org.apache.kafka.cep.utils.Observed
class ExpiredEventDetector(val underlyingDetector: Detector)(implicit system: CEP)
extends Detector(1) {
underlyingDetector.addObserver(ExpiredEventDetector.this)
override def handle(observed: Observed, event: Any) = observed match {
ca... | michal-harish/kafka-cep | src/main/scala/org/apache/kafka/cep/ExpiredEventDetector.scala | Scala | apache-2.0 | 734 |
@main def Test = {
val a = 5
val x = 1
+ `a` * 6
assert(x == 1, x)
}
| dotty-staging/dotty | tests/run/i7031.scala | Scala | apache-2.0 | 82 |
/**
* 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... | crashlytics/kafka | core/src/test/scala/unit/kafka/KafkaConfigTest.scala | Scala | apache-2.0 | 4,134 |
package org.eknet.spray.openid.provider
import scala.concurrent.ExecutionContext
import akka.util.Timeout
import spray.routing._
import spray.routing.directives.PathDirectives
class ProviderRoute(endpointSettings: EndpointSettings, discoverySettings: DiscoverySettings) extends PathDirectives with RouteConcatenation {... | eikek/spray-openid | src/main/scala/org/eknet/spray/openid/provider/ProviderRoute.scala | Scala | apache-2.0 | 591 |
/*
* 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 | foundation/src/main/scala/quasar/fp/ski/package.scala | Scala | apache-2.0 | 1,611 |
package lila.game
import chess.Clock
import lila.common.LightUser
import play.twirl.api.Html
object Namer {
def players(game: Game, withRatings: Boolean = true)(implicit lightUser: String => Option[LightUser]): (Html, Html) =
player(game.firstPlayer, withRatings) -> player(game.secondPlayer, withRatings)
d... | Enigmahack/lila | modules/game/src/main/Namer.scala | Scala | mit | 1,138 |
package swiss.sib.analytics.server.logs.custom.uniprot
case class UniProtEntryPropery(accession: String, database: String);
| sib-swiss/server-log-analytics | src/main/scala/swiss/sib/analytics/server/logs/custom/uniprot/UniProtEntryPropery.scala | Scala | gpl-2.0 | 125 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | pronix/spark | core/src/main/scala/org/apache/spark/network/netty/NettyBlockRpcServer.scala | Scala | apache-2.0 | 3,180 |
/*
* 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 ... | sh-cho/cshSpark | scheduler/JobResult.scala | Scala | apache-2.0 | 1,131 |
package bootstrap.liftweb
import javax.mail.internet.MimeMessage
import code.managers.ClusterRefs
import code.rest.TestRest
import net.liftweb._
import common._
import http._
import net.liftweb.util.Props
import util._
import code.config._
import akka.pattern.ask
import akka.util.Timeout
import scala.concurrent.Execut... | rhyolight/htm-moclu | moclu-http/src/main/scala/bootstrap/liftweb/Boot.scala | Scala | agpl-3.0 | 2,271 |
//optimiseHeapOptions optimiseHeapBooleans optimiseHeapStrings
class Foo(s: Option[String])
//---
{
final class Foo private (private[this] val _s: _root_.scala.Array[_root_.scala.Byte], private[this] val _bitmask: _root_.scala.Long) {
override def equals(thatAny: _root_.scala.Any): _root_.scala.Boolean = thatAny ... | vovapolu/scala-data-classes | src/test/resources/generatedTests/HeapOptimizationNoBitmaskGen.scala | Scala | lgpl-3.0 | 1,361 |
/*
* 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/test/scala/org/apache/flink/table/runtime/harness/MatchHarnessTest.scala | Scala | apache-2.0 | 3,135 |
package de.qlextension
import java.net.URLClassLoader
import java.net.URL
import java.io.File
import java.io.FileReader
import java.io.FileNotFoundException
import scala.collection.JavaConverters._
import org.nlogo.api.DefaultClassManager
import org.nlogo.api.PrimitiveManager
import org.nlogo.api.Primitive
import com.... | JZschache/NetLogo-QLearning-Extension | src/de/qlextension/QLExtension.scala | Scala | gpl-2.0 | 5,678 |
/**
* Copyright 2011-2012 eBusiness Information, Groupe Excilys (www.excilys.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
*
*... | Tjoene/thesis | Case_Programs/gatling-1.4.0/gatling-charts/src/main/scala/com/excilys/ebi/gatling/charts/component/impl/ComponentLibraryImpl.scala | Scala | gpl-2.0 | 2,743 |
package dotty.tools.scaladoc
package tasty
import scala.quoted._
object SyntheticsSupport:
extension (using Quotes)(t: reflect.TypeRepr)
def isCompiletimeAppliedType: Boolean = t.hackIsCompiletimeAppliedType(t)
private def hackIsCompiletimeAppliedType(rtpe: reflect.TypeRepr): Boolean =
import dotty... | dotty-staging/dotty | scaladoc/src/dotty/tools/scaladoc/tasty/SyntheticSupport.scala | Scala | apache-2.0 | 4,851 |
/**
* sbt-osgi-manager - OSGi development bridge based on Bnd and Tycho.
*
* Copyright (c) 2016 Alexey Aksenov [email protected]
*
* 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... | digimead/sbt-osgi-manager | src/test/scala/sbt/osgi/manager/tycho/MavenTest.scala | Scala | apache-2.0 | 8,460 |
/*
* Copyright 2013 http4s.org
*
* 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... | http4s/http4s | core/shared/src/main/scala-3/org/http4s/QValuePlatform.scala | Scala | apache-2.0 | 636 |
/*
* Copyright 2001-2013 Artima, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agre... | travisbrown/scalatest | src/test/scala/org/scalactic/PrettyMethodsSpec.scala | Scala | apache-2.0 | 1,858 |
/* __ *\\
** ________ ___ / / ___ __ ____ Scala.js Test Suite **
** / __/ __// _ | / / / _ | __ / // __/ (c) 2013-2015, LAMP/EPFL **
** __\\ \\/ /__/ __ |/ /__/ __ |/_// /_\\ \\ http://scala-js.org/ **
** /____/\\___/... | mdedetrich/scala-js | test-suite/shared/src/test/scala/org/scalajs/testsuite/javalib/util/LinkedHashSetTest.scala | Scala | bsd-3-clause | 2,077 |
package actors.persistent.arrivals
import akka.actor.Props
import akka.persistence.{Recovery, SnapshotSelectionCriteria}
import drt.shared.{FeedSource, SDateLike}
import org.slf4j.{Logger, LoggerFactory}
import server.protobuf.messages.FlightsMessage.FlightsDiffMessage
object ArrivalsReadActor {
def props(pointInTi... | UKHomeOffice/drt-scalajs-spa-exploration | server/src/main/scala/actors/persistent/arrivals/ArrivalsReadActor.scala | Scala | apache-2.0 | 1,380 |
package ionroller
import org.joda.time.DateTime
final case class EnvironmentUnusedDetails(at: DateTime)
| yonglehou/ionroller | core/src/main/scala/ionroller/EnvironmentUnusedDetails.scala | Scala | mit | 107 |
package uk.gov.gds.ier.transaction.forces.rank
import uk.gov.gds.ier.validation.{ErrorTransformForm, ErrorMessages, FormKeys}
import play.api.data.Forms._
import uk.gov.gds.ier.model._
import scala.Some
import play.api.data.validation.{Invalid, Valid, Constraint}
import uk.gov.gds.ier.transaction.forces.InprogressForc... | alphagov/ier-frontend | app/uk/gov/gds/ier/transaction/forces/rank/RankForms.scala | Scala | mit | 1,677 |
/**
* Copyright 2016, deepsense.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.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed ... | deepsense-io/seahorse-workflow-executor | deeplang/src/main/scala/io/deepsense/deeplang/doperables/spark/wrappers/models/LDAModel.scala | Scala | apache-2.0 | 2,512 |
/**
* Copyright (c) 2012 Alexey Aksenov [email protected]
*
* 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 appli... | ezh/digi-lib-ctrl | src/main/scala/org/digimead/digi/lib/ctrl/dialog/filechooser/FCCancel.scala | Scala | apache-2.0 | 1,232 |
trait F1[/* - */T, /* + */ R]
object Test {
import scala.annotation.unchecked._
private[this] type VariantF1[-T, +R] = F1[T @uncheckedVariance, R @uncheckedVariance]
trait C[+T] { def foo: VariantF1[Any, T] }
}
| felixmulder/scala | test/pending/pos/t8079c.scala | Scala | bsd-3-clause | 218 |
package Week3
/**
* Created by gustavo on 26/04/16.
*/
abstract class IntSet {
def incl(x: Int): IntSet
def contains(x: Int): Boolean
def union(other: IntSet): IntSet
}
| guhemama/moocs | Functional.Programming.in.Scala.Coursera/Week3/src/Week3/IntSet.scala | Scala | bsd-3-clause | 180 |
/*
* 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 ... | mdespriee/spark | sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/DataSourceV2StreamingScanExec.scala | Scala | apache-2.0 | 4,803 |
package com.countrygamer.arcanacraft.common.item.pendant
import baubles.api.{BaubleType, IBauble}
import com.countrygamer.arcanacraft.common.item.ItemArcanaCraft
import net.minecraft.entity.EntityLivingBase
import net.minecraft.item.ItemStack
/**
*
*
* @author CountryGamer
*/
class ItemPendant(name: String) exten... | TheTemportalist/ArcanaCraft | src/main/scala/com/countrygamer/arcanacraft/common/item/pendant/ItemPendant.scala | Scala | apache-2.0 | 960 |
package common.ConfHelper
import common.FileHelper.FileHelper
import scala.collection.mutable.ArrayBuffer
import scala.io.Source
/**
* Created by horatio on 10/28/15.
*/
object ConfigHelper {
var conf: Option[DynConfig] = None
def getConf(): DynConfig = {
conf match {
case None =>
val conf_... | bash-horatio/ESJ | app/common/ConfHelper/ConfigHelper.scala | Scala | apache-2.0 | 2,368 |
/*
* 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/scheme/transform/Preamblifier.scala | Scala | bsd-3-clause | 2,606 |
package io.finch.request
import com.twitter.finagle.httpx.Request
import com.twitter.io.Buf.ByteArray
import com.twitter.util.{Await, Future, Try}
import org.scalatest.{FlatSpec, Matchers}
import items._
class BodySpec extends FlatSpec with Matchers {
val foo = "foo"
val fooBytes = foo.getBytes("UTF-8")
"A Req... | peel/finch | core/src/test/scala/io/finch/request/BodySpec.scala | Scala | apache-2.0 | 4,993 |
/*
* 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 ... | greghogan/flink | flink-table/flink-table-planner-blink/src/test/scala/org/apache/flink/table/planner/plan/stream/sql/DagOptimizationTest.scala | Scala | apache-2.0 | 27,661 |
package fi.onesto.sbt.mobilizer
import org.slf4j.helpers.MessageFormatter
import sbt.Level
import sbt.Level._
import org.slf4j.Marker
final class Slf4jSbtLogger(
private[this] val underlying: sbt.AbstractLogger,
private[this] val name: String,
private[this] val minimumLevel: Level.Value)
exte... | onesto/sbt-mobilizer | src/main/scala/fi/onesto/sbt/mobilizer/Slf4jSbtLogger.scala | Scala | mit | 5,368 |
/**
* Copyright 2011-2016 GatlingCorp (http://gatling.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.org/licenses/LICENSE-2.0
*
* Unless required by appli... | GabrielPlassard/gatling | src/sphinx/general/code/Assertions.scala | Scala | apache-2.0 | 1,595 |
/***********************************************************************
* Copyright (c) 2013-2020 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... | aheyne/geomesa | geomesa-spark/geomesa-spark-jts/src/main/scala/org/locationtech/geomesa/spark/jts/udf/package.scala | Scala | apache-2.0 | 1,114 |
package cosbench_ng
import com.typesafe.config.ConfigFactory
import akka.actor.{ ActorSystem, PoisonPill }
import akka.event.Logging.DebugLevel
import akka.serialization.SerializerWithStringManifest
import MyProtoBufMsg._
//Cluster imports
import akka.cluster.{ Cluster, ClusterEvent }
import akka.cluster.ClusterEve... | vardhanv/cosbench_ng | common/src/main/scala/Config.scala | Scala | mit | 4,082 |
/*
* Copyright (C) 2009-2017 Lightbend Inc. <https://www.lightbend.com>
*/
package play.api.mvc.request
import javax.inject.Inject
import play.api.http.{ HttpConfiguration, SecretConfiguration }
import play.api.libs.crypto.CookieSignerProvider
import play.api.libs.typedmap.TypedMap
import play.api.mvc._
import play... | ktoso/playframework | framework/src/play/src/main/scala/play/api/mvc/request/RequestFactory.scala | Scala | apache-2.0 | 4,219 |
package im.actor.server.dialog
import akka.actor.ActorSystem
import akka.http.scaladsl.util.FastFuture
import im.actor.api.rpc.PeersImplicits
import im.actor.api.rpc.counters.{ ApiAppCounters, UpdateCountersChanged }
import im.actor.api.rpc.messaging._
import im.actor.server.db.DbExtension
import im.actor.server.messa... | ljshj/actor-platform | actor-server/actor-core/src/main/scala/im/actor/server/dialog/ActorDelivery.scala | Scala | mit | 4,347 |
/*
Copyright 2012 Georgia Tech Research Institute
Author: [email protected]
This file is part of org.gtri.util.xmlbuilder library.
org.gtri.util.xmlbuilder library is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published ... | gtri-iead/org.gtri.util.xmlbuilder | impl/src/main/scala/org/gtri/util/xmlbuilder/impl/events/AddXmlTextEvent.scala | Scala | gpl-3.0 | 1,532 |
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.