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 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/ct600a/v3/LPQ07.scala | Scala | apache-2.0 | 1,275 |
package org.atnos.site
import lib._
object OutOfTheBox extends UserGuidePage { def is = "Out of the box".title ^ s2"""
This library comes with the following effects:
Name | Description | Link
--------- | ----------------... | etorreborre/eff | jvm/src/test/scala/org/atnos/site/OutOfTheBox.scala | Scala | mit | 2,369 |
/*
* 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 ... | mkolod/incubator-spark | mllib/src/main/scala/org/apache/spark/mllib/optimization/Updater.scala | Scala | apache-2.0 | 4,102 |
package com.geeksville.mavlink
import org.mavlink.messages.MAVLinkMessage
/**
* published on our eventbus when a new packet arrives from the outside world
*/
/**
* Common code for any gateway that receives mavlink messages into our actor system
*/
trait MavlinkReceiver {
/**
* For now we pipe all our notif... | geeksville/arduleader | common/src/main/scala/com/geeksville/mavlink/MavlinkReceiver.scala | Scala | gpl-3.0 | 927 |
package nozzle.logging
import ingredients.logging._
case class PlainOldLoggerFactory(factory: String => PlainOldLogger)
object PlainOldLoggerFactory {
implicit def plainOldLoggerFactory(implicit logging: Logging): PlainOldLoggerFactory =
new PlainOldLoggerFactory(logging.plainOldLogger _)
}
| utaal/nozzle | src/main/scala/logging/PlainOldLoggerFactory.scala | Scala | mit | 301 |
/*
* Copyright 2015 Otto (GmbH & Co KG)
*
* 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... | ottogroup/flink-spector | flinkspector-core/src/test/scala/io/flinkspector/core/collection/VerifierTranslatorSpec.scala | Scala | apache-2.0 | 1,605 |
package db
import anorm.SqlParser._
import anorm._
import models.SupportedLanguage
import play.api.Logger
import play.api.Play.current
import play.api.db.DB
import scala.util.control.Breaks._
object SupportedLanguageDto {
val All = getAll
def getOfCode(ietfCode: String): Option[SupportedLanguage] = {
var re... | PanzerKunst/redesigned-cruited.com-frontend | website/app/db/SupportedLanguageDto.scala | Scala | gpl-3.0 | 1,116 |
package api
import akka.NotUsed
import com.lightbend.lagom.scaladsl.api._
import com.lightbend.lagom.scaladsl.api.transport.Method
trait BazService extends Service {
def baz: ServiceCall[NotUsed, String]
override def descriptor = {
import Service._
named("c").withCalls(
restCall(Method.GET, "/baz"... | rstento/lagom | dev/sbt-plugin/src/sbt-test/sbt-plugin/run-all-scaladsl/c/src-c/main/scala/api/BazService.scala | Scala | apache-2.0 | 357 |
package sbt
import sbt.internal.util.{ AttributeKey, Dag, Relation, Util }
import sbt.util.Logger
import Def.Setting
import Plugins._
import PluginsDebug._
import java.net.URI
private[sbt] class PluginsDebug(val available: List[AutoPlugin], val nameToKey: Map[String, AttributeKey[_]], val provided: Relation[... | mdedetrich/sbt | main/src/main/scala/sbt/PluginsDebug.scala | Scala | bsd-3-clause | 21,550 |
package com.datawizards.sparklocal.impl.scala.eager.dataset
import com.datawizards.sparklocal.dataset.{DataSetAPI, KeyValueGroupedDataSetAPI}
import com.datawizards.sparklocal.impl.scala.dataset.DataSetAPIScalaBase
import com.datawizards.sparklocal.rdd.RDDAPI
import org.apache.spark.sql.Encoder
import scala.collectio... | piotr-kalanski/spark-local | src/main/scala/com/datawizards/sparklocal/impl/scala/eager/dataset/DataSetAPIScalaEagerImpl.scala | Scala | apache-2.0 | 1,685 |
/*
* Copyright (C) 2016 Christopher Batey and Dogan Narinc
*
* 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... | mikefero/cpp-driver | gtests/src/integration/scassandra/server/codec/src/test/scala/org/scassandra/codec/CodecTablePropertyChecks.scala | Scala | apache-2.0 | 843 |
class i0 extends i0() {
var i1 = false
val i2: Int = 1
def i3(i4: String): String = i1
}
class i5 extends i1 {
def i6 = if (i2.i7) new _ }
{ if (collection
'{ println(); new i2() } def i6() = "" } | som-snytt/dotty | tests/fuzzy/6291e318fc02ee941333a81928ec3ce3e4afbfa8.scala | Scala | apache-2.0 | 197 |
/*
* Copyright (c) 2002-2018 "Neo Technology,"
* Network Engine for Objects in Lund AB [http://neotechnology.com]
*
* This file is part of Neo4j.
*
* Neo4j 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 Foundatio... | HuangLS/neo4j | community/cypher/cypher-compiler-2.3/src/main/scala/org/neo4j/cypher/internal/compiler/v2_3/planner/logical/plans/Sort.scala | Scala | apache-2.0 | 1,340 |
package lila.socket
import akka.actor.ActorRef
import akka.pattern.{ ask, pipe }
import play.api.libs.iteratee.{ Iteratee, Enumerator }
import play.api.libs.json._
import actorApi._
import lila.common.PimpedJson._
import lila.hub.actorApi.relation.ReloadOnlineFriends
import makeTimeout.large
object Handler {
type... | Happy0/lila | modules/socket/src/main/Handler.scala | Scala | mit | 2,236 |
/*
* Copyright 2011-2018 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 applic... | wiacekm/gatling | gatling-metrics/src/main/scala/io/gatling/metrics/GraphiteDataWriter.scala | Scala | apache-2.0 | 4,545 |
package io.ssc.trackthetrackers.analysis.stats
import io.ssc.trackthetrackers.analysis.{Edge, FlinkUtils}
import org.apache.flink.api.java.aggregation.Aggregations
import org.apache.flink.api.scala.{ExecutionEnvironment, _}
object TopThirdPartiesByPageRank extends App {
implicit val env = ExecutionEnvironment.get... | sscdotopen/trackthetrackers | analysis/src/main/scala/io/ssc/trackthetrackers/analysis/stats/TopThirdPartiesByPageRank.scala | Scala | gpl-3.0 | 1,299 |
package me.yingrui.segment.util
import java.text.DecimalFormat
object NumberUtil {
val minus = "负"
val digits = List("零", "一", "二", "三", "四", "五", "六", "七", "八", "九")
val digits2 = List("0", "1", "2", "3", "4", "5", "6", "7", "8", "9")
val digits3 = List("〇", "壹", "貳", "參", "肆", "伍", "陸", "柒", "捌", ... | yingrui/mahjong | lib-segment/src/main/scala/me/yingrui/segment/util/NumberUtil.scala | Scala | gpl-3.0 | 10,222 |
/*
* Copyright (C) 2016-2017 Lightbend Inc. <https://www.lightbend.com>
*/
package com.lightbend.lagom.javadsl.persistence.testkit
import scala.util.control.NoStackTrace
/**
* to avoid fat stack trace logging in tests
*/
class SimulatedNullpointerException extends NullPointerException("simulated NPE") with NoStac... | edouardKaiser/lagom | persistence/javadsl/src/test/scala/com/lightbend/lagom/javadsl/persistence/testkit/SimulatedNullpointerException.scala | Scala | apache-2.0 | 327 |
package logic
import scalaz._
import scalaz.std.AllInstances._
import FunctionEqual._
import scalaprops._
sealed abstract class LogicSpec extends Scalaprops{
protected[this] implicit def stateTEqual[F[_], A, B](implicit F: Equal[A => F[(A, B)]]): Equal[StateT[F, A, B]] =
F.contramap(_.apply _)
protected[thi... | beni55/scala-logic | src/test/scala/logic/LogicSpec.scala | Scala | mit | 2,268 |
import scala.reflect.runtime.universe._
import scala.tools.reflect.ToolBox
object Test extends dotty.runtime.LegacyApp {
val tb = runtimeMirror(getClass.getClassLoader).mkToolBox()
val tree1 = reify(new collection.immutable.HashMap[String, String])
val tree2 = reify(new collection.mutable.HashMap[String, String]... | yusuke2255/dotty | tests/disabled/macro/run/showraw_tree_ultimate.scala | Scala | bsd-3-clause | 613 |
package com.typesafe.akka.http.benchmark.handlers
import akka.http.scaladsl.model.HttpCharsets._
import akka.http.scaladsl.model.MediaTypes._
import akka.http.scaladsl.model.{HttpEntity, HttpResponse, StatusCodes}
import akka.http.scaladsl.server.Directives._
import com.typesafe.akka.http.benchmark.datastore.DataStore... | greg-hellings/FrameworkBenchmarks | frameworks/Scala/akka-http/src/main/scala/com/typesafe/akka/http/benchmark/handlers/DbHandler.scala | Scala | bsd-3-clause | 1,659 |
/*
* 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/metrics/MSESpec.scala | Scala | apache-2.0 | 1,208 |
object Foo:
opaque type BlaBla[+T, D] = Int
extension [T, D](token: BlaBla[T, D]) def data: D = ???
//To cause the crash, after initial clean compilation
//replace `???` with `value.data` to cause the compiler crash
def foo[W <: Int](value: Bar.BlaBla[W]): Unit = value.data
| dotty-staging/dotty | sbt-test/opaques/i12927/changes/Foo.scala | Scala | apache-2.0 | 280 |
package com.arcusys.valamis.util.mustache
trait Token {
def render(context: Any, partials: Map[String, Mustache], callstack: List[Any]): TokenProduct
def templateSource: String
}
| ViLPy/Valamis | valamis-util/src/main/scala/com/arcusys/valamis/util/mustache/Token.scala | Scala | lgpl-3.0 | 187 |
/***********************************************************************
* Copyright (c) 2013-2017 Commonwealth Computer Research, Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Apache License, Version 2.0
* which accompanies this distribution and... | ronq/geomesa | geomesa-hbase/geomesa-hbase-datastore/src/main/scala/org/locationtech/geomesa/hbase/data/HBaseDataStoreFactory.scala | Scala | apache-2.0 | 10,950 |
package com.arcusys.valamis.web.servlet.social.response
import com.arcusys.valamis.social.model.Comment
import com.arcusys.valamis.user.model.UserInfo
import com.arcusys.valamis.user.service.UserService
import org.ocpsoft.prettytime.PrettyTime
case class CommentResponse(id: Long,
user: User... | arcusys/Valamis | valamis-portlets/src/main/scala/com/arcusys/valamis/web/servlet/social/response/CommentResponse.scala | Scala | gpl-3.0 | 1,158 |
package sbttest
object Main {
def main(args: Array[String]): Unit = {
println("Hello")
val vmVersion = System.getProperty("java.vm.version")
println(vmVersion)
val isScalaJS = 1.0.toString() == "1"
println(s"isScalaJS = $isScalaJS")
if (isScalaJS)
assert(vmVersion == "1.0.0")
}
}
| densh/sbt-cross-project | sbt-crossproject-test/src/sbt-test/new-api/scalajs-1.0.0/src/main/scala/sbttest/Main.scala | Scala | bsd-3-clause | 317 |
/*
* Copyright 2015 Nicolas Rinaudo
*
* 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... | nrinaudo/scala-csv | laws/shared/src/main/scala/kantan/csv/laws/package.scala | Scala | mit | 1,710 |
/*
Copyright 2016 Jo Pol
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 program is distributed in the hope that it ... | d-bl/GroundForge | src/test/scala/dibl/proto/ProtoDemos.scala | Scala | gpl-3.0 | 1,325 |
package com.themillhousegroup.scoup
import scala.language.postfixOps
import org.specs2.mutable.Specification
import com.themillhousegroup.scoup.test.HtmlFixtures
import org.jsoup.nodes.Element
class ClosestElementsSpec extends Specification with ScoupImplicits with HtmlFixtures {
val doc = Scoup.parseHTML(nestedLi... | themillhousegroup/scoup | src/test/scala/com/themillhousegroup/scoup/ClosestElementsSpec.scala | Scala | mit | 2,163 |
//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
/** @author John Miller
* @version 1.3
* @date Mon Feb 2 16:56:03 EST 2015
* @see LICENSE (MIT style license file).
*/
package scalation.linalgebra.par
import scalation.linalgebra.{Factorization, MatriD, VectoD}
import s... | scalation/fda | scalation_1.3/scalation_mathstat/src/main/scala/scalation/linalgebra/par/Fac_QR.scala | Scala | mit | 5,992 |
package io.scalac.slack.common
import scala.slick.driver.H2Driver.simple._
object SlackbotDatabase {
lazy val db = Database.forConfig("h2")
}
| ScalaConsultants/scala-slack-bot-core | src/main/scala/io/scalac/slack/common/SlackbotDatabase.scala | Scala | mit | 146 |
package io.vamp.persistence.etcd
import akka.http.scaladsl.model._
import io.vamp.common.{ ClassMapper, Config }
import io.vamp.persistence.KeyValueStoreActor
import scala.concurrent.Future
case class EtcdKeyValue(node: EtcdNode)
case class EtcdNode(key: Option[String] = None, value: Option[String] = None, nodes: L... | magneticio/vamp | etcd/src/main/scala/io/vamp/persistence/etcd/EtcdStoreActor.scala | Scala | apache-2.0 | 2,400 |
/*
* 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 ... | smartiniOnGitHub/grails-scala | src/scala/grails_scala_test/Sample.scala | Scala | apache-2.0 | 7,795 |
/*
* 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 ... | tejasapatil/spark | core/src/main/scala/org/apache/spark/util/ClosureCleaner.scala | Scala | apache-2.0 | 20,647 |
package thangiee.riotapi.matches
case class MatchDetail(
mapId: Int,
matchCreation: Long,
matchDuration: Long,
matchId: Long,
matchMode: String,
matchType: String,
matchVersion: String,
participantIdentities: List[ParticipantIdentity],
participants: List[Participant],
platformId: String,
queueTyp... | Thangiee/Riot-API-Scala | src/main/scala/thangiee/riotapi/matches/MatchDetail.scala | Scala | mit | 413 |
/*
* 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/batch/BatchPhysicalHashJoinRule.scala | Scala | apache-2.0 | 7,952 |
package com.sksamuel.scapegoat.inspections
import com.sksamuel.scapegoat.PluginRunner
import org.scalatest.{ FreeSpec, Matchers, OneInstancePerTest }
/** @author Stephen Samuel */
class RedundantFinalModifierOnMethodTest
extends FreeSpec
with Matchers
with PluginRunner
with OneInstancePerTest {
ov... | pwwpche/scalac-scapegoat-plugin | src/test/scala/com/sksamuel/scapegoat/inspections/RedundantFinalModifierOnMethodTest.scala | Scala | apache-2.0 | 3,748 |
/**
* Copyright (C) 2014-2015 Really Inc. <http://really.io>
*/
package io.really
import akka.actor._
import akka.persistence.{ PersistentView, PersistentActor }
import scala.util.Random
object TestActors {
val echoActorProps = akka.testkit.TestActors.echoActorProps
def reportingActorProps(reportee: ActorRef) ... | reallylabs/really | modules/really-core/src/test/scala/io/really/TestActors.scala | Scala | apache-2.0 | 2,050 |
package helpers
import scala.concurrent.duration._
import scala.concurrent.{Await, Future}
import scala.language.postfixOps
object AwaitHelper {
private val longTime = Long.MaxValue nanos
def awaitResult[T](f: Future[T]): T = {
Await.result(f, longTime)
}
}
| luongbalinh/play-mongo | test/helpers/AwaitHelper.scala | Scala | apache-2.0 | 271 |
package chapter16
import scala.xml.XML
object Exercise4 extends App {
WithoutValidationParserFactory()
val doc = XML.loadFile("data/chapter16/example4.xhtml")
val queryResult = (doc \\\\ "img").filterNot(e => e.attribute("alt").isDefined)
println(queryResult.mkString("\\n"))
}
| vsuharnikov/books-exercises | scala/scala-for-the-impatient/src/main/scala/chapter16/Exercise4.scala | Scala | mit | 288 |
package com.github.sorhus.webalytics.client
import akka.NotUsed
import akka.actor.ActorSystem
import akka.http.scaladsl.Http
import akka.http.scaladsl.marshallers.sprayjson.SprayJsonSupport
import akka.http.scaladsl.model._
import akka.http.scaladsl.model.MediaTypes._
import akka.stream.ActorMaterializer
import akka.s... | sorhus/webalytics | client/src/main/scala/com/github/sorhus/webalytics/client/Webalytics.scala | Scala | gpl-3.0 | 2,706 |
object Test {
import scala.util.Try
def main(args: Array[String]): Unit = {
def stream = LazyList.from(0).take(100000).map(n => None)
println(Try(stream.flatten.length))
}
}
| som-snytt/dotty | tests/run/t8100.scala | Scala | apache-2.0 | 189 |
package net.sansa_stack.query
import java.util.stream.Collector
import org.apache.jena.graph.Triple
import org.apache.jena.sparql.engine.binding.Binding
import org.apache.spark.rdd.RDD
import org.apache.spark.sql.{DataFrame, SparkSession}
import net.sansa_stack.query.spark.api.domain.QueryExecutionFactorySpark
import... | SANSA-Stack/SANSA-RDF | sansa-query/sansa-query-spark/src/main/scala/net/sansa_stack/query/spark/package.scala | Scala | apache-2.0 | 4,745 |
package me.lachlanap.summis.database
import anorm._
import java.sql.Connection
import play.api._
import play.api.db.DB
class Database(app: Application) {
def execute[A](block: Connection => A) = DB.withConnection(block)(app)
}
| thorinii/summis-server | app/me/lachlanap/summis/database/Database.scala | Scala | mit | 231 |
/**
* Copyright (C) 2015-2016 Miguel Osorio. All rights reserved.
*/
package controllers
import java.util.UUID
import javax.inject.Inject
import com.mohiva.play.silhouette.api.{Silhouette, Environment}
import com.mohiva.play.silhouette.impl.authenticators.JWTAuthenticator
import com.mohiva.play.silhouette.impl.pr... | migue48/bbg-vintage-racing | app/controllers/AlbumsController.scala | Scala | apache-2.0 | 2,958 |
package scala
package reflect
/** Entry points into runtime reflection.
* See [[scala.reflect.api.package the overview page]] for details on how to use them.
*/
package object runtime {
/** The entry point into Scala runtime reflection.
*
* To use Scala runtime reflection, simply use or import `scala.refle... | felixmulder/scala | src/reflect/scala/reflect/runtime/package.scala | Scala | bsd-3-clause | 1,752 |
package illustrations
import scala.scalajs.js
import scala.scalajs.js.annotation.JSGlobal
import scala.scalajs.js.annotation.JSExport
import scala.scalajs.js.annotation.JSExportTopLevel
@js.native
trait SpeechSynthesisVoice extends js.Object {
val voiceURI: String = js.native
}
@js.native
@JSGlobal("SpeechSynthesi... | siddhartha-gadgil/presentations | illustrations/src/Speech.scala | Scala | mit | 944 |
import _root_.io.gatling.core.scenario.Simulation
import ch.qos.logback.classic.{Level, LoggerContext}
import io.gatling.core.Predef._
import io.gatling.http.Predef._
import org.slf4j.LoggerFactory
import scala.concurrent.duration._
/**
* Performance test for the Region entity.
*/
class RegionGatlingTest extends Si... | sandor-balazs/nosql-java | oracle/src/test/gatling/simulations/RegionGatlingTest.scala | Scala | bsd-2-clause | 3,296 |
package uaa
import com.excilys.ebi.gatling.http.Predef._
import com.excilys.ebi.gatling.core.Predef._
import uaa.Config._
import uaa.OAuthComponents._
case class User(username: String, password: String) {
override def toString = {
username
}
}
case class Group(displayName: String, members: Seq[User])
case c... | andybondar/cf-installer | uaa/gatling/src/main/scala/uaa/uaaApis.scala | Scala | gpl-3.0 | 1,557 |
package SpMVAccel
import Chisel._
import TidbitsDMA._
import TidbitsAXI._
import TidbitsStreams._
class SpMVBackendTwoPort(val p: SpMVAccelWrapperParams, val idBase: Int) extends Module {
val pMem = p.toMRP()
val io = new Bundle {
// control
val startRegular = Bool(INPUT)
val startWrite = Bool(INPUT)
... | maltanar/spmv-vector-cache | chisel/backend/SpMVBackendTwoPort.scala | Scala | bsd-3-clause | 8,844 |
package com.softwaremill.spray.client
import spray.http._
import spray.client.pipelining._
import akka.actor.ActorSystem
object ClientComplete extends App {
implicit val system = ActorSystem()
import system.dispatcher
val pipeline = sendReceive
val securePipeline = addCredentials(BasicHttpCredentials("adam"... | evbruno/spray-tutorial | src/main/scala/com/softwaremill/spray/client/ClientComplete.scala | Scala | apache-2.0 | 716 |
package djinni
import djinni.ast._
import djinni.generatorTools._
import djinni.meta._
class ObjcppMarshal(spec: Spec) extends Marshal(spec) {
private val cppMarshal = new CppMarshal(spec)
private val objcMarshal = new ObjcMarshal(spec)
override def typename(tm: MExpr): String = throw new AssertionError("not a... | eastonhou/djinni_with_cx | src/source/ObjcppMarshal.scala | Scala | apache-2.0 | 4,126 |
package objektwerks
import org.apache.spark.sql.{Dataset, SaveMode}
import org.scalatest.funsuite.AnyFunSuite
import org.scalatest.matchers.should.Matchers
class DataSourceTest extends AnyFunSuite with Matchers {
import SparkInstance._
import sparkSession.implicits._
test("csv") {
val dataframe = sparkSess... | objektwerks/spark | src/test/scala/objektwerks/DataSourceTest.scala | Scala | apache-2.0 | 4,562 |
package com.twitter.concurrent
import com.twitter.io.{Buf, Reader}
import com.twitter.util.{Future, Promise, Return, Throw, Try}
import scala.annotation.varargs
import scala.collection.mutable
/**
* A representation of a lazy (and possibly infinite) sequence of asynchronous
* values. We provide combinators for non-... | BuoyantIO/twitter-util | util-core/src/main/scala/com/twitter/concurrent/AsyncStream.scala | Scala | apache-2.0 | 25,667 |
package test
import scala.collection.immutable.Map
class CompilerTest(val valueList: List[Symbol]) {
def buildMap(map: Map[Symbol, Symbol], keyList: List[Symbol], valueList: List[Symbol]): Map[Symbol, Symbol] = {
(keyList, valueList) match {
case (Nil, Nil) => map
_ => buildMap(map.updated(keyList.he... | yusuke2255/dotty | tests/untried/neg/t1181.scala | Scala | bsd-3-clause | 382 |
package pl.msitko.xml.optics.laws
import monocle.law.discipline.TraversalTests
import pl.msitko.xml.entities.Node
import pl.msitko.xml.test.utils.ArbitraryElementConfig
import org.scalacheck.{Arbitrary, Gen}
import org.scalatest.Matchers
import pl.msitko.xml.test.utils.{ArbitraryElementConfig, ArbitraryInstances, Coge... | note/xml-lens | optics/shared/src/test/scala/pl/msitko/xml/optics/laws/NodeOpticsLawsSpec.scala | Scala | mit | 931 |
import sbt._
import Keys._
import java.util.regex.Pattern
object Status {
lazy val isSnapshot = SettingKey[Boolean]("is-snapshot")
lazy val publishStatus = SettingKey[String]("publish-status")
def settings: Seq[Setting[_]] = Seq(
isSnapshot <<= version(v => v.contains("-") && snapshotQualifier(v)),
publ... | jaceklaskowski/sbt | project/Status.scala | Scala | bsd-3-clause | 1,087 |
/***********************************************************************
* 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-features/geomesa-feature-avro/src/test/scala/org/locationtech/geomesa/features/avro/AvroSimpleFeatureUtilsTest.scala | Scala | apache-2.0 | 16,711 |
/*
* Copyright 2016 The BigDL Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agr... | intel-analytics/BigDL | scala/dllib/src/test/scala/com/intel/analytics/bigdl/dllib/keras/layers/SeparableConvolution2DSpec.scala | Scala | apache-2.0 | 4,399 |
// Copyright: 2010 - 2017 https://github.com/ensime/ensime-server/graphs
// License: http://www.gnu.org/licenses/gpl-3.0.en.html
package org.ensime.core
import java.io.{ ByteArrayOutputStream, PrintStream }
import java.nio.charset.StandardCharsets
import org.ensime.api.DeclaredAs
import org.ensime.indexer._
import s... | fommil/ensime-server | core/src/main/scala/org/ensime/core/ScalapSymbolToFqn.scala | Scala | gpl-3.0 | 4,383 |
//package io.skysail.core.akka
//
//import akka.testkit.{ TestKit, ImplicitSender }
//import akka.actor.{ Props, Actor, ActorSystem }
//import org.scalatest.WordSpecLike
//
//import akka.util.Timeout
//import scala.concurrent.Await
//import scala.util.{ Success, Failure }
//
//import scala.language.postfixOps
//import ... | evandor/skysail-core | skysail.core/test/io/skysail/core/akka/RequestProcessingActorSpec.scala | Scala | apache-2.0 | 1,671 |
/*
* 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 | sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/ConcurrentHiveSuite.scala | Scala | apache-2.0 | 1,598 |
// Copyright: 2010 - 2016 https://github.com/ensime/ensime-server/graphs
// Licence: http://www.gnu.org/licenses/gpl-3.0.en.html
package org.ensime.server
import akka.actor._
import akka.pattern.ask
import akka.stream.Materializer
import akka.util.Timeout
import org.ensime.api._
import org.ensime.core._
import scala.c... | d1egoaz/ensime-sbt | src/sbt-test/sbt-ensime/ensime-server/server/src/main/scala/org/ensime/server/WebServerImpl.scala | Scala | apache-2.0 | 1,183 |
package foo.bar
import java.io.File
import File.{pathSeparator => / }
import java.net.{URISyntaxException, URL}
class Holder { var value: Any = _ }
import scala.tools.nsc.{GenericRunnerSettings, Interpreter, Settings}
class Foo {
val g = new GenericRunnerSettings(System.err.println)
val settings = new Settings()
... | xuwei-k/xsbt | sbt-app/src/sbt-test/compiler-project/run-test/src/main/scala/Foo.scala | Scala | apache-2.0 | 1,247 |
/*
* Copyright (C) 2016-2020 Lightbend Inc. <https://www.lightbend.com>
*/
package akka.persistence.cassandra.query
import java.util.UUID
import akka.persistence.PersistentRepr
import akka.annotation.InternalApi
import akka.persistence.cassandra.journal.CassandraJournal.TagPidSequenceNr
/**
* INTERNAL API: Wrap ... | chbatey/akka-persistence-cassandra | core/src/main/scala/akka/persistence/cassandra/query/UUIDPersistentRepr.scala | Scala | apache-2.0 | 659 |
package muster
import scala.util.control.NoStackTrace
/** The location of a parser when some interesting event occurs
*
* @param line the current line the parser is on
* @param col the column the parser is on
* @param source the source path if any
*/
case class ParseLocation(line: Int, col: Int, source: Option[S... | json4s/muster | core/src/main/scala/muster/errors.scala | Scala | mit | 1,090 |
/*
* 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... | wzhongyuan/BigDL | spark/dl/src/main/scala/com/intel/analytics/bigdl/nn/tf/TensorModuleWrapper.scala | Scala | apache-2.0 | 1,964 |
/*
* 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/catalyst/src/test/scala/org/apache/spark/sql/HashByteArrayBenchmark.scala | Scala | apache-2.0 | 8,089 |
/*
* Copyright 2011-2017 Chris de Vreeze
*
* 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... | dvreeze/yaidom | shared/src/main/scala/eu/cdevreeze/yaidom/queryapi/ElemCreationApi.scala | Scala | apache-2.0 | 1,802 |
package org.dsa.iot.rx.core
import scala.concurrent.duration.{ Duration, DurationInt }
import org.dsa.iot.rx.RxTransformer
import org.dsa.iot.scala.Having
/**
* Creates an Observable which produces buffers of collected values.
*/
class WindowByTime[T] extends RxTransformer[T, Seq[T]] {
def span(time: Duration):... | IOT-DSA/dslink-scala-ignition | src/main/scala/org/dsa/iot/rx/core/WindowByTime.scala | Scala | apache-2.0 | 1,401 |
package com.twitter.finagle.http
import com.twitter.conversions.time._
import com.twitter.finagle.{Http => FinagleHttp, _}
import com.twitter.finagle.client.Transporter
import com.twitter.finagle.service.ConstantService
import com.twitter.finagle.server.Listener
import com.twitter.finagle.transport.Transport
import co... | adriancole/finagle | finagle-http/src/test/scala/com/twitter/finagle/http/AbstractStreamingTest.scala | Scala | apache-2.0 | 15,738 |
package org.joda.time.format
object DateTimeFormat {
def forPattern(pattern:String)=new DateTimeFormatter(pattern)
}
| easel/play-json-extra | scalajs-joda-time/src/main/scala/org/joda/time/format/DateTimeFormat.scala | Scala | apache-2.0 | 121 |
/**
* Copyright 2011-2017 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... | MykolaB/gatling | gatling-core/src/main/scala/io/gatling/core/action/Action.scala | Scala | apache-2.0 | 3,486 |
package org.scaladebugger.docs.styles
import scalatags.Text.all._
import scalatags.stylesheet._
/**
* Represents stylesheet for tab-oriented content.
*/
object TabsStyle extends CascadingStyleSheet {
initStyleSheet()
/** To be placed on <ul> element. */
lazy val tabs: Cls = cls(
display := "flex",
fl... | ensime/scala-debugger | scala-debugger-docs/src/main/scala/org/scaladebugger/docs/styles/TabsStyle.scala | Scala | apache-2.0 | 2,726 |
/*
* 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/hive/src/test/scala/org/apache/spark/sql/hive/orc/OrcHadoopFsRelationSuite.scala | Scala | apache-2.0 | 4,374 |
/*
* Copyright (c) 2014-2018 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... | Wogan/monix | monix-reactive/shared/src/test/scala/monix/reactive/internal/operators/WithLatestFrom6Suite.scala | Scala | apache-2.0 | 3,334 |
package psyco.scala.springboot
import com.google.common.collect.Lists
import org.springframework.web.bind.annotation.{RequestMapping, RestController}
import psyco.springboot.entity.Message
/**
* Created by lipeng on 15/7/23.
* Scala对Jdk8的支持必须scala-version 2.11.4(越高越好)
* Scala-compiler不能解析jdk包里jdk1.8的类,如java.util.f... | psyco4j/projects | src/main/scala/psyco/scala/springboot/ScalaRestController.scala | Scala | mit | 1,101 |
/*
* Copyright (C) Lightbend Inc. <https://www.lightbend.com>
*/
package com.example.shoppingcart.api
import java.time.Instant
import akka.{Done, NotUsed}
import com.lightbend.lagom.scaladsl.api.transport.Method
import com.lightbend.lagom.scaladsl.api.{Service, ServiceCall}
import play.api.libs.json.{Format, Json}... | lagom/lagom | dev/sbt-plugin/src/sbt-test/sbt-plugin/akka-persistence-typed-migration-scala/shopping-cart-api/src/main/scala/com/example/shoppingcart/api/ShoppingCartService.scala | Scala | apache-2.0 | 1,239 |
package io.pathfinder.websockets.controllers
import io.pathfinder.models.{Commodity, Cluster, Transport}
import io.pathfinder.routing.Action.{Start, DropOff, PickUp}
import io.pathfinder.routing.{Action, Route}
import io.pathfinder.websockets.{WebSocketMessage, ModelTypes}
import io.pathfinder.websockets.WebSocketMess... | CSSE497/pathfinder-server | app/io/pathfinder/websockets/controllers/VehicleSocketController.scala | Scala | mit | 578 |
/*
Copyright 2012 Denis Bardadym
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 ... | btd/luna | src/main/scala/code/snippet/SnippetHelper.scala | Scala | apache-2.0 | 7,934 |
package com.felixmilea.vorbit.http
import com.felixmilea.vorbit.http.Util.Request
abstract class Node {
def children: Seq[ChildNode]
final def execute(req: Request): Response = {
val segment = if (req.path.length > 0) req.path.last else ""
this.execute(req, segment)
}
def execute(req: Request, segmen... | felixmc/Felix-Milea-Ciobanu-Vorbit | code/com/felixmilea/vorbit/http/Node.scala | Scala | mit | 818 |
package models.player.commands
/**
* Created by rbrowning on 5/21/17.
*/
case class Unmute()
| rebrowning/entertainment-cluster-member | src/main/scala/models/player/commands/Unmute.scala | Scala | apache-2.0 | 98 |
package uk.gov.dvla.vehicles.presentation.common.webserviceclients.acquire
import org.joda.time.DateTime
import org.joda.time.format.ISODateTimeFormat
import play.api.libs.json.{JsString, JsValue, Writes, Json}
import uk.gov.dvla.vehicles.presentation.common.{TestWithApplication, UnitSpec}
import uk.gov.dvla.vehicles.... | dvla/vehicles-presentation-common | test/uk/gov/dvla/vehicles/presentation/common/webserviceclients/acquire_service/AcquireWebServiceImplSpec.scala | Scala | mit | 3,502 |
package s99.p08
// P08 (**) Eliminate consecutive duplicates of list elements.
// If a list contains repeated elements they should be replaced with a
// single copy of the element. The order of the elements should not be
// changed.
//
// Example:
// scala> compress(List('a, 'a, 'a, 'a, 'b, 'c, 'c... | izmailoff/scala-s-99 | src/main/scala/s99/p08/P08Answer.scala | Scala | apache-2.0 | 1,089 |
// Copyright 2010, Brian T. Howard (bhoward@depauw.edu)
//
// 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... | bhoward/Escalator | src/main/scala/edu/depauw/escalator/Main.scala | Scala | apache-2.0 | 1,814 |
/*
* This file is part of the "silex" library of helpers for Apache Spark.
*
* Copyright (c) 2015 Red Hat, 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.... | erikerlandson/silex | src/test/scala/com/redhat/et/silex/scalatest/matchers/matchers.scala | Scala | apache-2.0 | 1,253 |
/*
* Copyright (C) Lightbend Inc. <https://www.lightbend.com>
*/
package play.filters.https
import javax.inject.Inject
import com.typesafe.config.ConfigFactory
import play.api.Configuration
import play.api.Environment
import play.api._
import play.api.http.HttpFilters
import play.api.inject.bind
import play.api.in... | benmccann/playframework | web/play-filters-helpers/src/test/scala/play/filters/https/RedirectHttpsFilterSpec.scala | Scala | apache-2.0 | 10,591 |
/*
* Copyright 2016 The BigDL Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agr... | intel-analytics/BigDL | scala/dllib/src/test/scala/com/intel/analytics/bigdl/dllib/utils/tf/loaders/Conv3DBackpropInputV2Spec.scala | Scala | apache-2.0 | 2,716 |
//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
/** @author John Miller
* @version 1.3
* @date Mon Sep 21 15:05:06 EDT 2009
* @see LICENSE (MIT style license file).
*/
package scalation.scala2d
import scala.util.Random
//:::::::::::::::::::::::::::::::::::::::::::::... | scalation/fda | scalation_1.3/scalation_mathstat/src/main/scala/scalation/scala2d/Colors.scala | Scala | mit | 11,919 |
package play.boilerplate.parser.model
object HttpStatus {
private val statusByCode = Map(
// Success
200 -> "Ok",
201 -> "Created",
202 -> "Accepted",
203 -> "NonAuthoritativeInformation",
204 -> "NoContent",
205 -> "ResetContent",
206 -> "PartialContent",
207 -> "MultiStatus",
... | Romastyi/sbt-play-boilerplate | sbt-plugin/lib/src/main/scala/play/boilerplate/parser/model/HttpStatus.scala | Scala | apache-2.0 | 1,114 |
/**
* Copyright 2015 Frank Austin Nothaft
*
* 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 ... | fnothaft/ananas | src/test/scala/net/fnothaft/ananas/debruijn/IndexedDeBruijnGraphSuite.scala | Scala | apache-2.0 | 4,103 |
package kornell.server.api
import org.junit.runner.RunWith
import kornell.core.entity.CourseClass
import kornell.server.helper.SimpleInstitution
import kornell.server.test.UnitSpec
import org.scalatest.junit.JUnitRunner
import kornell.server.jdbc.repository.CourseClassesRepo
import kornell.server.helper.GenPlatformAdm... | Craftware/Kornell | kornell-api/src/test/REVIIEW-scala/kornell/server/api/CourseClassesSpec.scala | Scala | apache-2.0 | 2,611 |
package org.zouzias.qclocktwo.examples
import org.zouzias.qclocktwo.algo.GridPhrasesMatcher
import org.zouzias.qclocktwo.grid.LetterGrid
import org.zouzias.qclocktwo.phrases.TimePhrases
/**
* An example grid that time phrases are realizable
*/
object GridExample1 {
val grid = Array[String](
"NSEVENFOURC",
... | zouzias/qlocktwo-grid-generator | src/main/scala/org/zouzias/qclocktwo/examples/GridExample1.scala | Scala | apache-2.0 | 1,109 |
/**
* Copyright 2016 ZuInnoTe (Jörn Franke) <zuinnote@gmail.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 re... | ZuInnoTe/spark-hadoopcryptoledger-ds | src/main/scala/org/zuinnote/spark/bitcoin/transaction/DefaultSource15.scala | Scala | apache-2.0 | 1,375 |
package com.softwaremill.bootzooka.service.email.sender
import java.io.{ByteArrayInputStream, ByteArrayOutputStream}
import java.util.{Date, Properties}
import javax.activation.{DataHandler, DataSource}
import javax.mail.internet.{InternetAddress, MimeBodyPart, MimeMessage, MimeMultipart}
import javax.mail.{Address, M... | umitunal/bootzooka | backend/src/main/scala/com/softwaremill/bootzooka/service/email/sender/EmailSender.scala | Scala | apache-2.0 | 4,989 |
/*
* Copyright (c) 2017 CyberAgent
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish,... | CyberAgent/typebook | server/src/main/scala/jp/co/cyberagent/typebook/api/RegistryService.scala | Scala | mit | 3,120 |
package com.airbnb.scheduler.jobs
import com.google.common.util.concurrent.AbstractIdleService
import org.apache.curator.framework.CuratorFramework
import org.apache.curator.utils.CloseableUtils
class ZookeeperService(curator: CuratorFramework)
extends AbstractIdleService
{
override def startUp() {}
overr... | doronin/chronos | src/main/scala/com/airbnb/scheduler/jobs/ZookeeperService.scala | Scala | apache-2.0 | 388 |
/*
* Copyright 2017 Datamountaineer.
*
* 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... | CodeSmell/stream-reactor | kafka-connect-jms/src/main/scala/com/datamountaineer/streamreactor/connect/jms/config/JMSConfig.scala | Scala | apache-2.0 | 5,637 |
package org.macrogl.examples
import org.lwjgl.opengl._
import org.macrogl._
object EmptyExample {
def main(args: Array[String]) {
val contextAttributes = new ContextAttribs(3, 2)
.withForwardCompatible(true).withProfileCore(true)
Display.setDisplayMode(new DisplayMode(800, 600))
Display.create(n... | storm-enroute/macrogl | src/test/scala/org/macrogl/examples/EmptyExample.scala | Scala | bsd-3-clause | 455 |
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.