code
stringlengths
5
1M
repo_name
stringlengths
5
109
path
stringlengths
6
208
language
stringclasses
1 value
license
stringclasses
15 values
size
int64
5
1M
/* * Licensed 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 * distributed under the...
gnieh/tekstlib
src/main/scala/gnieh/diff/MyersLcs.scala
Scala
apache-2.0
1,479
package org.ciroque.logging import org.ciroque.logging.ImplicitLogging._ import org.scalatest.{Matchers, FunSpec} import org.scalatest.mock.EasyMockSugar class ImplicitLoggingTests extends FunSpec with Matchers with EasyMockSugar { describe("ImplicitLogging") { it("writes an info message to the logger with Suc...
ciroque/ImplicitLogging
src/test/scala/org/ciroque/logging/ImplicitLoggingTests.scala
Scala
mit
2,470
package akka.persistence.pg.query import akka.actor.Props import akka.persistence.pg.TestActor._ import akka.persistence.pg._ import akka.stream.scaladsl.Sink import com.typesafe.config.ConfigFactory import org.scalatest.concurrent.Eventually import scala.concurrent.Future /** * uses the default RowIdUpdating writ...
WegenenVerkeer/akka-persistence-postgresql
modules/akka-persistence-pg/src/test/scala/akka/persistence/pg/query/EventStoreQueryTest.scala
Scala
mit
9,782
package edu.berkeley.nlp.coref import scala.collection.mutable.HashSet import scala.collection.mutable.ArrayBuffer import edu.berkeley.nlp.futile.util.Logger import scala.collection.JavaConverters._ import edu.berkeley.nlp.futile.util.Counter import edu.berkeley.nlp.coref.nchains.DiscourseAnalyzer import edu.berkeley.n...
nate331/jbt-berkeley-coref-resolution
src/main/java/edu/berkeley/nlp/coref/CorefEvaluator.scala
Scala
gpl-3.0
25,536
object Acronym { def abbreviate(phrase: String): String = ??? }
exercism/xscala
exercises/practice/acronym/src/main/scala/Acronym.scala
Scala
mit
66
/* * 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
test/iht/views/ihtHelpers/custom/QuestionnaireFormViewTest.scala
Scala
apache-2.0
2,460
/* Copyright 2009-2016 EPFL, Lausanne */ package leon package synthesis import purescala.Expressions._ import purescala.Definitions._ import purescala.ExprOps._ import purescala.Common._ import purescala.Constructors._ import evaluators._ import leon.grammars._ import codegen._ import datagen._ import solvers._ impor...
epfl-lara/leon
src/main/scala/leon/synthesis/ExamplesFinder.scala
Scala
gpl-3.0
12,733
// NOTE: copy/pasted from https://github.com/lampepfl/dotty/tree/1962ada58fcd2333a2e40179ab0ac6efb6167ed2 package scala.meta package internal package tasty import collection.mutable abstract class TastyName object TastyName { case class NameRef(index: Int) extends AnyVal case class Simple(name: String) extend...
beni55/scalameta
scalameta/taxonomic/src/main/scala/scala/internal/tasty/TastyName.scala
Scala
bsd-3-clause
1,091
// Copyright 2014 Commonwealth Bank of Australia // // 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 ap...
twitter/scalding
scalding-core/src/test/scala/com/twitter/scalding/typed/PartitionedTextLineTest.scala
Scala
apache-2.0
3,773
/* * 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/web/settings/SettingsList.scala
Scala
apache-2.0
12,558
/* * Copyright (C) Lightbend Inc. <https://www.lightbend.com> */ package sbt.internal import sbt._ import sbt.compiler.Eval trait PlayDocsPluginCompat { def defaultLoad(state: State, localBase: java.io.File): (() => Eval, BuildStructure) = { Load.defaultLoad(state, localBase, state.log) } def evaluateCo...
benmccann/playframework
dev-mode/play-docs-sbt-plugin/src/main/scala/sbt/internal/PlayDocsPluginCompat.scala
Scala
apache-2.0
569
package io.rampant.vulgar.security import models.db.{UserTokens, Users} import play.api.libs.concurrent.Execution.Implicits.defaultContext import play.api.mvc.Results._ import play.api.mvc._ import scala.concurrent.Future object Secured { val Authenticated = new ActionBuilder[AuthRequest] with ActionTransformer[Re...
duaiwe/vulgar
app/io/rampant/vulgar/security/Secured.scala
Scala
mit
1,071
package com.milesoc.sa.core import com.stackmob.core.rest.ResponseToProcess import scala.collection.JavaConverters._ /** * Created by IntelliJ IDEA. * User: miles * Date: 2/10/13 */ object Utils { def errorResponse(code: Int, msg: String) = new ResponseToProcess(code, Map("error" -> msg).asJava) }
milesoc/cc-standard_aether
src/main/scala/com/milesoc/sa/core/Utils.scala
Scala
apache-2.0
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 may ...
mdespriee/spark
sql/catalyst/src/main/scala/org/apache/spark/sql/types/StructType.scala
Scala
apache-2.0
18,981
import com.orientechnologies.orient.core.sql.query.OResultSet import gremlin.scala._ import java.util.{ArrayList => JArrayList} import org.apache.tinkerpop.gremlin.orientdb._ import org.scalatest.{ShouldMatchers, WordSpec} import scala.collection.JavaConversions._ class SimpleSpec extends WordSpec with ShouldMatchers ...
dantodor/gremlin-scala-examples
orientdb/src/test/scala/SimpleSpec.scala
Scala
apache-2.0
6,368
package isabelle.eclipse.core.util import org.eclipse.core.runtime.IProgressMonitor import org.eclipse.core.runtime.IStatus import org.eclipse.core.runtime.Status import org.eclipse.core.runtime.jobs.Job /** A convenience encapsulation of Eclipse Job that can be restarted periodically * (with possible postpone dela...
andriusvelykis/isabelle-eclipse
isabelle.eclipse.core/src/isabelle/eclipse/core/util/PostponeJob.scala
Scala
epl-1.0
1,717
package com.giyeok.jparser.examples.metalang import com.giyeok.jparser.examples.{MetaLang1Example, MetaLangExample, MetaLangExamples} object SimpleGrammars extends MetaLangExamples { val arrayGrammar: MetaLang1Example = MetaLang1Example("SimpleArrayGrammar", """S = '[' WS elems WS ']' |elems = e...
Joonsoo/moon-parser
examples/src/main/scala/com/giyeok/jparser/examples/metalang/SimpleGrammars.scala
Scala
mit
3,017
/* * (c) Copyright 2016 Hewlett Packard Enterprise Development LP * * 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 b...
hpe-cct/cct-core
src/main/scala/cogx/compiler/codegenerator/opencl/hyperkernels/TensorReduceHyperKernel.scala
Scala
apache-2.0
10,186
/** * 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...
sebadiaz/kafka
core/src/main/scala/kafka/server/epoch/LeaderEpochFileCache.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 ...
zzcclp/carbondata
integration/spark/src/main/scala/org/apache/spark/sql/execution/command/index/CarbonCreateIndexCommand.scala
Scala
apache-2.0
14,380
/* * 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 ...
tillrohrmann/flink
flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/planner/plan/rules/physical/stream/StreamPhysicalWindowRankRule.scala
Scala
apache-2.0
3,979
/* * 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 ...
witgo/spark
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/UpdateFields.scala
Scala
apache-2.0
3,306
package chaplin import net.liftweb.json._ object Views { def of(jv: JValue, view: Option[Value] = Some(View())): Option[Value] = jv match { case JObject(fields) => val mapped = fields.map { case JField(name, value) => (name, of(value, view)) } view.flatMap { case v: V...
softprops/chaplin
src/test/scala/views.scala
Scala
mit
972
package org.jetbrains.plugins.scala.project import com.intellij.util.net.HttpConfigurable import org.jetbrains.plugins.scala.buildinfo.BuildInfo import org.jetbrains.plugins.scala.project.Platform.{Dotty, Scala} import scala.io.Source import scala.util.Try import scala.util.matching.Regex /** * @author Pavel Fatin ...
loskutov/intellij-scala
src/org/jetbrains/plugins/scala/project/Versions.scala
Scala
apache-2.0
2,666
package services.documents.pdf import org.log4s.getLogger import play.api.libs.json.{ JsBoolean, JsString, JsValue } object ConcatOrdering extends Ordering[PDFFieldLocator] { override def compare(left: PDFFieldLocator, right: PDFFieldLocator): Int = { val rightOrder: Int = right.concatOrder.getOrElse(0) va...
vetafi/vetafi-web
app/services/documents/pdf/PDFMapping.scala
Scala
apache-2.0
4,444
val outFile = opts.woFile("outFile","The file to write the merged counts to") val args = opts.listOfArgs("files","The list of files to merge") opts.verify namedTask("Merge counts") { val readers = args.map { arg => new util.PeekableIterator(opts.openInput(arg).getLines) } val out = opts.openOutput(outFile) whil...
jmccrae/nimrod
scripts/merge-counts.scala
Scala
apache-2.0
955
/* * Copyright 2012 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 t...
cordoval/zipkin
zipkin-test/src/test/scala/com/twitter/zipkin/Configs.scala
Scala
apache-2.0
3,762
package main.scala.overlapping.timeSeriesOld import breeze.linalg.{DenseMatrix, DenseVector} import main.scala.overlapping.containers.TSInstant import scala.reflect.ClassTag /** * Created by Francois Belletti on 9/24/15. */ class AutoregressiveLoss[IndexT : ClassTag]( p: Int, lossFunction: (Array[DenseMatrix[D...
bellettif/sparkGeoTS
sparkTS/src/main/scala/overlapping/timeSeriesOld/AutoregressiveLoss.scala
Scala
bsd-3-clause
1,103
package com.karasiq.bootstrap.buttons import com.karasiq.bootstrap.BootstrapImplicits._ import com.karasiq.bootstrap.{Bootstrap, BootstrapHtmlComponent} import org.scalajs.dom import rx._ import scalatags.JsDom.all._ final class DisabledButton(btn: ConcreteHtmlTag[dom.html.Button])(implicit ctx: Ctx.Owner) extends B...
GWoodmansey/Bootstrap-Scala.js-Play-Modal-Example
Project/client/src/main/scala/com/karasiq/bootstrap/buttons/DisabledButton.scala
Scala
mit
616
package lists import org.scalatest.FlatSpec import lists.P03.nth class ListNthSpec extends FlatSpec { "Checking for 0th element on List(1, 2, 3, 4, 5)" should "yield 1" in { val list = List(1, 2, 3, 4, 5) assert(nth(0, list) == 1) } "Checking for 1st element on List(42)" should "yield NoSuchElementEx...
luizpericolo/s-99
src/test/scala/lists/ListNthSpec.scala
Scala
mit
430
package be.ellefant.cloudr class AboutActivitySpec extends CloudrSpecification { def is = sequential ^ "AboutActivity should" ^ "show the about info" ! Context().showAbout end case class Context() extends RoboContext with Mocks.ConfigMock { val activity = new AboutActivity def showAbout = this...
sdb/cloudr
app/test/be/ellefant/cloudr/AboutActivitySpec.scala
Scala
gpl-3.0
494
package repositories.impl.mock import models.Teacher import repositories.general.{BaseTeacherRepository} import scala.concurrent.Future import scala.concurrent.ExecutionContext.Implicits.global class MockTeacherRepository extends BaseTeacherRepository { val teachers = Seq( Teacher(4, "Chris", "Robb", "Chris Ro...
Tannheuser/education
app/repositories/impl/mock/MockTeacherRepository.scala
Scala
mit
957
/* * 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 ...
yelshater/hadoop-2.3.0
spark-core_2.10-1.0.0-cdh5.1.0/src/main/scala/org/apache/spark/TaskState.scala
Scala
apache-2.0
1,935
package metamorphic.dsl.application import scala.reflect.macros.blackbox.Context case class Code(value: Any) { def trees(implicit c: Context): List[c.Tree] = { value match { case trees: List[c.Tree] => trees } } def merge(code: Code)(implicit c: Context): Code = { Code(trees ++ code.trees)...
frroliveira/metamorphic
metamorphic/src/main/scala/metamorphic/dsl/application/Code.scala
Scala
mit
326
package org.hablapps.meetup package funmonad package play import logic._ import common.logic.Domain._ import common.mysql.MySqlDomain._ import _root_.play.api.db.slick.DB import _root_.play.api.Play.current import scala.slick.driver.MySQLDriver.simple.{Sequence => _, _} import scalaz.Id.Id object IdStore extends S...
hablapps/meetapp
app/funMonad/play/IdStore.scala
Scala
apache-2.0
1,376
package scalaz.stream.mongodb.channel import scalaz.stream.Process import scalaz.stream.Process._ import scalaz.concurrent.Task import scalaz._ case class ChannelResult[R, A](channel: Channel[Task, R, Process[Task, A]]) { private[mongodb] def modify[B](f: Process[Task, A] => Process[Task, B]): ChannelResult[R, B...
Spinoco/scalaz-stream-mongodb
core/src/main/scala/scalaz/stream/mongodb/channel/ChannelResult.scala
Scala
mit
7,350
package x7c1.linen.database.control.upgrade object NotificationIdSchema { def init = Seq( s"""CREATE TABLE IF NOT EXISTS notification_ids ( | notification_id INTEGER PRIMARY KEY AUTOINCREMENT, | notification_content_kind TEXT NOT NULL, | notification_content_key TEXT NOT NULL, | c...
x7c1/Linen
linen-repository/src/main/scala/x7c1/linen/database/control/upgrade/NotificationIdSchema.scala
Scala
mit
602
package a19.step4 trait 自然数 { type Next[T] <: 自然数 type 作进位准备 <: 自然数 type 加数后上级进位操作[II <: 自然数] <: 自然数 } class P_3_Step_1[T1, T2, II1 <: 自然数, II2 <: 自然数] extends 自然数 { type _1_th = T1 type _2_th = T2 type _1 = II1 type _2 = II2 override type Next[T] = II1#加数后上级进位操作[P_3_Step_1[T1, T2, II1#Next[T], II2]...
djx314/ubw
a19-一二三/src/main/scala/a19/step4/三进制.scala
Scala
bsd-3-clause
4,281
package org.aja.tej.utils import org.apache.spark.rdd.RDD import org.apache.spark.{SparkContext, SparkConf} /** * Created by mageswaran on 26/7/15. */ object TejUtils { def getSparkContext(applicationName: String, master: String = "local[4]", config: Option[SparkConf] = None) = { val conf = config.getOrElse...
Mageswaran1989/aja
src/main/scala/org/aja/tej/utils/TejUtils.scala
Scala
apache-2.0
2,806
package com.twitter.finatra.http.request import com.google.common.net.{MediaType => CommonMediaTypes} import com.twitter.finagle.http.Request import com.twitter.finatra.http.HttpHeaders import com.twitter.finatra.http.exceptions.{BadRequestException, NotAcceptableException} import com.twitter.finatra.http.fileupload.{...
syamantm/finatra
http/src/main/scala/com/twitter/finatra/http/request/RequestUtils.scala
Scala
apache-2.0
1,910
/** * 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...
KevinLiLu/kafka
core/src/main/scala/kafka/api/Request.scala
Scala
apache-2.0
1,387
/* * 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
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/aggregate/CountMinSketchAggSuite.scala
Scala
apache-2.0
7,755
package stgy import core.spatial.Viewable trait Element extends Viewable{ var x : Double var y : Double }
DeltaIMT/Delta
stgy_server/src/main/scala/stgy/Element.scala
Scala
mit
112
package ozmi.lambda_core package lib import org.kiama.rewriting.Rewriter._ object Num extends TypeClass { object Zero extends NullaryOp ("Num.zero") object One extends NullaryOp ("Num.one") object Add extends BinaryOp ("Num.add") { override lazy val evalRules = rule[Expr] { ...
ozmi/lambda_core
src/main/scala/ozmi/lambda_core/lib/Num.scala
Scala
mit
1,158
/*********************************************************************** * Copyright (c) 2013-2020 Commonwealth Computer Research, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Apache License, Version 2.0 * which accompanies this distribution and...
aheyne/geomesa
geomesa-index-api/src/main/scala/org/locationtech/geomesa/index/index/z2/Z2Index.scala
Scala
apache-2.0
2,026
/** * Created by gkt on 12/12/14. */ package org.scalatddpackt import org.junit.Test import org.junit.Assert._ /** * Simple JUnit-based tests. */ class Tests { @Test def testTrue(): Unit = { assertTrue(true); } @Test def testFalse(): Unit = { assertFalse(false); } @Test def testDouble(): Unit...
LoyolaChicagoCode/scala-tdd-fundamentals
src/exclude/Tests.scala
Scala
apache-2.0
363
package issue347 import org.joda.time.DateTime import org.scalatest._ import scalikejdbc._ import scalikejdbc.scalatest.AutoRollback import skinny.dbmigration.DBSeeds import skinny.orm._ trait Connection { Class.forName("org.h2.Driver") ConnectionPool.add(Symbol("issue347"), "jdbc:h2:mem:issue347;MODE=PostgreSQL"...
skinny-framework/skinny-framework
orm/src/test/scala/issue346/Issue347Spec.scala
Scala
mit
4,018
package se.lu.nateko.cp.meta.utils.rdf4j import scala.collection.AbstractIterator import org.eclipse.rdf4j.common.iteration.CloseableIteration import se.lu.nateko.cp.meta.api.CloseableIterator class Rdf4jIterationIterator[T](res: CloseableIteration[T, _], closer: () => Unit = () => ()) extends CloseableIterator.Wrap...
ICOS-Carbon-Portal/meta
src/main/scala/se/lu/nateko/cp/meta/utils/rdf4j/Rdf4jIterationIterator.scala
Scala
gpl-3.0
416
trait TC[F[_]] object TC { def check[F[_], A](x: F[A])(implicit F: TC[F]): Unit = () } case class Foo[+E, +A](value: A) object Foo { type WithList[+E, +A] = Foo[List[E], A] implicit def instance[E]: TC[[x] =>> Foo[E, x]] = new TC[[x] =>> Foo[E, x]] {} } val x1: Foo[List[String], Int] = Foo(1) val x2: Foo...
som-snytt/dotty
tests/pos/i7993.scala
Scala
apache-2.0
393
/** * 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...
everttigchelaar/camel-svn
components/camel-scala/src/test/scala/org/apache/camel/scala/dsl/PipelineTest.scala
Scala
apache-2.0
2,738
/** * Copyright (c) 2016 Intel Corporation  * * 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 applicabl...
aayushidwivedi01/spark-tk
sparktk-core/src/main/scala/org/trustedanalytics/sparktk/frame/internal/ops/matrix/MatrixCovarianceMatrix.scala
Scala
apache-2.0
2,962
/* * 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...
GoogleCloudPlatform/professional-services
tools/bigquery-zos-mainframe-connector/src/main/scala/com/google/cloud/bqsh/RmOptionParser.scala
Scala
apache-2.0
2,839
/* * Copyright (c) 2012-2016 Snowplow Analytics Ltd. All rights reserved. * * This program is licensed to you under the Apache License Version 2.0, * and you may not use this file except in compliance with the Apache License Version 2.0. * You may obtain a copy of the Apache License Version 2.0 at http://www.apach...
haensel-ams/snowplow
3-enrich/scala-common-enrich/src/test/scala/com.snowplowanalytics.snowplow.enrich.common/utils/JsonPathSpec.scala
Scala
apache-2.0
3,234
import sbt._ import Keys._ import com.github.retronym.SbtOneJar object BuildSettings { val buildOrganization = "exsplay" val buildVersion = "0.1-SNAPHSOT" val buildScalaVersion = "2.10.1" val buildSettings = Defaults.defaultSettings ++ Seq ( organization := buildOrganization, version := buil...
wertlex/exsplay
project/Build.scala
Scala
apache-2.0
1,885
class CorrectClass { def dummy() = println("compulation suceed!) }
bigtruedata/docker-scala
tests/resources/IncorrectCompilationClass.scala
Scala
mit
73
package ucesoft.cbm abstract class Chip extends CBMComponent { val id: ChipID.ID val componentType = CBMComponentType.CHIP lazy val componentID = componentType.toString } object ChipID extends Enumeration { type ID = Value val CPU = Value("CPU") val CIA = Value("CIA") val VIC = Value("VIC") val SID...
abbruzze/kernal64
Kernal64/src/ucesoft/cbm/Chip.scala
Scala
mit
500
package net.mkowalski.sparkfim.util import net.mkowalski.sparkfim.test.BaseTest class CliArgsParserTest extends BaseTest { test("Should handle empty args") { run(Map()) } test("Should parse single arg with value") { run( Map("single-param" -> "77"), "--single-param", "77" ) } test...
mjkowalski/spark-fim
src/test/scala/net/mkowalski/sparkfim/util/CliArgsParserTest.scala
Scala
mit
1,662
package controllers import java.sql.Connection import javax.inject.{Inject, Singleton} import controllers.NeedLogin.{Authenticated} import play.api.data.Forms._ import play.api.data.validation.Constraints._ import play.api.data.Form import models._ import play.Logger import play.api.db.Database import pla...
ruimo/store2
app/controllers/CategoryMaintenance.scala
Scala
apache-2.0
13,233
/* * Copyright (c) 2015 Snowplow Analytics Ltd. All rights reserved. * * This program is licensed to you under the Apache License Version 2.0, * and you may not use this file except in compliance with the Apache License Version 2.0. * You may obtain a copy of the Apache License Version 2.0 at http://www.apache.org...
jramos/kinesis-redshift-sink
src/main/scala/com.snowplowanalytics.snowplow.storage.kinesis/redshift/RedshiftPipeline.scala
Scala
apache-2.0
1,951
package akashic.storage.patch import akashic.storage.backend.NodePath import akashic.storage.service.{Acl, Meta} case class Upload(root: NodePath) extends Patch { val parts = root("parts") private def partPath(n: Int) = parts(n.toString) def part(n: Int) = Part(partPath(n)) val meta = Meta.makeCache(root("me...
akiradeveloper/akashic-storage
src/main/scala/akashic/storage/patch/Upload.scala
Scala
apache-2.0
701
package cbb.cloudphylo import org.apache.hadoop.io.Text import org.apache.hadoop.mapreduce.lib.input.FileInputFormat import org.apache.hadoop.mapreduce.{RecordReader, TaskAttemptContext, InputSplit} class FastaFileFormat extends FileInputFormat[Text, Text] { override def createRecordReader(split: InputSplit, contex...
xingjianxu/cloudphylo
src/main/scala/cbb/cloudphylo/FastaFileFormat.scala
Scala
apache-2.0
407
package com.github.cuzfrog import scala.concurrent.Future import scala.concurrent.ExecutionContext.Implicits.global /** * Created by cuz on 17-6-3. */ object FuturePlay { val f1 = Future{ new UnsupportedOperationException } f1.failed }
cuzfrog/scala_sbt_template
src/main/scala/com/github/cuzfrog/FuturePlay.scala
Scala
apache-2.0
252
/* * 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 ...
KevinLiLu/kafka
core/src/test/scala/unit/kafka/integration/MinIsrConfigTest.scala
Scala
apache-2.0
1,353
package com.yetu.oauth2provider.integration import com.yetu.oauth2provider.oauth2.AuthorizationCodeFlow import com.yetu.oauth2provider.utils.Config import com.yetu.oauth2provider.utils.Config._ import play.api.test.Helpers._ import play.api.test._ /** * * Integration test from login via /authorize via /access_token...
yetu/oauth2-provider
test/com/yetu/oauth2provider/integration/IntegrationSpec.scala
Scala
mit
2,488
/* * Copyright 2012 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 agree...
prat0318/zipkin
zipkin-collector-service/config/collector-dev.scala
Scala
apache-2.0
1,818
package net.joshdevins.tuttle.light import net.joshdevins.tuttle.{Vertex => BaseVertex} trait Vertex[I] extends BaseVertex[I, (I) => Unit]
joshdevins/tuttle
src/main/scala/net.joshdevins.tuttle/light/vertices.scala
Scala
mit
141
import sbt._ object Dependencies { val scalazVersion = "7.2.9" val scalaMayorVersion = "2.12" val scalaMinorVersion = s"$scalaMayorVersion.1" val akkaVersion = "2.4.17" val logbackVersion = "1.1.3" lazy val scalaTest = "org.scalatest" %% "scalatest" % "3.0.1" lazy val scalaz = "org.scalaz" % s"scalaz-c...
fhuertas/monkey
project/Dependencies.scala
Scala
apache-2.0
875
package filters import play.Logger import play.api.mvc._ import play.api.libs.concurrent.Execution.Implicits._ import scala.concurrent.Future class LoggingFilter extends Filter{ override def apply(next: (RequestHeader) => Future[SimpleResult])(rh: RequestHeader): Future[SimpleResult] = { val startTime = System....
htrc/HTRC-Portal
app/filters/LoggingFilter.scala
Scala
apache-2.0
931
package io.backchat.hookup package server import org.jboss.netty.handler.codec.http._ import org.jboss.netty.handler.ssl.SslHandler import org.jboss.netty.handler.stream.ChunkedFile import org.jboss.netty.channel._ import org.jboss.netty.handler.codec.frame.TooLongFrameException import org.jboss.netty.buffer.ChannelBu...
backchatio/hookup
src/main/scala/io/backchat/hookup/server/StaticFileHandler.scala
Scala
mit
6,402
package org.elasticsearch.spark.sql import scala.collection.JavaConverters.mapAsJavaMapConverter import scala.collection.JavaConverters.propertiesAsScalaMapConverter import scala.collection.Map import org.apache.spark.sql.SQLContext import org.apache.spark.sql.SchemaRDD import org.elasticsearch.hadoop.cfg.Configurati...
costin/elasticsearch-hadoop
spark/sql-12/src/main/scala/org/elasticsearch/spark/sql/EsSparkSQL.scala
Scala
apache-2.0
2,438
package org.jetbrains.plugins.scala package editor.enterHandler import com.intellij.codeInsight.editorActions.enter.EnterHandlerDelegate.Result import com.intellij.codeInsight.editorActions.enter.EnterHandlerDelegateAdapter import com.intellij.openapi.actionSystem.DataContext import com.intellij.openapi.editor.Editor ...
Im-dex/intellij-scala
src/org/jetbrains/plugins/scala/editor/enterHandler/AddUnitTypeEnterHandler.scala
Scala
apache-2.0
2,287
package day2 object TestCensor extends Censor { val curses = Map("shoot" -> "pucky", "darn" -> "beans") val text = "Well shoot and darn it, I don't understand traits in Scala" println(subst(text, curses)) }
keefmarshall/seven-in-seven
scala-day2/src/day2/TestCensor.scala
Scala
gpl-2.0
215
package viewmodels import org.joda.time.DateTime /** * Created by Christian Simon on 14.05.2016. */ object ThreadsViewModels { /* * Show Thread */ case class ShowThreadPostUpload(filename: String, size: Long, hits: Int)...
metaxmx/FridayNightBeer
app/viewmodels/ThreadsViewModels.scala
Scala
apache-2.0
1,747
/* * 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 ...
JiechengZhao/simpleProject
src/main/scala/org/apache/spark/examples/mllib/IrisKMeans.scala
Scala
mit
3,572
package vaadin.scala case class KeyShortcut(keyCode: KeyCode, modifiers: KeyModifier*) case class KeyCode(value: Int) case class KeyModifier(value: Int) object KeyCode { val Enter = KeyCode(13) val Escape = KeyCode(27) val PageUp = KeyCode(33) val PageDown = KeyCode(34) val Tab = KeyCode(9) val A...
CloudInABox/scalavaadinutils
src/main/scala/vaadin/scala/Shortcut.scala
Scala
mit
1,907
package com.landoop.streamreactor.hive.it import com.landoop.streamreactor.connect.hive.{DatabaseName, TableName} import org.apache.kafka.connect.data.Schema import org.scalatest.concurrent.Eventually import org.scalatest.matchers.should.Matchers import org.scalatest.time.{Millis, Span} import org.scalatest.wordspec.A...
datamountaineer/stream-reactor
kafka-connect-hive/it/src/test/scala/com/landoop/streamreactor/hive/it/HiveSchemaTest.scala
Scala
apache-2.0
2,192
/* * Copyright (c) 2013-2014 Telefónica Investigación y Desarrollo S.A.U. * * 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 * * Unles...
telefonicaid/fiware-cosmos-platform
cosmos-api/test/es/tid/cosmos/api/quota/QuotaContextTest.scala
Scala
apache-2.0
8,800
/* * Copyright 2017 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...
liquidarmour/ct-calculations
src/test/scala/uk/gov/hmrc/ct/computations/CP252Spec.scala
Scala
apache-2.0
1,776
/* * 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 ...
rikima/spark
streaming/src/main/scala/org/apache/spark/streaming/util/FileBasedWriteAheadLog.scala
Scala
apache-2.0
12,502
package scalax.collection import org.scalatest.Suite import org.scalatest.Suites import org.scalatest.Informer import org.scalatest.matchers.ShouldMatchers import GraphPredef._, GraphEdge._ import generic.GraphFactory import org.scalatest.junit.JUnitRunner import org.junit.runner.RunWith @RunWith(class...
opyate/scala-graph
core/src/test/scala/scalax/collection/TEdit.scala
Scala
bsd-3-clause
14,250
package hackerRank.algorithms object HalloweenSale { def howManyGames(p: Int, d: Int, m: Int, s: Int): Int = { var remaining = s var noOfGames = 0 if (p < s) { remaining = s - p noOfGames = noOfGames + 1 var cost = p while (remaining >= 0) { cost = if (cost - d > m) cost ...
cricanr/AlgorithmsHackerRank
src/main/scala/hackerRank/algorithms/HalloweenSale.scala
Scala
mit
712
/** * 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...
wangcy6/storm_app
frame/kafka-0.11.0/kafka-0.11.0.1-src/core/src/test/scala/unit/kafka/server/ServerMetricsTest.scala
Scala
apache-2.0
1,840
/* * Copyright (c) 2014-2020 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...
alexandru/monifu
monix-eval/shared/src/test/scala/monix/eval/TaskLikeConversionsSuite.scala
Scala
apache-2.0
7,479
/* * 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/ct-calculations
src/main/scala/uk/gov/hmrc/ct/ct600/v2/RSQ3.scala
Scala
apache-2.0
1,142
/* * 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 ...
rahul003/mxnet
scala-package/core/src/main/scala/org/apache/mxnet/NDArrayCollector.scala
Scala
apache-2.0
5,783
package au.id.cxd.math.function.moments /** * empirical variance assuming normality * 1/n * \\sum_{i=1}^n (X - \\bar{X})^2 */ class Variance { def op(series:Seq[Double]): Double = { val n = series.length val mu = Mean(series) val start = Math.pow(series.head - mu, 2.0) val all = Seq(start) ++ ...
cxd/scala-au.id.cxd.math
math/src/main/scala/au/id/cxd/math/function/moments/Variance.scala
Scala
mit
521
package sri.universal.apis import sri.core.ReactClass import scala.scalajs.js @js.native trait AppRegistry extends js.Object { def registerConfig(config: js.Array[js.Object]): Unit = js.native def registerComponent(appKey: String, getComponentFunc: js.Function0[ReactClass]): Unit = js.native def registerRun...
chandu0101/sri
universal/src/main/scala/sri/universal/apis/AppRegistry.scala
Scala
apache-2.0
472
package se.culvertsoft.mgen.visualdesigner.util import java.awt.Dimension import java.awt.Point import scala.collection.JavaConversions.asScalaBuffer import se.culvertsoft.mgen.visualdesigner.model.Entity import se.culvertsoft.mgen.visualdesigner.model.Model import se.culvertsoft.mgen.visualdesigner.model.Module imp...
culvertsoft/mgen-visualdesigner
src/main/scala/se/culvertsoft/mgen/visualdesigner/util/LayOutEntities.scala
Scala
gpl-2.0
3,281
package com.blinkboxbooks.resourceserver import io.gatling.core.Predef._ import io.gatling.http.Predef._ import scala.concurrent.duration._ import java.util.Properties import java.io.FileInputStream import io.gatling.http.config.HttpProxyBuilder.toProxy import io.gatling.core.controller.inject.InjectionStep /** * Re...
blinkboxbooks/resource-server.scala
performance-tests/images/com/blinkboxbooks/resourceserver/ResourceServerSimulation.scala
Scala
mit
4,191
/* * Copyright 2015 ligaDATA * * 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 ...
traytonwhite/Kamanja
trunk/MetadataAPIService/src/main/scala/com/ligadata/metadataapiservice/AddFunctionService.scala
Scala
apache-2.0
2,571
// 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/osgi/WriteServiceImplSpecs.scala
Scala
apache-2.0
10,069
package futures import java.util.Date import java.util.concurrent.Executors import scala.concurrent.{ExecutionContext, Future} import scala.util.Random object Types { type A = String type B = Int } object MyService { import Types._ private val MAXMILLIS = 3000 implicit val executionContext = ExecutionC...
hermannhueck/MusicService
Services/MusicService-Play-Scala-Slick-NoAuth/app/futures/MyService.scala
Scala
apache-2.0
1,197
package scala.meta package prettyprinters import scala.language.experimental.macros import scala.compat.Platform.EOL trait Show[T] { def apply(t: T): Show.Result } object Show { private[meta] sealed abstract class Result { override def toString = { val sb = new StringBuilder var indentation = 0 ...
DavidDudson/scalameta
scalameta/common/shared/src/main/scala/scala/meta/prettyprinters/Show.scala
Scala
bsd-3-clause
3,582
package com.fsist import akka.http.util.FastFuture import scala.concurrent.Future package object stream { val futureSuccess: Future[Unit] = FastFuture.successful(()) val emptyIterable = Iterable.empty[Nothing] val futureEmptyIterable: Future[Iterable[Nothing]] = FastFuture.successful(emptyIterable) }
fsist/future-streams
src/main/scala/com/fsist/stream/package.scala
Scala
apache-2.0
311
/* * La Trobe University - Distributed Deep Learning System * Copyright 2016 Matthias Langer ([email protected]) * * 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.apa...
bashimao/ltudl
blaze/src/main/scala/edu/latrobe/blaze/objectives/PrintString.scala
Scala
apache-2.0
3,167
/* sbt -- Simple Build Tool * Copyright 2010 Mark Harrah */ package sbt package inc import xsbti.api.Source import java.io.File import APIs.getAPI import xsbti.api._internalOnly_NameHashes import scala.util.Sorting import xsbt.api.SameAPI trait APIs { /** * The API for the source file `src` at the time repres...
som-snytt/xsbt
compile/inc/src/main/scala/sbt/inc/APIs.scala
Scala
bsd-3-clause
3,976
package org.jetbrains.plugins.scala package lang.refactoring.rename.inplace import com.intellij.openapi.editor.Editor import com.intellij.openapi.project.Project import com.intellij.psi.PsiElement import com.intellij.refactoring.rename.{PsiElementRenameHandler, RenamePsiElementProcessor} import org.jetbrains.plugins.s...
triggerNZ/intellij-scala
src/org/jetbrains/plugins/scala/lang/refactoring/rename/inplace/ScalaInplaceRenameHandler.scala
Scala
apache-2.0
1,118
package io.github.hamsters import org.scalacheck.Prop.forAll import org.scalacheck.Properties @GenLens case class Street(number: Int, name: String) @GenLens case class User(firstName: String, lastName: String, street: Street) class LenserLawsProperties extends Properties("Lens laws") { import Generators._ impor...
dgouyette/hamsters
shared/src/test/scala/io/github/hamsters/LenserLawsProperties.scala
Scala
apache-2.0
1,058
package org.jetbrains.plugins.scala package lang package psi package impl package expr import org.jetbrains.plugins.scala.lang.psi.ScalaPsiElementImpl import com.intellij.lang.ASTNode import org.jetbrains.plugins.scala.lang.psi.api.expr._ import com.intellij.psi.PsiElementVisitor import api.ScalaElementVisitor import ...
consulo/consulo-scala
src/org/jetbrains/plugins/scala/lang/psi/impl/expr/ScTryStmtImpl.scala
Scala
apache-2.0
2,471
package org.bitcoins.protocol.rpc.bitcoincore.blockchain.softforks /** * Created by Tom on 1/11/2016. */ trait RejectionProgress { def status : Boolean def newVersionBlocksFound : Int def requiredBlocks : Int def recentBlocksWindow : Int } case class RejectionProgressImpl(status : Boolean , newVersionBlocks...
Christewart/scalacoin
src/main/scala/org/bitcoins/protocol/rpc/bitcoincore/blockchain/softforks/Rejection.scala
Scala
mit
441