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 |
|---|---|---|---|---|---|
//-----------------------------------------------------------------------
// FILE : MainSuite.scala
// SUBJECT : Class to do various testing operations on the Sprocket main.
// AUTHOR : (C) Copyright 2012 by Peter C. Chapin <PChapin@vtc.vsc.edu>
//
//-----------------------------------------------------------------... | pchapin/sprocket | test/edu/uvm/sprocket/MainSuite.scala | Scala | bsd-3-clause | 553 |
package com.sksamuel.elastic4s.searches.queries.matches
import com.sksamuel.elastic4s.searches.queries.Query
case class MatchAllQuery(boost: Option[Double] = None, queryName: Option[String] = None) extends Query {
def boost(boost: Double): MatchAllQuery = copy(boost = Option(boost))
def withBoost(boos... | Tecsisa/elastic4s | elastic4s-core/src/main/scala/com/sksamuel/elastic4s/searches/queries/matches/MatchAllQuery.scala | Scala | apache-2.0 | 835 |
package org.jetbrains.plugins.scala.editor.importOptimizer
/**
* @author Nikolay.Tropin
*/
case class RangeInfo(namesAtRangeStart: Set[String],
importInfos: Seq[ImportInfo],
usedImportedNames: Set[String],
isLocal: Boolean)
| katejim/intellij-scala | src/org/jetbrains/plugins/scala/editor/importOptimizer/RangeInfo.scala | Scala | apache-2.0 | 292 |
package com.whitepages.cloudmanager.operation
import org.apache.solr.client.solrj.impl.{CloudSolrClient}
import com.whitepages.cloudmanager.action.{StateCondition, Action}
import com.whitepages.cloudmanager.state.ClusterManager
import java.util.Calendar
import com.whitepages.cloudmanager.ManagerSupport
import scala.c... | randomstatistic/solrcloud_manager | src/main/scala/com/whitepages/cloudmanager/operation/Operation.scala | Scala | apache-2.0 | 1,761 |
import sbt._
object Version {
val akka = "2.4.1"
val hadoop = "2.7.1"
val logback = "1.1.3"
val mockito = "1.10.19"
val scala = "2.11.7"
val scalaTest = "2.2.5"
val slf4j = "1.7.6"
val spark = "1.5.2"
}
object Library {
val akkaActor = "com.typesafe.akka" %% "akka-actor"... | Bongani/series-monitor | project/Dependencies.scala | Scala | apache-2.0 | 1,146 |
package scala.meta.tests
package io
import java.io.File
import munit.FunSuite
import scala.meta._
class MultipathSuite extends FunSuite {
val tmp: File = File.createTempFile("src", "main")
assert(tmp.delete())
assert(tmp.mkdirs())
val files = List("a", "b")
files.foreach(file => {
assert(new File(tmp, f... | scalameta/scalameta | tests/jvm/src/test/scala/scala/meta/tests/io/MultipathSuite.scala | Scala | bsd-3-clause | 573 |
/*
* 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-execution/shared/src/main/scala/monix/execution/cancelables/MultiAssignCancelable.scala | Scala | apache-2.0 | 3,820 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | pgandhi999/spark | sql/core/src/main/scala/org/apache/spark/sql/dynamicpruning/PlanDynamicPruningFilters.scala | Scala | apache-2.0 | 4,458 |
package ru.org.codingteam.cttalk
import java.security.MessageDigest
import org.specs2.concurrent.ExecutionEnv
import org.specs2.mock._
import play.api.test.PlaySpecification
import reactivemongo.api.commands.WriteResult
import ru.org.codingteam.cttalk.model.{Token, User, UserHandle}
import ru.org.codingteam.cttalk.se... | hagane/cttalk | server/test/ru/org/codingteam/cttalk/UserServiceSpec.scala | Scala | mit | 5,248 |
package scanalyzer
package analysis
package interpreter
import cfg._
import util._
case class InterpretationException(msg:String) extends ScanalyzerException(msg)
/**
* An Interpreter for the SSA-CFG format that implicitly defines its semantics.
*/
class Interpreter(fun: Function) extends ValueAnalysis[Option[BigI... | fabian-r/scanalyzer | src/main/scala/analysis/Interpreter.scala | Scala | mit | 2,257 |
/*
* Copyright 2016 OSBI 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 agreed to in writ... | OSBI/meteorite-core | security-scala/src/main/scala/bi/meteorite/core/security/authentication/TokenResponseFilter.scala | Scala | apache-2.0 | 1,421 |
/*
* Copyright (C) 2015 Romain Reuillon
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This progra... | ISCPIF/PSEExperiments | openmole-src/openmole/core/org.openmole.core.workflow/src/main/scala/org/openmole/core/workflow/tools/PluginInfoActivator.scala | Scala | agpl-3.0 | 1,404 |
package model.services
import com.mohiva.play.silhouette.api.services.IdentityService
import com.mohiva.play.silhouette.impl.providers.CommonSocialProfile
import model.dtos.User
import scala.concurrent.Future
/**
* Handles actions to users.
*/
trait UserService extends IdentityService[User] {
/**
* Saves a u... | scify/DemocracIT-Web | app/model/services/UserService.scala | Scala | apache-2.0 | 774 |
package com.sksamuel.elastic4s.fields.builders
import com.sksamuel.elastic4s.fields.GeoShapeField
import com.sksamuel.elastic4s.json.{XContentBuilder, XContentFactory}
object GeoShapeFieldBuilderFn {
def build(field: GeoShapeField): XContentBuilder = {
val builder = XContentFactory.jsonBuilder()
builder.fie... | stringbean/elastic4s | elastic4s-core/src/main/scala/com/sksamuel/elastic4s/fields/builders/GeoShapeFieldBuilderFn.scala | Scala | apache-2.0 | 1,344 |
package org.opencompare.stats.utils
import org.opencompare.io.wikipedia.io.MediaWikiAPI
import org.opencompare.stats.interfaces.RevisionsParserInterface
import play.api.libs.json._
import scala.collection.mutable.ListBuffer
/**
* Created by smangin on 23/07/15.
*
* Used to get all revisions from a single wikipedi... | OpenCompare/pcm-stats | src/main/scala/org/opencompare/stats/utils/RevisionsParser.scala | Scala | apache-2.0 | 3,781 |
/*
* 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 ... | aljoscha/flink | flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/plan/nodes/physical/stream/StreamExecPythonOverAggregate.scala | Scala | apache-2.0 | 11,586 |
/*
* Copyright 2014 IBM Corp.
*
* 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... | bpburns/spark-kernel | kernel-api/src/main/scala/com/ibm/spark/utils/ConditionalOutputStream.scala | Scala | apache-2.0 | 883 |
package dsmoq.taskServer
import java.io.{ File, FileInputStream, IOException, InputStream }
import java.nio.file.{ Files, Paths }
import com.amazonaws.services.s3.AmazonS3Client
import com.amazonaws.services.s3.model.{ GetObjectRequest, ObjectMetadata }
import com.amazonaws.services.s3.transfer.{ TransferManager, Tran... | nkawa/dsmoq | server/taskServer/src/main/scala/dsmoq/taskServer/FileManager.scala | Scala | apache-2.0 | 3,919 |
/*
* Copyright 2010-2011 Vilius Normantas <code@norma.lt>
*
* This file is part of Crossbow library.
*
* Crossbow is free software: you can redistribute it and/or modify it under the terms of the GNU
* General Public License as published by the Free Software Foundation, either version 3 of the
* License, or (at ... | ViliusN/Crossbow | crossbow-core/test/lt/norma/crossbow/indicators/FirstValueTest.scala | Scala | gpl-3.0 | 3,210 |
/*******************************************************************************
* Copyright 2010 Maxime Lévesque
*
* 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://... | wukaikailive/squeryl | src/main/scala/org/squeryl/View.scala | Scala | apache-2.0 | 4,588 |
package models
import play.api.libs.json.Json
case class Wine(name: String, vintage: String)
object Wine {
implicit val wineFormat = Json.format[Wine]
} | benhalton/angular-play-mongo-starter | app/models/Wine.scala | Scala | gpl-3.0 | 159 |
/*
* (C) Copyright 2015 Atomic BITS (http://atomicbits.io).
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the GNU Affero General Public License
* (AGPL) version 3.0 which accompanies this distribution, and is available in
* the LICENSE file or at http... | rcavalcanti/scraml | modules/scraml-parser/src/main/scala/io/atomicbits/scraml/parser/model/Response.scala | Scala | agpl-3.0 | 1,278 |
/**
* Copyright (C) 2015-2016 DANS - Data Archiving and Networked Services (info@dans.knaw.nl)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/license... | vesaakerman/easy-sword2 | src/main/scala/nl/knaw/dans/api/sword2/DepositHandler.scala | Scala | apache-2.0 | 20,302 |
/*******************************************************************************
* Copyright (c) 2014 Łukasz Szpakowski.
*
* 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/MP... | luckboy/Purfuncor | src/main/scala/pl/luckboy/purfuncor/common/Evaluator.scala | Scala | mpl-2.0 | 3,127 |
package org.etl.util
import org.etl.command.Context
import org.apache.commons.text.StrSubstitutor
object ParameterisationEngine {
def resolve(inputString: String, context: Context): String = {
val configMap = context.getMe
val paramEngine = new StrSubstitutor(configMap)
val output = paramEngine.replace... | jpvelsamy/sparrow | sparrow-server/src/main/scala/org/etl/util/ParameterisationEngine.scala | Scala | apache-2.0 | 1,119 |
/*
* Copyright 2015 [See AUTHORS file for list of 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 require... | pxinghao/ParallelSubmodularMaximization | src/main/scala/SetCoverFunctions.scala | Scala | apache-2.0 | 3,813 |
package node
import org.junit.Assert
import common.CommonTest
import node.api.SkillState
import node.internal.PoolSizeMissmatchError
import node.internal.SkillException
/**
* Tests the file reading capabilities.
*/
class ParseTest extends CommonTest {
@inline def read(s: String) = SkillState.read("src/test/resou... | XyzNobody/skillScalaTestSuite | src/test/scala/node/ParseTest.scala | Scala | bsd-3-clause | 3,290 |
class Y(x: String) {
def this(x: Double, y: String) = this(y)
}
class Test(y: String) extends Y(5.0, y) { self =>
def this(x: Int, y: String, z: Double) = this("ff")
def this() = this("gg")
def this(y: String, z: Double) = this(5, y, z)
} | VladimirNik/tasty | exttests/tests/overloadedConstr3/Test.scala | Scala | bsd-3-clause | 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 | sql/catalyst/src/main/scala/org/apache/spark/sql/types/AbstractDataType.scala | Scala | apache-2.0 | 6,906 |
package chat.tox.antox.utils
import android.database.sqlite.SQLiteDatabase
object DatabaseUtil {
def isColumnInTable(mDb: SQLiteDatabase, table: String, column: String): Boolean = {
try {
val cursor = mDb.rawQuery("SELECT * FROM " + table + " LIMIT 0", null)
val result = cursor.getColumnIndex(column... | wiiam/Antox | app/src/main/scala/chat/tox/antox/utils/DatabaseUtil.scala | Scala | gpl-3.0 | 420 |
package monocle.std
import monocle.MonocleSuite
import monocle.function.all._
import monocle.std.byte._
import monocle.law.discipline.{OptionalTests, PrismTests}
class ByteSpec extends MonocleSuite {
checkAll("Byte index bit", OptionalTests(index[Byte, Int, Boolean](0)))
checkAll("Byte to Boolean", PrismTests(byt... | NightRa/Monocle | test/src/test/scala/monocle/std/ByteSpec.scala | Scala | mit | 335 |
package controllers
import utils.WithApplication
import java.io.InputStream
import java.net.HttpURLConnection
import java.util.UUID._
import org.specs2.mock.Mockito
import org.specs2.mutable._
import play.api.Logger
import play.api.test.FakeRequest
import play.api.test.Helpers._
/**
* Created by valtechuk on 25/03/2... | Department-for-Work-and-Pensions/ClaimCapture | c3/test/controllers/ChannelShiftSpec.scala | Scala | mit | 1,885 |
package breeze.linalg
/*
Copyright 2012 David Hall
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... | mredaelli/breeze | math/src/main/scala/breeze/linalg/Matrix.scala | Scala | apache-2.0 | 8,000 |
/*
Copyright 2014 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
distr... | twitter/scalding | scalding-core/src/test/scala/com/twitter/scalding/ExecutionTest.scala | Scala | apache-2.0 | 41,667 |
package org.jetbrains.sbt
package resolvers
import java.io.{IOException, File}
import com.intellij.notification.{Notification, NotificationType, Notifications}
import com.intellij.openapi.Disposable
import com.intellij.openapi.application.PathManager
import com.intellij.openapi.components.ServiceManager
import com.in... | whorbowicz/intellij-scala | src/org/jetbrains/sbt/resolvers/SbtResolverIndexesManager.scala | Scala | apache-2.0 | 4,189 |
package scala.generator
import com.bryzek.apidoc.generator.v0.models.InvocationForm
import scala.models.Play23ClientGenerator
import scala.models.ning.Ning18ClientGenerator
import models.TestHelper
import org.scalatest.{FunSpec, Matchers}
class ReferenceSpec extends FunSpec with Matchers {
lazy val ssd = new Scal... | Seanstoppable/apidoc-generator | scala-generator/src/test/scala/models/generator/ReferenceSpec.scala | Scala | mit | 1,727 |
package io.straight.radg.randomtypes
import io.straight.radg.Context
/**
* @author rbuckland
*/
case class RowNumberGenerator(name:String,startingNumber:Int = 1) extends DataGenerator[Int] {
var num = startingNumber
override def description: String = "Simple incrementing row number"
override def internalGe... | rbuckland/random-data-generator | src/main/scala/io/straight/radg/randomtypes/RowNumberGenerator.scala | Scala | apache-2.0 | 402 |
package com.joescii
object PrimeScala {
def isPrime(n:Int) = (2 to (n-1))
.forall(i => n % i != 0)
def first(n:Int) = Stream.from(2)
.filter(isPrime _)
.take(n)
def first(n:Int, p:Int=>Boolean) = Stream.from(2)
.filter(p)
.take(n)
def first2(n:Int) = first(n, isPrime _)
}
| joescii/fp-renaissance | src/main/scala/com/joescii/PrimeScala.scala | Scala | apache-2.0 | 307 |
/**
* 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"); yo... | Chasego/kafka | core/src/main/scala/kafka/server/ReplicaAlterLogDirsThread.scala | Scala | apache-2.0 | 13,553 |
/**
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may... | cran/rkafkajars | java/kafka/server/ReplicaManager.scala | Scala | apache-2.0 | 41,964 |
/*
Copyright (c) 2014 by Contributors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, so... | dmlc/xgboost | jvm-packages/xgboost4j/src/main/scala/ml/dmlc/xgboost4j/scala/ObjectiveTrait.scala | Scala | apache-2.0 | 1,302 |
package me.hawkweisman.alexandria
package model
import org.json4s._
import scala.language.postfixOps
import scala.util.Try
trait Ownable {
def owner: User
}
/**
* Internal model for a book.
*
* "A library is just a box with strings in it"
* ~ Hawk Weisman
*
* @param isbn The book's International Standar... | alexandrialibrary/Alexandria | src/main/scala/me/hawkweisman/alexandria/model/Book.scala | Scala | mit | 2,942 |
package com.wixpress.guineapig
import com.wixpress.guineapig.drivers.SpecificationWithEnvSupport
import org.springframework.http.HttpStatus
class PetriAppIT extends SpecificationWithEnvSupport {
"PetriApp" should {
"redirect on HTTP call" in {
val response = httpDriver.get("http://127.0.0.1:9901/petri/")... | wix/petri | guineapig-webapp-os/src/it/java/com/wixpress/guineapig/PetriAppIT.scala | Scala | bsd-3-clause | 1,057 |
package com.artclod.play
/**
* See http://chocksaway.com/blog/?p=547
*/
object CommonsMailerHelper {
// TODO
// def sendEmail(body : String, subject: String, from: String, recipients : String*) = {
// val mail = use[MailerPlugin].email
// mail.setSubject(subject)
// mail.setRecipient(recipients: _*)
// ... | kristiankime/calc-tutor | app/com/artclod/play/CommonsMailerHelper.scala | Scala | mit | 1,107 |
/**
* 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... | robort/kafka | core/src/main/scala/kafka/server/KafkaApis.scala | Scala | apache-2.0 | 40,341 |
/*
* 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... | dotty-staging/scalatest | scalactic-test/src/test/scala/org/scalactic/anyvals/NonEmptySetSpec.scala | Scala | apache-2.0 | 38,593 |
package interretis.intro
import interretis.utils.SparkContextBuilder.buildContext
import org.apache.spark.rdd.RDD
import org.apache.spark.rdd.RDD.rddToPairRDDFunctions
class WordCount {
def wordCount(lines: RDD[String]): RDD[(String, Int)] = {
val words = lines flatMap (_ split " ")
val occurences = words... | MarekDudek/spark-certification | src/main/scala/interretis/intro/WordCount.scala | Scala | mit | 1,022 |
/*
* 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/core/src/main/scala/org/apache/spark/sql/execution/python/ArrowPythonRunner.scala | Scala | apache-2.0 | 6,438 |
package unfiltered.filter
import unfiltered.response._
import unfiltered.Async
import javax.servlet.http.HttpServletResponse
trait AsyncBinding extends Async.Responder[HttpServletResponse] {
self: RequestBinding =>
private[filter] val con: org.eclipse.jetty.continuation.Continuation
private[filter] val filterC... | benhutchison/unfiltered | filter-async/src/main/scala/bindings.scala | Scala | mit | 673 |
package scavlink.task.schema
import scavlink.task._
import scala.collection.immutable.ListMap
/**
* Simplified definition for top-level request, response, and type reference schemas.
*/
case class RootSchema(title: String,
description: Option[String],
messages: List[Sche... | nickolasrossi/scavlink | src/main/scala/scavlink/task/schema/RootSchema.scala | Scala | mit | 1,468 |
trait Foo {
type Repr[+O] <: Foo {
type Repr[+OO] = Foo.this.Repr[OO]
}
def foo[T](f: Repr[T]): f.Repr[T] = ???
} | lampepfl/dotty | tests/pos-deep-subtype/i9346.scala | Scala | apache-2.0 | 124 |
package io.buoyant.namerd.storage.etcd
import com.twitter.finagle.Dtab
import com.twitter.io.Buf
import com.twitter.util.Activity
import io.buoyant.etcd.{Etcd, EtcdFixture}
import io.buoyant.namer.RichActivity
import io.buoyant.namerd.DtabStore.{DtabNamespaceAlreadyExistsException, DtabNamespaceDoesNotExistException, ... | linkerd/linkerd | namerd/storage/etcd/src/integration/scala/io/buoyant/namerd/storage/etcd/EtcdDtabStoreIntegrationTest.scala | Scala | apache-2.0 | 2,870 |
/*
* IJ-Plugins
* Copyright (C) 2002-2021 Jarek Sacha
* Author's email: jpsacha at gmail dot 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 ... | ij-plugins/ijp-toolkit | examples/scala/ij_plugins/toolkit/ui/progress/ProgressReporterExample.scala | Scala | lgpl-2.1 | 1,754 |
/**
* Copyright (c) 2013 Saddle Development Team
*
* 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 ... | saddle/saddle | saddle-core/src/main/scala/org/saddle/io/CsvFile.scala | Scala | apache-2.0 | 1,756 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | ArvinDevel/onlineAggregationOnSparkV2 | core/src/test/scala/org/apache/spark/deploy/rest/StandaloneRestSubmitSuite.scala | Scala | apache-2.0 | 28,117 |
/*
* Copyright 2017 PayPal
*
* 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 ... | akara/squbs | squbs-ext/src/test/scala/org/squbs/env/DummyEnvironmentResolver.scala | Scala | apache-2.0 | 1,516 |
package lila.tournament
import scala.concurrent.duration.FiniteDuration
import org.joda.time.DateTime
import lila.db.BSON._
import lila.user.{ User, UserRepo }
final class Winners(
mongoCache: lila.memo.MongoCache.Builder,
ttl: FiniteDuration) {
private implicit val WinnerBSONHandler =
reactivemongo.b... | r0k3/lila | modules/tournament/src/main/Winners.scala | Scala | mit | 1,446 |
package skinny.mailer
import org.scalatest._
class BodyTypeSpec extends FlatSpec with Matchers {
it should "have Text type" in {
Text.extension should equal("text")
}
it should "have Html type" in {
Html.extension should equal("html")
}
}
| holycattle/skinny-framework | mailer/src/test/scala/skinny/mailer/BodyTypeSpec.scala | Scala | mit | 260 |
package io.udash.testing
import io.udash._
import scala.collection.mutable
class TestViewFactoryRegistry(vp: Map[TestState, () => ViewFactory[_ <: TestState]],
default: () => ViewFactory[_ <: TestState]) extends ViewFactoryRegistry[TestState] {
var statesHistory: mutable.ArrayBuffer[TestState] = mutable.ArrayBuf... | UdashFramework/udash-core | core/.js/src/test/scala/io/udash/testing/TestViewFactoryRegistry.scala | Scala | apache-2.0 | 598 |
package com.omega.config
import org.springframework.context.annotation.Bean
import org.springframework.context.annotation.ComponentScan
import org.springframework.context.annotation.Configuration
import org.springframework.web.servlet.config.annotation.DefaultServletHandlerConfigurer
import org.springframework.web.ser... | milind-chawla/Omega | src/main/scala/com/omega/config/OmegaWebApplicationConfig.scala | Scala | mit | 1,655 |
/** soar
*
* Copyright (c) 2017 Hugo Firth
* Email: <me@hugofirth.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
*
... | NewcastleComputingScience/student-outcome-accelerator | core/src/main/scala/uk/ac/ncl/la/soar/Record.scala | Scala | apache-2.0 | 5,708 |
package controllers
import play.api._
import play.api.mvc._
import play.api.mvc.Session
import play.api.db.slick._
import play.api.data.{ Form }
import play.api.data.Forms._
import models.LoginInfo
import models.LDAPAuthentication
import models.persistance.UserDAO
object Login extends Controller {
def showLogin =... | seqprodbio/restoule | app/controllers/Login.scala | Scala | gpl-3.0 | 1,694 |
package service.bitcoin
import akka.event.Logging
import akka.http.scaladsl.marshalling.ToResponseMarshallable
import akka.http.scaladsl.model.HttpEntity
import akka.http.scaladsl.model.MediaTypes._
import akka.http.scaladsl.model.StatusCodes._
import akka.http.scaladsl.server.Directives._
import akka.stream.scaladsl.... | lancearlaus/akka-streams-http-presentation | src/main/scala/service/bitcoin/BitcoinTradesService.scala | Scala | apache-2.0 | 2,716 |
package cn.hjmao.learning.akka.http.demo.service
import cn.hjmao.learning.akka.http.demo.model.{UserEntity, UserEntityUpdate}
import cn.hjmao.learning.akka.http.demo.model.db.{DataSource, UserEntityTable}
import scala.concurrent.{ExecutionContext, Future}
/**
* Created by hjmao on 17-5-10.
*/
class UserService(va... | huajianmao/learning | framework/akka-http/demo/src/main/scala/cn/hjmao/learning/akka/http/demo/service/UserService.scala | Scala | mit | 1,294 |
package ml.sparkling.graph.operators.measures.vertex.betweenness.hua
import java.nio.file.Files
import ml.sparkling.graph.operators.MeasureTest
import ml.sparkling.graph.operators.measures.vertex.betweenness.edmonds.EdmondsBC
import org.apache.commons.io.FileUtils
import org.apache.spark.SparkContext
import org.apach... | sparkling-graph/sparkling-graph | operators/src/test/scala/ml/sparkling/graph/operators/measures/vertex/betweenness/hua/BetweennessHua$Test.scala | Scala | bsd-2-clause | 2,222 |
package com.lateralthoughts.points.controllers
import java.util.UUID
import com.lateralthoughts.points.model.JsonFormatter
import com.lateralthoughts.points.model.records.RewardingAction
import org.json4s.jackson.JsonMethods
import org.scalatra.test.scalatest._
class RewardingActionControllerTest extends ScalatraSui... | vincentdoba/points | points-server/src/test/scala/com/lateralthoughts/points/controllers/RewardingActionControllerTest.scala | Scala | mit | 5,587 |
/*
* Scala (https://www.scala-lang.org)
*
* Copyright EPFL and Lightbend, Inc.
*
* Licensed under Apache License 2.0
* (http://www.apache.org/licenses/LICENSE-2.0).
*
* See the NOTICE file distributed with this work for
* additional information regarding copyright ownership.
*/
package scala
package sys
imp... | lrytz/scala | src/library/scala/sys/SystemProperties.scala | Scala | apache-2.0 | 3,703 |
/*
* Copyright 2015 RONDHUIT Co.,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 agre... | gazimahmud/nlp4l | src/test/scala/org/nlp4l/stats/WordCountsSuite.scala | Scala | apache-2.0 | 7,862 |
/*
* 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... | zhangxiaoli73/BigDL | spark/dl/src/test/scala/com/intel/analytics/bigdl/integration/torch/LogSpec.scala | Scala | apache-2.0 | 1,994 |
/**
* Copyright 2015 Mohiva Organisation (license at mohiva dot 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 req... | mohiva/play-silhouette | silhouette/app/com/mohiva/play/silhouette/api/LoginInfo.scala | Scala | apache-2.0 | 1,384 |
package org.nexbook.app
import com.softwaremill.macwire._
import org.nexbook.concepts.akka.AkkaModule
import org.nexbook.concepts.pubsub.PubSubModule
import org.nexbook.fix.{FixEngineRunner, FixMessageHandler}
import org.slf4j.LoggerFactory
object OrderBookApp extends BasicComponentProvider {
val logger = LoggerFa... | milczarekIT/nexbook | src/main/scala/org/nexbook/app/OrderBookApp.scala | Scala | apache-2.0 | 1,025 |
package fi.pyppe.ircbot.slave
import com.google.code.chatterbotapi.{ChatterBotType, ChatterBotFactory}
import fi.pyppe.ircbot.LoggerSupport
import scala.concurrent.{ExecutionContext, Future}
import scala.util.{Failure, Success}
object BotWithinBot extends LoggerSupport {
private val botSession = {
val factory... | Pyppe/akka-ircbot | slave/src/main/scala/fi/pyppe/ircbot/slave/BotWithinBot.scala | Scala | mit | 1,016 |
/*
* Copyright 2011-2022 GatlingCorp (https://gatling.io)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by appli... | gatling/gatling | gatling-core/src/test/scala/io/gatling/core/assertion/AssertionSpec.scala | Scala | apache-2.0 | 12,749 |
package de.metacoder.edwardthreadlocal.analysis.datamodel
import de.metacoder.edwardthreadlocal
import scala.language.postfixOps
// other than a StackTraceElement array, this can be compared with equals, and returns a meaningful toString
case class StackTrace(elements:Seq[StackTraceElement])
object StackTrace {
pr... | metacoder/edward-tl | agent-impl/src/main/scala/de/metacoder/edwardthreadlocal/analysis/datamodel/StackTrace.scala | Scala | apache-2.0 | 1,589 |
package org.f100ded.play.fakews
import akka.util.ByteString
import play.api.libs.ws.{WSCookie, WSProxyServer}
case class FakeRequest
(
method: String,
url: String,
body: ByteString = ByteString.empty,
headers: Map[String, Seq[String]] = Map(),
cookies: Seq[WSCookie] = Seq(),
proxyServer: Option[WSProxySer... | f100ded/play-fake-ws-standalone | src/main/scala/org/f100ded/play/fakews/FakeRequest.scala | Scala | apache-2.0 | 407 |
/**
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may... | cran/rkafkajars | java/kafka/server/FetchDataInfo.scala | Scala | apache-2.0 | 939 |
import org.apache.spark.{SparkContext, SparkConf}
/**
* Created by jie on 4/13/16.
* userid, itemid, behavior, geohash, category, time
* item, geohash, category
*/
object featuresExtraction {
def main(args: Array[String]): Unit ={
if(args.length < 2){
println("Usage args")
System.exit(1)
... | JensenFeng/tianchi | src/main/featuresExtraction.scala | Scala | apache-2.0 | 9,521 |
/*
* Copyright 2017 PayPal
*
* 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 ... | akara/squbs | squbs-unicomplex/src/test/scala/org/squbs/stream/UnicomplexActorPublisherSpec.scala | Scala | apache-2.0 | 2,306 |
package org.ndc.ndc
class SimHash {
def fromFeatures(features: Array[Int]): Int = {
val bitcount = 32
val table = Array.fill(bitcount)(0)
for (value <- features) {
for (bit <- Range(0, bitcount)) {
if (((value >> bit) & 1) == 1) {
table(bit) += 1
... | NikolajLeischner/near_duplicates | src/main/scala/org/ndc/ndc/SimHash.scala | Scala | mit | 580 |
/*
* Copyright 2015 Netflix, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed t... | jasimmk/atlas | atlas-aws/src/test/scala/com/netflix/atlas/aws/DefaultAwsClientFactorySuite.scala | Scala | apache-2.0 | 2,150 |
object A {
def x: { def q: Int } = error("not important")
} | jamesward/xsbt | sbt/src/sbt-test/source-dependencies/struct-usage/A.scala | Scala | bsd-3-clause | 60 |
package nak.classify
import org.scalatest.FunSuite
import nak.data.{DataMatrix, Example}
import nak.stats.ContingencyStats
import breeze.linalg._
/**
*
* @author dlwh
*/
trait ClassifierTrainerTestHarness extends FunSuite {
def trainer[L,F]: Classifier.Trainer[L,Counter[F,Double]]
test("simple example") {
... | seanlgoldberg/nak | src/test/scala/nak/classify/ClassifierTrainerTestHarness.scala | Scala | apache-2.0 | 1,554 |
/**
* (C) Copyright IBM Corp. 2015 - 2017
*
* 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 la... | SparkTC/spark-bench | spark-launch/src/main/scala/com/ibm/sparktc/sparkbench/sparklaunch/submission/livy/LivySubmit.scala | Scala | apache-2.0 | 5,104 |
/*
* Sentries
* Copyright (c) 2012-2015 Erik van Oosten All rights reserved.
*
* The primary distribution site is https://github.com/erikvanoosten/sentries
*
* This software is released under the terms of the BSD 2-Clause License.
* There is NO WARRANTY. See the file LICENSE for the full text.
*/
package nl.gr... | erikvanoosten/sentries | src/test/scala/nl/grons/sentries/core/ConcurrencyLimitSentryTest.scala | Scala | bsd-2-clause | 2,290 |
package concrete.constraint
import concrete.{Domain, Event, Outcome, ProblemState}
trait Residues extends Constraint with EnumerateVariables {
val residues: ResidueManager = {
if (scope.map(v => v.initDomain.last - v.initDomain.head).sum < 30000) {
new ResidueManagerFast(scope)
} else {
new Res... | concrete-cp/concrete | src/main/scala/concrete/constraint/Residues.scala | Scala | lgpl-2.1 | 1,086 |
/**
* Copyright (C) 2007 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... | martinluther/orbeon-forms | src/main/scala/org/orbeon/oxf/processor/pipeline/PipelineFunctionLibrary.scala | Scala | lgpl-2.1 | 3,167 |
/*
* 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 ... | zcan/samza | samza-kafka/src/test/scala/org/apache/samza/config/TestKafkaConfig.scala | Scala | apache-2.0 | 8,744 |
package com.github.bzumhagen.sct
import java.time.LocalDate
import com.github.zafarkhaja.semver.Version
/** A changelog change
*
* @param description change description
* @param version change version
* @param changeType change type (i.e. Added)
* @param reference change reference (i.e. XYZ-123)
* @param... | bzumhagen/sct | src/main/scala/com/github/bzumhagen/sct/ChangelogChange.scala | Scala | mit | 780 |
/***********************************************************************
* Copyright (c) 2013-2022 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... | locationtech/geomesa | geomesa-features/geomesa-feature-kryo/src/main/scala/org/locationtech/geomesa/features/kryo/package.scala | Scala | apache-2.0 | 3,471 |
package example
import akka.actor.{PoisonPill, Props, Actor}
import akka.event.Logging
class Routee extends Actor {
val log = Logging(context.system, this)
def receive = {
case i : Int => {
println("Recieved something wallah............ClusterTest2")
log.error(s"${self.path} routing a calculation o... | taamneh/akka-cassandra-cluster-test-V2 | src/main/scala/example/Routee.scala | Scala | apache-2.0 | 482 |
package homepage.model
import net.liftweb.mapper._
object ImpressingItem extends ImpressingItem with KeyedMetaMapper[Long, ImpressingItem] {
override def dbTableName = "impressing_item"
override def fieldOrder = id :: title :: content :: youtubeIds :: urls :: tag :: Nil
}
class ImpressingItem extends KeyedMapper... | bbiletskyy/homepage | src/main/scala/homepage/model/ImpressingItem.scala | Scala | apache-2.0 | 685 |
object Test {
trait Fili[A]
trait Kili[M] {
def fili: Fili[M]
}
trait A extends Kili[A] {
def fili: Fili[A]
}
trait Ori[M] extends Kili[M] {
val ori: Fili[M]
def fili: ori.type
}
trait B extends Ori[B]
def foo(a: A, b: B) = if (true) a else b
}
| scala/scala | test/files/pos/t7612.scala | Scala | apache-2.0 | 282 |
package ca.hyperreal.sscheme
object MiscPrimitives extends Primitives
{
val list = Seq(
new Primitive( "display" )( {case SList(obj) => println(obj)} ),
new Primitive( "begin" )( {case exps: SList => exps.last} )
)
} | edadma/sscheme | src/main/scala/MiscPrimitives.scala | Scala | mit | 225 |
/*
* Copyright (C) 2014 Szu-Hsien Lee (misgod.tw@gmail.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable la... | misgod/twculture | src/main/scala/com/a30corner/twculture/CategoryFragment.scala | Scala | apache-2.0 | 1,909 |
package speedcam
import akka.actor.{Actor, ActorLogging, ActorRef, Props}
class LicenseFilter(next : ActorRef) extends Actor with ActorLogging {
override def receive : Receive = {
case msg : PhotoMessage =>
if (msg.license.isDefined) {
next ! msg
}
}
}
object LicenseFilter {
def props(n... | jvorhauer/akka-workshop | exercises/speedcam/src/main/scala/speedcam/LicenseFilter.scala | Scala | apache-2.0 | 371 |
package com.airbnb.scheduler.jobs.graph
import com.airbnb.scheduler.graph.JobGraph
import com.airbnb.scheduler.jobs.{DependencyBasedJob, BaseJob}
import org.jgrapht.experimental.dag.DirectedAcyclicGraph.CycleFoundException
import org.specs2.mock._
import org.specs2.mutable._
class JobGraphSpec extends SpecificationWi... | meelapshah/chronos | src/test/scala/com/airbnb/scheduler/jobs/graph/JobGraphSpec.scala | Scala | apache-2.0 | 4,688 |
package com.pygmalios.rawKafkaCassandra
import akka.actor.ActorSystem
import com.pygmalios.rawKafkaCassandra.actors.KafkaToCassandra
import com.pygmalios.rawKafkaCassandra.cassandra.CassandraSessionFactoryImpl
/**
* Application entry point.
*
* To load an external config file named `raw-kafka-cassandra.config`,... | pygmalios/raw-kafka-cassandra | src/main/scala/com/pygmalios/rawKafkaCassandra/RawKafkaCassandraApp.scala | Scala | apache-2.0 | 752 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | likithkailas/StreamingSystems | core/src/main/scala/org/apache/spark/util/RpcUtils.scala | Scala | apache-2.0 | 2,687 |
package com.twitter.finagle.httpx
import com.twitter.util.{Await, Promise, Future}
import com.twitter.finagle.client.Transporter
import com.twitter.finagle.{Service, ServiceFactory, Stack}
import org.junit.runner.RunWith
import org.scalatest.FunSuite
import org.scalatest.junit.JUnitRunner
@RunWith(classOf[JUnitRunner... | lysu/finagle | finagle-httpx/src/test/scala/com/twitter/finagle/httpx/TlsFilterTest.scala | Scala | apache-2.0 | 1,145 |
package com.lucidchart.open.nark.controllers
import com.lucidchart.open.nark.models.UserModel
import com.lucidchart.open.nark.models.records.{Pagination,User}
import com.lucidchart.open.nark.request.{AppAction, AppFlash, AuthAction}
import com.lucidchart.open.nark.views
import java.util.UUID
import play.api.data._
imp... | lucidsoftware/nark | app/com/lucidchart/open/nark/controllers/UsersController.scala | Scala | apache-2.0 | 3,390 |
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.