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 com.pongr.fourarms.matcher
import org.specs2.mock.Mockito
import org.apache.mailet._
import org.apache.mailet.base._
trait Mocks extends Mockito {
val spamEmailAddress = "spammer@test.com"
val relayEmail = "important@test.com"
val spamDomain = "wearespammer.com"
val goodDomain = "pongr.com"
val s... | pongr/fourarms | src/test/scala/mock.scala | Scala | apache-2.0 | 1,068 |
package com.ctask.utils
import java.time.{ZoneId, ZonedDateTime}
import com.ctask.util.DateUtils
import scala.util.{Failure, Try}
/**
* Argument parsing utils.
*/
object ArgsUtils {
val DEFAULT_ARG_SEPARATOR = "-"
/**
* Parses the provided args using the provided args separator.
*
* @param arg... | modsrm/ctask | common/src/main/scala/com/ctask/utils/ArgsUtils.scala | Scala | gpl-3.0 | 5,292 |
/*
* Copyright (C) 2014 LAMP/EPFL
* Copyright (C) 2014 Typesafe Inc. <http://www.typesafe.com>
*/
package selfassembly
import scala.reflect.macros.blackbox.Context
import scala.collection.mutable.{Map => MutableMap, ListBuffer => MutableList, WeakHashMap, Set => MutableSet}
import java.lang.ref.WeakReference
obje... | phaller/selfassembly | src/main/scala/selfassembly/Tools.scala | Scala | bsd-3-clause | 5,551 |
/* TerminationPolicy.scala
*
* Copyright (c) 2013-2014 linkedin.com
* Copyright (c) 2013-2014 zman.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/l... | zmanio/atmos | src/main/scala/atmos/TerminationPolicy.scala | Scala | apache-2.0 | 1,201 |
/*
* 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
* distribute... | wvlet/airframe | airframe-http/src/main/scala/wvlet/airframe/http/HttpClientException.scala | Scala | apache-2.0 | 8,920 |
package im.actor.server.models
import org.joda.time.DateTime
@SerialVersionUID(1L)
case class AuthSession(
userId: Int, id: Int, authId: Long, appId: Int, appTitle: String, deviceTitle: String, deviceHash: Array[Byte],
authTime: DateTime, authLocation: String, latitude: Option[Double], longitude: Option[Double]
)... | boneyao/actor-platform | actor-server/actor-models/src/main/scala/im/actor/server/models/AuthSession.scala | Scala | mit | 725 |
/*
* Copyright 2018 Analytics Zoo Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or... | intel-analytics/analytics-zoo | zoo/src/main/scala/com/intel/analytics/zoo/pipeline/api/keras/layers/Cropping1D.scala | Scala | apache-2.0 | 2,258 |
package pimpathon.frills
import org.junit.Test
import pimpathon.frills.function._
import pimpathon.util.{on, partial}
import scalaz.{\\/-, -\\/}
class PartialFunctionTest {
@Test def disjunction(): Unit = on(-\\/(1), \\/-("two"), -\\/(3), \\/-("four"))
.calling((partial(1 → 11) \\/ partial("two" → 22)).lift).... | raymanoz/pimpathon | src/test/scala/pimpathon/frills/function.scala | Scala | apache-2.0 | 359 |
package com.regblanc.sgl.menu
package desktop
import core._
import sgl.{InputHelpersComponent, GameLoopStatisticsComponent, ViewportComponent}
import sgl.native._
import sgl.native.util._
import sgl.scene._
/** Wire backend to the App here */
object Main extends AbstractApp with NativeApp
with InputHelpersCompone... | regb/scala-game-library | examples/menu/desktop-native/src/main/scala/Main.scala | Scala | mit | 519 |
/*
* 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
*... | fusepoolP3/p3-silk | silk-mapreduce/src/main/scala/de/fuberlin/wiwiss/silk/hadoop/impl/SilkOutputFormat.scala | Scala | apache-2.0 | 1,811 |
/*
* Copyright 2016 The BigDL Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agr... | intel-analytics/BigDL | scala/dllib/src/test/scala/com/intel/analytics/bigdl/dllib/utils/tf/loaders/Dilation2DSpec.scala | Scala | apache-2.0 | 2,836 |
/**
* Copyright (C) 2014-2015 Really Inc. <http://really.io>
*/
package io.really.jwt
import io.really.jwt.JWTException.{InvalidPrivateKey, InvalidPublicKey}
import org.bouncycastle.jce.provider.BouncyCastleProvider
import org.bouncycastle.openssl.PEMWriter
import org.scalatest.{FlatSpec, Matchers}
import play.api.l... | reallylabs/jwt-scala | src/test/scala/io/really/jwt/RSASpec.scala | Scala | apache-2.0 | 4,757 |
import akka.actor.{ActorRef, Props, ActorSystem}
import io.github.rollenholt.scala.email.sender.{EmailMessage, EmailSenderActor}
/**
* @author rollenholt
*/
object Test {
def main(args: Array[String]) {
val system: ActorSystem = ActorSystem("scalaEmailSender")
val actor: ActorRef = system.actorOf(Props[Em... | rollenholt/scala-email-sender | src/main/scala/Test.scala | Scala | mit | 571 |
import util.Random
object Chapter3 extends App {
// 1
def randArray(n: Int) = {
(for (i <- 1 to n) yield Random.nextInt).toArray
}
println("\\n\\nExercise 1")
var a = randArray(10)
println(a.toList)
// 2
def swap(arr: Array[Int]) = {
for (i <- 0 until(if (arr.length % 2 == 0) arr.length el... | skotzko/ImpatientScala | src/exercises/Chapter3.scala | Scala | apache-2.0 | 2,861 |
/*
* 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/deploy/RRunner.scala | Scala | apache-2.0 | 4,210 |
import sbt._
class TestProject(info: ProjectInfo) extends ParentProject(info)
{
val a = subproject("a", "Sub project A")
val b = subproject("b", "Sub project B")
private def subproject(path: Path, name: String) = project(path, name, new TestSubProject(_))
class TestSubProject(info: ProjectInfo) extends Default... | matheshar/simple-build-tool | src/sbt-test/properties/multi-project-b/project/build/src/TestProject.scala | Scala | bsd-3-clause | 335 |
/*
* 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/iht-frontend | app/iht/controllers/application/assets/stocksAndShares/StocksAndSharesOverviewController.scala | Scala | apache-2.0 | 2,856 |
package com.arcusys.learn.liferay.helpers
import java.util.Locale
import com.liferay.portlet.journal.model.JournalArticle
trait JournalArticleHelpers {
def getMap(article: JournalArticle) = Map("articleID" -> article.getArticleId,
"groupID" -> article.getGroupId.toString,
"version" -> article.getVersion.to... | igor-borisov/valamis | learn-liferay620-services/src/main/scala/com/arcusys/learn/liferay/helpers/JournalArticleHelpers.scala | Scala | gpl-3.0 | 788 |
package com.folio_sec.reladomo.scala_api.aggregation
import com.gs.fw.common.mithra.AggregateData
case class AggregateDataWrapper(underlying: AggregateData) {
def attribute[A: AggregateDataTypeBinder](attributeName: String): A = {
implicitly[AggregateDataTypeBinder[A]].apply(underlying, attributeName)
}
}
| folio-sec/reladomo-scala | reladomo-scala-common/src/main/scala/com/folio_sec/reladomo/scala_api/aggregation/AggregateDataWrapper.scala | Scala | apache-2.0 | 319 |
package se.uu.farmbio.vs.examples
import org.apache.spark.Logging
import org.apache.spark.SparkConf
import org.apache.spark.SparkContext
import openeye.oedocking.OEDockMethod
import openeye.oedocking.OESearchResolution
import scopt.OptionParser
import se.uu.farmbio.vs.SBVSPipeline
import java.io.PrintWriter
object Do... | laeeq80/spark-cpvs | vs.examples/src/main/scala/se/uu/farmbio/vs/examples/Docker.scala | Scala | apache-2.0 | 3,799 |
import sbt._
import Keys._
import play.Project._
object ApplicationBuild extends Build {
val appName = "LightningTasks"
val appVersion = "1.0"
val appDependencies = Seq(
"org.reactivemongo" %% "play2-reactivemongo" % "0.9"
)
val main = play.Project(appName, appVersion, appDependencies).settings(
)
}
| jbuffin/LightningTasksMongoDB | project/Build.scala | Scala | mit | 320 |
package play.boilerplate
import play.boilerplate.generators.GeneratorUtils.MimeTypeSupport
import play.boilerplate.generators._
import play.boilerplate.generators.injection._
import play.boilerplate.generators.logger.LoggerProvider
import play.boilerplate.generators.security.SecurityProvider
import play.boilerplate.ge... | Romastyi/sbt-play-boilerplate | sbt-plugin/plugin/src/main/scala/play/boilerplate/PlayBoilerplatePlugin.scala | Scala | apache-2.0 | 11,740 |
package ai.agnos.sparql.stream
import akka.actor.ActorSystem
import akka.http.scaladsl.Http
import akka.stream.ActorMaterializer
import akka.stream.scaladsl.Keep
import akka.stream.testkit.scaladsl.{TestSink, TestSource}
import akka.testkit.TestKit
import ai.agnos.sparql.SparqlQueries
import ai.agnos.sparql.api._
impo... | modelfabric/reactive-sparql | src/test/scala/ai/agnos/sparql/stream/SparqlRequestClientSpec.scala | Scala | mit | 4,334 |
package scalariform.formatter
import scalariform.lexer.Chars
import scalariform.lexer.Token
import scalariform.lexer.Tokens._
import scalariform.parser._
import scalariform.utils.Utils
import scalariform.formatter.preferences._
import scala.PartialFunction._
trait ExprFormatter { self: HasFormattingPreferences with A... | gangstead/scalariform | scalariform/src/main/scala/scalariform/formatter/ExprFormatter.scala | Scala | mit | 45,717 |
package com.twitter.finagle.util
import com.twitter.app.GlobalFlag
import com.twitter.conversions.DurationOps._
import com.twitter.finagle.stats.FinagleStatsReceiver
import com.twitter.logging.Logger
import com.twitter.util.JavaTimer
import com.twitter.util.ProxyTimer
import com.twitter.util.Timer
/**
* Configures w... | twitter/finagle | finagle-core/src/main/scala/com/twitter/finagle/util/DefaultTimer.scala | Scala | apache-2.0 | 5,203 |
// Generated by the Scala Plugin for the Protocol Buffer Compiler.
// Do not edit!
//
// Protofile syntax: PROTO3
package com.google.protobuf.`type`
/** A protocol buffer message type.
*
* @param name
* The fully qualified message name.
* @param fields
* The list of fields.
* @param oneofs
* The l... | trueaccord/ScalaPB | scalapb-runtime/src/main/scalajs/com/google/protobuf/type/Type.scala | Scala | apache-2.0 | 14,644 |
/*******************************************************************************
* Copyright 2017 Capital One Services, LLC and Bitwise, 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 Licens... | capitalone/Hydrograph | hydrograph.engine/hydrograph.engine.spark/src/main/scala/hydrograph/engine/spark/components/utils/SchemaCreator.scala | Scala | apache-2.0 | 9,149 |
package org.jetbrains.plugins.scala
package lang.refactoring.changeSignature.changeInfo
import com.intellij.psi.PsiModifier
import org.jetbrains.plugins.scala.lang.psi.types.api.presentation.AccessModifierRenderer
/**
* Nikolay.Tropin
* 2014-08-29
*/
private[changeInfo] trait VisibilityChangeInfo {
this: ScalaCha... | JetBrains/intellij-scala | scala/scala-impl/src/org/jetbrains/plugins/scala/lang/refactoring/changeSignature/changeInfo/VisibilityChangeInfo.scala | Scala | apache-2.0 | 949 |
package org.improving.scalify
import Scalify._
import org.eclipse.jdt.core.dom
// import scalaz.OptionW._
// * <li>An expression like "foo.this" can only be represented as a this
// * expression (<code>ThisExpression</code>) containing a simple name.
// * "this" is a keyword, and therefore invalid as an identifi... | mbana/scalify | src/main/ast/Name.scala | Scala | isc | 11,312 |
package highchair.datastore.meta
import com.google.appengine.api.datastore.{
Entity,
Text,
Key
}
import com.google.appengine.api.blobstore.BlobKey
/* A mapping from a Datastore type to a scala type, with methods to get from/set on an Entity. */
@annotation.implicitNotFound(msg = "Property instance not found for... | chrislewis/highchair | datastore/src/main/scala/properties.scala | Scala | mit | 3,337 |
/*
* MarkdownFrame.scala
* (Mellite)
*
* Copyright (c) 2012-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
* contact@sciss.de
*/
package de.sciss.mellite
imp... | Sciss/Mellite | core/src/main/scala/de/sciss/mellite/MarkdownFrame.scala | Scala | agpl-3.0 | 2,310 |
package com.dhruv
import org.apache.spark.SparkConf
import org.apache.spark.SparkContext
import org.apache.spark.sql.SaveMode
import org.apache.spark.sql.hive.HiveContext
object Main {
def main(args: Array[String]) {
val sparkConf = new SparkConf().setAppName("Spark to Hive examples")
val sc = new SparkCont... | DhruvKumar/spark-hive-orc | src/main/scala/com/dhruv/Main.scala | Scala | apache-2.0 | 562 |
package plda.json
/**
* The important helpers are defined in this trait,
* but they are also exposed via the singleton
* object [[syntax]] for easy importing. So that
* any scope where the following is imported
* can easily do this ``value.toJson``:
*
* {{{
* import plda.json.syntax._
* val x: PL... | 2017-Fall-UPT-PLDA/labs | src/main/scala/plda/json/JsonSyntax.scala | Scala | mit | 1,653 |
/**
* sbt-aop - AspectJ for nested projects.
*
* Copyright (c) 2013-2015 Alexey Aksenov ezh@ezh.msk.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/licen... | digimead-specific/sbt-aop | src/main/scala/sbt/aop/package.scala | Scala | apache-2.0 | 2,114 |
import Macros.*
object Test {
def main(args: Array[String]): Unit = {
printTree { var x = 1; x = 2 }
printTree((x: Int) => x)
printTree(???)
printTree(1: 1)
printTree(1: Int)
printTree(Nil: List[Int])
printTree(new Baz: Foo & Bar)
printTree(1: Int | String)
printTree { class Foo ... | lampepfl/dotty | tests/run-macros/tasty-extractors-2/quoted_2.scala | Scala | apache-2.0 | 1,636 |
package org.scalatra
import java.util.Date
import org.scalatest._
class CookieTest extends WordSpec with Matchers with BeforeAndAfterAll {
"a Cookie" should {
"render a simple name value pair" in {
val cookie = Cookie("theName", "theValue")
cookie.toCookieString should equal("theName=theValue")
... | lightvector/scalatra | core/src/test/scala/org/scalatra/CookieTest.scala | Scala | bsd-2-clause | 2,503 |
/*
* 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 not u... | EchoSYSU/spark-cassandra-connector | project/CassandraSparkBuild.scala | Scala | apache-2.0 | 11,674 |
package {{package}}
import com.twitter.scrooge.{
TFieldBlob, ThriftService, ThriftStruct, ThriftStructCodec, ThriftStructCodec3, ThriftStructFieldInfo, ThriftUtil}
import java.nio.ByteBuffer
import java.util.Arrays
import org.apache.thrift.protocol._
import org.apache.thrift.transport.TTransport
import org.apache.th... | tellapart/scrooge | scrooge-generator/src/main/resources/scalagen/service.scala | Scala | apache-2.0 | 2,088 |
/*
* 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 ... | bhoppi/zen | ml/src/main/scala/org/apache/spark/graphx2/GraphXUtils.scala | Scala | apache-2.0 | 1,724 |
/*
* 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 ... | practice-vishnoi/dev-spark-1 | sql/core/src/main/scala/org/apache/spark/sql/execution/Window.scala | Scala | apache-2.0 | 29,296 |
/*
* 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... | darroyocazorla/crossdata | core/src/main/scala/com/stratio/crossdata/util/utils.scala | Scala | apache-2.0 | 894 |
/*
* Copyright (c) 2014 - 2015 Contributor. All rights reserved.
*/
package org.scalaide.debug.internal.expression
package context
import scala.annotation.tailrec
import scala.reflect.NameTransformer
import scala.util.Success
import scala.util.Try
import org.scalaide.debug.internal.expression.Names.Scala
import org... | scala-ide/scala-ide | org.scala-ide.sdt.debug.expression/src/org/scalaide/debug/internal/expression/context/JdiMethodInvoker.scala | Scala | bsd-3-clause | 10,584 |
/*
* Copyright 2016 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/reactivemongo-json | src/main/scala/reactivemongo/json/commands/jsoncommands.scala | Scala | apache-2.0 | 2,119 |
package com.qunar.test
import org.junit.Test
class ScalaTest {
@Test
def test(): Unit = {
}
}
| spark-bypass-common/common-tungsten | src/test/scala/com/qunar/test/ScalaTest.scala | Scala | apache-2.0 | 105 |
package com.criteo.vizatra.vizsql.hive
import com.criteo.vizatra.vizsql._
import scala.util.parsing.combinator.PackratParsers
import scala.util.parsing.combinator.lexical.Lexical
import scala.util.parsing.combinator.syntactical.TokenParsers
import scala.util.parsing.input.CharArrayReader.EofCh
class TypeParser exten... | criteo/vizsql | shared/src/main/scala/com/criteo/vizatra/vizsql/dialects/hive/TypeParser.scala | Scala | apache-2.0 | 3,094 |
/*
* Copyright 2014 – 2018 Paul Horn
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agree... | knutwalker/transducers-scala | core/src/main/scala/scalax/transducers/internal/reducers.scala | Scala | apache-2.0 | 7,979 |
import scala.reflect.macros.blackbox.Context
object Impls {
def foo(c: Context)(x: c.Expr[Int])(y: c.Expr[Int]) = {
import c.universe._
val sum = Apply(Select(x.tree, TermName("$plus")), List(y.tree))
val body = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(sum))
c.Expr[Uni... | martijnhoekstra/scala | test/files/run/macro-invalidusage-partialapplication/Impls_Macros_1.scala | Scala | apache-2.0 | 404 |
//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
/** @author John Miller
* @version 1.2
* @date Thu Nov 19 18:43:58 EST 2015
* @see LICENSE (MIT style license file).
*/
package scalation.graphalytics
//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::... | NBKlepp/fda | scalation_1.2/src/main/scala/scalation/graphalytics/TrafficLight.scala | Scala | mit | 625 |
/*
* Copyright © 2015 Cask Data, 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 t... | caskdata/cdap | cdap-examples/WikipediaPipeline/src/main/scala/co/cask/cdap/examples/wikipedia/ClusteringUtils.scala | Scala | apache-2.0 | 6,521 |
package com.teambytes.awsleader
/**
* Runnable Task that can be run periodically, with the given rate in milli seconds
*/
trait PeriodicTask extends Runnable {
/**
* The rate at which this task is executed while the node is leader
*/
def periodMs: Long
/**
* The initial delay before this task is run... | grahamar/aws-leader-election | src/main/scala/com/teambytes/awsleader/PeriodicTask.scala | Scala | apache-2.0 | 413 |
package ch.epfl.bbp.uima.topicmodels.mallet
import cc.mallet.types.InstanceList
import cc.mallet.types.LabelAlphabet
import cc.mallet.types.FeatureSequence
import cc.mallet.types.Instance
import org.slf4j.LoggerFactory
/**
* Contains utils to convert diverse artifacts to the corresponding Mallet representation
*/
ob... | BlueBrain/bluima | modules/bluima_topic_models/src/main/scala/ch/epfl/bbp/uima/topicmodels/mallet/MalletUtils.scala | Scala | apache-2.0 | 4,221 |
/*
* This file is part of Apparat.
*
* Copyright (C) 2010 Joa Ebert
* http://www.joa-ebert.com/
*
* This library 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 Lice... | joa/apparat | apparat-core/src/main/scala/apparat/graph/DefaultDOTExport.scala | Scala | lgpl-2.1 | 1,580 |
package bug
// goes with t1987b.scala
package object packageb {
def func(a: Int) = ()
def func(a: String) = ()
}
| yusuke2255/dotty | tests/pos/t1987b/a.scala | Scala | bsd-3-clause | 118 |
package com.socrata.soda.server.highlevel
import com.rojoma.json.v3.ast.JObject
import com.rojoma.json.v3.codec.JsonEncode
import com.rojoma.json.v3.interpolation._
import com.socrata.computation_strategies._
import com.socrata.soda.server.highlevel.ColumnSpecUtils._
import com.socrata.soda.server.id.ColumnId
import c... | socrata-platform/soda-fountain | soda-fountain-lib/src/test/scala/com/socrata/soda/server/highlevel/ColumnSpecUtilsTest.scala | Scala | apache-2.0 | 9,310 |
package sbt
package std
import sbt.internal.util.complete
import sbt.internal.util.complete.{ DefaultParsers, Parsers }
/*object UseTask
{
import Def._
val set = setting { 23 }
val plain = PlainTaskMacro task { 19 }
val x = task { set.value }
val y = task { true }
val z = task { if(y.value) x.value else plai... | dansanduleac/sbt | main/settings/src/test/scala/UsageTest.scala | Scala | bsd-3-clause | 3,345 |
package me.apidoc.swagger
import org.scalatest.{FunSpec, Matchers}
import play.api.libs.json._
class UtilSpec extends FunSpec with Matchers {
it("formatName") {
Util.formatName("pet") should be("pet")
Util.formatName(" pet ") should be("pet")
}
it("substitutePathParameters") {
Util.substitutePat... | mbryzek/apidoc | swagger/src/test/scala/me/apidoc/swagger/UtilSpec.scala | Scala | mit | 3,422 |
package au.gov.dva.sopapi.sopref.parsing.implementations.parsers
import scala.collection.immutable
object LegalReferenceSequences {
private def getMainParaLetterSequence = {
val aToz = 'a' to 'z'
val doubled = aToz.map(l => s"$l$l")
val combined = aToz ++ doubled
combined.map(i => "(" + i + ")")
... | govlawtech/dva-sop-api | app/src/main/scala/au/gov/dva/sopapi/sopref/parsing/implementations/parsers/LegalReferenceSequences.scala | Scala | apache-2.0 | 2,427 |
package com.github.tweets.gateway.twitter
import com.github.tweets.common.{TweetInfo, GitHubProjectInfo}
import com.github.tweets.gateway.TwitterAPIGateway
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.stereotype.Component
import org.springframework.web.client.RestTemplate
im... | andrei-l/tweets-for-github-projects-gatherer | src/main/scala/com/github/tweets/gateway/twitter/TwitterAPIGatewayImpl.scala | Scala | mit | 838 |
package org.scalamu.core.utils
class InMemoryClassLoader(
classes: Map[String, Array[Byte]],
parent: ClassLoader = ClassLoadingUtils.contextClassLoader
) extends ClassLoader(parent) {
private def getClassBytes(name: String): Array[Byte] = classes.get(name) match {
case Some(aClass) => aClass
case None =... | sugakandrey/scalamu | core/src/main/scala/org/scalamu/core/utils/InMemoryClassLoader.scala | Scala | gpl-3.0 | 1,014 |
package org.greencheek.spray.cache.memcached.hostparsing.dnslookup
import scala.concurrent.duration.Duration
import java.net.InetSocketAddress
import java.util.concurrent.TimeUnit
/**
* Created by dominictootell on 06/06/2014.
*/
trait HostResolver {
private val DEFAULT_DNS_TIMEOUT : Duration = Duration(3,TimeUni... | tootedom/spray-cache-spymemcached | src/main/scala/org/greencheek/spray/cache/memcached/hostparsing/dnslookup/HostResolver.scala | Scala | apache-2.0 | 517 |
package ru.zconstz.shortener.service
import akka.actor.Actor
import ru.zconstz.shortener.http.HttpEntities._
import ru.zconstz.shortener.db.DbHolder._
import scala.slick.driver.PostgresDriver.simple._
import ru.zconstz.shortener.db.DataBaseSchema.{Clicks, Links}
import java.sql.Date
class ClickActor extends Actor {
... | konstantin-zlobin/url-shortener | src/main/scala/ru/zconstz/shortener/service/ClickActor.scala | Scala | apache-2.0 | 1,424 |
package de.tu_berlin.formic.datastructure.tree
import akka.actor.ActorSystem
import akka.testkit.TestKit
import de.tu_berlin.formic.common.json.FormicJsonProtocol
import org.scalatest.{BeforeAndAfterAll, Matchers, WordSpecLike}
/**
* @author Ronny Bräunlich
*/
class TreeServerDataStructureProviderSpec extends Tes... | rbraeunlich/formic | tree/jvm/src/test/scala/de/tu_berlin/formic/datastructure/tree/TreeServerDataStructureProviderSpec.scala | Scala | apache-2.0 | 2,182 |
/*
* Copyright 2014–2018 SlamData 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... | slamdata/slamengine | foundation/src/main/scala/quasar/contrib/cats/effect/effect.scala | Scala | apache-2.0 | 1,086 |
package com.blinkbox.books.auth.server.data
import com.blinkbox.books.slick.{TablesSupport, SlickTypes}
import scala.slick.driver.JdbcProfile
import scala.slick.profile.BasicProfile
trait RoleRepository[Profile <: BasicProfile] extends SlickTypes[Profile] {
def fetchRoles(userId: UserId)(implicit session: Session)... | blinkboxbooks/auth-service.scala | src/main/scala/com/blinkbox/books/auth/server/data/RoleRepository.scala | Scala | mit | 837 |
package com.openbee.test.crawler
import java.net.URL
import java.io._
import scala.collection.mutable
import java.util.{Calendar, UUID, Properties}
import scala.collection.JavaConversions._
import scala.collection.JavaConverters._
import scala.io.Source
/**
* Created by fabien_s on 01/02/14.
*/
class UrlGetterCache... | fasar/PDoc | app-getThunderbirdDocs/src/main/scala/com/openbee/test/crawler/UrlGetterCachedProperties.scala | Scala | apache-2.0 | 3,991 |
/*
* Copyright 2019 Google LLC All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicab... | CloudVLab/professional-services | tools/bigquery-zos-mainframe-connector/src/main/scala/akka/io/ByteBufferPool.scala | Scala | apache-2.0 | 769 |
package beamly.core.lang.extensions
import java.util.concurrent.atomic.AtomicReference
import scala.annotation.tailrec
final class AtomicReferenceW[A](val underlying: AtomicReference[A]) extends AnyVal {
@inline
def update(f: A => A) {
@tailrec
def updateAtomicReference(f: A => A) {
val a = under... | beamly/beamly.core.lang | src/main/scala/beamly/core/lang/extensions/AtomicReferenceW.scala | Scala | apache-2.0 | 452 |
package cmwell.analytics.data
import java.nio.charset.StandardCharsets.UTF_8
import java.security.MessageDigest
import cmwell.analytics.util.{CassandraSystem, DatasetFilter}
import com.datastax.spark.connector._
import com.google.common.primitives.Longs
import org.apache.commons.codec.binary.Hex
import org.apache.com... | e-orz/CM-Well | tools/dataConsistencyTool/cmwell-spark-analysis/src/main/scala/cmwell/analytics/data/InfotonDataIntegrity.scala | Scala | apache-2.0 | 13,532 |
/*
* Copyright (c) 2013 Christos KK Loverdos
*
* 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... | loverdos/scalapipes | src/main/scala/com/ckkloverdos/pipes/collection/immutable/PList.scala | Scala | apache-2.0 | 1,497 |
// Generated by the Scala Plugin for the Protocol Buffer Compiler.
// Do not edit!
//
// Protofile syntax: PROTO3
package com.google.protobuf.wrappers
/** Wrapper message for `int32`.
*
* The JSON representation for `Int32Value` is JSON number.
*
* @param value
* The int32 value.
*/
@SerialVersionUID(0L... | scalapb/ScalaPB | scalapb-runtime/src/main/scalajvm/com/google/protobuf/wrappers/Int32Value.scala | Scala | apache-2.0 | 6,255 |
import scala.util.matching.Regex
object RegulareExpressions {
def main(args: Array[String]) {
val pattern = "test".r // r funzione che converte stringhe in regex
println(pattern.findFirstIn("provatestprova1234test"))
val istanze = pattern.findAllIn("provatestprova1234test")
for(i <- istanze)
... | M9k/Scala-learning | 19-RegularExpressions.scala | Scala | bsd-3-clause | 3,367 |
package skinny.micro.util
import java.io._
import java.nio.channels.Channels
import skinny.util.LoanPattern._
import scala.annotation.tailrec
/**
* A collection of I/O utility methods.
*/
package object io {
/**
* Copies the input stream to the output stream.
*
* @param in the input stream to read. Th... | xerial/skinny-micro | micro/src/main/scala/skinny/micro/util/io/package.scala | Scala | bsd-2-clause | 2,028 |
/*
* 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 ... | WindCanDie/spark | sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/util/UnsafeArraySuite.scala | Scala | apache-2.0 | 8,962 |
package org.bitcoins.core.crypto
/**
* The result type returned by checking a signature
*/
sealed trait TransactionSignatureCheckerResult {
/**
* Indicates if the transaction signature checker was successful or failed
*/
def isValid: Boolean
}
/**
* Represents the case that the signatures checked i... | bitcoin-s/bitcoin-s-core | core/src/main/scala/org/bitcoins/core/crypto/TransactionSignatureCheckerResult.scala | Scala | mit | 2,905 |
package net.jetmq.broker
import akka.actor._
import akka.http.scaladsl.Http
import akka.http.scaladsl.Http.IncomingConnection
import akka.http.scaladsl.model.HttpMethods._
import akka.http.scaladsl.model.ws.{Message, BinaryMessage, UpgradeToWebsocket}
import akka.http.scaladsl.model.{HttpRequest, HttpResponse, Uri}
im... | butaji/JetMQ | core/src/main/scala/net/jetmq/broker/BrokerServer.scala | Scala | mit | 2,726 |
package com.sidemash.redson.scalatest
import java.util.function.Predicate
import com.sidemash.redson._
class JsonArraySpec extends UnitSpec {
"A JsonArray" should "have registered values in first-in-first-out order at creation time" in {
val array = JsonArray.of(Integer.valueOf(1), Integer.valueOf(2)) ;
a... | sidemash/redson | src/test/scala/com/sidemash/redson/scalatest/JsonArraySpec.scala | Scala | mit | 2,949 |
/**
* 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... | prashantbh/kafka | core/src/main/scala/kafka/server/ReplicaManager.scala | Scala | apache-2.0 | 46,929 |
/*
* 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 | server/src/com/treode/server/Main.scala | Scala | apache-2.0 | 2,185 |
/*
* 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 ... | andrewor14/iolap | mllib/src/main/scala/org/apache/spark/mllib/random/RandomRDDs.scala | Scala | apache-2.0 | 25,656 |
package swe.backend
object BackendStandalone extends App{
new BackendModule
}
| flosse/semanticExperiments | backend/src/main/scala/BackendStandalone.scala | Scala | gpl-3.0 | 81 |
package me.pennekamp.qtables
case class User(id: Id[User], name: String) extends HasId[User] {
override def updateId(id: Id[User]): User = copy(id = id)
}
| marcopennekamp/qtables | src/test/scala/me/pennekamp/qtables/User.scala | Scala | mit | 158 |
/*
* 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 ... | sclearn/sclearn | sc/src/main/scala/io/github/sclearn/dataset/spark/sql/types/Metadata.scala | Scala | apache-2.0 | 9,232 |
package mountainrangepvp.core
import com.badlogic.gdx.math.Vector2
import mountainrangepvp.engine.util.Event
case class ConnectedEvent(localId: ClientId) extends Event
case class SnapshotEvent(snapshot: Snapshot) extends Event
case class InputCommandEvent(command: InputCommand) extends Event
case object Server... | thorinii/MountainRangePvP | src/main/scala/mountainrangepvp/core/Events.scala | Scala | mit | 833 |
package rxgpio
import org.scalatest.{Matchers, WordSpecLike}
/**
*
*/
class ModelingLevelSpec extends WordSpecLike with Matchers {
"digital value" should {
"be high when true" in {Level(true) shouldBe High}
"be low when false" in {Level(false) shouldBe Low}
"be high when 1" in {Level(1) ... | jw3/pigpio4s | core/src/test/scala/rxgpio/ModelingLevelSpec.scala | Scala | apache-2.0 | 620 |
package com.spike.giantdataanalysis.spark.example
/**
* PrintStreamLogError.scala 输出日志流中错误
*/
package object streaming {
val DATA_DIR = com.spike.giantdataanalysis.spark.example.DATA_DIR
} | zhoujiagen/giant-data-analysis | data-management-infrastructure/scala-infrastructure-apache-spark/src/main/scala/com/spike/giantdataanalysis/spark/example/streaming/package.scala | Scala | mit | 216 |
package colossus
package protocols.http
import akka.util.ByteString
import com.github.nscala_time.time.Imports._
import scala.collection.immutable.HashMap
import parsing.ParseException
sealed abstract class HttpMethod(val name: String)
object HttpMethod {
case object Get extends HttpMethod("GET")
case objec... | noikiy/colossus | colossus/src/main/scala/colossus/protocols/http/Header.scala | Scala | apache-2.0 | 7,060 |
package Direction
sealed trait Direction {
def dx: Int
def dy: Int
def clockwise: Direction
def counterclockwise: Direction
}
abstract sealed class VerticalDirection(override val dy: Int) extends Direction {
override val dx: Int = 0
}
abstract sealed class HorizontalDirection(override val dx: Int) extends ... | CaseyLeask/Seawise-Giant | src/main/scala/Direction/Direction.scala | Scala | mit | 1,528 |
import akka.actor.{ActorSystem, Props}
import gym.{GymAgent, GymServer, StepResponse}
import scala.concurrent.{Future, blocking}
object Boot extends App with GymServer {
self =>
override val environment: String = "CartPole-v0"
val system = ActorSystem("mySystem")
initialize()
val actor = system.actorOf(... | flaviotruzzi/scala-gym | src/main/scala/Boot.scala | Scala | mit | 621 |
package org.dele.text.maen.test
import org.dele.text.maen.ErrorHandling.{AtomErrorMultvalueProp, AtomErrorNoProp}
import org.dele.text.maen.ErrorHandling
import org.dele.text.maen.TAtom
import scala.util.{Failure, Success, Try}
/**
* Created by jiaji on 2016-02-14.
*/
object TestAtom {
object Atom {
val Em... | new2scala/text-util | maen/src/main/scala/org/dele/text/maen/test/TestAtom.scala | Scala | apache-2.0 | 1,813 |
package org.jetbrains.sbt.project
import com.intellij.compiler.CompilerConfiguration
import com.intellij.compiler.impl.javaCompiler.javac.JavacConfiguration
import com.intellij.openapi.externalSystem.util.{DisposeAwareProjectChange, ExternalSystemApiUtil}
import com.intellij.openapi.module.Module
import com.intellij.o... | JetBrains/intellij-scala | scala/scala-impl/test/org/jetbrains/sbt/project/SbtProjectImportingTest.scala | Scala | apache-2.0 | 19,469 |
package org.locationtech.geomesa.web.security
import java.io.Serializable
import java.util
import org.apache.accumulo.core.security.Authorizations
import org.locationtech.geomesa.security.AuthorizationsProvider
import org.springframework.security.authentication.TestingAuthenticationToken
import org.springframework.se... | mmatz-ccri/geomesa | geomesa-web/geomesa-web-security/src/test/scala/org/locationtech/geomesa/web/security/TestAuthorizationsProvider.scala | Scala | apache-2.0 | 847 |
/*
* Copyright (c) 2015.
* Created by MrTJP.
* All rights reserved.
*/
package mrtjp.core.gui
import codechicken.lib.colour.EnumColour
import mrtjp.core.vec.{Point, Rect, Size, Vec2}
/**
* Represents a rectangular area in which all subnodes can be moved around the coordinate plane by clicking and
* dragging. ... | MrTJP/MrTJPCore | src/main/scala/mrtjp/core/gui/pan.scala | Scala | lgpl-3.0 | 6,261 |
/*
* Copyright (c) 2017-2022 Lymia Alusyia <lymia@lymiahugs.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use,... | Lymia/PrincessEdit | modules/princess-edit/src/main/scala/moe/lymia/princess/core/cardmodel/utils.scala | Scala | mit | 5,350 |
package com.github.scalatojava
import java.io.{File, StringWriter}
import java.nio.file.{Paths, Files}
import com.strobel.assembler.InputTypeLoader
import com.strobel.assembler.metadata._
import com.strobel.decompiler.languages.Languages
import com.strobel.decompiler.languages.java.JavaFormattingOptions
import com.st... | shyiko/scala-to-java | src/main/scala/com/github/scalatojava/ScalaToJava.scala | Scala | mit | 2,659 |
import scala.Tuple as STuple
enum Datatype[T] {
case Tuple[T <: STuple](elems: STuple.Map[T, Datatype]) extends Datatype[T]
}
object Datatype {
given [H, T <: STuple](using ht: Datatype[H], tt: Datatype[T]): Datatype[H *: T] = tt match {
case Datatype.Tuple(elems) => Datatype.Tuple(ht *: elems)
}
}
| dotty-staging/dotty | tests/pos/i8344-1.scala | Scala | apache-2.0 | 312 |
// 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 may obtain a copy of the License at
//
// http://www.apache... | scray/scray | scray-hdfs/modules/scray-hdfs-writer/src/test/scala/scray/hdfs/io/index/format/sequence/SequenceFileWriterSpecs.scala | Scala | apache-2.0 | 7,794 |
/*
* 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/main/scala/org/apache/spark/sql/jdbc/TeradataDialect.scala | Scala | apache-2.0 | 4,455 |
/*
Copyright (c) 2016, Rice University
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2.... | agrippa/spark-swat | functional-tests/nn/src/main/scala/nn/SparkNN.scala | Scala | bsd-3-clause | 24,883 |
package mesosphere.marathon.health
import java.lang.{ Integer => JInt }
import mesosphere.marathon.Protos
import mesosphere.marathon.Protos.HealthCheckDefinition.Protocol
import mesosphere.marathon.api.validation.ValidHealthCheck
import mesosphere.marathon.state.{ Timestamp, MarathonState, Command }
import org.apache... | Kosta-Github/marathon | src/main/scala/mesosphere/marathon/health/HealthCheck.scala | Scala | apache-2.0 | 3,812 |
/*
* Copyright 2008-present MongoDB, 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 ag... | rozza/mongo-scala-driver | driver/src/main/scala/org/mongodb/scala/MongoDatabase.scala | Scala | apache-2.0 | 18,294 |
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.