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 scala
import scala.language.higherKinds
package object collection {
@deprecated("Use Iterable instead of Traversable", "2.13.0")
type Traversable[+X] = Iterable[X]
@deprecated("Use Iterable instead of Traversable", "2.13.0")
val Traversable = Iterable
@deprecated("Use IterableOnce instead of Travers... | rorygraves/perf_tester | corpus/scala-library/src/main/scala/collection/package.scala | Scala | apache-2.0 | 3,941 |
/*
* Shadowsocks - A shadowsocks client for Android
* Copyright (C) 2014 <[email protected]>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at y... | ticonci/shadowsocks-android | src/main/scala/com/github/shadowsocks/database/Profile.scala | Scala | gpl-3.0 | 2,737 |
/*
* Copyright 2016 Coursera 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... | coursera/courscala | courscala/src/main/scala/org/coursera/common/concurrent/Futures.scala | Scala | apache-2.0 | 3,318 |
/*
* Copyright (C) 2005 - 2019 Schlichtherle IT Services.
* All rights reserved. Use is subject to license terms.
*/
package global.namespace.truelicense.tests.core
import global.namespace.fun.io.bios.BIOS.memory
trait LicenseConsumerPerformance {
this: TestContext =>
final def run(): Unit = new State {
{... | christian-schlichtherle/truelicense | tests/src/test/scala/global/namespace/truelicense/tests/core/LicenseConsumerPerformance.scala | Scala | apache-2.0 | 816 |
package com.ergodicity.marketdb.loader
import org.slf4j.LoggerFactory
import org.joda.time.Interval
import com.ergodicity.marketdb.loader.util.Implicits._
import com.twitter.ostrich.admin.{RuntimeEnvironment, Service}
import com.twitter.ostrich.stats.Stats
import com.ergodicity.marketdb.model.TradePayload
import scala... | ezhulenev/marketdb | marketdb-loader/src/main/scala/com/ergodicity/marketdb/loader/Loader.scala | Scala | mit | 1,442 |
package com.twitter.finagle.http
import com.twitter.io.{Reader => BufReader, Writer => BufWriter}
import com.twitter.finagle.netty3.ChannelBufferBuf
import com.twitter.util.{Await, Duration, Closable}
import java.io.{InputStream, InputStreamReader, OutputStream, OutputStreamWriter, Reader, Writer}
import java.util.{It... | lysu/finagle | finagle-http/src/main/scala/com/twitter/finagle/http/Message.scala | Scala | apache-2.0 | 15,984 |
/*
* Copyright (c) 2014-2020 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... | alexandru/monifu | monix-execution/shared/src/main/scala/monix/execution/atomic/PaddingStrategy.scala | Scala | apache-2.0 | 4,095 |
/*
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/transformers/Model2TransitionSystem.scala | Scala | gpl-2.0 | 1,618 |
/*
* Copyright 2018 Analytics Zoo 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... | intel-analytics/analytics-zoo | zoo/src/test/scala/com/intel/analytics/zoo/pipeline/api/keras/layers/GlobalMaxPooling1DSpec.scala | Scala | apache-2.0 | 1,963 |
package controllers
import play.api.libs.functional.syntax._
import play.api.libs.json.Reads._
import play.api.libs.json._
import models.entities.{Attachment => att}
/**
* Created by artem on 29.11.14.
*/
object AttachmentController extends JsonSerializerController with Secured {
/**
* Generate new attachmen... | arakcheev/wbox | app/controllers/AttachmentController.scala | Scala | apache-2.0 | 1,589 |
package io.plasmap.model
sealed trait OsmRole
case object OsmRoleInner extends OsmRole
case object OsmRoleOuter extends OsmRole
case object OsmRoleEmpty extends OsmRole
case class OsmRoleOther(value:String) extends OsmRole | plasmap/geow | src/main/scala/io/plasmap/model/OsmRole.scala | Scala | apache-2.0 | 223 |
package io.iohk.ethereum.blockchain.sync
import akka.actor.{ActorRef, ActorSystem, Props}
import akka.testkit.TestActor.AutoPilot
import akka.testkit.{TestActorRef, TestProbe}
import akka.util.ByteString
import io.iohk.ethereum.blockchain.sync.fast.FastSync
import io.iohk.ethereum.blockchain.sync.fast.FastSync.SyncSta... | input-output-hk/etc-client | src/test/scala/io/iohk/ethereum/blockchain/sync/SyncControllerSpec.scala | Scala | mit | 26,886 |
package org.gark87.yajom.macros
import scala.reflect.macros.Universe
class PredicateToFactory() {
def process[T: y.c.WeakTypeTag](y : YajomContext)(expr: y.c.Expr[T => Boolean], objectFactoryType: y.c.Type): y.c.Tree = {
import y.c.universe._
val creator = y.creator
val onNull = y.createOnNull
def... | gark87/yajom | yajom-macros/src/main/scala/org/gark87/yajom/macros/PredicateToFactory.scala | Scala | mit | 2,368 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | u2009cf/spark-radar | sql/core/src/test/scala/org/apache/spark/sql/streaming/FileStreamSourceSuite.scala | Scala | apache-2.0 | 48,339 |
import sbt._
import Keys._
import play.Project._
object ApplicationBuild extends Build {
val appName = "scalatest"
val appVersion = "1.0-SNAPSHOT"
val appDependencies = Seq(
// Add your project dependencies here,
"org.scalatestplus" % "play_2.10" % "1.0-RC1" % "test"
)
v... | jedesah/scalatest-website | project/Build.scala | Scala | apache-2.0 | 450 |
/*
* 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-blink/src/main/scala/org/apache/flink/table/plan/nodes/physical/batch/BatchExecExpand.scala | Scala | apache-2.0 | 1,972 |
/**
* 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... | WillCh/cs286A | dataMover/kafka/core/src/test/scala/unit/kafka/log4j/KafkaLog4jAppenderTest.scala | Scala | bsd-2-clause | 4,924 |
// Copyright: 2010 - 2018 https://github.com/ensime/ensime-server/graphs
// License: http://www.gnu.org/licenses/lgpl-3.0.en.html
package spray.json
import org.scalatest._
class JsonParserSpec extends WordSpec {
"The JsonParser" should {
"parse 'null' to JsNull" in {
JsonParser("null") === JsNull
}
... | yyadavalli/ensime-server | json/src/test/scala/spray/json/JsonParserSpec.scala | Scala | gpl-3.0 | 3,800 |
package chrome.webNavigation.bindings
import scala.scalajs.js
import scala.scalajs.js._
@js.native
trait OnDOMContentLoadedDetails extends js.Object {
/**
* The ID of the tab in which the navigation occurs.
*/
val tabId: Int = native
val url: String = native
/**
* The ID of the process that runs t... | lucidd/scala-js-chrome | bindings/src/main/scala/chrome/webNavigation/bindings/OnDOMContentLoadedDetails.scala | Scala | mit | 823 |
/*
* 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 ... | niketanpansare/systemml | src/main/scala/org/apache/sysml/api/ml/serving/NonBatchingScheduler.scala | Scala | apache-2.0 | 2,849 |
import java.io.File
import testgen.TestSuiteBuilder._
import testgen._
object SublistTestGenerator {
def main(args: Array[String]): Unit = {
val file = new File("src/main/resources/sublist.json")
def toString(expected: CanonicalDataParser.Expected): String = {
expected match {
case Right("equ... | ricemery/xscala | testgen/src/main/scala/SublistTestGenerator.scala | Scala | mit | 1,190 |
package com.nulabinc.backlog.migration.common.utils
import java.util.Locale
import com.osinka.i18n.Lang
import org.slf4j.{Logger, LoggerFactory}
/**
* @author
* uchida
*/
trait Logging {
implicit val userLang =
if (Locale.getDefault.equals(Locale.JAPAN)) Lang("ja") else Lang("en")
val logger: Logger =... | nulab/backlog-migration-common | core/src/main/scala/com/nulabinc/backlog/migration/common/utils/Logging.scala | Scala | mit | 358 |
package com.github.ligangty.scala.jsoup.helper
import com.github.ligangty.scala.jsoup.helper.Strings._
import org.scalatest.FunSuite
/**
* Test for Strings
*/
class StringsTest extends FunSuite {
test("join Iterable") {
assertResult("")(join(List(""), " "))
assertResult("one")(join(List("one"), " "))
... | ligangty/scalajsoup | src/test/scala/com/github/ligangty/scala/jsoup/helper/StringsTest.scala | Scala | mit | 2,453 |
package nl.svanwouw.trending.types
/**
* Syntactic sugar for a frequency integer.
* Represents topic frequency.
* @param v The value with run time value type.
*/
class Frequency(val v: Int) extends AnyVal with Serializable {
def +(o: Frequency): Frequency = new Frequency(v + o.v)
override def toString = v.toSt... | stefanvanwouw/spark-based-trending-topics-extraction | src/main/scala/nl/svanwouw/trending/types/Frequency.scala | Scala | mit | 329 |
package scorex.network
import java.net.{InetAddress, InetSocketAddress}
import akka.actor.Props
import akka.io.Tcp.{Close, Connected}
import akka.testkit.TestProbe
import scorex.ActorTestingCommons
import scorex.network.peer.PeerManager
import scala.concurrent.duration._
class NetworkListenerSpecification extends A... | B83YPoj/Waves | src/test/scala/scorex/network/NetworkListenerSpecification.scala | Scala | apache-2.0 | 3,773 |
/*
* 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 ... | dbtsai/spark | sql/hive/src/test/scala/org/apache/spark/sql/execution/benchmark/InsertIntoHiveTableBenchmark.scala | Scala | apache-2.0 | 5,106 |
/*
* Copyright 2021 HM Revenue & Customs
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or a... | hmrc/ct-calculations | src/main/scala/uk/gov/hmrc/ct/computations/CP283d.scala | Scala | apache-2.0 | 1,497 |
package org.jetbrains.plugins.scala.lang.psi.stubs.elements
import com.intellij.lang.Language
import com.intellij.psi.stubs.{IndexSink, StubElement, StubOutputStream, StubSerializer}
/**
* @author adkozlov
*/
trait DefaultStubSerializer[S <: StubElement[_]] extends StubSerializer[S] {
def getLanguage: Language
... | loskutov/intellij-scala | src/org/jetbrains/plugins/scala/lang/psi/stubs/elements/DefaultStubSerializer.scala | Scala | apache-2.0 | 580 |
package mesosphere.marathon
package state
import java.util.UUID
import org.apache.mesos.{Protos => mesos}
object TaskFailureTestHelper {
val taskFailureId = s"failedtask.${UUID.randomUUID()}"
lazy val taskFailure = TaskFailure(
appId = AbsolutePathId("/group/app"),
taskId = mesos.TaskID.newBuilder.setVal... | mesosphere/marathon | src/test/scala/mesosphere/marathon/state/TaskFailureTestHelper.scala | Scala | apache-2.0 | 532 |
package io.youi.event
sealed trait DeltaMode
object DeltaMode {
case object Pixel extends DeltaMode
case object Line extends DeltaMode
case object Page extends DeltaMode
} | outr/youi | gui/src/main/scala/io/youi/event/DeltaMode.scala | Scala | mit | 179 |
package fi.pyppe.ircbot.slave
import twitter4j.TwitterFactory
import scala.concurrent.{ExecutionContext, Future}
object Tweets {
def statusText(id: Long)(implicit ec: ExecutionContext): Future[String] = Future {
val status = TwitterFactory.getSingleton.showStatus(id)
val user = s"@${status.getUser.getScree... | Pyppe/akka-ircbot | slave/src/main/scala/fi/pyppe/ircbot/slave/Tweets.scala | Scala | mit | 542 |
package lila
package object plan extends PackageObject with WithPlay {
private[plan] def logger = lila.log("plan")
}
| clarkerubber/lila | modules/plan/src/main/package.scala | Scala | agpl-3.0 | 121 |
/*
* Copyright 2014 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/blaze | http/src/test/scala/org/http4s/blaze/http/http2/ProtocolFrameDecoder.scala | Scala | apache-2.0 | 2,266 |
/*
* 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 | core/src/main/scala/org/apache/spark/rdd/RDD.scala | Scala | apache-2.0 | 80,696 |
import org.scalatest._
import petrovich._
class PetrovichSpec extends FlatSpec with Matchers {
"Petrovich" should "detect female" in {
val person = FirstName("Светлана") :: MiddleName("Андреевна")
person.gender shouldEqual Gender.Female
}
it should "detect male" in {
val person = FirstName("Лев") :... | fomkin/petrovich-scala | petrovich-scala/src/test/scala/PetrovichSpec.scala | Scala | apache-2.0 | 1,774 |
package solve
object Problem16 extends App {
println(
BigInt.apply("1" + "0" * 1000, 2).toString()
.foldLeft(0) { _ + _.toString().toInt })
} | knaou/project-euler-scala | src/solve/Problem16.scala | Scala | mit | 154 |
package main.classifier
import breeze.linalg.SparseVector
import breeze.numerics.exp
import main.factory.InputLRData
import main.linalg.AlgUtil
import main.optimizer.FTRLProximal
import org.apache.spark.mllib.linalg.Vector
import org.apache.spark.mllib.regression.LabeledPoint
import org.apache.spark.rdd.RDD
import sc... | zhanghaoyu1993/MachineLearning_in_Spark | sparkML/src/main/Classifier/LRWithFTRL.scala | Scala | mit | 2,366 |
/*
* Copyright 2014 Intelix Pty 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 agreed... | mglukh/ehub | modules/core/src/main/scala/hq/flows/core/GateSinkBuilder.scala | Scala | apache-2.0 | 3,363 |
package nyaya.gen
import scala.collection.immutable.ArraySeq
import scala.collection.Factory
import scala.reflect.ClassTag
object ScalaVerSpecific {
implicit object SetLikeForLazyList extends SetLike.CastFromAny[LazyList]({
type F[A] = LazyList[A]
type A = Any
new SetLike[F, A] {
override def emp... | japgolly/nyaya | gen/shared/src/main/scala-3/nyaya/gen/Scala3Specific.scala | Scala | lgpl-2.1 | 1,293 |
package commons.mapper.utils
import java.lang.reflect.{ Method, Modifier }
import java.sql.Date
import java.util.Date
import scala.reflect.runtime.universe
import scala.reflect.runtime.universe.{ Mirror, TermName, runtimeMirror, termNames, typeOf }
import commons.mapper.ArgWithDefault
/**
* @author Kai Han
*/
pri... | hank-whu/common4s | src/main/scala/commons/mapper/utils/TypeUtils.scala | Scala | apache-2.0 | 8,636 |
package com.yannick_cw.elastic_indexer4s.elasticsearch.elasic_config
import com.sksamuel.elastic4s.analyzers.AnalyzerDefinition
import com.sksamuel.elastic4s.mappings.MappingDefinition
import io.circe.{Json, ParsingFailure}
import io.circe.parser.parse
sealed trait MappingSetting {
def fold[A](typed: TypedMappingSe... | yannick-cw/elastic-indexer4s | src/main/scala/com/yannick_cw/elastic_indexer4s/elasticsearch/elasic_config/MappingSetting.scala | Scala | mit | 1,074 |
package ignition.core.jobs
import scala.util.Try
object ExecutionRetry extends ExecutionRetry
trait ExecutionRetry {
def executeRetrying[T](code: => T, maxExecutions: Int = 3): T = {
assert(maxExecutions > 0) // we will execute at least once
// TODO: log retries
def _executeRetrying(retriesLeft: Int)... | chaordic/ignition-core | src/main/scala/ignition/core/jobs/ExecutionRetry.scala | Scala | mit | 561 |
/*
* 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 ... | manishgupta88/carbondata | integration/spark-common/src/main/scala/org/apache/carbondata/spark/PartitionFactory.scala | Scala | apache-2.0 | 2,609 |
package systems.opalia.commons.control
package object units {
type Percent = Double
type Meter = Double
type Radian = Double
type MeterPerSecond = Double
type RadianPerSecond = Double
type MeterPerSecondSq = Double
type RadianPerSecondSq = Double
}
| OpaliaSystems/commons | src/main/scala/systems/opalia/commons/control/units/package.scala | Scala | apache-2.0 | 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"); yo... | Zhiqiang-He/kafka-0914-edit | core/src/test/scala/integration/kafka/api/PlaintextProducerSendTest.scala | Scala | apache-2.0 | 2,215 |
/**
* Original work: SecureSocial (https://github.com/jaliss/securesocial)
* Copyright 2013 Jorge Aliss (jaliss at gmail dot com) - twitter: @jaliss
*
* Derivative work: Silhouette (https://github.com/mohiva/play-silhouette)
* Modifications Copyright 2015 Mohiva Organisation (license at mohiva dot com)
*
* Licen... | rfranco/play-silhouette | silhouette/app/com/mohiva/play/silhouette/impl/util/SecureRandomIDGenerator.scala | Scala | apache-2.0 | 2,160 |
/*
* 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 ... | dbtsai/spark | sql/core/src/test/scala/org/apache/spark/sql/test/SQLTestUtils.scala | Scala | apache-2.0 | 17,002 |
// scalac: -Xfatal-warnings
//
sealed abstract class Base
object Test {
case object Up extends Base
def foo(d1: Base) =
d1 match {
case Up =>
}
// Sealed subtype: ModuleTypeRef <empty>.this.Test.Up.type
// Pattern: UniqueThisType Test.this.type
}
object Test1 {
sealed abstrac... | scala/scala | test/files/pos/t7285a.scala | Scala | apache-2.0 | 1,462 |
object Test {
def main(args: Array[String]) {
trait T1 { def a: Int; def c: Int }
trait T2 { def a: Int; def b: Int }
class Bar(val x: Int)
class Foo(val a: Int, val b: Int, val c: Int) extends Bar(a + b + c) with T1 with T2
import scala.reflect.runtime.{currentMirror => cm}
val members = cm.... | felixmulder/scala | test/files/run/reflection-sorted-members.scala | Scala | bsd-3-clause | 438 |
package sorm.reflection
import reflect.runtime.universe._
import reflect.runtime.{currentMirror => mirror}
import sext._, embrace._
object ScalaApi {
implicit class TypeApi ( t : Type ) {
def s : Symbol = t.typeSymbol
private def members : Stream[Symbol] = t.members.toStream
def properties
= memb... | sorm/sorm | src/main/scala/sorm/reflection/ScalaApi.scala | Scala | mit | 1,172 |
package debop4s.core.jodatime
import org.joda.time.LocalDate.Property
import org.joda.time._
class JodaRichLocalDate(val self: LocalDate) extends AnyVal with Ordered[LocalDate] {
def -(period: ReadablePeriod): LocalDate = self.minus(period)
def -(builder: DurationBuilder): LocalDate = self.minus(builder.underly... | debop/debop4s | debop4s-core/src/main/scala/debop4s/core/jodatime/JodaRichLocalDate.scala | Scala | apache-2.0 | 1,414 |
/*
* Copyright (c) 2012-2016 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.apach... | snowplow/schema-guru | src/main/scala/com.snowplowanalytics/schemaguru/SchemaCodecs.scala | Scala | apache-2.0 | 2,474 |
/*
* 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 ... | darionyaphet/flink | flink-table/flink-table-planner-blink/src/test/scala/org/apache/flink/table/planner/runtime/batch/table/TableSinkITCase.scala | Scala | apache-2.0 | 6,130 |
package com.lyrx.html
import java.io.File
import com.lyrx.text._
import HTMLTypes._
import scalatags.Text.all._
trait ParBasedEbook extends ParBasedHTMLGenerator with BookData{
override def wordCount(): Int = ???
override def convertToString()(implicit coll:Collector[HTMLTag],ctx:Context):String=generat... | lyrx/lyrxgenerator | src/main/scala/com/lyrx/html/ParBasedEbook.scala | Scala | gpl-3.0 | 1,490 |
package de.fuberlin.wiwiss.silk.linkagerule
import de.fuberlin.wiwiss.silk.util.{ValidatingXMLReader, DPair}
import de.fuberlin.wiwiss.silk.entity.{Path, EntityDescription, Entity}
import de.fuberlin.wiwiss.silk.config.Prefixes
import de.fuberlin.wiwiss.silk.runtime.resource.ResourceLoader
import scala.xml.Node
import... | fusepoolP3/p3-silk | silk-core/src/main/scala/de/fuberlin/wiwiss/silk/linkagerule/TransformRule.scala | Scala | apache-2.0 | 2,229 |
package dotty.tools.dotc
package transform
import core._
import MegaPhase._
import dotty.tools.dotc.ast.tpd._
import dotty.tools.dotc.core.Contexts.Context
import dotty.tools.dotc.core.StdNames._
import ast._
import Trees._
import Flags._
import SymUtils._
import Symbols._
import Decorators._
import DenotTransformers.... | som-snytt/dotty | compiler/src/dotty/tools/dotc/transform/Constructors.scala | Scala | apache-2.0 | 11,827 |
/*
*************************************************************************************
* Copyright 2011 Normation SAS
*************************************************************************************
*
* This file is part of Rudder.
*
* Rudder is free software: you can redistribute it and/or modify
* it under the... | armeniaca/rudder | rudder-web/src/main/scala/com/normation/rudder/web/snippet/HomePage.scala | Scala | gpl-3.0 | 17,364 |
package org.maproulette.cache
import org.joda.time.DateTime
import org.maproulette.Config
import org.maproulette.data.{ItemType, ProjectType}
import org.maproulette.models.BaseObject
import org.scalatestplus.play.PlaySpec
import play.api.Configuration
import play.api.libs.json.{DefaultWrites, JodaReads, JodaWrites, Js... | mvexel/maproulette2 | test/org/maproulette/cache/CacheSpec.scala | Scala | apache-2.0 | 6,537 |
/**
* Created on: Feb 2, 2014
*/
package com.iteamsolutions.angular.services
package atom.actor
import scalaz.{
Failure => _,
Success => _,
_
}
import com.iteamsolutions.angular.models.atom.Feed
/**
* The '''AvailableFeedsRequest''' type serves as the parent for ''all''
* [[com.iteamsolutions.angular.servi... | osxhacker/angular-codegen | src/main/scala/com/iteamsolutions/angular/services/atom/actor/AvailableFeedsMessages.scala | Scala | bsd-2-clause | 918 |
/*
* 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/main/scala/com/intel/analytics/bigdl/utils/ConvertModel.scala | Scala | apache-2.0 | 4,462 |
/**
* Created by zyst on 1/12/2016.
*/
object Procedures {
def main(args: Array[String]) {
// A procedure is called only for its effect, and it returns no value.
def box(s: String) {
val border = "-" * s.length + "--\\n"
println(border + "|" + s + "|\\n" + border)
}
// ------------... | Zyst/SCALA-Fundamentals | Scala for the Impatient/L1/src/Procedures.scala | Scala | mit | 564 |
trait x0[T] { self: x0 => } // error
trait x1[T] { self: (=> String) => } // error
trait x2[T] { self: ([X] =>> X) => } // error
| som-snytt/dotty | tests/neg/bad-selftype.scala | Scala | apache-2.0 | 145 |
package com.morenware.tvcrawler.config
import java.io.File
import com.typesafe.scalalogging.Logger
import net.liftweb.json.DefaultFormats
import io._
import net.liftweb.json._
import org.slf4j.LoggerFactory
case class Config(crawlerConf: File = new File("."))
/**
* Created by david on 20/04/2016.
*/
object Config... | dfernandezm/tv-crawler-scala | src/main/scala/com/morenware/tvcrawler/config/Configuration.scala | Scala | mit | 2,137 |
def get[S]: State[S, S] =
State(s => (s, s))
def set[S](s: S): State[S, Unit] =
State(_ => ((), s)) | galarragas/FpInScala | answerkey/state/12.answer.scala | Scala | mit | 104 |
/* Example of case class */
abstract class Term
case class Var(name: String) extends Term
case class Fun(arg: String, body: Term) extends Term
case class App(f: Term, v: Term) extends Term
object TermTest extends Application {
def printTerm(term: Term) {
term match {
case Var(n) =>
... | uthcode/learntosolveit | languages/scala/TermTest.scala | Scala | bsd-3-clause | 938 |
package de.hska.wifl1011.seminararbeit
import scala.concurrent.{ future, promise }
import scala.concurrent.ExecutionContext.Implicits.global
import scala.util.{ Failure, Success }
object Main {
def main(args: Array[String]) {
val myPromise = promise[Integer]
val myFuture = myPromise.future
val apprent... | fwilhe/hska-seminararbeit | code/constructionsite/Main.scala | Scala | mit | 883 |
package hammock
package circe
import cats.implicits._
import io.circe.{Encoder => CirceEncoder, Decoder => CirceDecoder}
import io.circe.parser.{decode => circeDecode}
import io.circe.syntax._
class HammockEncoderForCirce[A: CirceEncoder] extends Encoder[A] {
override def encode(a: A): Entity =
Entity.StringEnt... | pepegar/hammock | hammock-circe/src/main/scala/hammock/circe/CirceCodec.scala | Scala | mit | 1,240 |
/**
* 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-http/src/main/scala/com/excilys/ebi/gatling/http/request/builder/GetHttpRequestBuilder.scala | Scala | gpl-2.0 | 1,274 |
package ch.ninecode.cim
import org.apache.spark.graphx.VertexId
/**
* Vertex data for topological processing.
*
* @param island the minimum (hash code) of all connected ConnectivityNode (single topological island)
* @param island_label a user friendly label for the island
* @param node the minimum ... | derrickoswald/CIMScala | CIMReader/src/main/scala/ch/ninecode/cim/CIMVertexData.scala | Scala | mit | 1,519 |
/*
Deduction Tactics
Copyright (C) 2012-2015 Raymond Dodge
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This progra... | rayrobdod/deductionTactics | src/main/scala/com/rayrobdod/deductionTactics/TokenClass.scala | Scala | gpl-3.0 | 23,955 |
// generated by tscfg 0.9.4 on Sat Jun 15 02:49:06 IST 2019
// source: src/main/resources/beam-template.conf
package beam.sim.config
case class BeamConfig(
beam: BeamConfig.Beam,
matsim: BeamConfig.Matsim
)
object BeamConfig {
case class Beam(
agentsim: BeamConfig.Beam.Agentsim,
calibration: BeamConfig... | colinsheppard/beam | src/main/scala/beam/sim/config/BeamConfig.scala | Scala | gpl-3.0 | 122,487 |
package com.tpl.lib.gui
import net.bdew.lib.gui.{Texture, WidgetContainer, Rect, Color}
import net.bdew.lib.gui.widgets.WidgetSubcontainer
class WidgetPlayerInventory(x: Int, y: Int, texture: Texture, invColor: Color = Color.white, hotbarColor: Color = Color.white, hotbarSpace: Int = 4, cellSize: Int = 18)
extends ... | piotrb/hamcraft | src/main/scala/com/tpl/lib/gui/WidgetPlayerInventory.scala | Scala | bsd-2-clause | 730 |
/*
* Copyright 2011 Goldman Sachs.
*
* 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 ... | jlz27/gs-collections | scala-unit-tests/src/test/scala/com/gs/collections/impl/EmptyListScalaTest.scala | Scala | apache-2.0 | 766 |
// Example: Hello CRON scheduling!
// This a minimal cuttle project demonstrating the CRON scheduler
package com.criteo.cuttle.examples
// The main package contains everything needed to create
// a cuttle project.
import com.criteo.cuttle._
import com.criteo.cuttle.cron.Implicits._
import com.criteo.cuttle.cron.{Cron... | criteo/cuttle | examples/src/main/scala/com/criteo/cuttle/examples/HelloCronScheduling.scala | Scala | apache-2.0 | 4,368 |
package org.apache.toree
/**
* A wrapper used to workaround
* <a href="http://docs.scala-lang.org/overviews/reflection/thread-safety.html">thread safety issues</a> in Scala 2.10 reflection
* facilities.
* <p>Any interaction with scala.reflect must be performed only via the [[ReflectionAccessor.useReflection()]] me... | Myllyenko/incubator-toree | plugins/src/main/scala-2.11/org/apache/toree/ReflectionAccessor.scala | Scala | apache-2.0 | 712 |
package info.mukel.telegrambot4s.api
import java.util.concurrent.Executors
import akka.actor.ActorSystem
import akka.http.scaladsl.Http
import akka.http.scaladsl.marshalling.Marshal
import akka.http.scaladsl.model._
import akka.http.scaladsl.unmarshalling.Unmarshal
import akka.stream.QueueOfferResult.Enqueued
import ... | hugemane/telegrambot4s | src/main/scala/info/mukel/telegrambot4s/api/HttpClientQueued.scala | Scala | apache-2.0 | 2,955 |
/*
* Copyright 2016 The BigDL Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agr... | yiheng/BigDL | spark/dl/src/main/scala/com/intel/analytics/bigdl/parameters/FP16SplitsCompressedTensor.scala | Scala | apache-2.0 | 5,560 |
package scala.meta
import scala.meta.dialects._
import scala.meta.internal.dialects._
import scala.collection.immutable.TreeMap
/**
* A dialect is used to configure what Scala syntax is allowed during tokenization and parsing.
*/
final class Dialect private (
// Are `&` intersection types supported by this dial... | scalameta/scalameta | scalameta/dialects/shared/src/main/scala/scala/meta/Dialect.scala | Scala | bsd-3-clause | 28,841 |
package org.apache.datacommons.prepbuddy.normalizers
import org.apache.datacommons.prepbuddy.rdds.TransformableRDD
/**
* A normalizer technique which normalizes data by their standard score.
* Formula for Z Score Normalization : (X - Mean) / Standard Deviation.
*/
class ZScoreNormalizer extends NormalizationStr... | blpabhishek/prep-buddy | src/main/scala/org/apache/datacommons/prepbuddy/normalizers/ZScoreNormalizer.scala | Scala | apache-2.0 | 782 |
/*
* 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 ... | h2oai/sparkling-water | core/src/main/scala/ai/h2o/sparkling/backend/api/ParameterBase.scala | Scala | apache-2.0 | 1,209 |
/*
* Copyright 2015-2016 IBM Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agree... | xin-cai/openwhisk | common/scala/src/main/scala/whisk/core/entity/Exec.scala | Scala | apache-2.0 | 11,974 |
/*
* This file is part of AnyMime, a program to help you swap files
* wirelessly between mobile devices.
*
* Copyright (C) 2011 Timur Mehrvarz, timur.mehrvarz(a)gmail(.)com
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published... | mehrvarz/Anymime | src/org/timur/anymime/SlotListAdapter.scala | Scala | gpl-3.0 | 3,248 |
package io.getquill.codegen.integration
import com.typesafe.scalalogging.Logger
import java.io.Closeable
import java.sql.Connection
import javax.sql.DataSource
import io.getquill.codegen.jdbc.DatabaseTypes._
import io.getquill.codegen.jdbc.gen.DefaultJdbcSchemaReader
import io.getquill.codegen.model.JdbcTableMeta
imp... | getquill/quill | quill-codegen-jdbc/src/test/scala/io/getquill/codegen/integration/DbHelper.scala | Scala | apache-2.0 | 5,966 |
package com.codahale.jerkson.deser
import scala.collection.JavaConversions._
import scala.collection.mutable.ArrayBuffer
import com.codahale.jerkson.JsonSnakeCase
import com.codahale.jerkson.util._
import com.codahale.jerkson.Util._
import org.codehaus.jackson.{JsonNode, JsonToken, JsonParser}
import org.codehaus.jack... | cphylabs/jerkson-old | src/main/scala/com/codahale/jerkson/deser/CaseClassDeserializer.scala | Scala | mit | 3,461 |
package io.techcode.streamy.event
/**
* All monitor events.
*/
object MonitorEvent {
/**
* Represent a process monitor event.
* This event is fired when a monitoring check has been done.
*/
case class Process(
timestamp: Long,
openFileDescriptors: Long,
maxFileDescriptors: Long,
cp... | amannocci/streamy | core/src/main/scala/io/techcode/streamy/event/MonitorEvent.scala | Scala | mit | 1,825 |
import org.fusesource.scalate.support.TemplatePackage
import org.fusesource.scalate.TemplateSource
import org.fusesource.scalate.Binding
class ScalatePackage extends TemplatePackage {
def header(source: TemplateSource, bindings: List[Binding]) = """
"""
} | MomoPain/scalajs-react-crud | jvm/src/main/scala/ScalatePackage.scala | Scala | mit | 262 |
package org.saddle.framework
import org.saddle._
import org.specs2.matcher._
import scala.reflect.ClassTag
/**
* A matcher for two numeric Mats that must be equal to within
* a tolerance
*/
class BeCloseToMat[T: Numeric : ClassTag](m: Mat[T], delta: T) extends Matcher[Mat[T]] {
def apply[S <: Mat[T]](x: Expecta... | amaizing/amaizing-saddle | saddle-test-framework/src/main/scala/org/saddle/framework/BeCloseToMat.scala | Scala | apache-2.0 | 812 |
package eu.akkamo
import akka.actor.ActorSystem
import com.typesafe.config.{Config, ConfigFactory}
import scala.concurrent.Future
import scala.util.Try
/**
* Register one or more Actor System
* {{{
* configuration example:
* akkamo.akka = {
* // one block with akka configuration contains several al... | akkamo/akkamo | akkamoAkka/src/main/scala/eu/akkamo/AkkaModule.scala | Scala | unlicense | 2,224 |
package stealthnet.scala.ui.web
import com.typesafe.config.{Config, ConfigFactory}
import java.util.concurrent.TimeUnit
import stealthnet.scala.{BaseSettings, Settings => coreSettings}
/** ''StealthNet'' web UI settings companion object. */
object Settings {
/** Core settings. */
val core: coreSettings = coreSet... | suiryc/StealthNet | ui-web-jsf/src/main/scala/stealthnet/scala/ui/web/Settings.scala | Scala | gpl-3.0 | 834 |
package com.metebalci
import org.scalatest._
import org.scalatest.Assertions._
class ModifySpec extends FunSuite {
test("modify") {
case class Foo(name:String, age:Int)
val foo = Foo("foo", 30)
val fooLens = Lens[Foo, String] (
f => f.name,
(n, f) => f.copy(name = n)
)
assert( fo... | metebalci/experiment-lenses-scala | src/test/scala/02-ModifySpec.scala | Scala | gpl-2.0 | 420 |
/*
* Copyright 2001-2014 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... | SRGOM/scalatest | scalatest/src/main/scala/org/scalatest/AsyncFlatSpec.scala | Scala | apache-2.0 | 1,182 |
/*
* 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/main/scala/org/apache/spark/util/Utils.scala | Scala | apache-2.0 | 30,085 |
/*
* 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/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveUDFSuite.scala | Scala | apache-2.0 | 28,344 |
package org.openapitools.server.model
/**
* @param `class` for example: ''null''
* @param links for example: ''null''
* @param classes for example: ''null''
*/
final case class ExtensionClassImpl (
`class`: Option[String],
links: Option[ExtensionClassImpllinks],
classes: Option[Seq[String]]
)
| cliffano/swaggy-jenkins | clients/scala-akka-http-server/generated/src/main/scala/org/openapitools/server/model/ExtensionClassImpl.scala | Scala | mit | 309 |
package gremlin.scala
import org.apache.commons.configuration2.Configuration
import org.apache.tinkerpop.gremlin.process.computer.GraphComputer
import org.apache.tinkerpop.gremlin.structure.Graph.Variables
import org.apache.tinkerpop.gremlin.structure.{T, Transaction}
import shapeless._
object ScalaGraph {
def appl... | mpollmeier/gremlin-scala | gremlin-scala/src/main/scala/gremlin/scala/ScalaGraph.scala | Scala | apache-2.0 | 3,612 |
/***********************************************************************
* Copyright (c) 2013-2019 Commonwealth Computer Research, Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Apache License, Version 2.0
* which accompanies this distribution and... | elahrvivaz/geomesa | geomesa-kudu/geomesa-kudu-tools/src/main/scala/org/locationtech/geomesa/kudu/tools/stats/KuduStatsBoundsCommand.scala | Scala | apache-2.0 | 1,350 |
/**
* 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/declaration/DConnection.scala | Scala | apache-2.0 | 2,389 |
package com.github.ponkin.bloom.server
import com.twitter.finagle.Thrift
class BloomServer(val conf: BloomConfig) {
import KryoSerializer._
val storeImpl = new BloomFilterStoreImpl(DiskStoreManager(conf.storage))
def run = Thrift
.server
.withLabel("BloomServer")
.serveIface(s"${conf.server.host}... | ponkin/bloom | server/src/main/scala/com/github/ponkin/bloom/server/BloomServer.scala | Scala | apache-2.0 | 435 |
/*
* Copyright (c) 2013 Christos KK Loverdos
*
* 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... | loverdos/thrift3r | src/main/scala/com/ckkloverdos/thrift3r/codec/struct/StructCodec.scala | Scala | apache-2.0 | 2,172 |
/*
* Copyright (C) 2015 Jason Mar
*
* 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... | jasonmar/scala-bigcollections | src/main/scala/com/jasonmar/BigBitMap.scala | Scala | apache-2.0 | 3,621 |
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.