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 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 ...
kevinyu98/spark
sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/orc/OrcTest.scala
Scala
apache-2.0
5,819
/* * 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-tail/shared/src/main/scala/monix/tail/batches/BatchCursor.scala
Scala
apache-2.0
16,987
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not u...
tophua/spark1.52
sql/core/src/main/scala/org/apache/spark/sql/execution/metric/SQLMetrics.scala
Scala
apache-2.0
4,305
// code-examples/TypeLessDoMore/count-to-script.scala def countTo(n: Int):Unit = { def count(i: Int): Unit = { if (i <= n) { println(i) count(i + 1) } } count(1) } countTo(5)
XClouded/t4f-core
scala/src/tmp/TypeLessDoMore/count-to-script.scala
Scala
apache-2.0
203
package recipestore.db.tinkerpop.models object DSEIndexType extends Enumeration { type DSEIndexType = Value val Secondary, Materialized, TextSearch, StringSearch = Value }
prad-a-RuntimeException/semantic-store
src/main/scala/recipestore/db/tinkerpop/models/DSEIndexType.scala
Scala
mit
176
/** * Copyright (C) 2012 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...
ajw625/orbeon-forms
src/test/scala/org/orbeon/oxf/resources/URLFactoryTest.scala
Scala
lgpl-2.1
1,640
package org.seanpquig.mini.search.core import akka.http.scaladsl.marshallers.sprayjson.SprayJsonSupport import org.seanpquig.mini.search.ml.ImagenetPrediction import spray.json._ /** * This file contains classes that support the different interfaces of the MiniSearch API. * Including requests and responses and su...
seanpquig/mini-search
src/main/scala/org/seanpquig/mini/search/core/ApiJsonObjects.scala
Scala
mit
1,888
/* * Copyright (c) 2016 SnappyData, Inc. 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 ap...
vjr/snappydata
cluster/src/main/scala/io/snappydata/impl/LeadImpl.scala
Scala
apache-2.0
19,008
package com.twitter.finagle.mysql import com.twitter.finagle.stats.{NullStatsReceiver, StatsReceiver} import com.twitter.finagle.{ClientConnection, ServiceFactory, ServiceProxy} import com.twitter.util._ object Client { /** * Creates a new Client based on a ServiceFactory. */ def apply( factory: Service...
spockz/finagle
finagle-mysql/src/main/scala/com/twitter/finagle/mysql/Client.scala
Scala
apache-2.0
5,344
/* * @author Stefan Schurgast */ package ch.uzh.ifi.ddis.markovlogicinference /** * Abstract class TruthValue represents the truth value that can be taken by a * grounded predicate or a grounded formula. It is either a Option for a boolean * value Some(true) (object TRUE) or Some(false) (object FALSE), or unknown *...
schurgast/LISy
src/ch/uzh/ifi/ddis/markovlogicinference/logic/TruthValue.scala
Scala
apache-2.0
1,398
package org.psliwa.idea.composerJson.intellij.codeAssist.file import com.intellij.psi.{PsiElement, PsiReference, PsiReferenceProvider} import com.intellij.util.ProcessingContext import org.psliwa.idea.composerJson.json.{EmailFormat, UriFormat} private object UrlReferenceProvider extends PsiReferenceProvider { overr...
psliwa/idea-composer-plugin
src/main/scala/org/psliwa/idea/composerJson/intellij/codeAssist/file/UrlReferenceProvider.scala
Scala
mit
791
/** * 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 ...
ksmpartners/ernie
ernie-engine/src/test/scala/com/ksmpartners/ernie/engine/report/DefinitionTest.scala
Scala
apache-2.0
2,888
// This is a sample code that was shamelessly stolen from // http://boldradius.com/blog-post/VS0NpTAAADAACs_E/introduction-to-akka-streams package extra import akka.actor.ActorSystem import akka.stream.ActorMaterializer import akka.stream.scaladsl.{Flow, Sink, Source} import scala.collection.immutable import scala.ut...
dotta/akka-streams-demo
scala-demo/src/main/scala/extra/CustomersExample.scala
Scala
apache-2.0
1,320
package com.twitter.util.routing import java.lang.{Iterable => JIterable} import java.util.function.Function import scala.jdk.CollectionConverters._ object Validator { /** [[Validator]] that does no validation and always returns empty error results */ val None: Validator[Any] = new Validator[Any] { def apply...
twitter/util
util-routing/src/main/scala/com/twitter/util/routing/Validator.scala
Scala
apache-2.0
877
package org.novetta.zoo.types /** * Create() case class. Used between the ConsumerActor and the WorkGroup. * @param key: Long => The message key associated with this work. * @param primaryURI: String => The primary URL for downloading the target resource * @param secondaryURI: String => The secondary URL for downl...
Novetta/totem
src/main/scala/org/novetta/zoo/types/CommandTypes.scala
Scala
bsd-3-clause
3,691
package com.datawizards.splot.examples.charts.histogram import com.datawizards.splot.api.implicits._ import com.datawizards.splot.examples.people object HistogramForStrings extends App { people.plotHistogramForCategories(_.education) }
piotr-kalanski/SPlot
src/main/scala/com/datawizards/splot/examples/charts/histogram/HistogramForStrings.scala
Scala
apache-2.0
240
package com.kifi.franz import com.amazonaws.services.sqs.AmazonSQSAsync import play.api.libs.json.{Format, Json} import scala.language.implicitConversions class FormattedSQSQueue[T]( protected val sqs: AmazonSQSAsync, val queue: QueueName, protected val createIfNotExists: Boolean = false, format: Fo...
stkem/franz
src/main/scala/com/kifi/franz/FormattedSQSQueue.scala
Scala
mit
522
package pw.anisimov.adverto.api import akka.actor.{Props, Actor, ActorLogging, ActorRef} import akka.http.scaladsl.Http import akka.stream.ActorMaterializer import akka.util.Timeout import pw.anisimov.adverto.api.ApiManagerActor.GetBinding import scala.concurrent.duration._ class ApiManagerActor(host: String, port: I...
yoks/adverto
src/main/scala/pw/anisimov/adverto/api/ApiManagerActor.scala
Scala
apache-2.0
1,276
/* * Copyright 2009-2010 the original author or 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 appl...
akisaarinen/ccf
ccf/src/main/scala/ccf/transport/http/HttpConnection.scala
Scala
apache-2.0
2,161
package com.github.j5ik2o.spetstore.adaptor.eventbus import akka.actor.{ ActorRef, ActorSystem } import akka.cluster.pubsub.DistributedPubSub import akka.cluster.pubsub.DistributedPubSubMediator.{ Publish, Subscribe, Unsubscribe } import akka.event.ActorEventBus import org.slf4j.LoggerFactory case class EventWithSend...
j5ik2o/spetstore-cqrs-es-akka
write-interface/src/main/scala/com/github/j5ik2o/spetstore/adaptor/eventbus/EventBus.scala
Scala
mit
2,318
/** * Copyright (C) 2012 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...
brunobuzzi/orbeon-forms
form-runner/jvm/src/main/scala/org/orbeon/oxf/fr/FormRunnerPDF.scala
Scala
lgpl-2.1
3,453
package effectful.examples.pure.dao.sql import effectful.examples.effects.sql._ import effectful.examples.effects.sql.SqlDriver.SqlRow import effectful.examples.pure.dao.DocDao.RecordMetadata trait SqlValFormat[A] { def toSqlVal(a: A) : SqlVal def fromSqlVal(v: SqlVal) : A } trait SqlRowFormat[A] { def toSqlRo...
S-Mach/effectful
src/test/scala/effectful/examples/pure/dao/sql/SqlFormat.scala
Scala
mit
1,486
/** * Copyright (C) 2014 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...
ajw625/orbeon-forms
src/test/scala/org/orbeon/oxf/fr/CacheTest.scala
Scala
lgpl-2.1
3,977
/* * Copyright 2016 Actian 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 applicable law or agree...
ActianCorp/spark-vector
loader/src/main/scala/com/actian/spark_vector/loader/command/ParquetRead.scala
Scala
apache-2.0
1,499
package slamdata.engine.fs import scalaz.\\/ import scalaz.concurrent._ import scalaz.stream._ import argonaut._ case class RenderedJson(value: String) { def toJson: String \\/ Json = JsonParser.parse(value) override def toString = value } trait FileSystem { def scan(path: Path, offset: Option[Long], limit: ...
sellout/slamengine-old
src/main/scala/slamdata/engine/fs/filesystem.scala
Scala
agpl-3.0
914
package com.twitter.finatra.http.exceptions import com.google.common.net.MediaType import com.twitter.finagle.http.{Response, Status} import com.twitter.finatra.http.response.{ErrorsResponse, ResponseBuilder} import org.jboss.netty.handler.codec.http.HttpResponseStatus /* HTTP Exceptions */ // TODO: Redesign to avoid...
nkhuyu/finatra
http/src/main/scala/com/twitter/finatra/http/exceptions/exceptions.scala
Scala
apache-2.0
4,706
package utils // spark-core import org.apache.spark.SparkContext import org.apache.spark.SparkContext._ import org.apache.spark.SparkConf import org.apache.spark.rdd._ // spark-sql import org.apache.spark.sql.SparkSession // mllib import org.apache.spark.mllib.linalg.{Vector, Vectors, Matrix, Matrices} // others impor...
jey/alchemist
test/src/main/scala/utils/Utils.scala
Scala
apache-2.0
3,799
/** * (c) Copyright 2013 WibiData, Inc. * * See the NOTICE 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...
kijiproject/kiji-schema-shell
src/main/scala/org/kiji/schema/shell/ddl/UseModuleCommand.scala
Scala
apache-2.0
3,371
import sbt._ import Keys._ import Tests._ import Defaults._ import java.io.{ CharArrayWriter, PrintWriter } import Import._ object Ticket543Test extends Build { val marker = new File("marker") val check = TaskKey[Unit]("check", "Check correct error has been returned.") lazy val root = Project("root", file("."), se...
dansanduleac/sbt
sbt/src/sbt-test/tests/t543/project/Ticket543Test.scala
Scala
bsd-3-clause
1,213
package org.jetbrains.plugins.scala package lang package parameterInfo package typeParameterInfo import _root_.scala.util.Sorting import lexer.ScalaTokenTypes import collection.mutable.ArrayBuffer import com.intellij.codeInsight.hint.{HintUtil, ShowParameterInfoContext} import com.intellij.psi.PsiElement import java.a...
consulo/consulo-scala
test/org/jetbrains/plugins/scala/lang/parameterInfo/typeParameterInfo/TypeParameterInfoTestBase.scala
Scala
apache-2.0
3,830
package com.wavesplatform.it.sync.transactions import com.typesafe.config.Config import com.typesafe.config.ConfigFactory.parseString import com.wavesplatform.account.Address import com.wavesplatform.api.http.ApiError.CustomValidationError import com.wavesplatform.common.state.ByteStr import com.wavesplatform.common.u...
wavesplatform/Waves
node-it/src/test/scala/com/wavesplatform/it/sync/transactions/RebroadcastTransactionSuite.scala
Scala
mit
3,728
/* * Copyright (C) 2014 Ivan Cukic <ivan at mi.sanu.ac.rs> * * 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...
ivan-cukic/litef-conductor
src/main/scala/core/Rest.scala
Scala
apache-2.0
1,873
/* * Copyright 2014 - 2015 SlamData Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or a...
wemrysi/quasar
core/src/main/scala/slamdata/engine/std/identity.scala
Scala
apache-2.0
1,441
package models import akka.actor.ActorRef /** Trait representing an order for a particular security. * * The OrderLike trait should be mixed in with each specific type of order * (i.e., ask orders, bid orders, limit orders, market orders, etc). * */ trait OrderLike { /** Whether the order is buy (true) ...
davidrpugh/play-securities-exchange
app/models/OrderLike.scala
Scala
apache-2.0
771
/* * Copyright 2016 MongoDB, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to...
jCalamari/mongo-scala-driver
driver/src/main/scala/org/mongodb/scala/gridfs/GridFSDownloadStream.scala
Scala
apache-2.0
2,768
/* 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 to in writing, software distr...
jinlee/algebird
algebird-core/src/main/scala/com/twitter/algebird/Monad.scala
Scala
apache-2.0
5,567
/* * 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/CatalystTypeConverters.scala
Scala
apache-2.0
19,811
package spatial.tests import org.scalatest.{FlatSpec, Matchers} import spatial.dsl._ import virtualized._ object OuterSwitchTest extends SpatialTest { @virtualize def main(): Unit = { val in = ArgIn[Int] setArg(in, 20) val dram = DRAM[Int](32) Accel { val data = SRAM[Int](32) if (in.va...
stanford-ppl/spatial-lang
spatial/core/test/spatial/tests/SwitchTests.scala
Scala
mit
640
package monocle.std import monocle.MonocleSuite import monocle.law.discipline.{IsoTests, PrismTests} import monocle.law.discipline.function.{EachTests, PossibleTests} import cats.data.Validated import scala.annotation.nowarn class ValidatedSpec extends MonocleSuite { import cats.laws.discipline.arbitrary._ chec...
julien-truffaut/Monocle
test/shared/src/test/scala/monocle/std/ValidatedSpec.scala
Scala
mit
758
package spgui.widgets import sp.domain._ import Logic._ import spgui.communication.BackendCommunication import scala.util.Try import sp.erica._ object EricaLogic { val dummyPatient = API_Patient.Patient( "4502085", API_Patient.Priority("NotTriaged", "2017-02-01T15:49:19Z"), API_Patient.Attended(tru...
kristoferB/SP
sperica/frontend/src/main/scala/spgui/widgets/WidgetComm.scala
Scala
mit
1,059
/* * Accio is a platform to launch computer science experiments. * Copyright (C) 2016-2018 Vincent Primault <v.primault@ucl.ac.uk> * * Accio 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...
privamov/accio
accio/java/fr/cnrs/liris/locapriv/ops/UniformSamplingOp.scala
Scala
gpl-3.0
1,743
package build.unstable.sonicd.source import akka.actor._ import akka.stream.ActorMaterializer import akka.stream.actor.ActorPublisher import akka.stream.actor.ActorPublisherMessage.{Cancel, Request, SubscriptionTimeoutExceeded} import akka.stream.scaladsl._ import build.unstable.sonic.JsonProtocol._ import build.unsta...
ernestrc/sonicd
server/src/main/scala/build/unstable/sonicd/source/Composer.scala
Scala
mit
11,826
/* * 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/NormalizeFloatingNumbers.scala
Scala
apache-2.0
9,014
package org.jetbrains.plugins.scala package codeInsight package daemon import com.intellij.openapi.util.text.StringUtil class ScalaRainbowVisitorTest extends base.ScalaLightCodeInsightFixtureTestAdapter { import ScalaRainbowVisitorTest.{END_TAG => E, START_TAG => S, START_TAG_1 => S_1, START_TAG_2 => S_2, START_TA...
JetBrains/intellij-scala
scala/codeInsight/test/org/jetbrains/plugins/scala/codeInsight/daemon/ScalaRainbowVisitorTest.scala
Scala
apache-2.0
3,515
/*********************************************************************** * 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-utils/src/main/scala/org/locationtech/geomesa/utils/clearspring/CountMinSketch.scala
Scala
apache-2.0
6,074
package net.sansa_stack.inference.flink import java.io.{File, FileInputStream} import java.net.URI import java.util.Properties import scala.io.Source import com.typesafe.config.ConfigFactory import org.apache.flink.api.java.utils.ParameterTool import org.apache.flink.api.scala.ExecutionEnvironment import org.apache....
SANSA-Stack/SANSA-RDF
sansa-inference/sansa-inference-flink/src/main/scala/net/sansa_stack/inference/flink/RDFGraphMaterializer.scala
Scala
apache-2.0
5,609
import _root_.io.gatling.core.scenario.Simulation import ch.qos.logback.classic.{Level, LoggerContext} import io.gatling.core.Predef._ import io.gatling.http.Predef._ import org.slf4j.LoggerFactory import scala.concurrent.duration._ /** * Performance test for the MultipleChoiceQuestion entity. */ class MultipleChoi...
LisLo/ArTEMiS
src/test/gatling/user-files/simulations/MultipleChoiceQuestionGatlingTest.scala
Scala
mit
3,550
/* * Copyright 2016 Nicolas Rinaudo * * 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...
nrinaudo/kantan.xpath
scalaz/src/test/scala/kantan/xpath/scalaz/arbitrary.scala
Scala
apache-2.0
767
import org.specs2.mutable._ import play.api.libs.iteratee._ import scala.concurrent._ import reactivemongo.bson.BSONObjectID case class User( _id: Option[BSONObjectID] = None, username: String) class JSONCollectionSpec extends Specification { import Common._ import reactivemongo.bson._ import reactivemong...
xnejp03/Play-ReactiveMongo
src/test/scala/jsoncollection.scala
Scala
apache-2.0
4,625
/* * 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
examples/src/main/scala/org/apache/spark/examples/ml/DecisionTreeClassificationExample.scala
Scala
apache-2.0
3,751
/* * 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 ...
kkk669/mxnet
scala-package/examples/src/main/scala/ml/dmlc/mxnetexamples/rnn/LstmBucketing.scala
Scala
apache-2.0
4,828
/* * 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/test/scala/uk/gov/hmrc/ct/accounts/frs102/boxes/AC154Spec.scala
Scala
apache-2.0
2,637
package io.iteratee.monix import cats.MonadError import io.iteratee.{ EnumerateeModule, EnumeratorErrorModule, IterateeErrorModule, Module } import io.iteratee.files.SuspendableFileModule import monix.eval.Task trait TaskModule extends Module[Task] with EnumerateeModule[Task] with EnumeratorErrorModule[Task, ...
flyingwalrusllc/iteratee
monix/jvm/src/main/scala/io/iteratee/monix/TaskModule.scala
Scala
apache-2.0
741
/** * 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...
eljefe6a/kafka
core/src/main/scala/kafka/utils/NetworkClientBlockingOps.scala
Scala
apache-2.0
5,433
package japgolly.scalajs.react.extra.router2 import japgolly.scalajs.react._, vdom.prefix_<^._ import japgolly.scalajs.react.test._ import org.scalajs.dom._ import scalaz._ import scalaz.effect.IO import utest._ import TestUtil._ object RouterTest extends TestSuite { sealed trait MyPage object MyPage { case ...
elacin/scalajs-react
test/src/test/scala/japgolly/scalajs/react/extra/router2/RouterTest.scala
Scala
apache-2.0
5,967
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may ...
WindCanDie/spark
sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/FileIndexSuite.scala
Scala
apache-2.0
14,679
/* Copyright (C) 2012-2013 Treode, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agr...
Treode/cps-example
src/main/scala/com/treode/cps/example/ExampleKit.scala
Scala
apache-2.0
3,891
package com.twitter.finagle.stats import com.twitter.app.GlobalFlag import scala.collection.Map import scala.collection.mutable object format extends GlobalFlag[String]( "commonsmetrics", "Format style for metric names (ostrich|commonsmetrics)" ) { private[stats] val Ostrich = "ostrich" private[stats] val Com...
jay-johnson/finagle
finagle-stats/src/main/scala/com/twitter/finagle/stats/StatsFormatter.scala
Scala
apache-2.0
3,646
/* * Copyright 2013 Akiyoshi Sugiki, University of Tsukuba * * 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 a...
axi-sugiki/kumoi
src/kumoi/impl/oflow/floodlight/FloodlightController.scala
Scala
apache-2.0
19,215
package io.continuum.bokeh class Traversal { def collect(objs: List[Model]): List[Model] = { val refs = collection.mutable.ListBuffer[Model]() traverse(objs, { case ref: Model => refs += ref }) refs.toList } def traverse(objs: List[Model], fn: PartialFunction[Model, Unit]) { ...
bokeh/bokeh-scala
bokeh/src/main/scala/Traversal.scala
Scala
mit
1,245
package ch.wsl.box.client.views.components.widget import java.util.UUID import ch.wsl.box.client.services.{Labels, REST} import ch.wsl.box.client.styles.GlobalStyles import ch.wsl.box.model.shared.{JSONField, JSONFieldLookup, JSONID, JSONLookup, JSONMetadata} import io.circe._ import io.circe.syntax._ import ch.wsl.bo...
Insubric/box
client/src/main/scala/ch/wsl/box/client/views/components/widget/Widget.scala
Scala
apache-2.0
5,070
import scala.quoted.* object PowerMacro { def powerCode(x: Expr[Double], n: Long)(using Quotes): Expr[Double] = if (n == 0) '{1.0} else if (n % 2 == 0) '{ val y = $x * $x; ${powerCode('y, n / 2)} } else '{ $x * ${powerCode(x, n - 1)} } def power2(x: Expr[Double])(using Quotes) = '{ inline def powe...
dotty-staging/dotty
tests/neg-macros/i4803f.scala
Scala
apache-2.0
392
package edu.uchicago.cs.encsel.dataset.column import java.io.File import org.junit.Assert.assertTrue import org.junit.Test import edu.uchicago.cs.encsel.dataset.column.csv.CSVColumnReader2 import edu.uchicago.cs.encsel.dataset.column.json.JsonColumnReader import edu.uchicago.cs.encsel.dataset.column.tsv.TSVColumnRea...
harperjiang/enc-selector
src/test/scala/edu/uchicago/cs/encsel/dataset/column/ColumnReaderFactoryTest.scala
Scala
apache-2.0
871
/* * 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 ...
mahmoudhanafy/spark-testing-base
src/main/1.3/scala/com/holdenkarau/spark/testing/RDDGenerator.scala
Scala
apache-2.0
3,956
/*********************************************************************** * 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 this distribution and...
ronq/geomesa
geomesa-features/geomesa-feature-kryo/src/main/scala/org/locationtech/geomesa/features/kryo/impl/KryoFeatureSerialization.scala
Scala
apache-2.0
7,468
/** * This file is part of the TA Buddy project. * Copyright (c) 2014 Alexey Aksenov ezh@ezh.msk.ru * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Affero General Global License version 3 * as published by the Free Software Foundation with the addition of t...
digimead/digi-TABuddy-desktop
part-logic/src/main/scala/org/digimead/tabuddy/desktop/logic/operation/graph/api/XOperationGraphSaveAs.scala
Scala
agpl-3.0
3,944
// Equites, a Scala chess playground // Copyright © 2013 Frank S. Thomas <frank@timepit.eu> // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your ...
equites-chess/equites-core
src/test/scala/eu/timepit/equites/util/NotationSpec.scala
Scala
gpl-3.0
1,493
/* * 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/calculations/NetTradingProfitCalculatorSpec.scala
Scala
apache-2.0
2,228
package com.es.scala.more /** * Created by mark on 12/4/14. */ class UseOfNull { /** * returns null if given null * but nulls are bad * @param x * @return */ def exampleOfNull(x: List[String]): String = { if ( x != null) { x.head } else null } /** * Returns an empty list...
elephantscale/learning-scala
scala-with-sujee/src/main/scala/com/es/scala/more/UseOfNull.scala
Scala
apache-2.0
646
package net.chwthewke.chcalc import org.parboiled2._ import scala.collection.immutable.SortedMap import scala.util.Try private class Parsers( val input : ParserInput ) extends Parser { import Parsers._ def HeroDefRule = rule { Name ~ Sep ~ BigNumberAndSep ~ BigNumberAndSep ~ 6.times( Upgrad...
chwthewke/ch-calc
src/main/scala/net/chwthewke/chcalc/Parsers.scala
Scala
mit
1,988
package spire.algebra import annotation.tailrec import scala.{specialized => spec} /** * Semiring is a ring without identities or an inverse. Thus, it has no * negation, zero, or one. * * A Semiring with an additive inverse (-) is a Rng. * A Semiring with additive and multiplicative identities (0 and 1) is a Ri...
lrytz/spire
core/src/main/scala/spire/algebra/Semiring.scala
Scala
mit
978
/* * 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/test/scala/org/apache/flink/table/planner/runtime/batch/sql/MultipleInputITCase.scala
Scala
apache-2.0
7,928
/** * 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...
noslowerdna/kafka
core/src/test/scala/integration/kafka/api/SaslSetup.scala
Scala
apache-2.0
6,731
package org.talkingpuffin.ui import _root_.scala.swing.UIElement import java.awt.Cursor import SwingInvoke._ /** * Whenever a long running operation is performed the UI thread should be released and a spinner should be shown. This object has * functions for simplifying these tasks. Every function spins off a thread...
dcbriccetti/talking-puffin
desktop/src/main/scala/org/talkingpuffin/ui/LongRunningSpinner.scala
Scala
mit
1,333
package org.jetbrains.plugins.scala.lang.overrideImplement import org.jetbrains.plugins.scala.base.ScalaLightPlatformCodeInsightTestCaseAdapter import org.jetbrains.plugins.scala.lang.formatting.settings.ScalaCodeStyleSettings import org.jetbrains.plugins.scala.overrideImplement.ScalaOIUtil import org.jetbrains.plugin...
triplequote/intellij-scala
scala/scala-impl/test/org/jetbrains/plugins/scala/lang/overrideImplement/ScalaOverrideImplementTest.scala
Scala
apache-2.0
25,824
// In run, rather than pos, to check for problems like SI-4283 object O1 { private[O1] class Base { def foo: Int = 0 } class Mediator extends Base } object O2 { class Derived extends O1.Mediator { override def foo: Int = super.foo } } object Test { def main(args: Array[String]): Unit = { new O...
yusuke2255/dotty
tests/run/t5162.scala
Scala
bsd-3-clause
342
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...
chen0031/breeze
math/src/main/scala/breeze/linalg/Counter2.scala
Scala
apache-2.0
10,293
package fi.pyppe.subtitler import java.io.File import org.specs2.mutable.Specification class OpenSubtitlesHasherSpec extends Specification { val breakdanceAvi = new File(getClass.getResource("/breakdance.avi").getPath) "OpenSubtitlesHasher" should { s"compute hash for ${breakdanceAvi.getName}" in { b...
Pyppe/subtitler
src/test/scala/fi/pyppe/subtitler/OpenSubtitlesHasherSpec.scala
Scala
mit
443
/* * Copyright 2013 Steve Vickers * * 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 ...
ReactiveMongo/ReactiveMongo-Extensions
bson/src/main/scala/dsl/criteria/Untyped.scala
Scala
apache-2.0
7,264
/* * Copyright 2017-2020 Aleksey Fomkin * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or ag...
fomkin/korolev
modules/effect/src/main/scala/korolev/effect/Effect.scala
Scala
apache-2.0
5,768
package org.bizzle.astar import scala.annotation.tailrec import org.bizzle.pathfinding.{ coordinate, pathingmap, PathingStatus }, coordinate.{ BadCoordinate2D, Coordinate2D }, pathingmap.PathingMapString, PathingStatus._ import base.{ AStarBase, AStarStepData, HeuristicLib } /** * Created by Inte...
TheBizzle/PathFinding
AStar/src/main/org/bizzle/astar/AStar.scala
Scala
bsd-3-clause
2,221
/* * 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/test/scala/uk/gov/hmrc/ct/accounts/frs102/boxes/AC115AbridgedSpec.scala
Scala
apache-2.0
2,559
package chana.xpath import chana.Clear import chana.Delete import chana.Entity import chana.Insert import chana.InsertAll import chana.InsertAllJson import chana.InsertJson import chana.Select import chana.SelectAvro import chana.SelectJson import chana.Update import chana.UpdateJson import chana.xpath import scala.ut...
hustnn/chana
src/main/scala/chana/xpath/XPathBehavior.scala
Scala
apache-2.0
4,494
package controllers import play.api._ import play.api.mvc._ import models.Task import repositories.SprintRepo import play.api.libs.json.Json import util.JsonConversions._ object TaskController extends Controller { def list = Action { Ok } def json(id: Long) = Action { val sprint = SprintRepo findById ...
soupytwist/knit
app/controllers/TaskController.scala
Scala
gpl-3.0
357
/* * Copyright (c) 2015-2017 Lymia Alusyia <lymia@lymiahugs.com> * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use,...
Lymia/CivV_Mod2DLC
src/main/scala/moe/lymia/mppatch/ui/I18N.scala
Scala
mit
3,184
package com.github.dtaniwaki.akka_pusher import com.github.dtaniwaki.akka_pusher.PusherModels.ChannelData import com.github.dtaniwaki.akka_pusher.attributes.{ PusherChannelsAttributes, PusherChannelAttributes } import spray.json.JsValue object PusherMessages { case class TriggerMessage( channel: String, eve...
dtaniwaki/akka-pusher
src/main/scala/com/github/dtaniwaki/akka_pusher/PusherMessages.scala
Scala
mit
1,937
package com.airbnb.common.ml.strategy.params import com.airbnb.common.ml.strategy.config.TrainingOptions import com.airbnb.common.ml.strategy.data.BaseBinarySample // use tanh function and assume BinaryScoringSample.x is between 0~1 case class BaseParam (params: Array[Double] = Array()) extends StrategyParams[BaseBi...
airbnb/aerosolve
airlearner/airlearner-strategy/src/main/scala/com/airbnb/common/ml/strategy/params/BaseParam.scala
Scala
apache-2.0
1,381
package com.github.luzhuomi.regex.pderiv /** The external AST * */ object ExtPattern { sealed trait EPat case class EEmpty(loc:Loc) extends EPat // empty sequence case class EGroupNonMarking(p:EPat,loc:Loc) extends EPat // non marking group (:?r) case class EGroup(p:EPat,loc:Loc) extends EPat // the marking ...
luzhuomi/scala-pderiv
src/main/scala/com/github/luzhuomi/regex/pderiv/ExtPattern.scala
Scala
apache-2.0
2,066
/* * 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/self-service-time-to-pay-frontend
app/uk/gov/hmrc/selfservicetimetopay/models/CalculatorAmountsDue.scala
Scala
apache-2.0
818
package blended.streams.dispatcher.internal.builder import akka.NotUsed import akka.stream._ import akka.stream.scaladsl.GraphDSL.Implicits._ import akka.stream.scaladsl.{Broadcast, Flow, GraphDSL, Merge} import blended.container.context.api.ContainerContext import blended.streams.FlowProcessor import blended.streams....
woq-blended/blended
blended.streams.dispatcher/src/main/scala/blended/streams/dispatcher/internal/builder/DispatcherBuilder.scala
Scala
apache-2.0
15,879
/* * 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-zkcluster/src/test/scala/org/squbs/cluster/test/ZkClusterMultiActorSystemTestKit.scala
Scala
apache-2.0
5,700
package io.vertx.asyncsql.test.mysql import io.vertx.asyncsql.test.{BaseSqlTests, SqlTestVerticle} import org.junit.Test import org.vertx.scala.core.json._ import org.vertx.testtools.VertxAssert._ class MySqlTest extends SqlTestVerticle with BaseSqlTests { override def doBefore() = expectOk(raw("DROP TABLE IF EXIS...
vert-x/mod-mysql-postgresql
src/test/scala/io/vertx/asyncsql/test/mysql/MySqlTest.scala
Scala
apache-2.0
3,396
package connectionpools /** * JdbcDrivers * @author Sunghyouk Bae sunghyouk.bae@gmail.com */ object JdbcDrivers { val DATASOURCE_CLASS_H2: String = "org.h2.jdbcx.JdbcDataSource" val DRIVER_CLASS_H2: String = "org.h2.Driver" val DIALECT_H2: String = "org.hibernate.dialect.H2Dialect" val DATASOURCE_CLASS_HS...
debop/connectionpool-benchmark
src/main/scala/connectionpools/JdbcDrivers.scala
Scala
apache-2.0
1,004
package com.github.mdr.mash.repl.browser import com.github.mdr.mash.view.model.ValueModel import com.github.mdr.mash.runtime.MashValue case class ValueBrowserState(model: ValueModel, path: String, expressionStateOpt: Option[ExpressionState] = None) extends Bro...
mdr/mash
src/main/scala/com/github/mdr/mash/repl/browser/ValueBrowserState.scala
Scala
mit
672
/* * (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/cogmath/hypergraph/Hypergraph.scala
Scala
apache-2.0
2,704
/* * # Trove * * This file is part of Trove - A FREE desktop budgeting application that * helps you track your finances, FREES you from complex budgeting, and * enables you to build your TROVE of savings! * * Copyright © 2016-2021 Eric John Fredericks. * * Trove is free software: you can redistribute it ...
emanchgo/trove
src/main/scala/trove/core/infrastructure/persist/lock/ProjectLock.scala
Scala
gpl-3.0
4,936
package workflow import org.apache.spark.SparkContext import org.apache.spark.rdd.RDD import org.scalatest.FunSuite import pipelines.Logging class EstimatorSuite extends FunSuite with PipelineContext with Logging { test("Estimator fit RDD") { sc = new SparkContext("local", "test") val intEstimator = new Es...
tomerk/keystone
src/test/scala/workflow/EstimatorSuite.scala
Scala
apache-2.0
1,332
package coursier import java.util.concurrent.ConcurrentHashMap import coursier.cache.{Cache, CacheLogger} import coursier.core.{Activation, DependencySet, Exclusions, Reconciliation} import coursier.error.ResolutionError import coursier.error.conflict.UnsatisfiedRule import coursier.graph.ReverseModuleTree import cou...
coursier/coursier
modules/coursier/shared/src/main/scala/coursier/Resolve.scala
Scala
apache-2.0
12,137
package use.basic.defmacro import org.scalatest.FunSuite class DefMacroSample01UseTest extends FunSuite { test("DefMacroSample01Use#use1を呼ぶ") { val d = new DefMacroSample01Use d.use1() } }
thachi/scala-macro-sample
use/src/test/scala/use/basic/defmacro/DefMacroSample01UseTest.scala
Scala
apache-2.0
212
package io.transwarp.midas.constant.midas.params.data /** * Created by linchen on 16-10-10. */ object OrderByParams { val orderByCol = "orderByCol" val descending = "descending" }
transwarpio/rapidminer
api-driver/src/main/scala/io/transwarp/midas/constant/midas/params/data/OrderByParams.scala
Scala
gpl-3.0
189