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 |
|---|---|---|---|---|---|
/*
* 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 ... | hengyicai/OnlineAggregationUCAS | sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/PruningSuite.scala | Scala | apache-2.0 | 6,002 |
/*§
===========================================================================
GraphsJ - SDK
===========================================================================
Copyright (C) 2009-2016 Gianluca Costa
===========================================================================
Licensed under the Apac... | giancosta86/GraphsJ-sdk | src/main/scala/info/gianlucacosta/graphsj/OutputConsole.scala | Scala | apache-2.0 | 1,579 |
/*
* WindowIndexWhere.scala
* (FScape)
*
* Copyright (c) 2001-2022 Hanns Holger Rutz. All rights reserved.
*
* This software is published under the GNU Affero General Public License v3+
*
*
* For further information, please contact Hanns Holger Rutz at
* [email protected]
*/
package de.sciss.fscape
pac... | Sciss/FScape-next | core/shared/src/main/scala/de/sciss/fscape/graph/WindowIndexWhere.scala | Scala | agpl-3.0 | 1,676 |
/*
* @author Philip Stutz
* @author Mihaela Verman
*
* Copyright 2013 University of Zurich
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/li... | hicolour/triplerush | src/main/scala/com/signalcollect/triplerush/vertices/query/ResultCountingQueryVertex.scala | Scala | apache-2.0 | 1,835 |
package finatra.quickstart
import com.google.inject.testing.fieldbinder.Bind
import com.twitter.finagle.http.Status._
import com.twitter.finatra.http.EmbeddedHttpServer
import com.twitter.inject.Mockito
import com.twitter.inject.server.FeatureTest
import com.twitter.util.Future
import finatra.quickstart.domain.TweetId... | syamantm/finatra | examples/twitter-clone/src/test/scala/finatra/quickstart/TwitterCloneFeatureTest.scala | Scala | apache-2.0 | 2,785 |
package controllers
import java.net.URLEncoder
import controllers.AdministrationDashboardController._
import utils.Global._
import utils.Implicits._
import play.api.mvc.{ Action, Controller }
import utils.Security.Authentication
import utils.semantic.{ Resource, RDFNode, SPARQLTools }
import utils.semantic.Vocabulary.... | FHK-ADV/lwm | app/controllers/SearchController.scala | Scala | mit | 3,527 |
package no.uio.musit.models
import play.api.libs.json.{JsNumber, Reads, Writes, _}
case class DatabaseId(underlying: Long) extends AnyVal
object DatabaseId {
implicit val reads: Reads[DatabaseId] = __.read[Long].map(DatabaseId.apply)
implicit val writes: Writes[DatabaseId] = Writes(did => JsNumber(did.underlyi... | MUSIT-Norway/musit | musit-models/src/main/scala/no/uio/musit/models/DatabaseId.scala | Scala | gpl-2.0 | 621 |
package com.harrys.hyppo.worker.exec
/**
* Created by jpetty on 12/7/15.
*/
sealed trait TaskLogStrategy {
def configName: String
}
object TaskLogStrategy {
case object PipeTaskLogStrategy extends TaskLogStrategy {
override def configName: String = "PIPE"
}
case object FileTaskLogStrategy extends Tas... | harrystech/hyppo-worker | worker/src/main/scala/com/harrys/hyppo/worker/exec/TaskLogStrategy.scala | Scala | mit | 881 |
package com.codacy.client.stash.client
import java.net.URL
import com.codacy.client.stash.client.auth.Authenticator
import com.codacy.client.stash.util.HTTPStatusCodes
import play.api.libs.json._
import scalaj.http.{Http, HttpOptions, HttpRequest, HttpResponse, StringBodyConnectFunc}
import scala.util.Properties
imp... | codacy/stash-scala-client | src/main/scala/com/codacy/client/stash/client/StashClient.scala | Scala | apache-2.0 | 8,628 |
package frameless
package ml
package feature
import frameless.ml.feature.TypedStringIndexer.HandleInvalid
import frameless.ml.internals.UnaryInputsChecker
import org.apache.spark.ml.feature.{StringIndexer, StringIndexerModel}
/**
* A label indexer that maps a string column of labels to an ML column of label indices... | adelbertc/frameless | ml/src/main/scala/frameless/ml/feature/TypedStringIndexer.scala | Scala | apache-2.0 | 1,612 |
package ch02
import org.specs2.mutable.Specification
class Ex23CurrySpec extends Specification{
"Curry function " should {
"" in {
//Given
//When
//Then
ok
}
}
}
| IrfanAnsari/fpinscala | src/test/scala/ch02/Ex23CurrySpec.scala | Scala | mit | 210 |
package storage
import scaldi.Module
import scala.language.existentials
package object postgres {
val dbProfile = EnhancedPostgresDriver.profile
val dbSimple = EnhancedPostgresDriver.simple
class DbModule extends Module {
import scala.slick.jdbc.JdbcBackend.Database
bind[Database] to Database.forDataS... | onurzdg/spray-app | src/main/scala/storage/postgres/package.scala | Scala | apache-2.0 | 351 |
/**
* This file contains all DPF concepts that aren't graph.
* I tried to keep all definitions very close to what have been defined in
* Adrian Rutle's PhD thesis https://bora.uib.no/handle/1956/4469 with a few exceptions:
* 1. The constraint semantics (i.e. the OCL) is mapped to a signature and not to the model.
... | fmantz/DPF_Text | no.hib.dpf.text/src_scala/no/hib/dpf/text/scala/ct/4_DPF.scala | Scala | epl-1.0 | 4,263 |
package freecli
package option
package dsl
import shapeless._
import shapeless.ops.hlist.{Diff, Intersection, LeftFolder}
import core.api.CanProduce
import option.api.StringValue
trait StringValueImplicits {
type StringValueTypes = StringValue :: HNil
implicit def canProduceStringValue[T, H <: HList, Out0 <: HL... | pavlosgi/freecli | core/src/main/scala/freecli/option/dsl/StringValueImplicits.scala | Scala | apache-2.0 | 1,070 |
/**
* Licensed to Big Data Genomics (BDG) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The BDG licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use ... | nfergu/bdg-utils | utils-metrics/src/main/scala/org/bdgenomics/utils/instrumentation/InstrumentationFunctions.scala | Scala | apache-2.0 | 1,612 |
/*
* 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 ... | fhueske/flink | flink-table/flink-table-planner-blink/src/test/scala/org/apache/flink/table/planner/expressions/TemporalTypesTest.scala | Scala | apache-2.0 | 27,358 |
/**
* Licensed to Big Data Genomics (BDG) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The BDG licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use ... | tdanford/avocado | avocado-core/src/main/scala/org/bdgenomics/avocado/algorithms/em/EMforAlleles.scala | Scala | apache-2.0 | 4,618 |
package lore.lsp
import org.eclipse.lsp4j.launch.LSPLauncher
object Main {
def main(args: Array[String]): Unit = {
val server = new LoreLanguageServer
val launcher = LSPLauncher.createServerLauncher(server, System.in, System.out)
val client = launcher.getRemoteProxy
server.connect(client)
laun... | marcopennekamp/lore | lsp/server/src/lore/lsp/Main.scala | Scala | mit | 349 |
/*******************************************************************************
Copyright (c) 2013-2014, S-Core, KAIST.
All rights reserved.
Use is subject to license terms.
This distribution may include materials developed by third parties.
*********************************************************... | darkrsw/safe | src/main/scala/kr/ac/kaist/jsaf/analysis/typing/models/Tizen/TIZENBluetoothSocket.scala | Scala | bsd-3-clause | 5,229 |
package im.actor.server.db
import java.sql.Connection
import javax.sql.DataSource
import org.flywaydb.core.Flyway
import org.flywaydb.core.api.MigrationInfo
import org.flywaydb.core.api.callback.FlywayCallback
trait FlywayInit {
def initFlyway(ds: DataSource) = {
val flyway = new Flyway()
flyway.setDataSou... | EaglesoftZJ/actor-platform | actor-server/actor-persist/src/main/scala/im/actor/server/db/FlywayInit.scala | Scala | agpl-3.0 | 1,950 |
import scuff.FakeType
package object delta {
type Revision = Int // >= 0
type Tick = Long
type Channel = Channel.Type
val Channel: FakeType[String] { type Type <: AnyRef } = new FakeType[String] {
type Type = String
def apply(str: String) = str
}
}
| nilskp/delta | src/main/scala/delta/package.scala | Scala | mit | 271 |
/*
* 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-eval/shared/src/test/scala/monix/eval/TaskConnectionRefSuite.scala | Scala | apache-2.0 | 3,532 |
package rx.lang.scala
import org.junit.Test
import org.scalatestplus.junit.JUnitSuite
import rx.lang.scala.observers.TestSubscriber
import scala.concurrent.Future
import scala.util.{Failure, Success}
class ScalaTypesConversionsTests extends JUnitSuite {
@Test
def testIterableConversion() = {
val it = Seq("1... | ReactiveX/RxScala | src/test/scala/rx/lang/scala/ScalaTypesConversionsTests.scala | Scala | apache-2.0 | 3,069 |
package unitspec
import org.scalatest._
abstract class UnitSpec extends FlatSpec with Matchers with
OptionValues with Inside with Inspectors | mvogiatzis/freq-count | src/test/scala/unitspec/UnitSpec.scala | Scala | mit | 142 |
/*
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... | zirpins/summingbird | summingbird-scalding/src/main/scala/com/twitter/summingbird/scalding/batch/BatchedOperations.scala | Scala | apache-2.0 | 2,234 |
/* Title: Pure/Admin/jenkins.scala
Author: Makarius
Support for Jenkins continuous integration service.
*/
package isabelle
import java.net.URL
import scala.util.matching.Regex
object Jenkins
{
/* server API */
def root(): String =
Isabelle_System.getenv_strict("ISABELLE_JENKINS_ROOT")
... | larsrh/libisabelle | modules/pide/2019-RC4/src/main/scala/Admin/jenkins.scala | Scala | apache-2.0 | 4,775 |
package org.concurrency.ch5
import scala.collection.parallel.Combiner
import scala.collection.mutable.ArrayBuffer
import scala.collection.parallel.mutable.ParArray
class ParStringCombiner extends Combiner[Char, ParString] {
private val chunks = new ArrayBuffer += new StringBuilder
private var sz = 0
private var... | marcos-sb/concurrent-programming-scala | src/main/scala-2.11/org/concurrency/ch5/ParStringCombiner.scala | Scala | apache-2.0 | 2,471 |
package org.brzy.validator.constraints
import org.scalatest.WordSpec
import org.scalatest.matchers.ShouldMatchers
class PatternSpec extends WordSpec with ShouldMatchers {
"Pattern validator" should {
"validate" in {
val pattern = Pattern("hello")
assert(pattern.isValid("hello you"))
}
"no... | m410/brzy | src/test/scala/org/brzy/validator/constraints/PatternSpec.scala | Scala | apache-2.0 | 426 |
package fr.acinq.eclair.blockchain
import akka.actor.ActorRef
import fr.acinq.bitcoin.Crypto.PublicKey
import fr.acinq.bitcoin.{ByteVector32, Script, ScriptWitness, Transaction}
import fr.acinq.eclair.channel.BitcoinEvent
import scodec.bits.ByteVector
import scala.util.{Success, Try}
sealed trait Watch {
def repl... | btcontract/wallet | app/src/main/java/fr/acinq/eclair/blockchain/WatcherTypes.scala | Scala | apache-2.0 | 2,257 |
package com.karasiq.shadowcloud.serialization.kryo
import com.esotericsoftware.kryo.Kryo
import com.esotericsoftware.kryo.io.{Input, Output}
import com.twitter.chill
import com.karasiq.shadowcloud.model.Timestamp
private[kryo] final class TimestampSerializer extends chill.KSerializer[Timestamp](false, true) {
def ... | Karasiq/shadowcloud | serialization/.jvm/src/main/scala/com/karasiq/shadowcloud/serialization/kryo/TimestampSerializer.scala | Scala | apache-2.0 | 825 |
package com.programmaticallyspeaking.ncd.nashorn
import com.programmaticallyspeaking.ncd.host.ValueNode
import com.sun.jdi._
/**
* Represents an object that doesn't exist in the remote VM.
*/
class LocalObject(val values: Map[String, ValueNode]) extends Value {
override def `type`(): Type = notSupported
overr... | provegard/ncdbg | src/main/scala/com/programmaticallyspeaking/ncd/nashorn/LocalObject.scala | Scala | bsd-3-clause | 465 |
package net.liftweb.markdown
/*
* Copyright 2013 WorldWide Conferencing, LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* U... | lzpfmh/framework-2 | core/markdown/src/test/scala/net/liftweb/markdown/BaseParsersTest.scala | Scala | apache-2.0 | 2,833 |
/*
* 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 | mllib/src/test/scala/org/apache/spark/ml/recommendation/ALSSuite.scala | Scala | apache-2.0 | 24,285 |
/* Ayasdi Inc. Copyright 2014 - all rights reserved. */
/**
* @author abhishek, ajith, mohit
* big dataframe on spark: wrappers for python access via py4j
*/
package org.apache.spark
import java.util.{ArrayList => JArrayList}
import scala.collection.JavaConverters._
import scala.reflect.ClassTag
import ne... | AyasdiOpenSource/bigdf | src/main/scala/com/ayasdi/bigdf/BigDFPyRDD.scala | Scala | apache-2.0 | 1,181 |
/**
* Copyright (C) 2013 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 prog... | evlist/orbeon-forms | src/test/scala/org/orbeon/oxf/client/CombinedClientTest.scala | Scala | lgpl-2.1 | 1,176 |
/*
* 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 ... | mihbor/kafka | core/src/test/scala/unit/kafka/cluster/PartitionTest.scala | Scala | apache-2.0 | 16,995 |
package org.bitcoins.core.protocol.ln
import org.bitcoins.crypto._
import scodec.bits.ByteVector
/** Payment preimage for generating LN invoices.
*/
final case class PaymentPreimage(bytes: ByteVector) extends NetworkElement {
require(bytes.size == 32, s"Payment preimage size must be 32 bytes")
lazy val hash: S... | bitcoin-s/bitcoin-s | core/src/main/scala/org/bitcoins/core/protocol/ln/PaymentPreimage.scala | Scala | mit | 603 |
package io.buoyant.router.http
import com.twitter.finagle.http.Fields._
import com.twitter.finagle.http.{Message, Request, Response}
import com.twitter.finagle.{Service, ServiceFactory, SimpleFilter, Stack}
object StripHopByHopHeadersFilter {
object HopByHopHeaders {
def scrub(msg: Message): Unit = {
va... | denverwilliams/linkerd | router/http/src/main/scala/io/buoyant/router/http/StripHopByHopHeadersFilter.scala | Scala | apache-2.0 | 1,577 |
package pl.newicom.dddd.eventhandling
import akka.actor.ActorRef
import pl.newicom.dddd.messaging.event.OfficeEventMessage
trait EventHandler {
def handle(senderRef: ActorRef, event: OfficeEventMessage)
}
| odd/akka-ddd | akka-ddd-core/src/main/scala/pl/newicom/dddd/eventhandling/EventHandler.scala | Scala | mit | 209 |
/*
* Copyright (c) 2013 Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* 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 Fou... | TiarkRompf/lancet | src/main/scala/generated/scala/BinarizedGradientTemplate.scala | Scala | agpl-3.0 | 1,792 |
package com.scalableminds.webknossos.datastore.models
import com.scalableminds.webknossos.datastore.models.datasource.DataLayer
import com.scalableminds.util.geometry.{BoundingBox, Vec3Int}
import org.apache.commons.lang3.builder.HashCodeBuilder
trait GenericPosition {
def x: Int
def y: Int
def z: Int
}
class ... | scalableminds/webknossos | webknossos-datastore/app/com/scalableminds/webknossos/datastore/models/Positions.scala | Scala | agpl-3.0 | 3,871 |
package se.chimps.cameltow.modules
import se.chimps.cameltow.{CameltowApp}
import com.google.inject.{Guice => Juice, Injector, Module}
import se.chimps.cameltow.lifecycle.Lifecycle
import scala.collection.mutable
import scala.collection.JavaConversions._
import scala.Some
import se.chimps.cameltow.exceptions.NotStarte... | Meduzz/Cameltow | src/main/scala/se/chimps/cameltow/modules/DependencyInjection.scala | Scala | gpl-2.0 | 2,577 |
/* ____ ___ *\\
** / __ | ___ ____ /__/___ A library of building blocks **
** / __ / __ |/ ___|/ / ___| **
** / /_/ / /_/ /\\__ \\/ /\\__ \\ (c) 2012-2013 Reify It **
** |_____/\\__... | ReifyIt/ortho-basis | basis-dispatch/src/main/scala/basis/dispatch/process/AsyncState.scala | Scala | mit | 1,692 |
package io.iohk.ethereum.metrics
import java.util.concurrent.atomic.{AtomicBoolean, AtomicInteger}
/**
* A gauge that starts at `0` and can be triggered to go to `1`.
* Next time it is sampled, it goes back to `0`.
* This is normally used for either one-off signals (e.g. when an application starts)
* or slowl... | input-output-hk/etc-client | src/main/scala/io/iohk/ethereum/metrics/DeltaSpikeGauge.scala | Scala | mit | 1,129 |
/*
* Copyright (c) 2013 Daniel Krzywicki <[email protected]>
*
* 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
... | eleaar/scala-mas | core/src/main/scala/pl/edu/agh/scalamas/stats/StatsFactory.scala | Scala | mit | 2,348 |
package org.tesserae
import org.slf4j.LoggerFactory
import java.util.concurrent.locks.ReentrantReadWriteLock
import org.iq80.leveldb.{CompressionType, Options, DB}
import java.io.File
import org.fusesource.leveldbjni.JniDBFactory._
import scala.Some
/**
* Manage any LevelDB database connections. Once established, a ... | eberle1080/tesserae-ng | text-analysis/src/main/scala/db/LevelDBManager.scala | Scala | bsd-2-clause | 2,380 |
class a {
ne/*caret*/
}
/*
new
*/ | ilinum/intellij-scala | testdata/keywordCompletion/expressions/new.scala | Scala | apache-2.0 | 35 |
package org.pfcoperez.dailyalgorithm.numericmethods.random
import org.pfcoperez.dailyalgorithm.numericmethods.random.DistributionRandomGenerator.DensityFunction
import org.pfcoperez.dailyalgorithm.numericmethods.random.impl.DoubleRandomGen
class DistributionRandomGenerator private (
private val randomDoubleGen: Ran... | pfcoperez/algorithmaday | src/main/scala/org/pfcoperez/dailyalgorithm/numericmethods/random/DistributionRandomGenerator.scala | Scala | gpl-3.0 | 2,713 |
package codemodels.incrementalparsers.javaip
import name.lakhin.eliah.projects.papacarlo.lexis.{Matcher, Tokenizer,
Contextualizer, Token}
import name.lakhin.eliah.projects.papacarlo.{Syntax, Lexer}
import name.lakhin.eliah.projects.papacarlo.syntax.Rule
import name.lakhin.eliah.projects.papacarlo.syntax.Expressions... | ftomassetti/JavaIncrementalParser | src/main/scala/javaip.scala | Scala | apache-2.0 | 28,254 |
/*
* 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 ... | mylog00/flink | flink-libraries/flink-table/src/test/scala/org/apache/flink/table/runtime/stream/table/TableSinkITCase.scala | Scala | apache-2.0 | 25,742 |
import org.apache.spark._
import org.apache.spark.sql.SQLContext
import org.apache.spark.mllib.feature.HashingTF
import org.apache.spark.mllib.clustering.KMeans
object Main {
def main(args: Array[String]) {
val conf = new SparkConf().setAppName("test").setMaster("local[*]")
val sc = new SparkContext(conf)
... | OmniaGM/spark-training | examples/twitter/scala/Main.scala | Scala | mit | 893 |
/* __ *\\
** ________ ___ / / ___ Scala API **
** / __/ __// _ | / / / _ | (c) 2003-2010, LAMP/EPFL **
** __\\ \\/ /__/ __ |/ /__/ __ | **
** /____/\\___/_/... | cran/rkafkajars | java/scala/util/logging/ConsoleLogger.scala | Scala | apache-2.0 | 915 |
import org.apache.hadoop.conf.Configuration
import org.apache.spark. {
SparkContext,
SparkConf
}
import org.apache.spark.rdd.RDD
import com.mongodb.MongoClient
import org.bson.BSONObject
import com.mongodb.hadoop. {
MongoInputFormat,
MongoOutputFormat,
BSONFileInputFormat,
BSONFileOutputFormat
}
import com.mongod... | StatisticalProject/CORDIR | makeLSA.scala | Scala | apache-2.0 | 5,675 |
import java.io.File
import testgen.TestSuiteBuilder.{toString, _}
import testgen._
object FlattenArrayTestGenerator {
def main(args: Array[String]): Unit = {
val file = new File("src/main/resources/flatten-array.json")
def sutArgsFromInput(parseResult: CanonicalDataParser.ParseResult, argNames: String*): S... | ricemery/xscala | testgen/src/main/scala/FlattenArrayTestGenerator.scala | Scala | mit | 1,512 |
/*
* 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 ... | ahnqirage/spark | core/src/main/scala/org/apache/spark/api/java/JavaPairRDD.scala | Scala | apache-2.0 | 46,844 |
package com.datastax.spark.connector.rdd.partitioner
import com.datastax.spark.connector.rdd.partitioner.dht.LongToken
/** Fast token range splitter assuming that data are spread out evenly in the whole range. */
private[partitioner] class Murmur3PartitionerTokenRangeSplitter
extends TokenRangeSplitter[Long, LongTo... | ponkin/spark-cassandra-connector | spark-cassandra-connector/src/main/scala/com/datastax/spark/connector/rdd/partitioner/Murmur3PartitionerTokenRangeSplitter.scala | Scala | apache-2.0 | 967 |
/*
* 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 ... | themarkypantz/kafka | core/src/main/scala/kafka/tools/GetOffsetShell.scala | Scala | apache-2.0 | 5,320 |
package modules
import com.mohiva.play.silhouette.api.util.PasswordInfo
import com.mohiva.play.silhouette.impl.daos.DelegableAuthInfoDAO
import com.mohiva.play.silhouette.impl.repositories.DelegableAuthInfoRepository
import models.daos.passwordinfo.PasswordInfoDao
import play.api.libs.concurrent.Execution.Implic... | mb720/cvs | app/modules/AuthInfoServiceModule.scala | Scala | bsd-2-clause | 647 |
package org.jetbrains.plugins.scala.lang.psi.light
import com.intellij.psi._
import com.intellij.psi.util.PsiTreeUtil
import org.jetbrains.plugins.scala.lang.psi.ScalaPsiUtil
import org.jetbrains.plugins.scala.lang.psi.api.statements.ScAnnotationsHolder
import org.jetbrains.plugins.scala.lang.psi.api.toplevel.typedef.... | ilinum/intellij-scala | src/org/jetbrains/plugins/scala/lang/psi/light/PsiTypedDefinitionWrapper.scala | Scala | apache-2.0 | 6,624 |
package play.api.cache.redis.impl
import scala.concurrent.{ExecutionContext, Future}
/**
* Invocation policy implements whether to wait for the operation result or not.
* This applies only in the limited number of operations. The best examples are `getOrElse`
* and `getOrFuture`. First, both methods invoke `get... | KarelCemus/play-redis | src/main/scala/play/api/cache/redis/impl/InvocationPolicy.scala | Scala | mpl-2.0 | 1,119 |
package com.twitter.finagle.util
import org.scalatest.FunSuite
import com.twitter.finagle.core.util.InetAddressUtil
import java.net.InetAddress
class InetAddressUtilTest extends FunSuite {
test("InetAddressUtil should isPrivateAddress") {
import InetAddressUtil.isPrivateAddress
assert(!isPrivateAddress(Ine... | luciferous/finagle | finagle-core/src/test/scala/com/twitter/finagle/util/InetAddressUtilTest.scala | Scala | apache-2.0 | 1,394 |
package com.datamountaineer.streamreactor.connect.converters.source
import java.util
import org.apache.kafka.connect.data.Schema
import org.apache.kafka.connect.data.SchemaAndValue
import org.apache.kafka.connect.json.JsonConverter
/**
* A Json converter built with resilience, meaning that malformed Json messages ... | datamountaineer/kafka-connect-common | src/main/scala/com/datamountaineer/streamreactor/connect/converters/source/JsonResilientConverter.scala | Scala | apache-2.0 | 1,058 |
package samples.scalaexchange.step2
import akka.actor.ActorSystem
import akka.http.scaladsl.Http
import akka.http.scaladsl.server._
import akka.stream.ActorMaterializer
import samples.scalaexchange.utils.SampleApp
import scala.io.StdIn
object HttpServiceApp extends SampleApp
with HelloWorldService {
val myExcep... | ktoso/akka-scala-exchange | src/main/scala/samples/scalaexchange/step2/HttpServiceApp.scala | Scala | apache-2.0 | 700 |
package com.github.jarlakxen.reactive.ftp
import scala.concurrent._
import scala.concurrent.duration._
import akka.actor.ActorSystem
import akka.stream.ActorMaterializer
import akka.stream.scaladsl._
import akka.testkit._
import akka.util.ByteString
import org.junit.runner.RunWith
import org.specs2.concurrent.Execut... | Jarlakxen/reactive-ftp | src/test/scala/com/github/jarlakxen/reactive/ftp/FtpSpecs.scala | Scala | apache-2.0 | 1,844 |
/* __ *\\
** ________ ___ / / ___ __ ____ Scala.js tools **
** / __/ __// _ | / / / _ | __ / // __/ (c) 2013-2014, LAMP/EPFL **
** __\\ \\/ /__/ __ |/ /__/ __ |/_// /_\\ \\ http://scala-js.org/ **
** /____/\\___/... | mdedetrich/scala-js | tools/shared/src/main/scala/org/scalajs/core/tools/javascript/JSBuilders.scala | Scala | bsd-3-clause | 4,783 |
package scala.collection.mutable
import org.junit.Test
import org.junit.runner.RunWith
import org.junit.runners.JUnit4
import org.junit.Assert._
import scala.tools.testkit.AssertUtil._
@RunWith(classOf[JUnit4])
class BitSetTest {
// Test for scala/bug#8910
@Test def capacityExpansionTest(): Unit = {
val bitS... | martijnhoekstra/scala | test/junit/scala/collection/mutable/BitSetTest.scala | Scala | apache-2.0 | 4,770 |
package org.positronicnet.sample.contacts
import org.positronicnet.ui._
import org.positronicnet.notifications.Actions._
import org.positronicnet.notifications.Future
import org.positronicnet.content.PositronicContentResolver
import android.util.Log
import android.os.Bundle
import android.content.{Context, Intent}
im... | rst/positronic_net | sample/contacts_app/src/main/scala/ViewContactActivity.scala | Scala | bsd-3-clause | 1,324 |
import scala.tools.partest.ReplTest
object Test extends ReplTest {
override def extraSettings = s"-Yrepl-outdir ${testOutput.path}"
def code = """
case class Bippy(x: Int)
val x = Bippy(1)
$intp.reporter.withoutUnwrapping {
println($intp.showDirectory)
}
"""
}
| lrytz/scala | test/files/run/repl-out-dir.scala | Scala | apache-2.0 | 272 |
import javax.servlet.ServletContext
import com.example.www.servlet.TestServlet
import org.scalatra.LifeCycle
class ScalatraBootstrap extends LifeCycle {
override def init(context: ServletContext) {
context.mount(new TestServlet, "/*")
}
}
| shyknight786/demo-scalatra-angularapp | src/main/scala/ScalatraBootstrap.scala | Scala | apache-2.0 | 253 |
/**
* 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... | usakey/kafka | core/src/test/scala/unit/kafka/zk/ZooKeeperTestHarness.scala | Scala | apache-2.0 | 1,534 |
package io.drakon.icarus
import cpw.mods.fml.common.Mod
import cpw.mods.fml.common.Mod.EventHandler
import cpw.mods.fml.common.event.{FMLPostInitializationEvent, FMLInitializationEvent, FMLPreInitializationEvent}
import io.drakon.icarus.jetty.JettyHandler
import io.drakon.icarus.lib.Config
import io.drakon.icarus.prom... | Emberwalker/Icarus | src/main/scala/io/drakon/icarus/Icarus.scala | Scala | mit | 1,064 |
/*
@meta {
"processorId": "org.helgoboss.scala_bundle:1.0.0",
"projectId": "org.helgoboss:drop-cms-groovy-request-processor:1.0",
"dependencies": [
"com.weiglewilczek.scala-lang-osgi:scala-library:2.9.1",
"javax.servlet:servlet-api:2.5",
"org.helgoboss:drop-cms-request-processor:1.0",
... | helgoboss/drop-cms-groovy-request-processor | org.helgoboss.drop-cms-groovy-request-processor.scala | Scala | mit | 2,734 |
/*
* 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 | core/src/test/scala/org/apache/spark/deploy/history/HistoryServerArgumentsSuite.scala | Scala | apache-2.0 | 2,853 |
package se.lu.nateko.cp.data.test.formats.delimitedheadercsv
import java.io.File
import akka.actor.ActorSystem
import akka.stream.Materializer
import akka.stream.scaladsl.{Sink, StreamConverters}
import org.scalatest.BeforeAndAfterAll
import org.scalatest.funsuite.AnyFunSuite
import se.lu.nateko.cp.data.formats._
imp... | ICOS-Carbon-Portal/data | src/test/scala/se/lu/nateko/cp/data/test/formats/delimitedheadercsv/SitesDailyDelimitedHeaderCsvStreamsTests.scala | Scala | gpl-3.0 | 2,795 |
package messages
import messages.parser.MessageConstants._
import messages.parser._
import tests.TestWordSpec
class MessageParserSpec extends TestWordSpec {
val parser = new MessageParser()
"Parser" should {
"parse simple send with text" in {
parser.parse("send to \\"user\\" message \\"sample-text\\"... | lymr/fun-chat | fun-chat-server/src/test/scala/messages/MessageParserSpec.scala | Scala | mit | 1,569 |
/*
* 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 ... | brad-kaiser/spark | sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveStrategies.scala | Scala | apache-2.0 | 11,059 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | pronix/spark | sql/core/src/main/scala/org/apache/spark/sql/execution/rowFormatConverters.scala | Scala | apache-2.0 | 4,591 |
/*
* 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/models/StreamingContextStatusEnum.scala | Scala | apache-2.0 | 861 |
/*
* SVMAdapter.scala is part of grado_informatica_tfg_naturallanguageprocessing (grado_informatica_TFG_NaturalLanguageProcessing).
*
* grado_informatica_TFG_NaturalLanguageProcessing is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as publis... | algui91/NLP_Dependency_Parsing | src/main/scala/com/elbauldelprogramador/nlp/svm/SVMAdapter.scala | Scala | gpl-3.0 | 2,669 |
/* sbt -- Simple Build Tool
* Copyright 2008, 2009 Mark Harrah
*/
package xsbt
import xsbti.Logger
import scala.tools.nsc.{GenericRunnerCommand, Interpreter, InterpreterLoop, ObjectRunner, Settings}
import scala.tools.nsc.interpreter.InteractiveReader
import scala.tools.nsc.reporters.Reporter
import scala.tools.nsc.... | olove/xsbt | compile/interface/src/main/scala/xsbt/ConsoleInterface.scala | Scala | bsd-3-clause | 2,753 |
package pl.touk.nussknacker.engine.requestresponse
import cats.Monad
import cats.data.Validated.{Invalid, Valid}
import cats.data.{NonEmptyList, Validated, ValidatedNel, WriterT}
import cats.implicits.toFunctorOps
import io.circe.Json
import io.circe.syntax._
import pl.touk.nussknacker.engine.Interpreter.InterpreterSh... | TouK/nussknacker | engine/lite/request-response/runtime/src/main/scala/pl/touk/nussknacker/engine/requestresponse/RequestResponseInterpreter.scala | Scala | apache-2.0 | 5,404 |
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... | danilovsergey/i-bur | modules/socket/src/main/Handler.scala | Scala | mit | 1,862 |
/*
* Copyright (c) 2014-2015 Snowplow Analytics Ltd. All rights reserved.
*
* This program is licensed to you under the Apache License Version 2.0,
* and you may not use this file except in compliance with the Apache License Version 2.0.
* You may obtain a copy of the Apache License Version 2.0 at http://www.apach... | mdavid/lessig-bigdata | lib/snowplow/3-enrich/scala-common-enrich/src/main/scala/com.snowplowanalytics.snowplow.enrich/common/adapters/registry/CloudfrontAccessLogAdapter.scala | Scala | mit | 7,497 |
package com.plasmaconduit.framework.middleware
import com.plasmaconduit.edge.http._
import com.plasmaconduit.framework.mvc.controllers.AdhocController
import com.plasmaconduit.framework.mvc.{Controller, Middleware}
import com.plasmaconduit.waterhouse.{Hash, HashAlgorithm}
import io.netty.buffer.{ByteBuf, Unpooled}
fi... | plasmaconduit/etag-cache-middleware | src/main/scala/com/plasmaconduit/framework/middleware/EtagCacheMiddleware.scala | Scala | mit | 1,189 |
package com.kostassoid.materialist
case class Route(source: Source, target: Target, operationPredicate: StorageOperation ⇒ Boolean) | Kostassoid/materialist | src/main/scala/com/kostassoid/materialist/Route.scala | Scala | apache-2.0 | 134 |
/*
* 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/scalactic-test/src/test/scala/org/scalactic/OrSpec.scala | Scala | apache-2.0 | 28,773 |
package com.arcusys.learn.web
import com.arcusys.learn.controllers.api.BaseApiController
import com.arcusys.valamis.file.service.FileService
import com.arcusys.valamis.util.FileSystemUtil
import com.escalatesoft.subcut.inject.BindingModule
import com.arcusys.learn.ioc.Configuration
import org.scalatra.servlet.F... | ViLPy/Valamis | learn-portlet/src/main/scala/com/arcusys/learn/web/FileStorageFilter.scala | Scala | lgpl-3.0 | 1,522 |
//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
/** @author John Miller
* @version 1.3
* @date Wed May 28 16:06:12 EDT 2014
* @see LICENSE (MIT style license file).
*
* @see www.math.pitt.edu/~sussmanm//2071Spring08/lab09/index.html
* @see www.netlib.org/lapack/lawns... | NBKlepp/fda | scalation_1.3/scalation_mathstat/src/main/scala/scalation/linalgebra/SVD3.scala | Scala | mit | 29,510 |
/*
* 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 | core/src/test/scala/org/apache/spark/shuffle/sort/IndexShuffleBlockResolverSuite.scala | Scala | apache-2.0 | 5,788 |
package shapes.untouchable
sealed trait Shape
final case class Square(a: Double) extends Shape
final case class Circle(r: Double) extends Shape
| tupol/scala-patterns-tc-pml | src/main/scala/shapes/untouchable/Shape.scala | Scala | apache-2.0 | 148 |
package com.typesafe.slick.docs
import scala.collection.mutable.ArrayBuffer
import scala.concurrent.{Future, Await}
import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.duration.Duration
//#imports
import slick.jdbc.H2Profile.api._
//#imports
import slick.jdbc.GetResult
import slick.jdbc.... | slick/slick | doc/code/PlainSQL.scala | Scala | bsd-2-clause | 5,715 |
trait X { def foo: PartialFunction[Int, Int] }
trait Y extends X {
// Inferred type was AbstractPartialFunction[Int, Int] with Serializable
abstract override def foo = { case i => super.foo(i) * 2 }
}
trait Z extends X {
// ditto
abstract override def foo = { case i => super.foo(i) + 3 }
}
trait Comb extends ... | som-snytt/dotty | tests/pos/t6575a.scala | Scala | apache-2.0 | 462 |
package domain.user
import domain.{ Entity, Enum, EnumEntry, ValueObject }
/**
* ユーザ情報.
* @param userId ユーザID
* @param name ユーザ名
* @param loginId ログインID
* @param authority ユーザ権限
* @param lockVersion lockVersion
*/
case class User(
userId: Option[UserId],
loginId: String,
name: String,
authority... | nemuzuka/vss-kanban | src/main/scala/domain/user/User.scala | Scala | mit | 1,115 |
/*
* 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-finagle/src/test/scala/com/outworkers/phantom/finagle/query/prepared/BatchablePreparedInsertQueryTest.scala | Scala | apache-2.0 | 2,098 |
package tastytest
object AnythingIsPossible {
class Box[A](val a: A)
class Class extends Box({ class X { final val x = Map(("", 3)) } ; val foo = new X(); foo.x: foo.x.type })
class Lambda extends Box((x: Int) => (y: String) => y.length == x)
object Zero {
def unapply[A: Numeric](a: A): Boolean = impli... | lrytz/scala | test/tasty/run/src-3/tastytest/AnythingIsPossible.scala | Scala | apache-2.0 | 1,058 |
package com.twitter.finatra.example
import java.util.concurrent.atomic.AtomicInteger
import javax.inject.Singleton
@Singleton
class TestQueue extends Queue(Integer.MAX_VALUE) {
val addCounter: AtomicInteger = new AtomicInteger(0)
override def add(value: String): Boolean = {
addCounter.incrementAndGet()
s... | twitter/finatra | examples/injectable-twitter-server/scala/src/test/scala/com/twitter/finatra/example/TestQueue.scala | Scala | apache-2.0 | 342 |
/*
* Copyright 2017-2020 47 Degrees, LLC. <http://www.47deg.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 require... | frees-io/freestyle-rpc | modules/kafka/src/main/scala/higherkindness/mu/format/Deserialiser.scala | Scala | apache-2.0 | 726 |
package scalaz.stream.mongodb.query
import com.mongodb.{BasicDBObject, DBObject}
import collection.JavaConverters._
/**
* Simple key-value query to mongo
*/
case class BasicQuery(o: DBObject = new BasicDBObject) {
/**
* Normalizes query so in case there are no operands between predicates, `$and` is inject... | Spinoco/scalaz-stream-mongodb | core/src/main/scala/scalaz/stream/mongodb/query/BasicQuery.scala | Scala | mit | 1,409 |
package filodb.query.exec.aggregator
import filodb.core.metadata.Column.ColumnType
import filodb.core.query._
import filodb.memory.format.RowReader
/**
* Map: Every sample is mapped to three values: (a) the stddev value "0" and (b) the value itself
* (c) and its count value "1"
* ReduceAggregate: Similar as red... | filodb/FiloDB | query/src/main/scala/filodb/query/exec/aggregator/StddevRowAggregator.scala | Scala | apache-2.0 | 3,015 |
/**
* 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... | linzhe/matrix | src/main/scala/org/apache/spark/framework/operator/AbstractOperator.scala | Scala | apache-2.0 | 1,322 |
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.