code stringlengths 5 1M | repo_name stringlengths 5 109 | path stringlengths 6 208 | language stringclasses 1
value | license stringclasses 15
values | size int64 5 1M |
|---|---|---|---|---|---|
package chandu0101.scalajs.rn.apis
import scala.scalajs.js
class Fetch extends js.Object {
// def this(request : js.Object) : Promise[js.Dynamic] = this()
}
//object Fetch | beni55/scalajs-react-native | core/src/main/scala/chandu0101/scalajs/rn/apis/Fetch.scala | Scala | apache-2.0 | 179 |
package twitter4s
import com.typesafe.config.ConfigFactory
import http.client.connection.impl.PlayWSHttpConnection
import http.client.method.GetMethod
import http.client.response.HttpHeader
import org.scalatest._
import twitter4s.request.{TwitterAuthorizationHeader, TwitterTimelineRequest}
import scala.concurrent.dur... | SocialOrra/social4s | twitter4s/src/test/scala/twitter4s/TwitterRequestSpec.scala | Scala | apache-2.0 | 2,024 |
package com.twitter.finagle.dispatch
import com.twitter.finagle.stats.InMemoryStatsReceiver
import com.twitter.finagle.transport.Transport
import com.twitter.finagle.{Failure, WriteException}
import com.twitter.util.{Future, Promise, Return, Throw}
import org.junit.runner.RunWith
import org.mockito.Matchers._
import o... | liamstewart/finagle | finagle-core/src/test/scala/com/twitter/finagle/dispatch/ClientDispatcherTest.scala | Scala | apache-2.0 | 4,254 |
object Macros {
import scala.language.implicitConversions
implicit def foo(x: String): Option[Int] = macro Impls.foo
}
object Test extends App {
import Macros._
println("2": Option[Int])
val s: Int = "2" getOrElse 0
println(s)
}
| som-snytt/dotty | tests/disabled/macro/run/macro-expand-implicit-macro-is-implicit/Macros_Test_2.scala | Scala | apache-2.0 | 242 |
package org.jetbrains.plugins.scala
package lang
package psi
package impl
package expr
package xml
import _root_.org.jetbrains.plugins.scala.lang.psi.types.{ScType, ScalaType}
import com.intellij.lang.ASTNode
import org.jetbrains.plugins.scala.lang.psi.api.expr.xml._
import org.jetbrains.plugins.scala.lang.psi.api.top... | jastice/intellij-scala | scala/scala-impl/src/org/jetbrains/plugins/scala/lang/psi/impl/expr/xml/ScXmlExprImpl.scala | Scala | apache-2.0 | 1,379 |
/*
* 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 ... | style95/openwhisk | common/scala/src/main/scala/org/apache/openwhisk/core/entity/Annotations.scala | Scala | apache-2.0 | 1,310 |
import scala.tools.partest.Util.ArrayDeep
import scala.reflect.runtime.universe._
import scala.reflect.{ClassTag, classTag}
object Test extends App {
Test1
Test2
}
class Foo[T](x: T)
trait Bar[T] { def f: T }
object Test1 extends TestUtil {
print(())
print(true)
print('a')
print(1)
print("abc")
print... | lrytz/scala | test/files/jvm/manifests-new.scala | Scala | apache-2.0 | 3,839 |
package ru.mipt.acsl.decode.idea.plugin
import com.intellij.openapi.actionSystem.DefaultActionGroup
/**
* @author Artem Shein
*/
class DecodeActionGroup extends DefaultActionGroup
| acsl-mipt/decode-idea-plugin | src/main/scala/ru/mipt/acsl/decode/idea/plugin/DecodeActionGroup.scala | Scala | mit | 184 |
package jobs
import com.quantifind.sumac.validation.Required
import com.quantifind.sumac.{ArgMain, FieldArgs}
import core.utils.SparkUtils
import org.apache.accumulo.core.client.ZooKeeperInstance
import org.apache.accumulo.core.client.mapreduce.AccumuloInputFormat
import org.apache.accumulo.core.client.mapreduce.lib.u... | pomadchin/accumulo-spark-sample | src/main/scala/jobs/AccumuloTest.scala | Scala | apache-2.0 | 1,686 |
/**
* 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/test/scala/org/bdgenomics/avocado/genotyping/BiallelicGenotyperSuite.scala | Scala | apache-2.0 | 4,430 |
/**
* 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... | themarkypantz/kafka | core/src/main/scala/kafka/admin/ConfigCommand.scala | Scala | apache-2.0 | 17,391 |
/*
* Copyright (c) 2016 Frank S. Thomas
*
* 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 ag... | isaka/shapeless | core/src/test/scala/shapeless/compiletime.scala | Scala | apache-2.0 | 884 |
/**
* Clase de utilidad para representar conjuntos de tweets con temas de
* google y apple, junto con un objeto de la clase Tendencia con todos
* ellos
*/
object TerminosGoogleApple {
// Lista de terminos de interes para google
val google = List("android", "Android", "galaxy", "Galaxy", "nexus", "Nexus")
... | fblupi/grado_informatica-NTP | Practicas/P4/src/Main.scala | Scala | gpl-2.0 | 2,510 |
package sample.model.account
import scalikejdbc._
import sample._
import sample.context._
import sample.context.orm.SkinnyORMMapper
/**
* 口座に紐づく金融機関口座を表現します。
* <p>口座を相手方とする入出金で利用します。
* low: サンプルなので支店や名称、名義といった本来必須な情報をかなり省略しています。(通常は全銀仕様を踏襲します)
*/
case class FiAccount(
/** ID */
id: Long,
/** 口座ID */
accou... | jkazama/sample-boot-scala | src/main/scala/sample/model/account/FiAccount.scala | Scala | mit | 1,239 |
package bad.robot.radiate
import scalaz.{-\\/, \\/-, \\/}
object Sequence {
def sequence[E, A](list: List[E \\/ A]): List[E] \\/ List[A] = {
list.partition(_.isLeft) match {
case (Nil, successes) => \\/-(for (\\/-(success) <- successes) yield success)
case (errors, _) => -\\/(for (-\\/(error) <- err... | tobyweston/radiate | src/main/scala/bad/robot/radiate/Sequence.scala | Scala | apache-2.0 | 340 |
/***********************************************************************
* Copyright (c) 2013-2016 Commonwealth Computer Research, Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Apache License, Version 2.0
* which accompanies this distribution and is ... | nagavallia/geomesa | geomesa-kafka/geomesa-kafka-datastore/geomesa-kafka-datastore-common/src/main/scala/org/locationtech/geomesa/kafka/ReplayConfig.scala | Scala | apache-2.0 | 9,360 |
package com.socrata.querycoordinator
import com.socrata.querycoordinator.QueryRewriter.{Anal, RollupName}
import com.socrata.querycoordinator.util.Join
import com.socrata.soql.SoQLAnalysis
import com.socrata.soql.environment.ColumnName
import com.socrata.soql.types.SoQLType
class TestQueryRewriter extends TestQueryRe... | socrata-platform/query-coordinator | query-coordinator/src/test/scala/com/socrata/querycoordinator/TestQueryRewriter.scala | Scala | apache-2.0 | 18,106 |
/*
* 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 ... | reminisce/mxnet | scala-package/core/src/main/scala/org/apache/mxnet/SparseNDArray.scala | Scala | apache-2.0 | 7,021 |
package models.join
import models.db.{CreateShip, MasterShipBase}
import scalikejdbc._
/**
*
* @author ponkotuy
* Date: 14/04/20.
*/
case class CreateShipWithName(
fuel: Int, ammo: Int, steel: Int, bauxite: Int, develop: Int,
largeFlag: Boolean, created: Long, name: String, firstShip: Option[String])
ob... | ttdoda/MyFleetGirls | server/app/models/join/CreateShipWithName.scala | Scala | mit | 1,259 |
package foo
import org.openjdk.jmh.annotations.{Benchmark, Scope, State}
import java.nio.file.{Files, Paths}
class TestBenchmark {
@State(Scope.Benchmark)
class BenchmarkState {
val myScalaType = ScalaType(100)
val myJavaType = new JavaType
}
@Benchmark
def sumIntegersBenchmark: Int =
AddNumber... | smparkes/rules_scala | test/jmh/TestBenchmark.scala | Scala | apache-2.0 | 465 |
package uk.gov.gds.router.integration
import uk.gov.gds.router.util.JsonSerializer._
import uk.gov.gds.router.model._
class ApplicationsLifecycleTest
extends RouterIntegrationTestSetup {
test("can create and delete applications") {
given("A new application ID that does not exist in the router database")
... | gds-attic/scala-router | router/router-integration-tests/src/test/scala/uk/gov/gds/router/integration/ApplicationsLifecycleTest.scala | Scala | mit | 3,905 |
/*
* Copyright (C) 2016 Department for Business, Energy and Industrial Strategy
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) an... | UKGovernmentBEIS/rifs-business | src/test/scala/rifs/business/NotificationsTest.scala | Scala | gpl-3.0 | 6,367 |
package com.datastax.spark.connector.streaming
import java.net.InetAddress
import java.util.concurrent.CompletableFuture
import com.datastax.spark.connector._
import com.datastax.spark.connector.cluster.DefaultCluster
import com.datastax.spark.connector.cql.CassandraConnector
import com.datastax.spark.connector.testk... | datastax/spark-cassandra-connector | connector/src/it/scala/com/datastax/spark/connector/streaming/RDDStreamingSpec.scala | Scala | apache-2.0 | 6,576 |
/*
* 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 ... | ron8hu/spark | sql/hive/src/test/scala/org/apache/spark/sql/hive/HiveExternalCatalogVersionsSuite.scala | Scala | apache-2.0 | 10,190 |
package com.debasish.nlp.parsers
import opennlp.tools.cmdline.parser.ParserTool
import opennlp.tools.parser.{ParserFactory, ParserModel}
/**
* Created by debasish on 5/21/16.
*/
private[parsers] class OpenNlpParser extends Parser {
private[this] val path = getClass.getResource("/models/en-parser-chunking.bin"... | DEK11/MoreNLP | src/main/scala/com/debasish/nlp/parsers/OpenNlpParser.scala | Scala | apache-2.0 | 565 |
package de.metacoder.edwardthreadlocal.analysis
import de.metacoder.edwardthreadlocal.analysis.datamodel.CallData.{CallToRemove, CallToSet, CurrentValueInfo}
import de.metacoder.edwardthreadlocal.analysis.datamodel.{CallData, ValueInstanceID}
import scala.annotation.tailrec
import scala.language.postfixOps
object Fi... | metacoder/edward-tl | agent-impl/src/main/scala/de/metacoder/edwardthreadlocal/analysis/FindFaultySubSeries.scala | Scala | apache-2.0 | 2,698 |
package org.tribbloid.ispark.msg
import org.tribbloid.ispark.UUID
import org.tribbloid.ispark.display.{Data, MIME}
object ExecutionStatus extends Enumeration {
type ExecutionStatus = Value
val ok = Value
val error = Value
val abort = Value
}
object HistAccessType extends Enumeration {
type HistAccessType =... | deeplearning4j/ISpark | core/src/main/scala/org/tribbloid/ispark/msg/Msg.scala | Scala | apache-2.0 | 26,866 |
package com.microsoft.awt.data
import org.scalajs.nodejs.mongodb.{Collection, Db}
import scala.concurrent.ExecutionContext
import scala.scalajs.js
/**
* Post DAO
* @author lawrence.daniels@gmail.com
*/
@js.native
trait PostDAO extends Collection
/**
* Post DAO Companion
* @author lawrence.daniels@gmail.co... | ldaniels528/awt | app-nodejs/src/main/scala/com/microsoft/awt/data/PostDAO.scala | Scala | apache-2.0 | 621 |
package us.feliscat.text.normalizer.ja
import us.feliscat.m17n.JapaneseLocale
import us.feliscat.text.StringOption
import us.feliscat.text.normalizer.MultiLingualDictionaryBasedNormalizer
/**
* @author K.Sakamoto
* Created on 2016/08/06
*/
object JapaneseSentenceBeginningNormalizer
extends MultiLingua... | ktr-skmt/FelisCatusZero-multilingual | libraries/src/main/scala/us/feliscat/text/normalizer/ja/JapaneseSentenceBeginningNormalizer.scala | Scala | apache-2.0 | 584 |
/**
* Copyright 2017 Alessandro Simi
*
* 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 ... | alessandrosimi/aws-dynamodb-nio | dynamodb/src/test/scala/io/exemplary/aws/DynamoDBOperations.scala | Scala | apache-2.0 | 3,352 |
import scala.reflect.ClassTag
type Matcher[A] = A match { case String => String }
def patternMatch[A](a: Any)(using tt: ClassTag[Matcher[A]]): Option[Matcher[A]] = {
// type T = RDF.Triple[Rdf]
a match {
case res: Matcher[A] => Some(res)
case _ => None
}
}
def patternMatchWithAlias[A](a: Any)(using tt:... | lampepfl/dotty | tests/pos-special/fatal-warnings/i13433b.scala | Scala | apache-2.0 | 645 |
package at.forsyte.apalache.tla.bmcmt
import at.forsyte.apalache.tla.bmcmt.caches.{EqCache, EqCacheSnapshot}
import at.forsyte.apalache.tla.bmcmt.implicitConversions._
import at.forsyte.apalache.tla.bmcmt.rewriter.{ConstSimplifierForSmt, Recoverable}
import at.forsyte.apalache.tla.bmcmt.types._
import at.forsyte.apala... | konnov/apalache | tla-bmcmt/src/main/scala/at/forsyte/apalache/tla/bmcmt/LazyEquality.scala | Scala | apache-2.0 | 19,384 |
/**
* 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... | zheolong/kafka-manager | app/kafka/manager/utils/logkafka81/LogConfig.scala | Scala | apache-2.0 | 11,523 |
class A extends B {}
class B extends C {}
class C extends D {}
class D extends A {}
object Main { def main(args: Array[String]) { } }
| tobast/compil-petitscala | tests/typing/bad/testfile-cyclic3-1.scala | Scala | gpl-3.0 | 134 |
/*
* Skylark
* http://skylark.io
*
* Copyright 2012-2017 Quantarray, 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
*
* Unl... | quantarray/skylark | skylark-measure/src/main/scala/com/quantarray/skylark/measure/VolumeToExponentialLengthConverter.scala | Scala | apache-2.0 | 1,225 |
/**
* 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... | samaitra/kafka | core/src/main/scala/kafka/consumer/BaseConsumer.scala | Scala | apache-2.0 | 3,534 |
package scruffy.examples
import com.sksamuel.scruffy.undertow.ScruffyUndertowHttpHandler
import io.undertow.{UndertowOptions, Undertow}
/** @author Stephen Samuel */
object Main extends App {
val port = 8080
val scruffy = new ScruffyUndertowHttpHandler
scruffy.mount(new Test1Endpoint)
scruffy.mount(new Test... | hamiltont/FrameworkBenchmarks | frameworks/Scala/scruffy/src/main/scala/scruffy/examples/Main.scala | Scala | bsd-3-clause | 948 |
/**
* 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... | ErikKringen/kafka | core/src/main/scala/kafka/common/ZkNodeChangeNotificationListener.scala | Scala | apache-2.0 | 6,172 |
package com.arcusys.valamis.lesson.scorm.model
import com.arcusys.valamis.lesson.scorm.model.manifest._
import org.scalatest.FlatSpec
import org.scalatest.matchers.ShouldMatchers
class ConditionRuleItemSetTest extends FlatSpec with ShouldMatchers {
val condition1 = new ConditionRuleItem(ConditionType.ActivityAttemp... | igor-borisov/valamis | valamis-scorm-lesson/src/test/scala/com/arcusys/valamis/lesson/scorm/model/ConditionRuleItemSetTest.scala | Scala | gpl-3.0 | 1,492 |
package com.a.eye.gemini.analysis.executer.model
import com.google.gson.JsonObject
class RecevierPairsData extends Serializable {
var messageId: Long = _
var tcpSeq: String = _
var tcpAck: String = _
var tcpTime: Long = _
var reqData: Map[String, String] = _
var resData: Map[String, String] = _
var isPa... | skywalking-developer/gemini | gemini-analysis/src/main/scala/com/a/eye/gemini/analysis/executer/model/RecevierPairsData.scala | Scala | apache-2.0 | 337 |
/* Copyright (C) 2008-2014 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... | hlin117/factorie | src/main/scala/cc/factorie/variable/Assignment.scala | Scala | apache-2.0 | 16,416 |
/***********************************************************************
* Copyright (c) 2013-2020 Commonwealth Computer Research, Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Apache License, Version 2.0
* which accompanies this distribution and... | aheyne/geomesa | geomesa-kudu/geomesa-kudu-tools/src/main/scala/org/locationtech/geomesa/kudu/tools/ingest/KuduDeleteFeaturesCommand.scala | Scala | apache-2.0 | 1,356 |
/**
* Copyright 2017 Interel
*
* 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... | Interel-Group/core3 | src/main/scala/core3/http/controllers/local/ServiceController.scala | Scala | apache-2.0 | 16,886 |
package ch.fram.medlineGeo.explore
import javax.inject.Inject
import ch.fram.medlineGeo.explore.utils.DiskCache
import play.api.mvc.{Action, Controller}
/**
* Created by alex on 28/09/15.
*/
class CountryCountController @Inject()(cached: DiskCache) extends Controller {
def index = Action {
Ok("CountryCount... | alexmasselot/medlineGeoBackend | app/ch/fram/medlineGeo/explore/CountryCountController.scala | Scala | mit | 608 |
package scala_docs.zipfile
import java.util.zip.ZipEntry
sealed trait CompressionMethod
object CompressionMethod {
case object Stored extends CompressionMethod
case object Deflated extends CompressionMethod
def apply(i: Int): Option[CompressionMethod] = i match {
case -1 => None
case ZipEntry.STORED... | chris-martin/scala-docs | src/main/scala/scala_docs/zipfile/CompressionMethod.scala | Scala | cc0-1.0 | 460 |
package com.danielwestheide.kontextfrei
import org.apache.spark.Partitioner
object DummyRangePartitioner extends Partitioner {
override def numPartitions: Int = 2
override def getPartition(key: Any): Int = {
key match {
case x: Int =>
if (x < 0) 0
else 1
case _ => 0
}
... | dwestheide/kontextfrei | core/src/test/scala/com/danielwestheide/kontextfrei/DummyRangePartitioner.scala | Scala | apache-2.0 | 326 |
package users
/**
* Created by harsh on 10/8/14.
*/
//import java.util.Enumeration
import address.Address
import enumspckg.AddressType.AddressType
import enumspckg.AuthType.AuthType
import enumspckg.Country.Country
import enumspckg.Gender.Gender
import enumspckg.Industry.Industry
import enumspckg.MaritalStatus._
... | hardmettle/slick-postgress-samples | app/models/users/GlobalUsers.scala | Scala | apache-2.0 | 1,990 |
package hercules.config.masters
/**
* TODO I'm not sure that this is necessary. Maybe better to just use to
* the Typesafe Config directly instead? /JD 20141113
*
* Configure the master actor
*
* @param snapshotInterval how often to snapshot the state.
*/
case class MasterActorConfig(enablePersistence: Boolean,... | johandahlberg/hercules | src/main/scala/hercules/config/masters/MasterActorConfig.scala | Scala | mit | 348 |
package spark.scheduler.cluster
import spark.TaskState.TaskState
import java.nio.ByteBuffer
import spark.util.SerializableBuffer
sealed trait StandaloneClusterMessage extends Serializable
// Master to slaves
case class LaunchTask(task: TaskDescription) extends StandaloneClusterMessage
case class RegisteredSlave(spar... | ankurdave/arthur | core/src/main/scala/spark/scheduler/cluster/StandaloneClusterMessage.scala | Scala | bsd-3-clause | 1,156 |
/*
* Copyright 2014 Treode, 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... | Treode/store | disk/test/com/treode/disk/SegmentLedgerSpec.scala | Scala | apache-2.0 | 4,866 |
/*
* 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 ... | derrickburns/generalized-kmeans-clustering | src/main/scala/com/massivedatascience/clusterer/MultiKMeans.scala | Scala | apache-2.0 | 5,246 |
/*
* 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 ... | chenc10/Spark-PAF | core/src/main/scala/org/apache/spark/api/r/RUtils.scala | Scala | apache-2.0 | 3,829 |
package com.karasiq.shadowcloud.config
import com.karasiq.common.configs.ConfigImplicits
import com.karasiq.shadowcloud.ui.UIProvider
import com.karasiq.shadowcloud.ui.passwords.PasswordProvider
import com.typesafe.config.Config
private[shadowcloud] final case class UIConfig(rootConfig: Config, passwordProvider: Clas... | Karasiq/shadowcloud | core/src/main/scala/com/karasiq/shadowcloud/config/UIConfig.scala | Scala | apache-2.0 | 778 |
package dotty.tools.dotc.util
import scala.language.unsafeNulls
import java.net.URLClassLoader
import java.nio.file.Paths
import dotty.tools.repl.AbstractFileClassLoader
object ClasspathFromClassloader {
/** Attempt to recreate a classpath from a classloader.
*
* BEWARE: with exotic enough classloaders, t... | dotty-staging/dotty | compiler/src/dotty/tools/dotc/util/ClasspathFromClassloader.scala | Scala | apache-2.0 | 2,357 |
package eu.shiftforward
trait Tracer {
type Probe = (String, Connector[_])
def setProbes(probes: Probe*)
def trace(currentTime: Long)
def close() { }
}
object DummyTracer extends Tracer {
def setProbes(probes: Probe*) { }
def trace(currentTime: Long) { }
}
class ConsoleTracer extends Tracer {
var last... | hugoferreira/from-zero-to-computer | src/main/scala/eu/shiftforward/Tracer.scala | Scala | mit | 2,560 |
package processframework
import akka.actor.{ Actor, ActorContext, ActorRef, ActorSystem, Props }
import akka.testkit.{ TestActor, TestKit, TestProbe }
object ProcessStepTest {
case object Completed extends Process.Event
case object Response
case class Command(state: Int)
def testStep(executeProbe: ActorRef)(... | jgordijn/process | src/test/scala/processframework/ProcessStepTest.scala | Scala | apache-2.0 | 3,597 |
package outer
package nested
object indent1:
object inner:
def x: Int = 1
end inner
val y: Int = 2
end indent1
| som-snytt/dotty | tests/pos-special/sourcepath/outer/nested/indent1.scala | Scala | apache-2.0 | 122 |
package ca.uwaterloo.gsd.rangeFix
import org.kiama.rewriting.Rewriter
import org.kiama.rewriting.Rewriter._
object MyRewriter {
def everywheretdWithGuard(g: => Rewriter.Strategy,
s: => Rewriter.Strategy) : Rewriter.Strategy =
g <+ (attempt(s) <* (all (everywheretdWithGuard(g... | matachi/rangeFix | src/main/scala/util/rewriting.scala | Scala | mit | 531 |
/*
* Copyright (c) 2017 Magomed Abdurakhmanov, Hypertino
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
*/
package com.hypertino.hyperbus.transport
import com... | hypertino/hyperbus | hyperbus/src/test/scala/com/hypertino/hyperbus/transport/IdGeneratorSpec.scala | Scala | mpl-2.0 | 787 |
import com.mike_burns.ohlaunch
import org.scalatest.matchers.ShouldMatchers
import org.scalatest.Spec
class Specs extends Spec with ShouldMatchers {
describe("a spec") {
it("should do something") {
}
}
} | mike-burns/ohlaunch | src/test/scala/Specs.scala | Scala | bsd-3-clause | 216 |
package nodes.learning
import java.io.File
import breeze.linalg._
import breeze.numerics.{exp, log => bLog}
import breeze.stats._
import org.apache.spark.rdd.RDD
import pipelines.{Logging, Estimator}
import utils.MatrixUtils
/**
* Fit a Gaussian Mixture model to Data.
*
* @param k Number of centers to estimate.
... | shivaram/keystone | src/main/scala/nodes/learning/BensGMMEstimator.scala | Scala | apache-2.0 | 5,611 |
package com.dominikgruber.fpinscala.chapter08
import com.dominikgruber.fpinscala.chapter05.Stream
import com.dominikgruber.fpinscala.chapter06.{RNG, Simple}
import Prop._
case class Prop(run: (MaxSize, TestCases, RNG) => Result) {
/**
* Exercise 09
* Now that we have a representation of Prop, implement &&, a... | TheDom/functional-programming-in-scala | src/main/scala/com/dominikgruber/fpinscala/chapter08/Prop.scala | Scala | mit | 3,625 |
package controllers
import play.api.mvc.{Action, Controller}
import play.api.libs.json._
import apidoc.models.json._
import apidoc.models.sample.SampleImpl
object Samples extends Controller {
def getGuid(guid: String) = Action {
val sampleObj = SampleImpl(guid, "Gilt World")
Ok(Json.toJson(sampleObj))
}
... | gilt/activator-gilt-app | svc/app/controllers/Samples.scala | Scala | apache-2.0 | 322 |
package io.catbird.util.effect
import java.time.Instant
import java.util.concurrent.TimeUnit
import cats.effect.Clock
import com.twitter.util.Await
import io.catbird.util.Rerunnable
import org.scalatest.Outcome
import org.scalatest.concurrent.Eventually
import org.scalatest.funsuite.FixtureAnyFunSuite
/**
* We'll u... | travisbrown/catbird | effect/src/test/scala/io/catbird/util/effect/RerunnableClockSuite.scala | Scala | apache-2.0 | 1,590 |
/*
* 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 ... | michalsenkyr/spark | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/TypeCoercion.scala | Scala | apache-2.0 | 46,490 |
package eva4s
package matchmaking
import eva4s.util._
/** Returns the fittest individuals of `pairs` tournaments.
*
* There will be `pairs` tournaments to determine the pairs. Each tournament consists of
* `participants` randomly chosen participants. From these participants are the fittest two for the
* pair ... | wookietreiber/eva4s-old | core/main/scala/matchmaking/TournamentMatchmaker.scala | Scala | gpl-3.0 | 860 |
package com.softwaremill.bootzooka.common
import java.util.Random
object Utils {
def randomString(length: Int) = {
val sb = new StringBuffer()
val r = new Random()
for (i <- 1 to length) {
sb.append((r.nextInt(25) + 65).toChar) // A - Z
}
sb.toString
}
// see http://stackoverflow.... | aywengo/bootzooka | backend/src/main/scala/com/softwaremill/bootzooka/common/Utils.scala | Scala | apache-2.0 | 2,828 |
/*
* Copyright 2015 Databricks 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 ... | josiahsams/spark-sql-perf-spark2.0.0 | src/main/scala/com/databricks/spark/sql/perf/tpcds/Tables.scala | Scala | apache-2.0 | 27,893 |
/**
* 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... | ErikKringen/kafka | core/src/main/scala/kafka/log/LogConfig.scala | Scala | apache-2.0 | 16,860 |
package me.laiseca.urlmapper
import me.laiseca.urlmapper.trie.Trie
/**
* Created by Xabier Laiseca on 27/07/14.
*/
trait UrlMapper[T] {
def map(url: String): Option[T]
}
object UrlMapper {
private def toPathTrie[T] (wildcard: String, recursiveWildcard: String, mappings: (String, T)*): PathTrie[T] =
Trie((f... | xabierlaiseca/scala-urlmapper | src/main/scala/me/laiseca/urlmapper/UrlMapper.scala | Scala | apache-2.0 | 2,919 |
package quizleague.firestore
object Connection{
val apiKey = "AIzaSyBs6LpcOSpLMlKlzw0aPB6Ie-39mqlKrm8"
val authDomain = "chiltern-ql-firestore.firebaseapp.com"
val databaseURL = "https://chiltern-ql-firestore.firebaseio.com"
val projectId = "chiltern-ql-firestore"
val storageBucket = "chiltern-ql-firestore.... | gumdrop/quizleague-maintain | shared/src/main/scala/quizleague/firestore/Connection.scala | Scala | mit | 1,114 |
// Jubatus: Online machine learning framework for distributed environment
// Copyright (C) 2014-2015 Preferred Networks and Nippon Telegraph and Telephone Corporation.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License version 2.1... | jubatus/jubaql-server | processor/src/test/scala/us/jubat/jubaql_server/processor/SlidingStreamSpec.scala | Scala | lgpl-2.1 | 12,531 |
package me.venuatu.background_tracker
import android.app.Fragment
import android.os.Bundle
import android.view._
import macroid.{Contexts, IdGeneration}
class BaseFragment(layout: Int = -1, menuLayout: Int = -1) extends Fragment with Contexts[Fragment] with IdGeneration {
def ctx = getActivity.asInstanceOf[BaseActi... | venuatu/background-tracker | src/main/scala/me/venuatu/background_tracker/BaseFragment.scala | Scala | unlicense | 1,050 |
package tests.admin
import akka.actor.{ActorRef, ActorSystem}
import akka.testkit.{ImplicitSender, TestKit}
import org.scalatest.{BeforeAndAfterAll, Matchers, FlatSpecLike}
import sisdn.admin.Organization
import sisdn.admin.Organization._
import sisdn.common._
class AdminOrganizationSpecs(_system: ActorSystem) extend... | sisdn/backend | src/test/scala/tests/admin/AdminOrganizationSpecs.scala | Scala | agpl-3.0 | 3,061 |
/*
* Copyright 2011-2018 GatlingCorp (http://gatling.io)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applic... | wiacekm/gatling | gatling-commons/src/test/scala/io/gatling/commons/util/RoundRobinSpec.scala | Scala | apache-2.0 | 1,425 |
package org.broadinstitute.clio.client.metadata
import java.net.URI
import org.broadinstitute.clio.client.dispatch.MoveExecutor.MoveOp
import org.broadinstitute.clio.transfer.model.arrays.{ArraysExtensions, ArraysMetadata}
class ArrayMover extends MetadataMover[ArraysMetadata] {
override protected def moveMetadata(... | broadinstitute/clio | clio-client/src/main/scala/org/broadinstitute/clio/client/metadata/ArrayMover.scala | Scala | bsd-3-clause | 3,620 |
package com.github.jeanadrien.gatling.mqtt.actions
import com.github.jeanadrien.gatling.mqtt.client.{FuseSourceConnectionListener, MqttCommands}
import com.github.jeanadrien.gatling.mqtt.protocol.{ConnectionSettings, MqttComponents}
import io.gatling.commons.stats._
import io.gatling.commons.util.ClockSingleton._
impo... | jeanadrien/gatling-mqtt-protocol | src/main/scala/com/github/jeanadrien/gatling/mqtt/actions/ConnectAction.scala | Scala | apache-2.0 | 2,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 ... | aokolnychyi/spark | core/src/main/scala/org/apache/spark/scheduler/LiveListenerBus.scala | Scala | apache-2.0 | 11,425 |
package com.codacy.client.bitbucket.v2.service
import com.codacy.client.bitbucket.v2.BuildStatus
import com.codacy.client.bitbucket.client.{BitbucketClient, Request, RequestResponse}
import play.api.libs.json._
class BuildStatusServices(client: BitbucketClient) {
/*
* Gets a commit build status
*
*/
def... | rtfpessoa/bitbucket-scala-client | src/main/scala/com/codacy/client/bitbucket/v2/service/BuildStatusServices.scala | Scala | apache-2.0 | 1,763 |
case class Foo1(x1: Int, x2: Int, x3: Int, x4: Int, x5: Int, x6: Int, x7: Int, x8: Int, x9: Int, x10: Int)
case class Foo2(x1: Int, x2: Int, x3: Int, x4: Int, x5: Int, x6: Int, x7: Int, x8: Int, x9: Int, x10: Int)
case class Foo3(x1: Int, x2: Int, x3: Int, x4: Int, x5: Int, x6: Int, x7: Int, x8: Int, x9: Int, x10: Int)... | som-snytt/dotty | tests/pos/i2903.scala | Scala | apache-2.0 | 6,660 |
package de.htwg.zeta.common.models.project.gdsl.shape.geomodel
import de.htwg.zeta.common.models.project.gdsl.shape.geomodel.Align.Horizontal.HorizontalAlignment
import de.htwg.zeta.common.models.project.gdsl.shape.geomodel.Align.Vertical.VerticalAlignment
case class Align(
horizontal: HorizontalAlignment,
ve... | Zeta-Project/zeta | api/common/src/main/scala/de/htwg/zeta/common/models/project/gdsl/shape/geomodel/Align.scala | Scala | bsd-2-clause | 667 |
/*
Facsimile: A Discrete-Event Simulation Library
Copyright © 2004-2020, Michael J Allen.
This file is part of Facsimile.
Facsimile 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 3 of the ... | MichaelJAllen/facsimile | core/src/test/scala/org/facsim/anim/cell/test/RotationOrderTest.scala | Scala | lgpl-3.0 | 4,382 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | sryza/spark | core/src/test/scala/org/apache/spark/util/collection/AppendOnlyMapSuite.scala | Scala | apache-2.0 | 5,974 |
/**
* This file is part of the TA Buddy project.
* Copyright (c) 2014 Alexey Aksenov ezh@ezh.msk.ru
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Affero General Global License version 3
* as published by the Free Software Foundation with the addition of t... | digimead/digi-TABuddy-desktop | part-logic/src/main/scala/org/digimead/tabuddy/desktop/logic/ui/preference/SignatureValidator.scala | Scala | agpl-3.0 | 10,631 |
/* Copyright 2009-2016 EPFL, Lausanne */
package leon
package utils
object Graphs {
trait EdgeLike[Node] {
def _1: Node
def _2: Node
}
case class SimpleEdge[Node](_1: Node, _2: Node) extends EdgeLike[Node]
case class LabeledEdge[Label, Node](_1: Node, l: Label, _2: Node) extends EdgeLike[Node]
tra... | epfl-lara/leon | src/main/scala/leon/utils/Graphs.scala | Scala | gpl-3.0 | 5,589 |
/*
* Copyright 2013 Stephan Rehfeld
*
* 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 ... | stephan-rehfeld/scaladelray | src/test/scala/test/scaladelray/geometry/NodeSpec.scala | Scala | apache-2.0 | 1,859 |
package com.overviewdocs.searchindex
import scala.collection.immutable
import scala.concurrent.Future
import com.overviewdocs.query.Query
import com.overviewdocs.models.Document
/** Interacts with a search index.
*
* A search index is a program that stores all documents. The documents are
* grouped by document... | overview/overview-server | worker/src/main/scala/com/overviewdocs/searchindex/IndexClient.scala | Scala | agpl-3.0 | 3,016 |
package scala.xml
import org.junit.Test
import org.junit.Assert.assertEquals
class XMLSyntaxTestJVM {
@Test
def test3(): Unit = {
// this demonstrates how to handle entities
val s = io.Source.fromString("<a> </a>")
object parser extends xml.parsing.ConstructingParser(s, false /*ignore ws*/) {
... | scala/scala-xml | jvm/src/test/scala/scala/xml/XMLSyntaxTest.scala | Scala | apache-2.0 | 782 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | ueshin/apache-spark | sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetVectorizedSuite.scala | Scala | apache-2.0 | 16,992 |
package models.service.importer
import models.database.facade.ArtistFacade
import models.database.facade.api.SoundcloudFacade
import models.service.api.discover.MusicBrainzApi
import models.util.Constants
import play.api.libs.json.JsValue
import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurre... | haffla/stream-compare | app/models/service/importer/SoundcloudImporter.scala | Scala | gpl-3.0 | 2,417 |
/*
* 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/nisp-frontend | app/uk/gov/hmrc/nisp/models/SPAgeModel.scala | Scala | apache-2.0 | 789 |
/*
*************************************************************************************
* Copyright 2011 Normation SAS
*************************************************************************************
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero Ge... | Kegeruneku/rudder | rudder-web/src/main/scala/com/normation/rudder/web/rest/RestUtils.scala | Scala | agpl-3.0 | 8,730 |
package quizleague.web.model
import scala.scalajs.js
import scala.scalajs.js.Date
import scala.scalajs.js.Any.fromBoolean
import scala.scalajs.js.Any.fromString
import scala.scalajs.js.annotation.JSExportAll
import rxscalajs.Observable
object CompetitionType extends Enumeration {
type CompetitionType = Value
val ... | gumdrop/quizleague-maintain | js/src/main/scala/quizleague/web/model/Competition.scala | Scala | mit | 2,813 |
import edu.luc.cs.ui.promptInt
object Addition3 {
def sumProblemString(x: Int, y: Int): String = {
val sum = x + y
val sentence = s"The sum of $x and $y is $sum."
sentence
}
def main(args: Array[String]) {
println(sumProblemString(2, 3))
println(sumProblemString(12345, 53579))
val a = p... | LoyolaChicagoBooks/introcs-scala-examples | addition3/addition3.scala | Scala | gpl-3.0 | 450 |
/*
* Copyright (C) 2012 Romain Reuillon
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is di... | ISCPIF/PSEExperiments | openmole-src/openmole/core/org.openmole.core.batch/src/main/scala/org/openmole/core/batch/authentication/CypheredPassword.scala | Scala | agpl-3.0 | 1,056 |
package scalarules.test_expect_failure.plus_one_deps.internal_deps
class C | smparkes/rules_scala | test_expect_failure/plus_one_deps/internal_deps/C.scala | Scala | apache-2.0 | 75 |
package org.example1.usage
import org.example1.declaration._
import org.example1.declaration.data.{X => X_Renamed}
trait Usage_NoOther_Imports_Wildcard_WithRename_MovedClass_WithSomeLocalImport {
val x1: X_Renamed = ???
val y: Y = ???
val z: Z = ???
def myScope(): Unit = {
import org.example1.declaratio... | JetBrains/intellij-scala | scala/scala-impl/testdata/move/allInOne/after/org/example1/usage/Usage_NoOther_Imports_Wildcard_WithRename_MovedClass_WithSomeLocalImport.scala | Scala | apache-2.0 | 354 |
package org.scalarules.dsl.nl.grammar
import org.scalarules.dsl.nl.grammar.DslCondition._
import org.scalarules.engine._
import org.scalarules.facts.Fact
import org.scalarules.utils.{SourcePosition, SourceUnknown}
import scala.language.implicitConversions
case class DslCondition(facts: Set[Fact[Any]], condition: Con... | scala-rules/rule-engine | engine/src/main/scala/org/scalarules/dsl/nl/grammar/DslCondition.scala | Scala | mit | 1,980 |
/*
* Shadowsocks - A shadowsocks client for Android
* Copyright (C) 2014 <max.c.lv@gmail.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at y... | baohaojun/shadowsocks-android | src/main/scala/com/github/shadowsocks/AppManager.scala | Scala | gpl-3.0 | 11,482 |
package uk.co.grahamcox.oauth
import com.github.nscala_time.time.Imports._
import javax.crypto._
import org.apache.commons.codec.binary.Base64
import grizzled.slf4j.Logger
/**
* Base class to represent the Signing Method
*/
abstract class SigningMethod {
/**
* Sign the given value with the given key
* @para... | sazzer/books | oauth/src/main/scala/uk/co/grahamcox/oauth/Signature.scala | Scala | gpl-3.0 | 3,355 |
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.