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 (C) 2015 DANS - Data Archiving and Networked Services (info@dans.knaw.nl)
*
* 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... | DANS-KNAW/easy-archive-bag | command/src/main/scala/nl.knaw.dans.easy.archivebag.command/CommandLineOptions.scala | Scala | apache-2.0 | 4,080 |
/*
* Scala.js (https://www.scala-js.org/)
*
* Copyright EPFL.
*
* Licensed under Apache License 2.0
* (https://www.apache.org/licenses/LICENSE-2.0).
*
* See the NOTICE file distributed with this work for
* additional information regarding copyright ownership.
*/
package org.scalajs.testsuite.javalib.util
im... | SebsLittleHelpers/scala-js | test-suite/shared/src/test/scala/org/scalajs/testsuite/javalib/util/CollectionsOnCheckedMapTest.scala | Scala | apache-2.0 | 4,535 |
package uk.co.pragmasoft.experiments.bigdata.spark
import org.scalatest.{FlatSpec, Matchers}
class CSVOperationsSpec extends FlatSpec with Matchers with SparkTestSupport {
import CSVOperations._
behavior of "CSVReaderOperations"
it should "Convert an RDD of strings into an RDD of Array[String] splitting the ... | galarragas/spark-experiments | src/test/scala/uk/co/pragmasoft/experiments/bigdata/spark/CSVOperationsSpec.scala | Scala | apache-2.0 | 1,004 |
package mr.merc.map.hex
import mr.merc.map.ShortestGrid
import mr.merc.map.hex.Direction._
import mr.merc.map.pathfind.PathFinder
import scala.collection.concurrent.TrieMap
abstract class AbstractHexField[T <: Hex](init: (Int, Int) => T) {
def isLegalCoords(x: Int, y: Int): Boolean
def hex(x: Int, y: Int): T
... | RenualdMarch/merc | src/main/scala/mr/merc/map/hex/AbstractHexField.scala | Scala | gpl-3.0 | 4,745 |
package com.evojam.mongodb.client.cursor
import scala.concurrent.{ExecutionContext, Future}
import org.bson.codecs.Codec
import rx.lang.scala.Observable
import com.evojam.mongodb.client.codec.Reader
trait Cursor {
def head[T]()(implicit r: Reader[T], exc: ExecutionContext): Future[T] =
rawHead()(r.codec, exc)... | evojam/mongodb-driver-scala | src/main/scala/com/evojam/mongodb/client/cursor/Cursor.scala | Scala | apache-2.0 | 1,606 |
package tests.rescala.misc
import tests.rescala.testtools.RETests
class ReactiveCreationInTurnsTest extends RETests {
multiEngined { engine =>
import engine._
test("evaluations Of Inner Signals") {
val v1 = Var(5)
val c1 = Var(0)
val v2 = Signal {
val _ = v1.value
var r... | guidosalva/REScala | Code/Main/shared/src/test/scala-2/tests/rescala/misc/ReactiveCreationInTurnsTest.scala | Scala | apache-2.0 | 3,262 |
/*
* Copyright 2016 rdbc contributors
*
* 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... | rdbc-io/rdbc | rdbc-implbase/src/test/scala-2.11/io/rdbc/implbase/CompatSpec.scala | Scala | apache-2.0 | 1,945 |
package com.github.mdr.mash.utils
import com.github.mdr.mash.utils.StringUtils.ellipsisise
import org.scalatest.{ FlatSpec, Matchers }
class StringUtilsTest extends FlatSpec with Matchers {
"Ellipsisise" should "work" in {
ellipsisise("123456", 3) should equal("12…")
ellipsisise("123", 3) should equal("12... | mdr/mash | src/test/scala/com/github/mdr/mash/utils/StringUtilsTest.scala | Scala | mit | 547 |
/*
* 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/amls-frontend | app/services/flowmanagement/flowrouters/businessmatching/RemoveBusinessTypeRouter.scala | Scala | apache-2.0 | 2,510 |
package com.monovore.decline.effect
import cats.effect.ExitCode
import org.scalatest.flatspec.AnyFlatSpec
import org.scalatest.matchers.should.Matchers
import cats.effect.unsafe.IORuntime
class CommandIOAppSpec extends AnyFlatSpec with Matchers {
"CommandIOApp" should "return a success exit code when passing an a... | bkirwi/decline | effect/jvm/src/test/scala/com/monovore/decline/effect/CommandIOAppSpec.scala | Scala | apache-2.0 | 878 |
/*
* 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 ... | pperalta/ignite | modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/cache/VisorCacheResetCommand.scala | Scala | apache-2.0 | 3,583 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | trueyao/spark-lever | streaming/src/main/scala/org/apache/spark/streaming/util/RawTextHelper.scala | Scala | apache-2.0 | 3,322 |
case object Direction {
private val dict = Vector(Pos(1, 0), Pos(1, 1), Pos(0, 1), Pos(-1, 1), Pos(-1, 0), Pos(-1, -1), Pos(0, -1), Pos(1, -1))
private def angle(p: Pos) = (((math.atan2(p.y, p.x) * 180 / math.Pi + 360) % 360) / 45).toInt
def apply(pos: Pos): Direction = if(pos != Pos.Mid)
Direction.apply(angle(p... | nurkiewicz/scalatron-bot | src/main/scala/Direction.scala | Scala | apache-2.0 | 1,007 |
/*
* 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 ... | shuangshuangwang/spark | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/v2ResolutionPlans.scala | Scala | apache-2.0 | 3,915 |
/*
* 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 ... | bravo-zhang/spark | streaming/src/main/scala/org/apache/spark/streaming/StreamingContext.scala | Scala | apache-2.0 | 35,621 |
/*
* Scala.js (https://www.scala-js.org/)
*
* Copyright EPFL.
*
* Licensed under Apache License 2.0
* (https://www.apache.org/licenses/LICENSE-2.0).
*
* See the NOTICE file distributed with this work for
* additional information regarding copyright ownership.
*/
package org.scalajs.ir
import scala.annotatio... | nicolasstucki/scala-js | ir/src/main/scala/org/scalajs/ir/Printers.scala | Scala | apache-2.0 | 27,839 |
/*
,i::,
:;;;;;;;
;:,,::;.
1ft1;::;1tL
t1;::;1,
:;::; _____ __ ___ __
fCLff ;:: tfLLC / ___/ / |/ /____ _ _____ / /_
CLft11 :,, i1tffLi \\__ \\ ____ / /|_/ ... | S-Mach/s_mach.explain | metadata/src/main/scala/s_mach/metadata/Cardinality.scala | Scala | mit | 1,431 |
package ucesoft.cbm.peripheral.keyboard
import java.io.{BufferedReader, FileInputStream, FileNotFoundException, IOException, InputStreamReader, PrintWriter}
import java.awt.event.KeyEvent
import ucesoft.cbm.Log
trait KeyboardMapper {
val map : Map[Int,CKey.Key]
val keypad_map : Map[Int,CKey.Key]
}
object Keyboard... | abbruzze/kernal64 | Kernal64/src/ucesoft/cbm/peripheral/keyboard/KeyboardMapper.scala | Scala | mit | 4,701 |
import org.junit.Assert.assertEquals
import org.junit.Test
class TestSuite {
@Test
def getRoot(): Unit = {
assertEquals(
Response(
200,
Map("Content-Type" -> "text/html;charset=utf-8"),
body = """|<html>
| <body>
| <h1>Hello, worl... | earldouglas/xsbt-web-plugin | src/reqs/src/test/scala/TestSuite.scala | Scala | bsd-3-clause | 494 |
/*
* 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 ... | jiangxb1987/spark | sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/ddl.scala | Scala | apache-2.0 | 4,862 |
package mageknight
case class GameMap() | fadeddata/mk | src/main/scala/GameMap.scala | Scala | mit | 40 |
package wom.types
abstract class WomPrimitiveType extends WomType {
lazy val coercionMap: Map[WomType, Seq[WomType]] = Map(
// From type -> To type
WomStringType -> Seq(WomStringType, WomIntegerType, WomFloatType, WomFileType, WomBooleanType),
WomFileType -> Seq(WomStringType, WomFileType),
WomIntege... | ohsu-comp-bio/cromwell | wom/src/main/scala/wom/types/WomPrimitiveType.scala | Scala | bsd-3-clause | 683 |
package com.aristocrat.mandrill.requests.Exports
import com.aristocrat.mandrill.requests.MandrillRequest
case class Whitelist(key: String, notifyEmail: String) extends MandrillRequest
| aristocratic/mandrill | src/main/scala/com/aristocrat/mandrill/requests/Exports/Whitelist.scala | Scala | mit | 186 |
package endpoints.scalaj.client
import endpoints.testsuite.client.{BasicAuthTestSuite, OptionalResponsesTestSuite, SimpleTestSuite}
import endpoints.testsuite.{BasicAuthTestApi, OptionalResponsesTestApi, SimpleTestApi}
import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.Future
class Tes... | Krever/endpoints | scalaj/client/src/test/scala/endpoints/scalaj/client/EndpointsTest.scala | Scala | mit | 906 |
package geotrellis.util
object Colors {
val black = "\\u001b[0;30m"
val red = "\\u001b[0;31m"
val green = "\\u001b[0;32m"
val yellow = "\\u001b[0;33m"
val blue = "\\u001b[0;34m"
val magenta = "\\u001b[0;35m"
val cyan = "\\u001b[0;36m"
val grey = "\\u001b[0;37m"
val default = "\\u001... | pomadchin/geotrellis-integration-tests | src/main/scala/geotrellis/util/Colors.scala | Scala | apache-2.0 | 889 |
/*
* 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/play-conditional-form-mapping | src/main/scala/uk/gov/voa/play/form/ConditionalMapping.scala | Scala | apache-2.0 | 1,593 |
package uk.gov.gds.ier.transaction.ordinary.openRegister
import com.google.inject.{Inject, Singleton}
import uk.gov.gds.ier.serialiser.JsonSerialiser
import uk.gov.gds.ier.validation._
import play.api.mvc.Call
import play.api.templates.Html
import uk.gov.gds.ier.config.Config
import uk.gov.gds.ier.security.EncryptionS... | alphagov/ier-frontend | app/uk/gov/gds/ier/transaction/ordinary/openRegister/OpenRegisterStep.scala | Scala | mit | 1,256 |
/**
* 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... | kavink92/kafka-0.8.0-beta1-src | core/src/test/scala/unit/kafka/producer/SyncProducerTest.scala | Scala | apache-2.0 | 9,318 |
package gh2011.models
import net.liftweb.json.JsonAST.JValue
case class MemberEventPayload(repo: String, member: String, actor: String, actor_gravatar: String, action: String)
object MemberEventPayload
{
def apply(json: JValue): Option[MemberEventPayload] =
{
val n2s = gh3.node2String(json)(_)
val ... | mgoeminne/github_etl | src/main/scala/gh2011/models/MemberEventPayload.scala | Scala | mit | 762 |
/*
* Copyright 2020 Precog Data
*
* 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 ... | mossprescott/slamengine-pathy | scalacheck/src/main/scala/pathy/scalacheck/PathNameOf.scala | Scala | agpl-3.0 | 2,130 |
package io.cumulus.stages
import java.time.format.DateTimeFormatter
import java.time.{LocalDateTime, ZoneId}
import akka.stream.Materializer
import akka.stream.scaladsl.StreamConverters
import com.sksamuel.scrimage
import io.cumulus.stream.storage.StorageReferenceReader
import io.cumulus.validation.AppError
import io... | Cumulus-Cloud/cumulus | server/cumulus-core/src/main/scala/io/cumulus/stages/MetadataStage.scala | Scala | mit | 6,546 |
/*
* Copyright (C) Lightbend Inc. <https://www.lightbend.com>
*/
package test
import play.api.test._
import models.UserId
object RouterSpec extends PlaySpecification {
"reverse routes containing boolean parameters" in {
"in the query string" in {
controllers.routes.Application.takeBool(true).url must ... | mkurz/playframework | dev-mode/sbt-plugin/src/sbt-test/play-sbt-plugin/routes-compiler-injected-routes-compilation/tests/RouterSpec.scala | Scala | apache-2.0 | 9,259 |
object Test extends App {
trait MyPF[@specialized(Int) -A] extends (A => Unit) {
def isDefinedAt(x: A): Boolean
def applyOrElse[A1 <: A](x: A1, default: A1 => Unit): Unit = {
println("MyPF.applyOrElse entered...")
if (isDefinedAt(x)) apply(x) else default(x)
}
}
trait MySmartPF[@speciali... | scala/scala | test/files/run/t5629b.scala | Scala | apache-2.0 | 1,016 |
package termfiltering
import org.apache.log4j.{Level, Logger}
import org.apache.spark.{SparkConf, SparkContext}
/**
* Created by chanjinpark on 2016. 9. 15..
*/
object TermFrequency extends App {
/* TODO: 1. 많이 나오는 단어 분포 2. TFIDF로 중요 단어 분포
중요하지 않으면서 자주 나오지 않은 단어를 제거
*/
val conf = new SparkConf(true... | chanjin/NRFAnalysis | src/main/scala/termfiltering/TermFrequency.scala | Scala | apache-2.0 | 2,876 |
/*
* Copyright (C) 2012 The Regents of The University California.
* All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENS... | stefanvanwouw/puppet-shark | files/shark-0.9.0/src/main/scala/shark/execution/TableScanOperator.scala | Scala | mit | 12,008 |
package org.decaf.distributed
import akka.actor.ActorSystem
package object server {
lazy val ServerActorSystem = ActorSystem("server")
}
| adamdecaf/distributed | server/src/main/scala/package.scala | Scala | apache-2.0 | 140 |
package com.lookout.borderpatrol.session
import com.lookout.borderpatrol.session.secret.InMemorySecretStore
import org.scalatest.{FlatSpec, Matchers}
import com.lookout.borderpatrol.session.id.{Generator => IdGenerator}
class CryptoSpec extends FlatSpec with Matchers {
behavior of "Generator"
it should "create ... | rtyler/borderpatrol | borderpatrol-core/src/test/scala/com/lookout/borderpatrol/session/CryptoSpec.scala | Scala | mit | 1,141 |
object Test {
def main(args: Array[String]): Unit = {
val a = 1 + 2 // [break] [step: a * 9]
val b = a * 9 // [step: plus] [step: x * x]
def plus(x: Int, y: Int) = {
val a = x * x // [step: y * y]
val b = y * y // [step: a + b]
a + b ... | som-snytt/dotty | tests/debug/nested-method.scala | Scala | apache-2.0 | 434 |
package org.jetbrains.plugins.scala
package lang
package completion3
import com.intellij.codeInsight.completion.CompletionType.SMART
import com.intellij.testFramework.EditorTestUtil
/**
* @author Alexander Podkhalyuzin
*/
class ScalaSmartAnonymousFunctionCompletionTest extends ScalaCodeInsightTestBase {
import... | loskutov/intellij-scala | test/org/jetbrains/plugins/scala/lang/completion3/ScalaSmartAnonymousFunctionCompletionTest.scala | Scala | apache-2.0 | 4,628 |
/*
* 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/command/databases.scala | Scala | apache-2.0 | 2,254 |
package com.tomogle.fpinscala
import org.scalatest.{FlatSpec, Matchers}
class GettingStartedTest extends FlatSpec with Matchers {
behavior of "fib"
import GettingStarted.fib
it should "give 0 for 1st element" in {
fib(1) shouldBe 0
}
it should "give 1 for 2nd element" in {
fib(2) shouldBe 1
}
... | tom-ogle/scala-scratch-code | src/test/scala/com/tomogle/fpinscala/GettingStartedTest.scala | Scala | mit | 2,218 |
/*
* Copyright 2011-2022 GatlingCorp (https://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... | gatling/gatling | gatling-core/src/test/scala/io/gatling/core/stats/message/StatusSpec.scala | Scala | apache-2.0 | 1,209 |
/*
* Copyright (C) Lightbend Inc. <https://www.lightbend.com>
*/
package scalaguide.akka.typed.oo
package multi
import javax.inject.Inject
import javax.inject.Provider
import akka.actor.ActorSystem
import akka.actor.typed.scaladsl.adapter._
import akka.actor.typed.ActorRef
import com.google.inject.AbstractModule
im... | benmccann/playframework | documentation/manual/working/commonGuide/akka/code/scalaguide/akka/typed/oo/multi/AppModule.scala | Scala | apache-2.0 | 1,580 |
/* __ *\
** ________ ___ / / ___ Scala API **
** / __/ __// _ | / / / _ | (c) 2003-2010, LAMP/EPFL **
** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\___/_/ |_/... | cran/rkafkajars | java/scala/collection/mutable/ImmutableSetAdaptor.scala | Scala | apache-2.0 | 1,707 |
/*
* Copyright 2014 Frugal Mechanic (http://frugalmechanic.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required... | er1c/fm-http | src/main/scala/fm/netty/NettyFutureWrapper.scala | Scala | apache-2.0 | 2,752 |
/*
* 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 ... | Intel-bigdata/OAP | oap-cache/oap/src/test/scala/org/apache/spark/sql/execution/datasources/oap/utils/FilterHelperSuite.scala | Scala | apache-2.0 | 2,578 |
import org.scalatest._
import Matchers._
class SimpleTest extends FunSuite {
def sum(a: Int, b: Int): Int = a + b
test("sum works for 1 + 2 = 3") {
sum(1, 2) shouldEqual 3
}
}
| malancas/CUNY-CoLAG-Sims-2016-17 | Yang-weighted-model/src/test/scala/SimpleTest.scala | Scala | gpl-3.0 | 186 |
/*
* Copyright 2013 Stephane Godbillon (@sgodbillon)
*
* 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 applicabl... | sgodbillon/reactive-bson-2.9 | src/main/scala/bufferhandlers.scala | Scala | apache-2.0 | 11,593 |
/**
* 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... | TiVo/kafka | core/src/test/scala/unit/kafka/server/FetchRequestMaxBytesTest.scala | Scala | apache-2.0 | 4,822 |
/*
* Copyright 2017 Alexey Kuzin <amkuzink@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 required by applicab... | leviathan941/choiceroulette | guiapp/src/main/scala/choiceroulette/gui/FullStage.scala | Scala | apache-2.0 | 1,757 |
package chess
package format.pgn
class TagTest extends ChessTest {
"Tags" should {
// http://www.saremba.de/chessgml/standards/pgn/pgn-complete.htm#c8.1.1
"be sorted" in {
Tags(
List(
Tag(Tag.Site, "https://lichess.org/QuCzSfxw"),
Tag(Tag.Round, "-"),
Tag(Tag.Date... | ornicar/scalachess | src/test/scala/format/pgn/TagTest.scala | Scala | mit | 1,092 |
/*
* Copyright 2017 HM Revenue & Customs
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or a... | pncampbell/ct-calculations | src/main/scala/uk/gov/hmrc/ct/ct600j/v3/J30A.scala | Scala | apache-2.0 | 992 |
package services
import java.io._
import java.util.Properties
import javax.inject.{Inject, Singleton}
import javax.mail.Session
import javax.mail.internet.{InternetAddress, MimeMessage}
import conf.AppConf
import common._
import com.google.api.client.util.Base64
import com.google.api.services.gmail.model._
import com... | phdezann/connectus | connectus-backend/app/services/GmailClient.scala | Scala | mit | 11,589 |
/*
* 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 ... | bravo-zhang/spark | sql/core/src/test/scala/org/apache/spark/sql/LocalSparkSession.scala | Scala | apache-2.0 | 2,229 |
package com.github.agourlay.cornichon.steps.wrapped
import cats.data.{ NonEmptyList, StateT }
import cats.effect.IO
import com.github.agourlay.cornichon.core.Done.rightDone
import com.github.agourlay.cornichon.core._
case class RepeatWithStep(nested: List[Step], elements: List[String], elementName: String) extends Wr... | agourlay/cornichon | cornichon-core/src/main/scala/com/github/agourlay/cornichon/steps/wrapped/RepeatWithStep.scala | Scala | apache-2.0 | 2,985 |
/**
* Copyright (C) 2009-2010 the original author or authors.
* See the notice.md file distributed with this work for additional
* information regarding copyright ownership.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* Yo... | arashi01/scalate-samples | scalate-sample-sitegen/ext/ScalatePackage.scala | Scala | apache-2.0 | 1,108 |
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you ... | gyfora/flink | flink-table/flink-table-planner-blink/src/test/scala/org/apache/flink/table/planner/runtime/stream/sql/AggregateITCase.scala | Scala | apache-2.0 | 37,690 |
/* NSC -- new Scala compiler
* Copyright 2005-2012 LAMP/EPFL
* @author Martin Odersky
*/
package dotty.tools.dotc
package backend.jvm
import dotty.tools.backend.jvm.GenBCodePipeline
import dotty.tools.dotc.ast.Trees.Select
import dotty.tools.dotc.ast.tpd._
import dotty.tools.dotc.core.Names.TermName
import dotty.... | densh/dotty | src/dotty/tools/backend/jvm/scalaPrimitives.scala | Scala | bsd-3-clause | 15,295 |
/*
* Copyright (C) Lightbend Inc. <https://www.lightbend.com>
*/
package scalaguide.detailed.filters.csp
import java.nio.charset.Charset
import java.nio.charset.StandardCharsets
import java.security.MessageDigest
import java.util.Base64
// #csp-hash-generator
class CSPHashGenerator(digestAlgorithm: String) {
pri... | benmccann/playframework | documentation/manual/working/commonGuide/filters/code/scalaguide/detailed/filters/csp/CSPHashGenerator.scala | Scala | apache-2.0 | 1,032 |
package com.wavesplatform.state.diffs
import cats.instances.list._
import cats.instances.map._
import cats.syntax.semigroup._
import cats.syntax.traverse._
import com.wavesplatform.account.Address
import com.wavesplatform.lang.ValidationError
import com.wavesplatform.state._
import com.wavesplatform.transaction.Asset.... | wavesplatform/Waves | node/src/main/scala/com/wavesplatform/state/diffs/MassTransferTransactionDiff.scala | Scala | mit | 2,315 |
package org.jetbrains.plugins.scala.lang.refactoring.util
import java.awt.Point
import javax.swing.SwingUtilities
import com.intellij.openapi.editor.Editor
import com.intellij.openapi.project.Project
import com.intellij.openapi.ui.MessageType
import com.intellij.openapi.ui.popup.{Balloon, JBPopupFactory}
import com.i... | triggerNZ/intellij-scala | src/org/jetbrains/plugins/scala/lang/refactoring/util/ConflictsReporter.scala | Scala | apache-2.0 | 2,156 |
/*
* 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 agreed to in writ... | dotty-staging/scalatest | scalatest-test/src/test/scala/org/scalatest/EveryShouldContainInOrderElementsOfLogicalAndSpec.scala | Scala | apache-2.0 | 49,551 |
package org.npmaven.model
import net.liftweb.http.LiftRules
import org.specs2.mutable.Specification
object BowerSpecs extends Specification {
"Bower object" should {
val angular = Bower("angular", "1.3.14", "./angular.js")
"extract the angular.json to a case class via String" in {
val json = LiftRule... | npmaven/npmaven | src/test/scala/org/npmaven/model/BowerSpecs.scala | Scala | apache-2.0 | 1,024 |
package com.etsy.conjecture.scalding.train
import cascading.flow._
import cascading.operation._
import cascading.pipe._
import cascading.pipe.joiner.InnerJoin
import com.etsy.conjecture.data._
import com.etsy.conjecture.model._
import com.twitter.scalding._
class LargeModelTrainer[L <: Label, M <: UpdateableModel[L... | mathkann/Conjecture | src/main/scala/com/etsy/conjecture/scalding/train/LargeModelTrainer.scala | Scala | mit | 5,961 |
package org.openapitools.models
import io.circe._
import io.finch.circe._
import io.circe.generic.semiauto._
import io.circe.java8.time._
import org.openapitools._
import org.openapitools.models.HudsonMasterComputerexecutors
import org.openapitools.models.HudsonMasterComputermonitorData
import org.openapitools.models.... | cliffano/swaggy-jenkins | clients/scala-finch/generated/src/main/scala/org/openapitools/models/HudsonMasterComputer.scala | Scala | mit | 1,863 |
package me.reminisce.json
import me.reminisce.database.MongoDBEntities.FBLocation
import me.reminisce.gameboard.board.GameboardEntities._
import spray.json.{JsObject, JsString, JsValue, RootJsonFormat, deserializationError, serializationError}
trait GameQuestionJSONSupport extends BoardJSONSupport with SubjectJSONSup... | reminisceme/game-creator | src/main/scala/me/reminisce/json/GameQuestionJSONSupport.scala | Scala | apache-2.0 | 6,356 |
package com.codingkapoor.codingbat
import org.scalatest.Matchers
import org.scalatest.FlatSpec
class WarmupIISpec extends FlatSpec with Matchers {
"stringTimes" should "return a larger string that is 'n' copies of the original string, given a string and a non-negative int 'n'" in {
WarmupII.stringTimes("Hi", 2... | codingkapoor/scala-coding-bat | src/test/scala/com/codingkapoor/codingbat/WarmupIISpec.scala | Scala | mit | 5,837 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | tophua/spark1.52 | sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/parquet/CatalystSchemaConverter.scala | Scala | apache-2.0 | 24,488 |
/**
* Copyright (C) 2011 Orbeon, Inc.
*
* This program is free software; you can redistribute it and/or modify it under the terms of the
* GNU Lesser General Public License as published by the Free Software Foundation; either version
* 2.1 of the License, or (at your option) any later version.
*
* This program i... | evlist/orbeon-forms | src/main/scala/org/orbeon/oxf/externalcontext/WSRPURLRewriter.scala | Scala | lgpl-2.1 | 7,495 |
package us.feliscat.time.en
import us.feliscat.m17n.English
import us.feliscat.time.MultiLingualTimeExtractorInGlossaryEntries
import us.feliscat.util.LibrariesConfig
/**
* <pre>
* Created on 2017/02/08.
* </pre>
*
* @author K.Sakamoto
*/
object EnglishTimeExtractorInGlossaryEntries extends MultiLingualTi... | ktr-skmt/FelisCatusZero-multilingual | libraries/src/main/scala/us/feliscat/time/en/EnglishTimeExtractorInGlossaryEntries.scala | Scala | apache-2.0 | 474 |
package test.verifier
import org.scalatest.{GivenWhenThen, FlatSpec}
import org.scalatest.matchers.ShouldMatchers._
import tap.ast._
import tap.{LocalId, ModuleId, InstId}
import tap.verifier.defs.{DefinitionsLookup, ModuleDefinitions}
import tap.verifier.ModuleVerifier
import tap.verifier.errors._
import tap.types._
... | garyb/tap | src/test/scala/test/verifier/ModuleVerifierTests.scala | Scala | mit | 50,706 |
package kvstore
import akka.testkit.TestKit
import akka.testkit.ImplicitSender
import org.scalatest.BeforeAndAfterAll
import org.scalatest.Matchers
import org.scalatest.FunSuiteLike
import akka.actor.ActorSystem
import akka.testkit.TestProbe
import Arbiter._
import Replicator._
import org.scalactic.ConversionCheckedTr... | vasnake/Principles-of-Reactive-Programming | w6/kvstore/src/test/scala/kvstore/Step6_NewSecondarySpec.scala | Scala | gpl-3.0 | 3,019 |
/*
* Copyright (c) <2012-2013>, Amanj Sherwany <http://www.amanj.me>
* All rights reserved.
* */
package ch.usi.inf.l3.moolc.evaluator
import _root_.ch.usi.inf.l3.moolc.ast._
trait StoreTrait {
def newStore(env: Map[Var, PEValue]): StoreTrait
def addEnv(env: Map[Var, PEValue]): Unit
def get(v: Var): Optio... | amanjpro/mool-compiler | src/main/scala/ch/usi/inf/l3/moolc/eval/StoreTrait.scala | Scala | bsd-3-clause | 482 |
/*
* Copyright 2013 - 2020 Outworkers Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or... | outworkers/phantom | phantom-dsl/src/test/scala/com/outworkers/phantom/tables/TableKeyTests.scala | Scala | apache-2.0 | 1,411 |
package fpinscala.errorhandling
import scala.{Option => _, Either => _, Left => _, Right => _, _}
// hide std library `Option` and `Either`, since we are writing our own in this chapter
sealed trait Either[+E, +A] {
/** Exercise 4.6 */
def map[B](f: A => B): Either[E, B] = this match {
case Right(v) => Rig... | lzongren/fpinscala | exercises/src/main/scala/fpinscala/errorhandling/Either.scala | Scala | mit | 1,793 |
/*
* 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 ... | shaneknapp/spark | core/src/main/scala/org/apache/spark/SparkContext.scala | Scala | apache-2.0 | 131,087 |
package scalaz.stream
import scalaz._
import scalaz.syntax.equal._
import scalaz.syntax.foldable._
import scalaz.std.anyVal._
import scalaz.std.list._
import scalaz.std.list.listSyntax._
import scalaz.std.string._
import org.scalacheck._
import Prop.{extendedAny => _, _}
import Arbitrary.arbitrary
import scalaz.concu... | doctau/scalaz-stream | src/test/scala/scalaz/stream/ProcessSpec.scala | Scala | mit | 17,660 |
package play.core
import scala.concurrent.ExecutionContext
import java.util.concurrent.Executors
private[play] object Execution {
lazy val internalContext: scala.concurrent.ExecutionContext = {
val numberOfThreads = play.api.Play.maybeApplication.map(_.configuration.getInt("internal-threadpool-size")).flatten.... | noel-yap/setter-for-catan | play-2.1.1/framework/src/play/src/main/scala/play/core/system/Execution.scala | Scala | apache-2.0 | 523 |
package org.jetbrains.plugins.scala
package debugger
import java.util
import java.util.Collections
import com.intellij.debugger.engine._
import com.intellij.debugger.jdi.VirtualMachineProxyImpl
import com.intellij.debugger.requests.ClassPrepareRequestor
import com.intellij.debugger.{MultiRequestPositionManager, NoDat... | ilinum/intellij-scala | src/org/jetbrains/plugins/scala/debugger/ScalaPositionManager.scala | Scala | apache-2.0 | 40,034 |
import java.util.Timer
import java.util.TimerTask
import com.typesafe.scalalogging.LazyLogging
import org.apache.commons.daemon.Daemon
import org.slf4j.MarkerFactory
object JsvcDemo extends App {
new JsvcDemoDaemon().start
}
class JsvcDemoDaemon extends Daemon with LazyLogging {
val timer:Timer = new Timer()
... | ThStock/jsvc-wrapper | src/main/scala/JsvcDemo.scala | Scala | apache-2.0 | 2,573 |
package com.github.simonthecat.eventdrivenorders.orderservice
import org.apache.kafka.clients.consumer.KafkaConsumer
import org.apache.kafka.clients.producer.KafkaProducer
import scala.io.StdIn
/**
* Created by simon on 04.08.16.
*/
object OrderApp extends App {
val confirmationService = new ConfirmationServi... | simonthecat/event-driven-orders | order-service/src/main/scala/com/github/simonthecat/eventdrivenorders/orderservice/OrderApp.scala | Scala | mit | 912 |
/*
* Copyright 2010 LinkedIn
*
* 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... | jinfei21/kafka | src/kafka/message/InvalidMessageException.scala | Scala | apache-2.0 | 743 |
package com.twitter.server.util
import com.twitter.concurrent.AsyncStream
import com.twitter.io.{Buf, Reader}
import com.twitter.util.events.{Event, Sink}
import java.util.logging.LogRecord
/**
* A utility to serialize the [[com.twitter.util.events.Sink]] in a format
* readable by [[http://goo.gl/iN9ozV Trace Viewe... | BuoyantIO/twitter-server | src/main/scala/com/twitter/server/util/TraceEventSink.scala | Scala | apache-2.0 | 2,145 |
package org.rplsd.condalang.command
import com.mongodb.casbah.commons.MongoDBObject
import org.rplsd.condalang.data.{BahanBaku, Kuantitas, Recipe}
import org.rplsd.condalang.util.DBConnection
import com.mongodb.casbah.Imports._
/**
* Created by Luqman on 11/27/2015.
*/
object read {
def recipe(s:String)(implici... | luqmankusnadi/Tugas-RPLSD-DSL | src/main/scala/org/rplsd/condalang/command/read.scala | Scala | mit | 2,282 |
package actors.routing.minutes
import actors.routing.minutes.MinutesActorLike.MinutesLookup
import drt.shared.CrunchApi.{CrunchMinute, MillisSinceEpoch, MinutesContainer, StaffMinute}
import drt.shared.Terminals.Terminal
import drt.shared._
import drt.shared.dates.UtcDate
import services.SDate
import scala.concurrent... | UKHomeOffice/drt-scalajs-spa-exploration | server/src/test/scala/actors/routing/minutes/MockMinutesLookup.scala | Scala | apache-2.0 | 1,231 |
/*
* Copyright 2009-2010 LinkedIn, 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 ... | rhavyn/norbert | cluster/src/main/scala/com/linkedin/norbert/cluster/ClusterEvent.scala | Scala | apache-2.0 | 2,080 |
package cluster
import java.io.FileWriter
import org.apache.spark.ml.clustering.LDA
import org.apache.spark.ml.feature._
import org.apache.spark.ml.linalg.Vector
import org.apache.spark.sql.functions._
import org.apache.spark.sql.{DataFrame, Row, SparkSession}
object LDANewsClusteringCoreNLP {
val spark = SparkSe... | rockiey/explore-spark | src/main/scala/cluster/LDANewsClusteringCoreNLP.scala | Scala | mit | 5,537 |
package com.twitter.scalding.typed.functions
import com.twitter.algebird.{ Aggregator, Ring, Semigroup, Fold }
import java.util.Random
import java.io.Serializable
case class Constant[T](result: T) extends Function1[Any, T] {
def apply(a: Any) = result
}
case class ConstantKey[K, V](key: K) extends Function1[V, (K,... | jzmq/scalding | scalding-core/src/main/scala/com/twitter/scalding/typed/functions/Functions.scala | Scala | apache-2.0 | 10,444 |
/*
* the monty hall problem is a simple game show based probability puzzle with
* a puzzling outcome :)
*
* Suppose you are on a gameshow and you are given the choice of 3 doors. Behind
* one of these doors is the price and behind the others a goat. Only the
* moderator knows behind which door the price is and w... | urso/scala_prob | examples/MontyHall.scala | Scala | bsd-3-clause | 3,055 |
/*
* The MIT License (MIT)
*
* Copyright (c) 2015 Ryan C. Brozo
*
* 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... | ryanbrozo/akka-http-hawk | lib/src/test/scala/com/ryanbrozo/akka/http/hawk/common/Imports.scala | Scala | mit | 1,239 |
package nabab
object Moralization {
def moralize(graph: Graph): UnorientedGraph = {
import graph.factory
val edges = for {
node <- graph.nodes.toIterator;
parents = graph.origins(node).toList;
parentCount = parents.size;
iParent1 <- 0 until parentCount - 1;
parent1 = parents(iPa... | ochafik/nabab | ScalaPort/src/main/scala/Moralization.scala | Scala | mit | 554 |
/*
* Copyright (C) 2015 Stratio (http://stratio.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by app... | danielcsant/sparta | serving-core/src/main/scala/com/stratio/sparta/serving/core/policy/status/PolicyStatusActor.scala | Scala | apache-2.0 | 10,633 |
/*
* Copyright 2015 Webtrends (http://www.webtrends.com)
*
* See the LICENCE.txt file distributed with this work for additional
* information regarding copyright ownership.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* Yo... | Crashfreak/wookiee | wookiee-core/src/main/scala/com/webtrends/harness/component/ComponentHelper.scala | Scala | apache-2.0 | 6,483 |
/*
* 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 ... | mrchristine/spark-examples-dbc | src/main/scala/org/apache/spark/examples/ml/GaussianMixtureExample.scala | Scala | apache-2.0 | 1,872 |
package org.gc.scala.learningscala.db.postgres.slick
import slick.driver.PostgresDriver.api._
import scala.concurrent.{Future, Await}
import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.duration.Duration
import scala.util.{Failure, Success}
object Sample {
class Users(tag: Tag) exten... | ganeshchand/learning-scala | src/main/scala-2.11/org/gc/scala/learningscala/db/postgres/slick/Sample.scala | Scala | mit | 1,018 |
/*
* Copyright (C) 2014 Pedro Vicente Gómez Sánchez.
*
* 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 ... | pedrovgs/ProjectEuler | src/test/scala/com/github/pedrovgs/prime/PrimeUtilSuite.scala | Scala | apache-2.0 | 1,244 |
package org.scalajs.openui5.sap.ui.core
import scala.scalajs.js
import scala.scalajs.js.annotation.JSName
@JSName("sap.ui.core.HorizontalAlign")
@js.native
object HorizontalAlign extends js.Object {
// Must use String for now due to
// https://issues.scala-lang.org/browse/SI-9668
val Begin: String /*HorizontalA... | lastsys/scalajs-openui5 | src/main/scala/org/scalajs/openui5/sap/ui/core/HorizontalAlign.scala | Scala | mit | 548 |
package net.tomasherman.specus.server.api.net
import net.tomasherman.specus.common.api.net.Packet
/**
* This file is part of Specus.
*
* Specus 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 ver... | tomasherman/specus | server_api/src/main/scala/net/CodecRepository.scala | Scala | gpl-3.0 | 1,988 |
package s99.p07
object P07 {
/*
* Type [T] also works instead of [Any]. However, it's not bounded so pretty much is Any anyway :).
*/
def flatten(input: List[Any]): List[Any] =
input match {
case List() => List()
case head :: tail =>
head match {
case list: List[_] => flatt... | izmailoff/scala-s-99 | src/main/scala/s99/p07/P07.scala | Scala | apache-2.0 | 974 |
// See comment in BCodeBodyBuilder
// -target:jvm-1.6 -Ybackend:GenBCode -Yopt:l:none
// target enables stack map frame generation
class C {
// can't just emit a call to ???, that returns value of type Nothing$ (not Int).
def f1: Int = ???
def f2: Int = throw new Error("")
def f3(x: Boolean) = {
var y =... | lampepfl/dotty | tests/run/nothingTypeNoOpt.scala | Scala | apache-2.0 | 1,205 |
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.