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 |
|---|---|---|---|---|---|
object O {
/* line: 3 */ v + 1
val v = 1
/* line: 3 */ v + 1
} | ilinum/intellij-scala | testdata/resolve2/order/Object.scala | Scala | apache-2.0 | 68 |
package main.ru.vsu.amm.problems.entities
import main.ru.vsu.amm.problems._
import scala.io.Source
import scala.util.Random
/**
* Created by FManukovskiy on 31.10.17.
*/
class IntMatrix(matrix: Seq[Seq[Int]]) extends Matrix[Int](matrix) {
lazy val sum: Int = data.map(_.sum).sum
def toInt: IntMatrix = this
... | FeodorM/amm_code | problems/assignment-problem/src/main/ru/vsu/amm/problems/entities/IntMatrix.scala | Scala | mit | 699 |
package lila.i18n
import play.api.i18n.Lang
object Fonts {
private lazy val packs: Map[String, String] = List(
"cyrillic" -> "av be bg ce cu cv kv mk os ru sr uk",
"cyrillic-ext" -> "ab ba kk ky mn tg",
"devanagari" -> "hi ne mr",
"greek" -> "el",
"latin-ext" -> "cs cy gn hu mi ro sm tr ty pl",... | danilovsergey/i-bur | modules/i18n/src/main/Fonts.scala | Scala | mit | 619 |
/**
* 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... | cran/rkafkajars | java/kafka/admin/ConsumerGroupCommand.scala | Scala | apache-2.0 | 14,733 |
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you ... | hequn8128/flink | flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/plan/rules/physical/stream/StreamExecCalcRule.scala | Scala | apache-2.0 | 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 ... | pgandhi999/spark | sql/core/src/main/scala/org/apache/spark/sql/execution/OptimizeMetadataOnlyQuery.scala | Scala | apache-2.0 | 7,979 |
package com.socrata.soda.external
import com.rojoma.json.v3.ast._
import com.rojoma.json.v3.io.{JsonReader, CompactJsonWriter}
import com.github.tomakehurst.wiremock.WireMockServer
import com.github.tomakehurst.wiremock.client.{WireMock => WM, MappingBuilder, UrlMatchingStrategy}
import com.github.tomakehurst.wiremock... | socrata-platform/soda-fountain | soda-fountain-external/src/test/scala/com/socrata/soda/external/SodaFountainClientTest.scala | Scala | apache-2.0 | 7,501 |
/* __ *\\
** ________ ___ / / ___ Scala API **
** / __/ __// _ | / / / _ | (c) 2003-2010, LAMP/EPFL **
** __\\ \\/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\\___/_/... | cran/rkafkajars | java/scala/package.scala | Scala | apache-2.0 | 10,488 |
/*
* 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 ... | BryanCutler/spark | sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/SubexpressionEliminationSuite.scala | Scala | apache-2.0 | 12,526 |
package org.http4s
package server
import cats.effect._
import cats.implicits._
class HttpServiceSpec extends Http4sSpec {
val srvc1 = HttpService[IO] {
case req if req.pathInfo == "/match" =>
Response[IO](Status.Ok).withBody("match")
case req if req.pathInfo == "/conflict" =>
Response[IO](Stat... | reactormonk/http4s | server/src/test/scala/org/http4s/server/HttpServiceSpec.scala | Scala | apache-2.0 | 1,642 |
/*
* Copyright 2010-2011 Vilius Normantas <code@norma.lt>
*
* This file is part of Crossbow library.
*
* Crossbow 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 ... | ViliusN/Crossbow | crossbow-core/src/lt/norma/crossbow/indicators/Divide.scala | Scala | gpl-3.0 | 1,415 |
package com.github.ldaniels528.trifecta.modules.etl.io.device
import com.github.ldaniels528.trifecta.modules.etl.io.Scope
import com.github.ldaniels528.trifecta.modules.etl.io.layout.Layout
/**
* Represents a Generic Input or Output Source
* @author lawrence.daniels@gmail.com
*/
trait DataSource extends Statist... | ldaniels528/trifecta | app-modules/etl/src/main/scala/com/github/ldaniels528/trifecta/modules/etl/io/device/DataSource.scala | Scala | apache-2.0 | 804 |
package net.jetmq.broker
import akka.actor.{ActorRef, FSM}
import scala.concurrent.duration._
case class ResetSession()
sealed trait SessionState
case object WaitingForNewSession extends SessionState
case object SessionConnected extends SessionState
sealed trait SessionBag {
val message_id: Int
val clean_ses... | butaji/JetMQ | core/src/main/scala/net/jetmq/broker/SessionActor.scala | Scala | mit | 8,522 |
package com.github.mjreid.flinkwrapper
import com.github.mjreid.flinkwrapper.util.Readers
import play.api.libs.json.{JsPath, Reads}
import play.api.libs.functional.syntax._
case class OptimizerProperties(
globalProperties: Option[Map[String, String]],
localProperties: Option[Map[String, String]],
estimates: Opt... | mjreid/flink-rest-scala-wrapper | api/src/main/scala/com/github/mjreid/flinkwrapper/OptimizerProperties.scala | Scala | apache-2.0 | 1,040 |
package reopp.common.guardedcommands.dataconnectors
import reopp.common.guardedcommands._
import reopp.common.{OptionSol, Predicate, Utils}
import Utils._
/**
* Created with IntelliJ IDEA.
* User: jose
* Date: 12/11/12
* Time: 16:52
* To change this template use File | Settings | File Templates.
*/
class GCSim... | joseproenca/ip-constraints | code/src/main/scala/reopp/common/guardedcommands/dataconnectors/GCSimpleVarFilter.scala | Scala | mit | 785 |
/*
* 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 ... | manuzhang/incubator-gearpump | core/src/test/scala/org/apache/gearpump/util/GraphSpec.scala | Scala | apache-2.0 | 7,128 |
/*
* Copyright 2014-2022 Netflix, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agr... | Netflix/atlas | atlas-json/src/test/scala/com/netflix/atlas/json/JsonParserHelperSuite.scala | Scala | apache-2.0 | 5,824 |
package skuber
/**
* @author David O'Riordan
*/
package object apiextensions {
type CustomResourceDefinitionList=ListResource[CustomResourceDefinition]
}
| minatjanster/skuber | client/src/main/scala/skuber/apiextensions/package.scala | Scala | apache-2.0 | 161 |
/*
* 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 ... | WangTaoTheTonic/flink | flink-libraries/flink-table/src/main/scala/org/apache/flink/table/runtime/io/ValuesInputFormat.scala | Scala | apache-2.0 | 2,058 |
/*
* 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 | plugins/src/test/scala/com/stratio/sparta/plugin/operator/median/MedianOperatorTest.scala | Scala | apache-2.0 | 5,015 |
package controllers
import org.scalatest.{BeforeAndAfter, Matchers, WordSpecLike}
import play.api.mvc.Cookie
import play.api.mvc.Results._
import play.api.test.Helpers._
import play.api.test._
import services.ConfigurationService
class AuthorizationControllerTest extends WordSpecLike with Matchers with BeforeAndAfter... | atanana/vue-stocks | test/controllers/AuthorizationControllerTest.scala | Scala | mit | 1,925 |
/*
* Copyright 1998-2017 Linux.org.ru
* 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... | kloun/lorsource | src/main/scala/ru/org/linux/search/ElasticsearchIndexService.scala | Scala | apache-2.0 | 7,344 |
package com.twitter.finagle.thrift
import com.twitter.finagle.context.Contexts
import com.twitter.util.{Return, Throw}
import com.twitter.io.Buf
case class ClientId(name: String) {
def toThrift: thrift.ClientId = new thrift.ClientId(name)
/**
* Executes the given function with this ClientId set as the current... | travisbrown/finagle | finagle-thrift/src/main/scala/com/twitter/finagle/thrift/ClientId.scala | Scala | apache-2.0 | 1,979 |
/* Copyright (C) 2008-2016 University of Massachusetts Amherst.
This file is part of "FACTORIE" (Factor graphs, Imperative, Extensible)
http://factorie.cs.umass.edu, http://github.com/factorie
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with... | factorie/factorie | src/main/scala/cc/factorie/infer/Marginal.scala | Scala | apache-2.0 | 13,172 |
/*
* 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/fset-faststream | app/model/persisted/AuditEvent.scala | Scala | apache-2.0 | 1,374 |
package lecture2
/**
* @author Alefas
* @since 31/03/15.
*/
object helper {
implicit class StringActivity(s: String) {
def vs(other: String)(body: => Unit) = new {
def apply(x: Unit): Unit = {}
}
}
val нет: Any = null
val !!! : Any = null
object В {
def Scala(o: Any) = new {def полей(x... | Alefas/ScalaCourse2015 | src/main/scala/lecture2/helper.scala | Scala | apache-2.0 | 353 |
/*
* Copyright 2015 Dmitriy Yefremov
*
* 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... | dmitriy-yefremov/sleipnir | project/Sonatype.scala | Scala | apache-2.0 | 1,688 |
/*
* Happy Melly Teller
* Copyright (C) 2013 - 2016, Happy Melly http://www.happymelly.com
*
* This file is part of the Happy Melly Teller.
*
* Happy Melly Teller 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 Fo... | HappyMelly/teller | app/controllers/Registration.scala | Scala | gpl-3.0 | 19,252 |
// Copyright (C) 2011-2012 the original author or authors.
// 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.
// You ... | chrisjwwalker/cjww-rest-api | app/controllerTraits/DeleteDeviceCtrl.scala | Scala | apache-2.0 | 1,256 |
/*
* 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... | fjsc/sparta | driver/src/main/scala/com/stratio/sparta/driver/stage/RawDataStage.scala | Scala | apache-2.0 | 2,579 |
/*
* 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 ... | bowenli86/flink | flink-table/flink-table-planner/src/test/scala/org/apache/flink/table/api/stream/table/validation/AggregateValidationTest.scala | Scala | apache-2.0 | 4,840 |
package chess
import Pos._
import com.roundeights.hasher.Implicits._
class HistoryTest extends ChessTest {
"threefold repetition" should {
def toHash(a: Any) = a.toString.md5.toString
def makeHistory(positions: List[Any]) = (positions map toHash).foldLeft(History()) {
case (history, hash) ⇒ history w... | cxd4/scalachess | src/test/scala/HistoryTest.scala | Scala | mit | 910 |
package com.slick101.test.cases.smoke
import com.slick101.test.{BaseTest, MemDb, TestEnv}
import slick.jdbc.H2Profile.api._
import scala.concurrent.ExecutionContext.Implicits.global
class SmokeSpec extends BaseTest with MemDb {
"Smoke tests" must {
"correctly read configuration" in {
val driverClass = Te... | nexelem/slick-101 | src/test/scala/com/slick101/test/cases/smoke/SmokeSpec.scala | Scala | apache-2.0 | 725 |
/**
* Copyright 2013 Netflix, 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 ... | mttkay/RxJava | language-adaptors/rxjava-scala/src/test/scala/rx/lang/scala/ObservableTest.scala | Scala | apache-2.0 | 10,419 |
package com.monovore.coast
package machine
import org.specs2.mutable._
class SystemSpec extends Specification {
"an actor system" should {
"send a message" in {
val machine = System[String](
edges = Map("source" -> Seq("target"))
)
val (state, _) = machine.update(
System.St... | bkirwi/coast | core/src/test/scala/com/monovore/coast/machine/SystemSpec.scala | Scala | apache-2.0 | 1,018 |
package de.fosd.typechef.parser.c
import java.io.{StringWriter, Writer}
import de.fosd.typechef.conditional._
import de.fosd.typechef.featureexpr.{FeatureExpr, FeatureExprFactory}
object PrettyPrinter {
//pretty printer combinators, stolen from http://www.scala-blogs.org/2009/04/combinators-for-pretty-printers-... | mbeddr/TypeChef | CParser/src/main/scala/de/fosd/typechef/parser/c/PrettyPrinter.scala | Scala | lgpl-3.0 | 25,021 |
/*
Copyright 2013 Twitter, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software... | rangadi/summingbird | summingbird-storm/src/main/scala/com/twitter/summingbird/storm/StormSink.scala | Scala | apache-2.0 | 1,486 |
import scala.collection.mutable.TreeSet
object Test extends App {
val list = List(6,5,4,3,2,1,1,2,3,4,5,6,6,5,4,3,2,1)
val distinct = list.distinct
val sorted = distinct.sorted
// sublist stuff for a single level of slicing
val min = list.min
val max = list.max
val nonlist = ((min - 10) until (max + 20)... | scala/scala | test/files/run/mutable-treeset.scala | Scala | apache-2.0 | 5,134 |
package com.nflabs.zeppelin.spark
import scala.tools.nsc._
import scala.tools.nsc.interpreter._
import org.apache.spark.repl.SparkILoop
import org.apache.spark.repl.SparkIMain
import org.apache.spark.util.Utils
import java.io.BufferedReader
import scala.tools.nsc.util.{ ClassPath, Exceptional, stringFromWriter, string... | epahomov/zeppelin | spark/src/main/scala/com/nflabs/zeppelin/spark/ReflectSparkILoop.scala | Scala | apache-2.0 | 2,017 |
package spinoco.fs2.cassandra.sample
/**
* Created by pach on 07/06/16.
*/
object TestEnumeration extends Enumeration {
val One, Two, Three = Value
}
| Spinoco/fs2-cassandra | test/src/test/scala/spinoco/fs2/cassandra/sample/TestEnumeration.scala | Scala | mit | 157 |
package asobu.distributed.service
import akka.actor.ActorSystem
import asobu.distributed.protocol.Prefix
import asobu.distributed.protocol.EndpointDefinition
import play.routes.compiler.{HandlerCall, Route}
import scala.concurrent.{ExecutionContext, Future}
import scala.reflect.ClassTag
/**
* Bare bone controller w... | iheartradio/asobu | distributed/src/main/scala/asobu/distributed/service/Controller.scala | Scala | apache-2.0 | 1,085 |
package com.github.bespalovdn.asteriskscala.agitest
import java.net.InetSocketAddress
import akka.actor.ActorRef
import com.github.bespalovdn.asteriskscala.agi.AgiServerActor
import com.github.bespalovdn.asteriskscala.agi.handler.AgiRequestHandlerFactory
trait AgiServerSupport extends TestSupportAkka
{
var agiSe... | bespalovdn/asterisk-scala | agi-test/src/main/scala/com/github/bespalovdn/asteriskscala/agitest/AgiServerSupport.scala | Scala | mit | 719 |
package hostclub
import scala.util.parsing.combinator.RegexParsers
object Parse extends RegexParsers {
override def skipWhitespace = false
def any: Parser[String] = """.|(\\r?\\n)+""".r
def space: Parser[String] = """[^\\S\\n]+""".r
def name: Parser[String] = """[0-9A-Za-z-_.]+""".r
val Ip = ("(?:(?:25... | softprops/hostclub | src/main/scala/parse.scala | Scala | mit | 2,305 |
package com.lookout.borderpatrol
import com.twitter.finagle.Service
import com.twitter.finagle.http.{Status, Request, Response}
import com.twitter.util.{Await, Future}
package object test {
/**
* Helper ops for Futures in testing
*/
implicit class FutureOps[A](val future: Future[A]) extends AnyVal {
/*... | rikesh-chouhan/borderpatrol | core/src/test/scala/com/lookout/borderpatrol/test/package.scala | Scala | mit | 814 |
package sbtavro
package filesorter
import spray.json.DefaultJsonProtocol._
import spray.json._
/**
* Code adapted from https://github.com/ch4mpy/sbt-avro/blob/master/src/main/scala/com/c4soft/sbtavro/SbtAvro.scala
* by Jerome Wascongne
*/
object ReferredTypeFinder {
object Keys {
val Fields = "fields"
... | julianpeeters/sbt-avro | src/main/scala/sbtavro/filesorter/ReferredTypeFinder.scala | Scala | bsd-3-clause | 1,219 |
/*
* Copyright 2001-2013 Artima, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agre... | scalatest/scalatest | jvm/scalatest-test/src/test/scala/org/scalatest/ListShouldContainNoElementsOfSpec.scala | Scala | apache-2.0 | 25,946 |
/* Copyright 2009-2016 EPFL, Lausanne */
import leon.lang._
import leon.lang.synthesis._
import leon.annotation._
object Numerals {
sealed abstract class Num
case object Z extends Num
case class S(pred: Num) extends Num
def value(n:Num) : BigInt = {
n match {
case Z => 0
case S(p) => 1 + val... | epfl-lara/leon | src/test/resources/regression/performance/cegis/Squared.scala | Scala | gpl-3.0 | 760 |
package com.bazaarvoice.sswf
import com.amazonaws.services.simpleworkflow.AmazonSimpleWorkflowClient
import com.amazonaws.services.simpleworkflow.model._
import com.bazaarvoice.sswf.model.history.StepsHistory
import com.bazaarvoice.sswf.model.result.{StepResult, Success, TimedOut}
import com.bazaarvoice.sswf.model.{De... | bazaarvoice/super-simple-workflow | sswf-core/src/it/scala/com/bazaarvoice/sswf/StepTransitionTest.scala | Scala | apache-2.0 | 4,890 |
package hu.frankdavid.ranking.strategy
import breeze.linalg.{DenseMatrix, DenseVector}
import hu.frankdavid.ranking._
case class ColleyStrategy(maxRounds: (TournamentContext => Int) = SwissStrategy.DefaultNumberOfRounds)
extends SwissStrategy("Colley Strategy", maxRounds) {
protected def playerScores(implicit co... | frankdavid/ranking | src/main/scala/hu/frankdavid/ranking/strategy/ColleyStrategy.scala | Scala | apache-2.0 | 1,088 |
/**
* Copyright 2012-2013 StackMob
*
* 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... | megamsys/newman | src/test/scala/com/stackmob/newman/test/request/serialization/HttpRequestSerializationSpecs.scala | Scala | apache-2.0 | 3,517 |
package com.twitter.finagle
import _root_.java.net.SocketAddress
import com.twitter.concurrent.Broker
import com.twitter.conversions.time._
import com.twitter.finagle
import com.twitter.finagle.cacheresolver.{CacheNode, CacheNodeGroup}
import com.twitter.finagle.client.{DefaultPool, StackClient, StdStackClient, Transp... | liamstewart/finagle | finagle-memcached/src/main/scala/com/twitter/finagle/Memcached.scala | Scala | apache-2.0 | 15,043 |
/*
* Copyright 2022 HM Revenue & Customs
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or a... | hmrc/self-service-time-to-pay-frontend | app/ssttpeligibility/IaService.scala | Scala | apache-2.0 | 1,562 |
/* use sql context */
import org.apache.spark.sql._
val sqlCtx = new org.apache.spark.sql.hive.HiveContext(sc)
val book_df = sqlCtx.sql("SELECT * FROM bible.orc_part1_book WHERE book = 'Jn'")
val verse316_df = book_df.filter("cidx = 3").where("vidx = 16")
val verse_df = verse316_df.select("verse")
verse_df.collect().f... | zhuwbigdata/hadoop-admin-utils | spark-utils/scala/bible/selectDP2DF.scala | Scala | apache-2.0 | 337 |
/**********************************************************************************************************************
* This file is part of Scrupal, a Scalable Reactive Web Application Framework for Content Management *
* ... | scrupal/scrupal | scrupal-core/src/main/scala/scrupal/core/http/RequestHandler.scala | Scala | apache-2.0 | 3,396 |
package com.datastax.spark.connector.rdd
import java.io.IOException
import java.util.Date
import scala.reflect.runtime.universe.typeTag
import org.joda.time.DateTime
import com.datastax.spark.connector._
import com.datastax.spark.connector.cql.CassandraConnector
import com.datastax.spark.connector.embedded._
import... | willgalen/REVEL | spark-cassandra-connector/src/it/scala/com/datastax/spark/connector/rdd/CassandraRDDSpec.scala | Scala | apache-2.0 | 34,519 |
/*
* Scala (https://www.scala-lang.org)
*
* Copyright EPFL and Lightbend, Inc.
*
* Licensed under Apache License 2.0
* (http://www.apache.org/licenses/LICENSE-2.0).
*
* See the NOTICE file distributed with this work for
* additional information regarding copyright ownership.
*/
package scala.concurrent.impl
... | martijnhoekstra/scala | src/library/scala/concurrent/impl/Promise.scala | Scala | apache-2.0 | 21,917 |
import sbt._
import sbt.Keys._
object PluginBuild extends Build {
lazy val playHandlebars = Project(
id = "play-handlebars", base = file(".")
)
}
| AlexRiedler/play-handlebars | project/Build.scala | Scala | bsd-2-clause | 157 |
package scorex.account
import scorex.crypto.Crypto
case class PrivateKeyAccount(seed: Array[Byte], privateKey: Array[Byte], override val publicKey: Array[Byte])
extends PublicKeyAccount(publicKey) {
require(seed != null)
require(privateKey != null)
require(publicKey != null)
override val address = Crypto.... | Pole-he/Scorex-Lagonaki | src/main/scala/scorex/account/PrivateKeyAccount.scala | Scala | cc0-1.0 | 520 |
package com.twitter.finagle.mux.transport
import com.twitter.finagle.{Dentry, Dtab, Failure, Path, tracing}
import com.twitter.io.Buf
import com.twitter.util.Time
import com.twitter.conversions.DurationOps._
import org.scalatest.FunSuite
import scala.collection.mutable
class MessageTest extends FunSuite {
import Me... | luciferous/finagle | finagle-mux/src/test/scala/com/twitter/finagle/mux/transport/MessageTest.scala | Scala | apache-2.0 | 6,750 |
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2015-2021 Andre White.
*
* 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
*
* https://www.apache.org/licenses/LICENSE... | adarro/ddo-calc | subprojects/common/ddo-core/src/main/scala/io/truthencode/ddo/model/compendium/types/Elementals.scala | Scala | apache-2.0 | 917 |
sealed trait Ty {
type T
}
class TUnit() extends Ty {
type T = Unit
}
case object TUnit extends TUnit()
final case class TFun(dom: Ty, cod: Ty) extends Ty {
type T = dom.T => cod.T
}
def default(ty: Ty): ty.T = (ty: ty.type & Ty) match {
case a: (ty.type & TUnit) => (): a.T
case a: (ty.type & TFun) =>
... | lampepfl/dotty | tests/patmat/i12475.scala | Scala | apache-2.0 | 377 |
/*
* 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 sbt.testing
/** Information in additi... | scala-js/scala-js | test-interface/src/main/scala/sbt/testing/Selectors.scala | Scala | apache-2.0 | 6,099 |
package data.daos
import javax.inject.Inject
import com.google.inject.ImplementedBy
import com.mongodb.casbah.Imports._
import com.mongodb.casbah.TypeImports
import models.User
import play.api.Application
/**
* User Dao to handle db operations for Users.
*/
@ImplementedBy(classOf[UserMongoDao])
trait UserDao {
/... | maximx1/openwalrus | app/data/daos/UserMongoDao.scala | Scala | mit | 7,456 |
package app.services.cache
import scala.concurrent.duration.{ Duration, _ }
import scala.concurrent.{ Await, Future }
import scala.concurrent.ExecutionContext.Implicits.global
import scala.reflect.ClassTag
import play.api.cache.ehcache.EhCacheApi
import net.sf.ehcache.{ Cache, CacheManager }
class EhCacheProvider(cac... | YoshinoriN/Credentiam | src/app/services/cache/EhCacheProvider.scala | Scala | apache-2.0 | 839 |
package com.programmaticallyspeaking.ncd.nashorn
import com.programmaticallyspeaking.ncd.host._
import com.programmaticallyspeaking.ncd.messaging.Observer
import com.programmaticallyspeaking.ncd.testing.UnitTest
import org.scalatest.concurrent.{IntegrationPatience, ScalaFutures}
import scala.collection.mutable
import... | provegard/ncdbg | src/test/scala/com/programmaticallyspeaking/ncd/nashorn/EvaluateTestFixture.scala | Scala | bsd-3-clause | 1,558 |
package mesosphere.marathon.api.v2
import java.util
import javax.ws.rs._
import javax.ws.rs.core.{ MediaType, Response }
import javax.inject.Inject
import com.sun.jersey.api.Responses
import mesosphere.marathon.api.{ EndpointsHelper, RestResource }
import mesosphere.marathon.api.v2.json.EnrichedTask
import mesosphere.... | quamilek/marathon | src/main/scala/mesosphere/marathon/api/v2/TasksResource.scala | Scala | apache-2.0 | 3,315 |
package services
import javax.inject.Inject
import brave.play.{TraceData, ZipkinTraceServiceLike}
import repositories.ApiRepository
import scala.concurrent.Future
class ApiSampleService @Inject() (
repo: ApiRepository,
tracer: ZipkinTraceServiceLike
) {
def sample(url: String)(implicit traceData: TraceData): ... | bizreach/play-zipkin-tracing | sample/zipkin-api-play27/app/services/ApiSampleService.scala | Scala | apache-2.0 | 549 |
package A {
opaque type T = Int
def t: T = 0
}
package B {
export A.T
val t: B.T = A.t
}
| dotty-staging/dotty | tests/pos/i12168.scala | Scala | apache-2.0 | 106 |
package com.portia.models
import com.mongodb.casbah.Imports.ObjectId
import com.mongodb.casbah.commons.MongoDBObject
import com.novus.salat.dao.SalatDAO
import com.novus.salat.global._
/**
* Pending web nodes which will be dequeue later to crawl
* @author duytd
*/
case class DBQueue(_id: ObjectId = new ObjectId, u... | duytd/blackspider | src/main/scala/com/portia/models/DBQueue.scala | Scala | gpl-3.0 | 679 |
object O {
implicit class Foo[A](val value: String) extends AnyVal {
def bippy() = {
@annotation.tailrec def loop(x: A): Unit = loop(x)
()
}
// The original test cases fail with the new is/asInstanceOf semantics
// introduced along with -Yliteral-types because the method has a
// sing... | jastice/intellij-scala | scala/scala-impl/testdata/annotator/literalTypes/sip23t6891.scala | Scala | apache-2.0 | 1,335 |
package lila.game
import chess.{ Clock, Pos, CheckCount }
import chess.variant.Crazyhouse
import Game.BSONFields._
import org.joda.time.DateTime
import reactivemongo.bson._
import lila.db.BSON.BSONJodaDateTimeHandler
import lila.db.ByteArray
private[game] object GameDiff {
type Set = (String, BSONValue)
type Un... | JimmyMow/lila | modules/game/src/main/GameDiff.scala | Scala | mit | 2,960 |
package dotty.tools
package dotc
package reporting
import scala.language.unsafeNulls
import dotty.tools.dotc.core.Contexts._
import dotty.tools.dotc.core.Mode
import dotty.tools.dotc.core.Symbols.{NoSymbol, Symbol}
import dotty.tools.dotc.reporting.Diagnostic._
import dotty.tools.dotc.reporting.Message._
import dotty... | lampepfl/dotty | compiler/src/dotty/tools/dotc/reporting/Reporter.scala | Scala | apache-2.0 | 9,533 |
/*
* 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/TimeSeriesTableWithTTL.scala | Scala | apache-2.0 | 1,182 |
/*
* Copyright (c) 2014 Paul Bernard
*
* 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... | quantintel/spectrum | financial/src/main/scala/org/quantintel/ql/instruments/forward/Forward.scala | Scala | apache-2.0 | 902 |
/*
* 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 ... | wangmiao1981/spark | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/SelectedField.scala | Scala | apache-2.0 | 6,265 |
/*
* Copyright (c) 2014 Dufresne Management Consulting LLC.
*/
package com.nickelsoftware.bettercare4me.hedis.hedis2014
import scala.util.Random
import org.joda.time.DateTime
import org.joda.time.Interval
import com.nickelsoftware.bettercare4me.hedis.HEDISRule
import com.nickelsoftware.bettercare4me.hedis.Scorecar... | reactivecore01/bettercare4.me | play/app/com/nickelsoftware/bettercare4me/hedis/hedis2014/CDC_EE_Rule.scala | Scala | apache-2.0 | 5,438 |
import org.scalatest.{Matchers, FlatSpec}
class TrinaryTest extends FlatSpec with Matchers {
it should "empty string should error" in {
intercept[IllegalArgumentException] {
Trinary.trinaryToInt("")
}
}
it should "invalid trinary should error" in {
intercept[IllegalArgumentException] {
T... | daewon/til | exercism/scala/trinary/src/test/scala/TrinaryTest.scala | Scala | mpl-2.0 | 1,755 |
package SpMVAccel
import Chisel._
import TidbitsOCM._
import TidbitsDMA._
import TidbitsStreams._
class SearchableQueue(w: Int, entries: Int) extends Module {
val io = new Bundle {
val enq = Decoupled(UInt(width=w)).flip
val deq = Decoupled(UInt(width=w))
val search = UInt(INPUT, width=w)
val found ... | maltanar/spmv-vector-cache | chisel/cache-new/NBVectorCache.scala | Scala | bsd-3-clause | 14,285 |
package spire
package benchmark
import java.util.concurrent.TimeUnit
import org.openjdk.jmh.annotations._
import scala.util.Random
import Random._
import spire.algebra._
import spire.implicits._
import Arrays.init
@BenchmarkMode(Array(Mode.AverageTime))
@OutputTimeUnit(TimeUnit.MICROSECONDS)
@State(Scope.Thread)
... | non/spire | benchmark/src/main/scala/spire/benchmark/ArrayOrderBenchmark.scala | Scala | mit | 2,243 |
/*
* 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 ... | ArvinDevel/onlineAggregationOnSparkV2 | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/rules/RuleExecutor.scala | Scala | apache-2.0 | 4,435 |
/**
* 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... | piavlo/operations-debs-kafka | core/src/test/scala/unit/kafka/integration/FetcherTest.scala | Scala | apache-2.0 | 3,713 |
object Test {
val f : PartialFunction[_, Int] = { case a : Int => a } // undefined param
def foo[A](pf: PartialFunction[A, Int]) {};
foo { case a : Int => a } // undefined param
val g : PartialFunction[Int, _] = { case a : Int => a } // okay
}
// Another variation, seen in the wild with Specs2.
class X {
trai... | felixmulder/scala | test/files/neg/t6258.scala | Scala | bsd-3-clause | 554 |
package dundertext.editor.cmd
import dundertext.data.Row
import dundertext.editor.RowNode
object SplitRow extends CommandDescription {
def apply() = new SplitRow
}
class SplitRow extends SubtitlingCommand {
override def applies: Boolean = {
cursor.row.hasText
}
override def execute(): Unit = {
val o... | dundertext/dundertext | editor/src/main/scala/dundertext/editor/cmd/SplitRow.scala | Scala | gpl-3.0 | 553 |
package controllers.forms
import models.Tables._
import play.api.data.Form
import play.api.data.Forms._
/**
* Created by info on 27.10.2016.
*/
case class DBUserForm(firstName: String, lastName: String, email: String, userRole: String, password: String)
object DBUserForm {
def from(q: User): DBUserForm = {
... | Starofall/QryGraph | qrygraph/jvm/app/controllers/forms/DBUserForm.scala | Scala | mit | 731 |
package com.github.suzuki0keiichi.nomorescript.trees
case class NoMoreScriptSuper(child: NoMoreScriptTree) extends NoMoreScriptTree {
override def toJs(terminate: Boolean) = {
val childJs = child.toJs(false)
Util.addLast(childJs, ".__super__")
}
}
| suzuki0keiichi/nomorescript | nomorescript-plugin/src/main/scala/com/github/suzuki0keiichi/nomorescript/trees/NoMoreScriptSuper.scala | Scala | mit | 271 |
package scala.runtime
import org.junit.Assert._
import org.junit.Test
import scala.tools.testkit.AllocationTest
class CharBoxingTest extends SideEffectTest with AllocationTest {
val value = 'x'
@Test def hash1(): Unit = {
nonAllocating(value.hashCode())
}
@Test def hash2(): Unit = {
nonAllocating(v... | scala/scala | test/junit/scala/runtime/CharBoxingTest.scala | Scala | apache-2.0 | 1,122 |
package org.ucf.scala
object CurryFunction {
/**
* plainOldSum: (x: Int, y: Int)Int
*
* It is a standard definition of sum function, which call as method
* @param x
* @param y
* @return
*/
def plainOldSum(x:Int, y:Int) = x + y
/**
* functionValueSum: (Int, Int) => Int
... | bingrao/Scala-Learning | ControlAbstraction/src/test/scala/org/ucf/scala/CurryFunction.scala | Scala | mit | 921 |
package com.sksamuel.elastic4s.requests.delete
import com.fasterxml.jackson.annotation.JsonProperty
import com.sksamuel.elastic4s.requests.common.{DocumentRef, Shards}
case class DeleteResponse(@JsonProperty("_shards") shards: Shards,
@JsonProperty("_index") index: String,
... | stringbean/elastic4s | elastic4s-core/src/main/scala/com/sksamuel/elastic4s/requests/delete/DeleteResponse.scala | Scala | apache-2.0 | 793 |
package io.github.facaiy.fp.scala.c5
/**
* Created by facai on 4/26/17.
*/
sealed trait Stream[+A] {
import Stream._
/*
def headOption: Option[A] = this match {
case Empty => None
case Cons(h, t) => Some(h())
}
*/
// ex 5.1
def toList: List[A] = this match {
case Empty => Nil
case Con... | ningchi/book_notes | Manning_Functional_Programming_in_Scala/src/main/scala/io/github/facaiy/fp/scala/c5/Stream.scala | Scala | cc0-1.0 | 5,122 |
package com.jackbeasley.enigma
import com.jackbeasley.enigma.{RotorManager}
class Enigma(crypt:RotorManager) {
}
| jackbeasley/enigma | src/main/scala/Enigma.scala | Scala | gpl-3.0 | 116 |
/*
* Copyright (C) 30/05/13 Romain Reuillon
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This pr... | ISCPIF/PSEExperiments | simpuzzle-src/models/simpoplocal/src/main/scala/fr/geocites/simpoplocal/RandomDisaster.scala | Scala | agpl-3.0 | 1,174 |
package com.enkidu.lignum.parsers.ast.statement.interruptable
import com.enkidu.lignum.parsers.ast.statement.Block
import com.enkidu.lignum.parsers.ast.statement.declaration.LocalVariableDeclaration
case class TryWithResources(resources: Seq[LocalVariableDeclaration], tryBlock: Block, catches: Seq[CatchClause],
... | marek1840/java-parser | src/main/scala/com/enkidu/lignum/parsers/ast/statement/interruptable/TryWithResources.scala | Scala | mit | 610 |
/**
* 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... | Flipkart/kafka-manager | app/kafka/manager/utils/zero82/LogConfig.scala | Scala | apache-2.0 | 10,909 |
package org.helgoboss.scala_osgi_metatype.adapters
import org.helgoboss.scala_osgi_metatype.interfaces.ElementaryAttributeDefinition
/**
* Provides the given Scala elementary attribute definition as an OSGi-compliant attribute definition.
*
* @constructor Creates an adapter for the given definition.
* @param de... | helgoboss/scala-osgi-metatype | src/main/scala/org/helgoboss/scala_osgi_metatype/adapters/ElementaryAttributeDefinitionAdapter.scala | Scala | mit | 688 |
import org.specs2.mutable._
import org.specs2.runner._
import org.junit.runner._
import play.api.test._
import play.api.test.Helpers._
@RunWith(classOf[JUnitRunner])
class ApplicationSpec extends Specification {
"Application" should {
"send 404 on a bad request" in {
running(FakeApplication()) {
... | briandignan/scala-play-hello-world | test/ApplicationSpec.scala | Scala | apache-2.0 | 1,180 |
package pdi.jwt
import scala.concurrent.duration.Duration
import javax.inject.Inject
import java.time.Clock
import play.api.libs.json._
import play.api.libs.json.Json.JsValueWrapper
import play.api.Configuration
import pdi.jwt.algorithms.{JwtAsymmetricAlgorithm, JwtHmacAlgorithm}
/** Similar to the default Play Sess... | pauldijou/jwt-scala | play/src/main/scala/JwtSession.scala | Scala | apache-2.0 | 8,262 |
package com.github.mogproject.redismock.util
/**
* Wrapper for Byte
*
* @param x base Byte
*/
class EnhancedByte(x: Byte) {
/** Convert to unsigned integer */
def toUnsignedInt: Int = x & 0xff
def toUnsignedLong: Long = toUnsignedInt.toLong
/** Count the number of 1-bit */
def popCount: Int = {
v... | mogproject/scala-redis-mock | src/main/scala/com/github/mogproject/redismock/util/EnhancedByte.scala | Scala | apache-2.0 | 428 |
package knub.master_thesis.math
object Bessel {
val ACC = 40.0
val BIGNO = 1.0e10
val BIGNI = 1.0e-10
def bessi0(x: Double): Double = {
val ax = Math.abs(x)
var ans: Double = 0.0
if (ax < 3.75) {
var y = x / 3.75
y = y * y
ans=1.0+y*(3.51562... | knub/master-thesis | code/scala/src/main/scala/knub/master_thesis/math/Bessel.scala | Scala | apache-2.0 | 2,452 |
package scala.slick.test.driver
import org.junit.runner.RunWith
import com.typesafe.slick.testkit.util.{StandardTestDBs, DriverTest, Testkit}
@RunWith(classOf[Testkit])
class H2MemTest extends DriverTest(StandardTestDBs.H2Mem)
@RunWith(classOf[Testkit])
class H2DiskTest extends DriverTest(StandardTestDBs.H2Disk)
@R... | nuodb/slick | slick-testkit/src/test/scala/scala/slick/test/driver/DriverTest.scala | Scala | bsd-2-clause | 1,237 |
/*
* Copyright (C) 2020 MapRoulette contributors (see CONTRIBUTORS.md).
* Licensed under the Apache License, Version 2.0 (see LICENSE).
*/
package org.maproulette.framework.service
import java.util.UUID
import java.util.concurrent.TimeUnit
import scala.concurrent.duration.FiniteDuration
import play.api.libs.json.J... | mgcuthbert/maproulette2 | test/org/maproulette/framework/service/TaskReviewServiceSpec.scala | Scala | apache-2.0 | 15,125 |
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.