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 json.schema.codegen import json.schema.parser.JsonSchemaParser import org.scalatest.{FlatSpec, Matchers} import scalaz.\/- class ScalaGeneratorTest extends FlatSpec with Matchers with ScalaGenerator with ConsoleLogging { def parse(s: String): SValidation[Set[LangType]] = JsonSchemaParser.parse(s).flatMap(S...
VoxSupplyChain/json-schema-codegen
codegen/src/test/scala/json/schema/codegen/ScalaGeneratorTest.scala
Scala
apache-2.0
6,584
package myplugins import sbt._ import sbt.Keys._ object PluginKeys extends AutoPlugin { object autoImport { lazy val checkedSettingSet = Def.settingKey[Set[String]]("checked setting set") } } import PluginKeys.autoImport._ object PluginForJVM extends AutoPlugin { override def projectSettings: Seq[Se...
densh/sbt-cross-project
sbt-crossproject-test/src/sbt-test/new-api/plugins/project/MyPlugins.scala
Scala
bsd-3-clause
971
/* * 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
scalatest-test/src/test/scala/org/scalatest/tools/RunnerSpec.scala
Scala
apache-2.0
2,738
/* * Copyright 2020 Spotify AB. * * 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 ...
spotify/scio
scio-extra/src/main/scala/com/spotify/scio/extra/hll/zetasketch/syntax/SCollectionSyntax.scala
Scala
apache-2.0
4,371
package org.jetbrains.plugins.scala.externalHighlighters import com.intellij.lang.annotation.HighlightSeverity import com.intellij.openapi.fileEditor.FileEditorManager import com.intellij.openapi.util.TextRange import com.intellij.openapi.vfs.VirtualFile import org.jetbrains.plugins.scala.ScalaVersion import org.jetbr...
JetBrains/intellij-scala
scala/scala-impl/test/org/jetbrains/plugins/scala/externalHighlighters/ScalaWorksheetCompilerHighlightingTest.scala
Scala
apache-2.0
4,968
/*********************************************************************** * Copyright (c) 2017 IBM * Copyright (c) 2013-2017 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 ...
MutahirKazmi/geomesa
geomesa-cassandra/geomesa-cassandra-datastore/src/main/scala/org/locationtech/geomesa/cassandra/index/CassandraZ2Layout.scala
Scala
apache-2.0
2,470
package net.ettinsmoor import javax.xml.bind.DatatypeConverter object KeyFormat { def apply(key: String) : String = { val _key_bingformat = key + ":" + key DatatypeConverter.printBase64Binary(_key_bingformat.getBytes("UTF-8")) } }
dbarowy/bingerator
src/main/scala/net/ettinsmoor/KeyFormat.scala
Scala
bsd-2-clause
244
/* * 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 ...
Panos-Bletsos/spark-cost-model-optimizer
core/src/test/scala/org/apache/spark/status/api/v1/AllStagesResourceSuite.scala
Scala
apache-2.0
2,326
package org.scalatra import java.io.{ ByteArrayOutputStream, ObjectOutputStream } import org.junit.runner.RunWith import org.scalatest.junit.JUnitRunner import org.scalatest.{ BeforeAndAfterEach, FunSuite, Matchers } @RunWith(classOf[JUnitRunner]) class FlashMapTest extends FunSuite with Matchers with BeforeAndAfter...
lightvector/scalatra
core/src/test/scala/org/scalatra/FlashMapTest.scala
Scala
bsd-2-clause
3,944
package spotlight.app import java.nio.file.{ Paths, WatchEvent } import java.util.concurrent.atomic.AtomicLong import scala.concurrent.Future import scala.concurrent.duration._ import scala.util.{ Failure, Success } import akka.{ Done, NotUsed } import akka.actor.{ Actor, ActorRef, ActorSystem, DeadLetter, Props } im...
dmrolfs/lineup
app-batch/src/main/scala/spotlight/app/FileBatchExample.scala
Scala
mit
17,769
/* * Copyright 2014 Databricks * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to i...
JoshRosen/spark-avro
src/main/scala/com/databricks/spark/avro/package.scala
Scala
apache-2.0
1,108
/** * Copyright 2011-2017 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 appli...
MykolaB/gatling
gatling-http/src/main/scala/io/gatling/http/action/async/ws/WsReconciliate.scala
Scala
apache-2.0
1,148
package spire package tests import org.scalatest.Matchers import org.scalatest._ import prop._ trait SpireProperties extends PropSpec with Matchers with PropertyChecks { // disable scalatest === override def convertToEqualizer[T](left: T): Equalizer[T] = ??? } trait SpireTests extends FunSuite with Matchers { ...
kevinmeredith/spire
tests/src/test/scala/spire/tests/package.scala
Scala
mit
413
/* * 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 ...
ueshin/apache-flink
flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/plan/nodes/physical/stream/StreamExecValues.scala
Scala
apache-2.0
1,927
package com.nthportal.versions import org.scalatest.flatspec.AnyFlatSpec import org.scalatest.matchers.should.Matchers import org.scalatest.{Inside, OptionValues} abstract class SimpleSpec extends AnyFlatSpec with Matchers with Inside with OptionValues
NthPortal/versions
src/test/scala/com/nthportal/versions/SimpleSpec.scala
Scala
apache-2.0
255
package demy.mllib; import demy.mllib.evaluation.{BinaryMetrics, HasBinaryMetrics} import demy.mllib.util.log import demy.mllib.params._ import demy.storage.Storage import org.apache.spark.ml.{Transformer, Estimator, PipelineStage} import org.apache.spark.ml.param.{Params} import org.apache.spark.sql.{DataFrame, Row, ...
forchard-epi/demy
mllib/src/main/scala/Model.scala
Scala
bsd-3-clause
16,046
package agile.android import sbt._ import scala.xml._ protected object Android { def findManifestPath(sourceDirectory: File): File = { try { new File((sourceDirectory ** "AndroidManifest.xml").getPaths(0)) } catch { case _ : Throwable => throw new Exception("""Manife...
luismfonseca/agile-scala-android
src/main/scala/Android.scala
Scala
mit
1,960
package es.uvigo.ei.sing.biomsef package database import scala.concurrent.Future import play.api.Play import play.api.db.slick.{ DatabaseConfigProvider, HasDatabaseConfig } import play.api.libs.concurrent.Execution.Implicits.defaultContext import slick.driver.JdbcProfile import entity._ import util.Page trait Sear...
agjacome/biomsef
src/main/scala/database/SearchTermsDAO.scala
Scala
mit
4,741
package dk.bayes.dsl.variable.gaussian.univariate import dk.bayes.dsl.factor.SingleFactor import dk.bayes.math.gaussian.Gaussian import dk.bayes.dsl.variable.gaussian._ trait UnivariateGaussianFactor extends SingleFactor[Gaussian] { this: UnivariateGaussian => val factorMsgDown: Gaussian = Gaussian(this.m, this...
danielkorzekwa/bayes-scala
src/main/scala/dk/bayes/dsl/variable/gaussian/univariate/UnivariateGaussianFactor.scala
Scala
bsd-2-clause
325
package security import helpers._ import models._ import play.api.mvc._ import scala.concurrent._ import scala.util._ /** * @author zepeng.li@gmail.com */ trait Authentication extends PAMLogging { self: DefaultPlayExecutor => def _users: Users def pam: PAM def authenticate(req: RequestHeader) = pam(...
lizepeng/app.io
modules/security/app/security/Authentication.scala
Scala
apache-2.0
2,049
package com.olvind.crud package frontend import scalacss.Defaults._ import scalacss.ScalaCssReact._ import scalacss.ext.CssReset import scalacss.mutable.{GlobalRegistry, StyleSheet} object Styles extends StyleSheet.Inline { import dsl._ val body = style( CssReset.normaliseCss, fontFamily := "'Roboto', sa...
skytteren/slick-crud
crud/js/src/main/scala/com/olvind/crud/frontend/Styles.scala
Scala
apache-2.0
549
// Copyright (c) 2016 Yuichiroh Matsubayashi package yuima.nuimo.action import yuima.nuimo.Nuimode import yuima.nuimo.config.LedImage object ItunesAction { def playpause() = { val cmd = """tell application "Music" | playpause |end tell """.stripMargin Nuimode....
Yuichiroh/nuimode
src/main/scala/yuima/nuimo/action/ItunesAction.scala
Scala
mit
5,335
package at.nonblocking.cliwix.integrationtest import at.nonblocking.cliwix.core.ExecutionContext import at.nonblocking.cliwix.core.command.{CompanyInsertCommand, PageSetReadCommand, SiteInsertCommand, _} import at.nonblocking.cliwix.core.compare.LiferayEntityComparator import at.nonblocking.cliwix.core.handler._ impor...
nonblocking/cliwix
cliwix-test-integration/src/test/scala/at/nonblocking/cliwix/integrationtest/PageSetHandlerIntegrationTest.scala
Scala
agpl-3.0
3,924
package org.kokho.scheduling.multicritical.schedulers import org.kokho.scheduling.ScheduledJob import org.kokho.scheduling.multicritical.system.MulticriticalTask /** * @author: Mikhail Kokho * @date 7/3/15. */ class SwapScheduler (override val partition: Seq[Seq[MulticriticalTask]]) extends MulticriticalScheduler(...
mkokho/dynoslack
src/main/scala/org/kokho/scheduling/multicritical/schedulers/SwapScheduler.scala
Scala
apache-2.0
793
/** ***************************************************************************** * 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 Licen...
capitalone/Hydrograph
hydrograph.engine/hydrograph.engine.spark/src/main/scala/hydrograph/engine/spark/core/reusablerow/OutputReusableRow.scala
Scala
apache-2.0
2,402
/* * 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 ...
goldmedal/spark
core/src/main/scala/org/apache/spark/scheduler/LiveListenerBus.scala
Scala
apache-2.0
10,490
package dotty.tools.dotc package printing import core._ import Texts._, ast.Trees._ import Types.Type, Symbols.Symbol, Contexts.Context, Scopes.Scope, Constants.Constant, Names.Name, Denotations._, Annotations.Annotation /** The base class of all printers */ abstract class Printer { private[this] var prec:...
yusuke2255/dotty
src/dotty/tools/dotc/printing/Printer.scala
Scala
bsd-3-clause
3,192
/** **\\ ** Copyright (c) 2012 Center for Organic and Medicinal Chemistry ** ** Zurich University of Applied Sciences ** ** Wädenswil, Switzerland ** \\** ...
stefan-hoeck/chemf
src/main/scala/chemf/package.scala
Scala
gpl-3.0
885
/** * Copyright (C) 2010-2011 LShift 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 la...
aprescott/diffa
agent/src/main/scala/net/lshift/diffa/agent/amqp/AmqpInboundEndpointFactory.scala
Scala
apache-2.0
4,277
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may ...
wangmiao1981/spark
repl/src/test/scala/org/apache/spark/repl/ReplSuite.scala
Scala
apache-2.0
15,134
package defacto.crf import breeze.linalg.{Vector, SparseVector} import scala.collection.mutable import scala.collection.mutable.ArrayBuffer import scala.reflect.runtime.universe._ /** * Created by samanzaroot on 9/23/14. */ abstract class Domain[A](implicit val ev: TypeTag[A]) { val values : ArrayBuffer[A] val...
samanz/DeFacto
src/main/scala/defacto/crf/Domain.scala
Scala
apache-2.0
3,667
/* * Copyright 2021 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/amls-frontend
app/models/responsiblepeople/DateOfBirth.scala
Scala
apache-2.0
1,778
object power_table { def main(args: Array[String]) { // Put code here } }
LoyolaChicagoBooks/introcs-scala-examples
power_table/power_table.scala
Scala
gpl-3.0
82
package org.jetbrains.plugins.scala.codeInsight.intention.types import org.jetbrains.plugins.scala.codeInsight.intentions.ScalaIntentionTestBase class ConvertJavaToScalaCollectionIntentionTest extends ScalaIntentionTestBase { def familyName: String = ConvertJavaToScalaCollectionIntention.getFamilyName def testI...
LPTK/intellij-scala
test/org/jetbrains/plugins/scala/codeInsight/intention/types/ConvertJavaToScalaCollectionIntentionTest.scala
Scala
apache-2.0
2,570
/* * 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 ...
neoremind/kraps-rpc
kraps-core/src/main/scala/com/neoremind/kraps/rpc/RpcCallContext.scala
Scala
apache-2.0
1,340
/* ************************************************************************************* * 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...
fanf/cf-clerk
src/main/scala/com/normation/cfclerk/domain/Cf3PromisesFileTemplate.scala
Scala
agpl-3.0
4,138
package com.basho.riak.spark.rdd.failover import java.util.concurrent.CountDownLatch import com.basho.riak.spark._ import com.basho.riak.stub.{RequestBasedMessageAdapter, RiakMessageHandler} import org.junit.rules.ExpectedException import org.junit.{After, Rule, Test} import shaded.com.basho.riak.protobuf.RiakKvPB._ ...
basho/spark-riak-connector
connector/src/test/scala/com/basho/riak/spark/rdd/failover/RequestTimeoutTest.scala
Scala
apache-2.0
2,067
/* * Copyright (C) 2016-2017 Lightbend Inc. <https://www.lightbend.com> */ package com.lightbend.lagom.internal.scaladsl.persistence.jdbc import com.lightbend.lagom.internal.persistence.ReadSideConfig import com.lightbend.lagom.internal.persistence.jdbc.AbstractSlickOffsetStoreConfiguration import play.api.Configura...
edouardKaiser/lagom
persistence-jdbc/scaladsl/src/main/scala/com/lightbend/lagom/internal/scaladsl/persistence/jdbc/JdbcOffsetStore.scala
Scala
apache-2.0
999
/* * 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 ...
ksattler/piglet
src/main/scala/dbis/pig/op/ConstructBag.scala
Scala
apache-2.0
3,890
package frameless import org.scalacheck.Prop import org.scalacheck.Prop._ class SparkSessionTests extends TypedDatasetSuite { test("sparkSession") { def prop[A: TypedEncoder](data: Vector[A]): Prop = { val dataset = TypedDataset.create[A](data) dataset.sparkSession =? dataset.dataset.sparkSession ...
adelbertc/frameless
dataset/src/test/scala/frameless/forward/SparkSessionTests.scala
Scala
apache-2.0
396
/* * Licensed to Elasticsearch under one or more contributor * license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright * ownership. Elasticsearch licenses this file to you under * the Apache License, Version 2.0 (the "License"); you may * not use this fi...
eliasah/elasticsearch-hadoop
spark/src/itest/scala/org/elasticsearch/spark/integration/AbstractScalaEsSparkSQL.scala
Scala
apache-2.0
5,226
package cookbook trait Recipe { def title() def cook() }
ykchat/cookbook
scala/src/main/scala/cookbook/Recipe.scala
Scala
mit
69
package gitbucket.core.util import java.net.{URLDecoder, URLEncoder} import org.mozilla.universalchardet.UniversalDetector import ControlUtil._ import org.apache.commons.io.input.BOMInputStream import org.apache.commons.io.IOUtils object StringUtil { def sha1(value: String): String = defining(java.security.Mes...
uli-heller/gitbucket
src/main/scala/gitbucket/core/util/StringUtil.scala
Scala
apache-2.0
3,246
/* * Copyright 2012 Eike Kettner * * 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...
eikek/publet
gitr/src/main/scala/org/eknet/gitr/GitrRepository.scala
Scala
apache-2.0
12,977
/* * Copyright University of Basel, Graphics and Vision Research Group * * 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 ...
unibas-gravis/scalismo-faces
src/main/scala/scalismo/faces/parameters/ColorTransform.scala
Scala
apache-2.0
1,143
package com.lot.generators import org.joda.time.DateTime import org.scalacheck.Gen.oneOf import com.lot.security.model.SecurityType import com.lot.marketEvent.model.MarketEventType import com.lot.marketEvent.model.MarketEvent object MarketEventFactory { def generate(id: Option[Long] = None, name: St...
thimmaiah/life_of_a_trade_scala
src/test/scala/com/lot/generators/MarketEventFactory.scala
Scala
apache-2.0
1,438
package controllers.backend import play.api._ import play.api.mvc._ import play.api.data._ import play.api.data.Forms._ import play.api.data.validation.Constraints._ import models.Posts import entities.Post import util.Location object Blog extends Controller { val postModel = new Posts val postForm = Form( ...
icambridge-old/inspector
app/controllers/backend/Blog.scala
Scala
mit
2,346
import scala.quoted.* import scala.quoted.staging.* object Test extends App { // make available the necessary toolbox for runtime code generation given Compiler = Compiler.make(getClass.getClassLoader) run { val expr: Expr[Int] = '{ var x = 1; x = 2; 42 } expr match { case '{ var x: Int = $bindi...
dotty-staging/dotty
tests/neg-staging/i9693.scala
Scala
apache-2.0
506
package org.scalajs.testsuite.niobuffer import java.nio._ import scala.language.implicitConversions import scala.reflect._ sealed abstract class BufferFactory { type BufferType <: Buffer with Comparable[BufferType] type ElementType implicit val elemClassTag: ClassTag[ElementType] implicit def elemFromInt(v...
mdedetrich/scala-js
test-suite/shared/src/test/scala/org/scalajs/testsuite/niobuffer/BufferFactory.scala
Scala
bsd-3-clause
7,997
package gitbucket.core.util import org.scalatest.funspec.AnyFunSpec class StringUtilSpec extends AnyFunSpec { describe("urlEncode") { it("should encode whitespace to %20") { val encoded = StringUtil.urlEncode("aa bb") assert(encoded == "aa%20bb") } } describe("urlDecode") { it("should ...
gitbucket/gitbucket
src/test/scala/gitbucket/core/util/StringUtilSpec.scala
Scala
apache-2.0
4,478
// Adapted from i12949 object Catch22: trait TC[V] object TC: export Hodor.TC.given object Hodor: object TC: import Catch22.TC given fromString[V <: String]: TC[V] = new TC[V] {} transparent inline given fromDouble[V <: Double]: TC[V] = new TC[V]: type Out = Double given fromIn...
dotty-staging/dotty
tests/run/forwardCompat-refinedGivens/Lib_1_r3.0.scala
Scala
apache-2.0
364
package ee.cone.c4generator import scala.annotation.{StaticAnnotation, compileTimeOnly} import scala.meta.Term.Name import scala.meta._ import scala.collection.immutable.Seq case class ProtoProp( sizeStatement: String, encodeStatement: String, initDecodeStatement: String, decodeCase: String, constructArg:...
wregs/c4proto
generator/src/main/scala/ee/cone/c4generator/Protocol.scala
Scala
apache-2.0
11,836
package ai.akka.exception import akka.actor.ActorRef /** * Object with exceptions */ object Exception { /** * Trait with information and reference to actor which waiting http response */ trait OAuthServiceException { val httpResponseActor: ActorRef val msg: String } /** * Exception when p...
andrew--i/spray-oauth2
src/main/scala/ai/akka/exception/Exception.scala
Scala
apache-2.0
1,683
package spire package macros import spire.algebra.{Field, Ring} import spire.macros.compat.Context import spire.math.{Rational, UByte, UShort, UInt, ULong} object Macros { case class LiteralUtil(c: Context) { import c.universe._ def getString: String = { val Apply(_, List(Apply(_, List(Literal(Const...
tixxit/spire
core/shared/src/main/scala/spire/macros/Macros.scala
Scala
mit
6,955
object test { class AAA[T, S <: T](i: Int) } object test2 { import test.{AAA => BBB} val x = new BBB[/*caret*/] } //T, S <: T
whorbowicz/intellij-scala
testdata/parameterInfo/typeParameterInfo/SimpleTests/AliasedClassTypeParams.scala
Scala
apache-2.0
133
package org.bitcoins.script.stack import org.scalatest.{MustMatchers, FlatSpec} /** * Created by chris on 1/8/16. */ class StackOperationFactoryTest extends FlatSpec with MustMatchers { "StackOperationFactory" must "match correct operations with their strings" in { StackOperation.fromString("OP_DUP") must be...
Christewart/scalacoin
src/test/scala/org/bitcoins/script/stack/StackOperationFactoryTest.scala
Scala
mit
548
package com.sksamuel.elastic4s.fields.builders import com.sksamuel.elastic4s.fields.RankFeatureField import com.sksamuel.elastic4s.json.{XContentBuilder, XContentFactory} object RankFeatureFieldBuilderFn { def build(field: RankFeatureField): XContentBuilder = { val builder = XContentFactory.jsonBuilder() b...
stringbean/elastic4s
elastic4s-core/src/main/scala/com/sksamuel/elastic4s/fields/builders/RankFeatureFieldBuilderFn.scala
Scala
apache-2.0
466
package filters import play.api.mvc.{RequestHeader, Filter} import scala.concurrent.Future import play.api.mvc.SimpleResult import play.api.libs.concurrent.Execution.Implicits.defaultContext object VersionFilter extends Filter { override def apply(f: (RequestHeader) => Future[SimpleResult])(rh: RequestHeader) = {...
tsechov/shoehorn
app/filters/VersionFilter.scala
Scala
apache-2.0
400
package modules import com.google.inject.{ AbstractModule, Provides } import com.mohiva.play.silhouette.api.repositories.AuthInfoRepository import com.mohiva.play.silhouette.api.services._ import com.mohiva.play.silhouette.api.util._ import com.mohiva.play.silhouette.api.{ Environment, EventBus } import com.mohiva.pla...
sbrunk/play-silhouette-slick-seed
app/modules/SilhouetteModule.scala
Scala
apache-2.0
11,655
/** * Copyright (C) 2011 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 program i...
martinluther/orbeon-forms
src/test/scala/org/orbeon/oxf/portlet/FormRunnerRequestFilterTest.scala
Scala
lgpl-2.1
4,128
/* * 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 ...
rishita/mxnet
scala-package/core/src/main/scala/ml/dmlc/mxnet/optimizer/RMSProp.scala
Scala
apache-2.0
4,330
package com.xuanyuansen.algo import breeze.linalg._ import breeze.numerics.{ sqrt, exp, tanh, sigmoid } import com.typesafe.scalalogging.slf4j.Logger import org.slf4j.LoggerFactory import scala.collection.mutable.ArrayBuffer /** * Created by wangshuai on 16/7/14. * basic lstm network */ case class LSTMLayerParam(...
xuanyuansen/scalaLSTM
src/main/scala/com/xuanyuansen/algo/LSTM.scala
Scala
apache-2.0
23,785
package pureconfig.module.magnolia import scala.collection.JavaConverters._ import scala.language.higherKinds import com.typesafe.config.{ConfigFactory, ConfigRenderOptions, ConfigValueFactory} import org.scalacheck.Arbitrary import pureconfig.ConfigConvert.catchReadError import pureconfig._ import pureconfig.error....
pureconfig/pureconfig
modules/magnolia/src/test/scala/pureconfig/module/magnolia/ProductConvertersSuite.scala
Scala
mpl-2.0
7,190
package nodes.learning import org.scalatest.FunSuite import java.io._ import breeze.linalg._ import breeze.stats.distributions.Rand import org.apache.spark.rdd.RDD import org.apache.spark.SparkContext import pipelines._ import utils.{Stats, MatrixUtils, TestUtils} class BlockWeightedLeastSquaresSuite extends FunS...
etrain/keystone-old
src/test/scala/nodes/learning/BlockWeightedLeastSquaresSuite.scala
Scala
apache-2.0
2,996
/** * 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...
tnachen/kafka
core/src/main/scala/kafka/server/KafkaConfig.scala
Scala
apache-2.0
4,658
package org.gbougeard.model.changes /** * Created with IntelliJ IDEA. * User: gbougeard * Date: 13/07/13 * Time: 21:08 * To change this template use File | Settings | File Templates. */ case class ReviewInput(message: Option[String], labels: Option[Map[String, String]], ...
gbougeard/gas
src/main/scala/org/gbougeard/model/changes/ReviewInput.scala
Scala
apache-2.0
686
package dispatch.github import dispatch._ import Defaults._ import net.liftweb.json._ import java.util.Date case class GhContributor(id: Int, login: String, avatar_url: String) case class GhAuthorSummary(name:String, date:Date, email:String) case class GhAuthor(avatar_url: String, url: String, login: String, grava...
andreazevedo/dispatch-github
src/main/scala/dispatch/github/GhUser.scala
Scala
mit
1,000
package mesosphere.marathon.api.v2 import java.net.{ HttpURLConnection, URL, URLConnection } import javax.validation.ConstraintViolation import mesosphere.marathon.api.v2.BeanValidation._ import mesosphere.marathon.api.v2.json.{ V2AppDefinition, V2AppUpdate, V2Group, V2GroupUpdate } import mesosphere.marathon.state._...
ayouwei/marathon
src/main/scala/mesosphere/marathon/api/v2/ModelValidation.scala
Scala
apache-2.0
10,597
package mesosphere.marathon package stream import java.io.{ByteArrayInputStream, ByteArrayOutputStream} import akka.stream.scaladsl.Source import akka.util.ByteString import mesosphere.AkkaUnitTest import org.apache.commons.compress.archivers.tar.{TarArchiveInputStream, TarArchiveOutputStream, TarConstants} import s...
mesosphere/marathon
src/test/scala/mesosphere/marathon/stream/TarFlowTest.scala
Scala
apache-2.0
2,904
/* * Copyright (c) 2016. Fengguo (Hugo) Wei and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Detailed co...
arguslab/argus-cit-intellij
src/main/scala/org/argus/cit/intellij/jawa/lang/psi/api/base/JawaParameterList.scala
Scala
epl-1.0
671
/* * 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...
ray26/shadowsocks-android
src/main/scala/com/github/shadowsocks/database/ProfileManager.scala
Scala
gpl-3.0
5,947
/* * Licensed to The Apereo Foundation under one or more contributor license * agreements. See the NOTICE file distributed with this work for additional * information regarding copyright ownership. * * The Apereo Foundation licenses this file to you under the Apache License, * Version 2.0, (the "License"); you ma...
equella/Equella
Source/Plugins/Core/com.equella.core/scalasrc/com/tle/core/settings/UserPrefs.scala
Scala
apache-2.0
1,319
package webui import cz.kamenitxan.jakon.core.model.Page import org.openqa.selenium.{By, WebDriver} import org.scalatest.DoNotDiscover import test.TestBase import scala.jdk.CollectionConverters._ /** * Created by TPa on 2019-03-19. */ @DoNotDiscover class ObjectControllerTest extends TestBase { private def che...
kamenitxan/Jakon
modules/backend/src/test/scala/webui/ObjectControllerTest.scala
Scala
bsd-3-clause
4,219
package com.magmanics.licensing.ui.content.customer import com.magmanics.licensing.model.Customer import com.magmanics.vaadin.component.TableWithCheckboxes import scala.collection.JavaConverters._ /** * @author James Baxter - 05/09/2014. */ class CustomerSelectionTable(customers: Set[Customer]) extends TableWithCh...
manicmonkey/licensing
Licensing-UI-Vaadin/src/main/scala/com/magmanics/licensing/ui/content/customer/CustomerSelectionTable.scala
Scala
gpl-3.0
761
package pl.touk.nussknacker.engine.flink.util.transformer.aggregate import org.apache.flink.annotation.PublicEvolving import org.apache.flink.api.common.typeinfo.TypeInformation import org.apache.flink.streaming.api.scala._ import org.apache.flink.streaming.api.windowing.assigners.{EventTimeSessionWindows, TumblingEve...
TouK/nussknacker
engine/flink/components/base/src/main/scala/pl/touk/nussknacker/engine/flink/util/transformer/aggregate/transformers.scala
Scala
apache-2.0
9,747
import controllers.PowerLevelsController import org.junit.runner._ import org.specs2.mutable._ import org.specs2.runner._ import play.api.test.Helpers._ import play.api.test._ @RunWith(classOf[JUnitRunner]) class PowerLevelsControllerSpec extends Specification { PowerLevelsController.getClass.getName should { "s...
saturday06/github-scouter.net
test/PowerLevelsControllerSpec.scala
Scala
mit
660
package engine import org.lwjgl.LWJGLException import org.lwjgl.opengl.Display import org.lwjgl.opengl.DisplayMode import org.lwjgl.opengl.GLContext import org.lwjgl.opengl.ContextCapabilities import org.lwjgl.input.Keyboard import org.lwjgl.input.Mouse import org.lwjgl.util.Timer import scala.collection.mutable.Hash...
julienr/scalamd5
src/main/scala/engine/kernel.scala
Scala
bsd-2-clause
2,442
package de.htwg.zeta.server.model.modelValidator.generator import de.htwg.zeta.common.models.project.concept.Concept import de.htwg.zeta.server.model.modelValidator.generator.consistencyRules.ConsistencyRules class ConceptConsistencyChecker(concept: Concept) { def checkConsistency(): ConsistencyCheckResult = Consi...
Zeta-Project/zeta
api/server/app/de/htwg/zeta/server/model/modelValidator/generator/ConceptConsistencyChecker.scala
Scala
bsd-2-clause
578
package gapt.examples import gapt.expr._ import gapt.proofs.Sequent import gapt.proofs.context.Context import gapt.proofs.context.update.InductiveType import gapt.proofs.context.update.{ PrimitiveRecursiveFunction => PrimRecFun } import gapt.proofs.context.update.ProofNameDeclaration import gapt.proofs.context.update....
gapt/gapt
examples/schema/Schema Tutorial/FirstSchema4.scala
Scala
gpl-3.0
3,309
/* * 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 ...
apache/flink
flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/planner/plan/rules/physical/stream/TwoStageOptimizedAggregateRule.scala
Scala
apache-2.0
6,465
package fpinscala.datastructures sealed trait List[+A] // `List` data type, parameterized on a type, `A` case object Nil extends List[Nothing] // A `List` data constructor representing the empty list /* Another data constructor, representing nonempty lists. Note that `tail` is another `List[A]`, which may be `Nil` o...
Tillaert/fpinscala
exercises/src/main/scala/fpinscala/datastructures/List.scala
Scala
mit
4,778
package com.eharmony.aloha.models.reg import com.eharmony.aloha.dataset.density.Sparse import com.eharmony.aloha.semantics.func.GenAggFunc import scala.collection.{immutable => sci, mutable => scm} /** * A helper trait for sparse regression models with String keys. This trait exposes the ''constructFeatures'' * m...
eHarmony/aloha
aloha-core/src/main/scala/com/eharmony/aloha/models/reg/RegressionFeatures.scala
Scala
mit
6,025
/* * 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 ...
sahilTakiar/spark
sql/core/src/main/scala/org/apache/spark/sql/streaming/ProcessingTime.scala
Scala
apache-2.0
4,523
package relational.attributes import relational.comparissions._ import relational.comparissions.None trait Comparable extends AttributeLike { def ===(other: => Any ) = this == other def ->(other: => Any ) = this == other def ==(other: => Any ) = newEquality(Equality.Equals, other) def !=(other: => Any ) = ne...
mauricioszabo/relational-scala
src/main/scala/relational/attributes/Comparable.scala
Scala
artistic-2.0
1,186
package de.choffmeister.microserviceutils.auth.models import java.security.MessageDigest import java.time.Instant import java.util.Base64 import de.choffmeister.microserviceutils.auth.utils.ConstantTimeCompare final case class AuthorizationCode( code: String, state: Option[String], scopes: Set[String], resou...
choffmeister/microservice-utils
microservice-utils-auth/src/main/scala/de/choffmeister/microserviceutils/auth/models/AuthorizationCode.scala
Scala
mit
1,265
/* * * Copyright 2014 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 ...
wstcpyt/breeze
math/src/test/scala/breeze/stats/distributions/HasCdfTestBase.scala
Scala
apache-2.0
1,953
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may ...
tophua/spark1.52
streaming/src/test/scala/org/apache/spark/streaming/scheduler/rate/PIDRateEstimatorSuite.scala
Scala
apache-2.0
7,869
/** * 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...
engagepoint/camel
components/camel-scala/src/test/scala/org/apache/camel/scala/dsl/SplitterTokenizeXMLTest.scala
Scala
apache-2.0
1,596
/** * Copyright 2015 Ram Sriharsha * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to i...
harsha2010/magellan
src/main/scala/magellan/mapreduce/ShapeInputFormat.scala
Scala
apache-2.0
3,259
package backpresurre import scala.concurrent.duration._ import java.util.Date class LeakyBucket(var rate: Int, var perDuration: FiniteDuration) { var numDropsInBucket: Int = 0 var timeOfLastDropLeak:Date = null var msDropLeaks = perDuration.toMillis def dropToBucket():Boolean = { synchronized { va...
tnddn/iv-web
portal/rest-portal/app/backpresurre/LeakyBucket.scala
Scala
apache-2.0
956
package sgl.android /** Provides Android implementation for games services * * Games services are features that request the use of a server to * sync data between players. The most common example is the Google * games services which provide out-of-the-box many useful services such * as leaderboards, achievem...
regb/scala-game-library
android/core/src/main/scala/sgl/android/services/package.scala
Scala
mit
618
package japgolly.microlibs.recursion import cats.free.Free import cats.{Functor, Monad} final class FAlgebraOps[F[_], A](private val self: FAlgebra[F, A]) extends AnyVal { def toFAlgebraM[M[_]](implicit M: Monad[M]): FAlgebraM[M, F, A] = fa => M.point(self(fa)) def toRAlgebra(implicit F: Functor[F]): RAlgeb...
japgolly/microlibs-scala
recursion/shared/src/main/scala/japgolly/microlibs/recursion/Algebras.scala
Scala
apache-2.0
1,233
/* * Copyright (C) 2015-2016 Paulo Angelo Alves Resende <pa@pauloangelo.com> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License Version 2 as * published by the Free Software Foundation. You may not use, modify or * distribute this program und...
pauloangelo/hogzilla
src/Hogzilla.scala
Scala
gpl-2.0
2,659
package org.orbroker import JdbcCloser._ import org.orbroker.exception._ import java.sql.{ SQLException, ResultSet, Connection, PreparedStatement } /** * The session encapsulating the a connection * from the data source. * @author Nils Kilden-Pedersen */ private[orbroker] abstract class Session( isolationLev...
nilskp/orbroker
src/main/scala/org/orbroker/Session.scala
Scala
mit
2,974
package is.hail.asm4s import java.io._ import java.nio.charset.StandardCharsets import is.hail.expr.ir.EmitCodeBuilder import is.hail.lir import is.hail.utils._ import org.apache.spark.TaskContext import org.objectweb.asm.ClassReader import org.objectweb.asm.Opcodes._ import org.objectweb.asm.tree._ import org.object...
hail-is/hail
hail/src/main/scala/is/hail/asm4s/ClassBuilder.scala
Scala
mit
21,925
package japgolly.microlibs.nonempty import utest._ object NonEmptyTest extends TestSuite { case class X() case class Y() override def tests = Tests { "vector" - { "empty" - assert(NonEmpty(Vector()).isEmpty) "one" - assert(NonEmpty(Vector(1)) == Some(NonEmptyVector(1))) "two" - assert(No...
japgolly/microlibs-scala
nonempty/shared/src/test/scala/japgolly/microlibs/nonempty/NonEmptyTest.scala
Scala
apache-2.0
770
package tmeval trait TopicModel { def topicweights: Array[Double] def topics: Array[Map[Int,Double]] lazy val cachedTypeProfiles = collection.mutable.HashMap[Int,Array[Double]]() // Get the probability of a word in each topic. Cache the values we've looked up // already to minimize hash lookups. Could be d...
utcompling/topicmodel-eval
src/main/scala/tmeval/Model.scala
Scala
apache-2.0
5,189
package sampler.example import java.nio.file.{Files, Paths} import org.apache.commons.io.FileUtils import play.api.libs.json.JsObject import play.api.libs.json.Json import play.api.libs.json.Json._ import sampler._ import sampler.distribution.Distribution import sampler.io.Rounding.Roundable import sampler.maths.Rand...
tearne/Sampler
sampler-examples/src/main/scala/sampler/example/Randomisation.scala
Scala
apache-2.0
5,932
package pl.project13.scala.akka.raft import pl.project13.scala.akka.raft.config.RaftConfig import pl.project13.scala.akka.raft.model._ import pl.project13.scala.akka.raft.protocol._ import scala.annotation.tailrec import scala.collection.immutable private[raft] trait Follower { this: RaftActor => protected def ...
colin-scott/akka-raft
src/main/scala/pl/project13/scala/akka/raft/Follower.scala
Scala
apache-2.0
5,085
/* * 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 ...
javalovelinux/SparkGroovyScript
mllib/src/test/scala/org/apache/spark/mllib/impl/PeriodicRDDCheckpointerSuite.scala
Scala
apache-2.0
6,325