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...
usakey/kafka
core/src/test/scala/unit/kafka/integration/TopicMetadataTest.scala
Scala
apache-2.0
12,970
package scalapb.textformat class TokenizerSpec extends munit.FunSuite { def tokenize(text: String): Vector[String] = { val b = Vector.newBuilder[String] val t = new Tokenizer(text) while (t.hasNext) b += t.next() b.result() } test("Tokenizer is tokenizing") { assertEquals(tokenize("hello wo...
scalapb/ScalaPB
scalapb-runtime/src/test/scala/scalapb/textformat/TokenizerSpec.scala
Scala
apache-2.0
1,327
/* * (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/runtime/allocation/SharedLatch.scala
Scala
apache-2.0
3,543
/* *\\ ** Squants ** ** ** ** Scala Quantities and Units of Measure Library and DSL ** ** (c) 2013-2018, G...
garyKeorkunian/squants
shared/src/main/scala/squants/radio/Activity.scala
Scala
apache-2.0
2,216
object PatternGuards2 { def test(y: Int): Int = { var x = y def foo(): Boolean = x > 10 x = x + 1 x match { case z if foo() => x case _ => 11 } } ensuring(_ > 10) }
regb/leon
src/test/resources/regression/verification/xlang/valid/PatternGuards2.scala
Scala
gpl-3.0
209
/** * 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...
evlist/orbeon-forms
src/main/scala/org/orbeon/oxf/xforms/event/ClientEvents.scala
Scala
lgpl-2.1
25,777
package es.um.nosql.streaminginference.spark.implicits import scala.collection.JavaConversions.asScalaBuffer import scala.collection.JavaConversions.seqAsJavaList import scala.collection.mutable.Buffer import scala.collection.mutable.HashMap import org.apache.spark.sql.Row import org.apache.spark.sql.SparkSession imp...
catedrasaes-umu/NoSQLDataEngineering
projects/es.um.nosql.streaminginference.json2dbschema/src/es/um/nosql/streaminginference/spark/implicits/InferenceSQLSchema.scala
Scala
mit
6,037
package kornell.server.ws.rs.writer import javax.ws.rs.core.{MediaType, MultivaluedMap} import javax.ws.rs.ext.{MessageBodyWriter, Provider} @Provider class BooleanWriter extends MessageBodyWriter[Boolean] { override def getSize(b: Boolean, aType: java.lang.Class[_], genericType: java.lang.reflect.Type, ...
Craftware/Kornell
kornell-api/src/main/scala/kornell/server/ws/rs/writer/BooleanWriter.scala
Scala
apache-2.0
1,004
package xsbtWebApp import scala.xml.{ Node => XmlNode, NodeSeq => XmlNodeSeq, _ } import scala.xml.transform.{ RewriteRule, RuleTransformer } import sbt._ import Keys.TaskStreams import xsbtUtil.types._ import xsbtUtil.{ util => xu } import xsbtClasspath.{ Asset => ClasspathAsset, ClasspathPlugin } import xsbtClass...
ritschwumm/xsbt-webapp
src/main/scala/WebAppPlugin.scala
Scala
bsd-2-clause
5,820
package org.archive.archivespark.sparkling.io import java.io.{FileInputStream, OutputStream} import org.apache.hadoop.fs.Path import org.archive.archivespark.sparkling.logging.{Log, LogContext} import scala.util.Try class HdfsFileWriter private(filename: String, append: Boolean, replication: Short) extends OutputSt...
helgeho/ArchiveSpark
src/main/scala/org/archive/archivespark/sparkling/io/HdfsFileWriter.scala
Scala
mit
1,591
package functions import org.scalatest.FunSuite import basics.functions.FunctionComposition class FunctionCompositionTest extends FunSuite { test("FunctionCompositionTest1") { assert(FunctionComposition.computeComposed===12); assert(FunctionComposition.computeComposed2===12); } }
szaqal/KitchenSink
Scala/01/src/test/scala/functions/FunctionCompositionTest.scala
Scala
gpl-3.0
296
package dotty.tools.dotc.util /** A common class for lightweight mutable sets. */ abstract class MutableSet[T] extends ReadOnlySet[T]: /** Add element `x` to the set */ def +=(x: T): Unit /** Like `+=` but return existing element equal to `x` of it exists, * `x` itself otherwise. */ def put(x: T): T ...
dotty-staging/dotty
compiler/src/dotty/tools/dotc/util/MutableSet.scala
Scala
apache-2.0
557
/* * 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 ...
trueyao/spark-lever
sql/core/src/main/scala/org/apache/spark/sql/UDFRegistration.scala
Scala
apache-2.0
28,934
/* * 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 ...
dbtsai/spark
sql/core/src/main/scala/org/apache/spark/sql/execution/exchange/BroadcastExchangeExec.scala
Scala
apache-2.0
8,985
/* * 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 ...
fhueske/flink
flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/calcite/CalciteConfig.scala
Scala
apache-2.0
9,790
/** * Copyright 2011-2016 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...
GabrielPlassard/gatling
gatling-core/src/main/scala/io/gatling/core/structure/StructureSupport.scala
Scala
apache-2.0
940
/* * Copyright (C) Lightbend Inc. <https://www.lightbend.com> */ package scalaguide.common.build package object controllers { type AssetsBuilder = _root_.controllers.AssetsBuilder type Assets = _root_.controllers.Assets }
benmccann/playframework
documentation/manual/working/commonGuide/build/code/scalaguide/common/build/controllers/SubProjectAssets.scala
Scala
apache-2.0
237
/* * 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 ...
lincoln-lil/flink
flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/planner/plan/rules/logical/FlinkLogicalRankRule.scala
Scala
apache-2.0
9,805
package spark.executor import java.nio.ByteBuffer import spark.TaskState.TaskState /** * A pluggable interface used by the Executor to send updates to the cluster scheduler. */ trait ExecutorBackend { def statusUpdate(taskId: Long, state: TaskState, data: ByteBuffer) }
ankurdave/arthur
core/src/main/scala/spark/executor/ExecutorBackend.scala
Scala
bsd-3-clause
276
package mesosphere.marathon package integration.setup import java.io.File import java.lang.management.ManagementFactory import java.net.{URLDecoder, URLEncoder} import java.nio.charset.Charset import java.nio.file.Files import java.util.UUID import java.util.concurrent.ConcurrentLinkedQueue import akka.Done import ak...
mesosphere/marathon
tests/integration/src/test/scala/mesosphere/marathon/integration/setup/MarathonTest.scala
Scala
apache-2.0
41,955
package stronghold.strings /** * problem description: http://rosalind.info/problems/revc/ */ object ComputingGcContent { object SampleData { val sample: List[String] = List( ">Rosalind_6404", "CCTGCGGAAGATCGGCACTAGAATAGCCAGAACCGTTTCTCTGAGGCTTCCGGCCTTCCC", "TCCCACTAATAATTCTGAGG...
ghostrider77/Bioinformatics
Bioinformatics/src/main/scala-2.11/stronghold/strings/ComputingGcContent.scala
Scala
mit
2,045
/* * Copyright (c) 2015 Robert Conrad - All Rights Reserved. * Unauthorized copying of this file, via any medium is strictly prohibited. * This file is proprietary and confidential. * Last modified by rconrad, 1/3/15 7:09 PM */ package base.socket.message import base.socket.json.JsonFormats import io.netty.chann...
robconrad/base-api
project-socket/src/main/scala/base/socket/message/Message.scala
Scala
mit
2,715
package org.jetbrains.plugins.scala.failed.typeInference import org.jetbrains.plugins.scala.PerfCycleTests import org.jetbrains.plugins.scala.lang.typeInference.TypeInferenceTestBase import org.junit.experimental.categories.Category /** * Created by Anton Yalyshev on 17/05/16. */ @Category(Array(classOf[PerfCycle...
jastice/intellij-scala
scala/scala-impl/test/org/jetbrains/plugins/scala/failed/typeInference/CaseClassTypeInferenceTest.scala
Scala
apache-2.0
1,528
package com.twitter.finatra.http.filters import com.twitter.finagle.Service import com.twitter.finagle.httpx.{Request, Response} import com.twitter.finagle.stats.StatsReceiver import com.twitter.finatra.http.internal.exceptions.ExceptionManager import com.twitter.util.Memoize import javax.inject.{Inject, Singleton} @...
deanh/finatra
http/src/main/scala/com/twitter/finatra/http/filters/ExceptionBarrierFilter.scala
Scala
apache-2.0
1,059
package org.sisioh.aws4s.eb.model import com.amazonaws.services.elasticbeanstalk.model.RestartAppServerRequest import org.sisioh.aws4s.PimpedType object RestartAppServerRequestFactory { def create(): RestartAppServerRequest = new RestartAppServerRequest() } class RichRestartAppServerRequest(val underlying: Resta...
everpeace/aws4s
aws4s-eb/src/main/scala/org/sisioh/aws4s/eb/model/RichRestartAppServerRequest.scala
Scala
mit
1,035
package ch.descabato.core.model import java.io.{File, IOException} import java.math.{BigDecimal => JBigDecimal} import java.nio.file.attribute._ import java.nio.file.{Files, LinkOption, Path} import java.security.Principal import java.util import java.util.regex.Pattern import ch.descabato.core.util.JacksonAnnotation...
Stivo/DeScaBaTo
core/src/main/scala/ch/descabato/core/model/Models.scala
Scala
gpl-3.0
7,508
/** * Copyright (c) 2010, Stefan Langer * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * * Redistributions of source code must retain the above copyright * notice, this list o...
emarsys/dyson
project/build/Filter.scala
Scala
gpl-3.0
3,220
package sGeneticAlgorithm.ga import akka.actor._ object GA { case class Unique[T]( val any: Any, val uuid: String = java.util.UUID.randomUUID.toString) extends Serializable case object Start type Genome[T, I <: Iterable[T]] = I type Population[T, I <: Iterable[T]] = Vector[Genome[T, I]] type Species[T, I <:...
rkewley/sGeneticAlgorithm
src/main/scala/sGeneticAlgorithm/ga/GA.scala
Scala
apache-2.0
6,964
/* * 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 ...
maropu/spark
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/FileWrite.scala
Scala
apache-2.0
6,144
/* * Scala (https://www.scala-lang.org) * * Copyright EPFL and Lightbend, Inc. * * Licensed under Apache License 2.0 * (http://www.apache.org/licenses/LICENSE-2.0). * * See the NOTICE file distributed with this work for * additional information regarding copyright ownership. */ package scala.tools.nsc /** A...
scala/scala
src/compiler/scala/tools/nsc/CompilerCommand.scala
Scala
apache-2.0
6,028
/* * 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-assessment-api
test/fixtures/SelfAssessmentApiDefinitionFixture.scala
Scala
apache-2.0
2,238
/* * Copyright 2013 Carnegie Mellon University * * 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 applica...
oaqa/suim
suim-scala/src/main/scala/edu/cmu/lti/suim/SCAS.scala
Scala
apache-2.0
1,880
/* Copyright 2013, 2014 NICTA This file is part of t3as (Text Analysis As A Service). t3as 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...
NICTA/t3as-pat-clas
pat-clas-service/src/test/scala/org/t3as/patClas/service/TestPatClasService.scala
Scala
gpl-3.0
3,392
package shapeless import scala.collection.immutable.ListMap import scala.reflect.macros.whitebox trait OpenImplicitMacros { val c: whitebox.Context import c.universe._ def openImplicitTpe: Option[Type] = c.openImplicits.headOption.map(_.pt) def openImplicitTpeParam: Option[Type] = openImplicitTpe.m...
isaka/shapeless
core/src/main/scala_2.13-/shapeless/LazyMacros.scala
Scala
apache-2.0
12,126
package enumeratum.values import argonaut._ import Argonaut._ /** Created by alonsodomin on 14/10/2016. */ object Argonauter { def encoder[ValueType: EncodeJson, EntryType <: ValueEnumEntry[ValueType]]( enum: ValueEnum[ValueType, EntryType] ): EncodeJson[EntryType] = { val encodeValue = implicitly[En...
lloydmeta/enumeratum
enumeratum-argonaut/src/main/scala/enumeratum/values/Argonauter.scala
Scala
mit
906
package org.jetbrains.plugins.scala package codeInspection package unusedInspections import com.intellij.codeInsight.FileModificationService import com.intellij.codeInsight.daemon.QuickFixBundle import com.intellij.codeInsight.intention.{HighPriorityAction, IntentionAction, LowPriorityAction} import com.intellij.opena...
JetBrains/intellij-scala
scala/scala-impl/src/org/jetbrains/plugins/scala/codeInspection/unusedInspections/ScalaOptimizeImportsFix.scala
Scala
apache-2.0
3,270
package play.boilerplate.generators import org.scalatest.{FlatSpec, Matchers} import play.boilerplate.generators.security.{Play2AuthSecurityProvider, SecurityProvider} import play.boilerplate.parser.backend.swagger.SwaggerBackend import treehugger.forest class ClientCodeGeneratorTest extends FlatSpec with Matchers wi...
Romastyi/sbt-play-boilerplate
sbt-plugin/lib/src/test/scala/play/boilerplate/generators/ClientCodeGeneratorTest.scala
Scala
apache-2.0
1,451
package net.categoricaldata.category import org.scalatest.FlatSpec import org.scalatest.matchers.ShouldMatchers import org.junit.runner.RunWith import org.scalatest.junit.JUnitRunner import scala.math._ import net.categoricaldata.ontology._ import net.categoricaldata.examples.Examples import net.categoricaldata.util.C...
JasonGross/categoricaldata
src/test/scala/net/categoricaldata/category/NaturalTransformationDevTest.scala
Scala
mit
7,785
/* * 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/network/BlockDataManager.scala
Scala
apache-2.0
2,403
/*********************************************************************** * Copyright (c) 2013-2019 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...
elahrvivaz/geomesa
geomesa-gt/geomesa-gt-tools/src/main/scala/org/locationtech/geomesa/geotools/tools/export/GeoToolsPlaybackCommand.scala
Scala
apache-2.0
1,396
package io.swagger.client.model import io.swagger.client.core.ApiModel import org.joda.time.DateTime case class ValueObject ( /* Timestamp for the measurement event in epoch time (unixtime) */ timestamp: Long, /* Measurement value */ value: Double, /* Optional note to include with the measurement */ note...
QuantiModo/QuantiModo-SDK-Akka-Scala
src/main/scala/io/swagger/client/model/ValueObject.scala
Scala
gpl-2.0
360
package com.socrata.datacoordinator.common.soql.csvreps import com.socrata.datacoordinator.truth.csv.CsvColumnRep import com.socrata.soql.types.{SoQLNull, SoQLValue, SoQLID, SoQLType} object IDRep extends CsvColumnRep[SoQLType, SoQLValue] { val size = 1 val representedType = SoQLID def decode(row: IndexedSeq[...
socrata-platform/data-coordinator
coordinatorlib/src/main/scala/com/socrata/datacoordinator/common/soql/csvreps/IDRep.scala
Scala
apache-2.0
632
package sio.regions import cats.data.ReaderT import sio.core.{IORef, IO, MonadIO} import sio.core.syntax.st._ /** * Duplicate a handle in the parent region. */ trait Dup[H[_[_]]] { def dup[F[_], CS, PS](h: H[RegionT[CS, RegionT[PS, F, ?], ?]]) (implicit F: MonadIO[F]): RegionT[CS, RegionT[PS, F, ?], H[RegionT...
alexknvl/sio
regions/src/main/scala/sio/regions/Dup.scala
Scala
mit
1,576
/* __ *\\ ** ________ ___ / / ___ __ ____ Scala.js sbt plugin ** ** / __/ __// _ | / / / _ | __ / // __/ (c) 2013, LAMP/EPFL ** ** __\\ \\/ /__/ __ |/ /__/ __ |/_// /_\\ \\ http://scala-js.org/ ** ** /____/\\___/...
matthughes/scala-js
js-envs/src/main/scala/org/scalajs/jsenv/rhino/RhinoJSEnv.scala
Scala
bsd-3-clause
16,080
/* * Scala.js (https://www.scala-js.org/) * * Copyright EPFL. * * Licensed under Apache License 2.0 * (https://www.apache.org/licenses/LICENSE-2.0). * * See the NOTICE file distributed with this work for * additional information regarding copyright ownership. */ package org.scalajs.testing.interface import ...
nicolasstucki/scala-js
test-interface/src/main/scala/org/scalajs/testing/interface/JSRPC.scala
Scala
apache-2.0
1,012
def &&(p: Prop) = Prop { (n,rng) => run(n,rng) match { case Right((a,n)) => p.run(n,rng).right.map { case (s,m) => (s,n+m) } case l => l } } def ||(p: Prop) = Prop { (n,rng) => run(n,rng) match { case Left(msg) => p.tag(msg).run(n,rng) case r => r } } /* This is rather simplistic - in the eve...
galarragas/FpInScala
answerkey/testing/12.answer.scala
Scala
mit
534
package playground.models case class Password(private val password: String) { def neverLog[A](f: String => A): A = f(password) // intended to be final so you can never log a Password by inadvertance but by passing by neverLog final override def toString() = "[PROTECTED]" }
ybr/playground
src/main/scala/playground/models/Password.scala
Scala
mit
282
package com.outr.arango.api import com.outr.arango.api.model._ import io.youi.client.HttpClient import io.youi.http.HttpMethod import io.youi.net._ import io.circe.Json import scala.concurrent.{ExecutionContext, Future} object APIIndexskiplist { def post(client: HttpClient, collectionName: String, body: Post...
outr/arangodb-scala
api/src/main/scala/com/outr/arango/api/APIIndexskiplist.scala
Scala
mit
566
/* * sbt * Copyright 2011 - 2018, Lightbend, Inc. * Copyright 2008 - 2010, Mark Harrah * Licensed under Apache License 2.0 (see LICENSE) */ package sbt.internal import sbt.BasicCommandStrings.{ ClearOnFailure, FailureWall } import sbt.Watched.ContinuousEventMonitor import sbt.internal.io.{ EventMonitor, WatchSta...
xuwei-k/xsbt
main-command/src/main/scala/sbt/internal/LegacyWatched.scala
Scala
apache-2.0
3,109
package org.opencommercesearch.api.models /* * Licensed to OpenCommerceSearch under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. OpenCommerceSearch licenses this * file to you under the Apache License, Version...
madickson/opencommercesearch
opencommercesearch-api/app/org/opencommercesearch/api/models/Availability.scala
Scala
apache-2.0
2,787
package io.hnfmr.chapter4 import cats.syntax.either._ object EitherTut extends App { // Either in Scala 2.12 is right-biased val either0 = Right(123) val either1 = either0.flatMap(x => Right(x + 1)) val either2 = either0.flatMap(x => Right(x + 2)) val either3 = "DIV0".asLeft[Int] val d = for { a <- e...
hnfmr/advanced-scala
src/main/scala/io/hnfmr/chapter4/EitherTut.scala
Scala
mit
425
object TypedPlaceholder { def foo[T](x: T => Int, y: T) = x(y) foo(/*start*/(_: String).length/*end*/, "") } //(String) => Int
ilinum/intellij-scala
testdata/typeInference/expected/placeholder/TypedPlaceholder.scala
Scala
apache-2.0
131
package emailvalidator import emailvalidator.lexer.{Token, TokenReader} import emailvalidator.parser.EmailParser import scala.util.parsing.input.Reader sealed trait ValidationResult { def warnings: Option[List[Warning]] = None def isSuccess: Boolean def isFailure: Boolean } sealed case class Warning (msg:Stri...
egulias/EmailValidator4Scala
src/main/scala/emailvalidator/EmailValidator.scala
Scala
mit
1,080
package controllers.admin import com.google.inject.Inject import controllers.{routes => normalroutes} import model.Room import model.json.ResultMessage import play.Logger import play.api.Environment import play.api.i18n.MessagesApi import play.api.libs.json.{JsError, JsSuccess, Json} import services.{LaboratoryService...
ProjectAton/AtonLab
app/controllers/admin/RoomController.scala
Scala
gpl-3.0
2,935
package io.skysail.server.demo.resources.html import play.twirl.api.Html import html.main import io.skysail.server.RepresentationModel object BookmarksResource_Get extends _root_.play.twirl.api.BaseScalaTemplate[play.twirl.api.HtmlFormat.Appendable,_root_.play.twirl.api.Format[play.twirl.api.HtmlFormat.Appendable]](...
evandor/skysail-server
skysail.server.demo/src/io/skysail/server/demo/resources/html/BookmarksResource_Get.template.scala
Scala
apache-2.0
3,689
package skinny.filter import skinny.micro.contrib.{ FlashMapSupport, CSRFTokenSupport } import skinny.micro.contrib.csrf.CSRFTokenGenerator import skinny.micro.contrib.flash.FlashMap import scala.language.implicitConversions import skinny.controller.feature._ import skinny.micro.context.SkinnyContext import skinny.s...
Kuchitama/skinny-framework
framework/src/main/scala/skinny/filter/SkinnySessionFilter.scala
Scala
mit
3,765
package com.cyrusinnovation.computation.util /* * Copyright 2014 Cyrus Innovation, LLC. Licensed under Apache license 2.0. */ import org.slf4j.Logger /** * logging is done via slf4j * * Keeping Logging implementation separate from * the one used in the scripting engine * */ trait Log { def debug(msg: Strin...
psfblair/computation-engine
core/src/main/scala/com/cyrusinnovation/computation/util/Logger.scala
Scala
apache-2.0
793
package com.meekrab.rsseater import scalaj.http._ import scala.xml._ import sys.process._ import java.io._ /* * Based trait for RSS, Atom, and Podcast feeds */ trait Feed /* * Singleton factory that creates new instances of RSS and Atom feeds */ object Feeder { /* * Contains RSS Feed elements * @param f...
meekrabR6R/rsseater-scala
src/main/scala/Reader.scala
Scala
mit
4,552
/* * Copyright (C) 2014 HMPerson1 <hmperson1@gmail.com> and nathanfei123 * * This file is part of AOCM. * * AOCM 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 * (a...
HMPerson1/adorable-octo-computing-machine
src/net/adorableoctocm/graphics/Renderer.scala
Scala
gpl-3.0
2,107
package io.github.mandar2812.dynaml.utils import breeze.linalg._ import breeze.stats.distributions.{Gaussian, LogNormal} import io.github.mandar2812.dynaml.algebra.PartitionedMatrixOps._ import io.github.mandar2812.dynaml.algebra.{PartitionedMatrix, btrace} import io.github.mandar2812.dynaml.analysis.implicits._ impor...
transcendent-ai-labs/DynaML
dynaml-core/src/test/scala/io/github/mandar2812/dynaml/utils/UtilsSpec.scala
Scala
apache-2.0
4,440
package pages.disposal_of_vehicle import uk.gov.dvla.vehicles.presentation.common.helpers.webbrowser.{Page, WebDriverFactory} object TermsAndConditionsPage extends Page { final val address = buildAppUrl("tandc") final override val title: String = "Terms and Conditions" final val titleCy: String = "Amodau a Thel...
dvla/vehicles-online
test/pages/disposal_of_vehicle/TermsAndConditionsPage.scala
Scala
mit
403
package org.yamlidea.psi import com.intellij.psi.tree.IElementType import org.yamlidea.YamlLanguage import org.jetbrains.annotations.{NotNull, NonNls} class YamlTokenType(@NotNull @NonNls debugName: String) extends IElementType(debugName, YamlLanguage) { override def toString = "YamlTokenType." + sup...
jameslan/yaml-idea
src/main/scala/org/yamlidea/psi/YamlTokenType.scala
Scala
apache-2.0
333
/* * 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 ...
UndeadBaneGitHub/spark
sql/hive/src/test/scala/org/apache/spark/sql/hive/StatisticsSuite.scala
Scala
apache-2.0
44,803
package io.scalac.slack import io.scalac.slack.api.{ApiTestResponse, AuthTestResponse, RtmStartResponse} import io.scalac.slack.models._ import org.joda.time.DateTime import org.scalatest.{FunSuite, Matchers} import spray.json._ /** * Created on 27.01.15 22:39 */ class UnmarshallerTest extends FunSuite with Matcher...
Cheers-Dev/scala-slack-bot-core
src/test/scala/io/scalac/slack/UnmarshallerTest.scala
Scala
mit
38,839
package io.pathfinder.models import java.util import javax.persistence.CascadeType._ import javax.persistence._ import com.avaje.ebean.Model import com.avaje.ebean.Model.{Finder, Find} import play.api.libs.json.{Json, Format} import scala.collection.mutable import scala.collection.JavaConverters.asScalaBufferConverte...
CSSE497/pathfinder-server
app/io/pathfinder/models/Application.scala
Scala
mit
1,695
/*********************************************************************** * Copyright (c) 2013-2018 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...
ddseapy/geomesa
geomesa-accumulo/geomesa-accumulo-datastore/src/main/scala/org/locationtech/geomesa/accumulo/audit/AccumuloQueryEventTransform.scala
Scala
apache-2.0
4,018
package org.json4s import org.specs2.mutable.Specification class FormatsSpec extends Specification { "Formats" should { "be a Serializable" in { val f = new Formats { def dateFormat: DateFormat = ??? } f.isInstanceOf[Serializable] must beTrue } } "DefaultFormats" should { ...
dacr/json4s
tests/src/test/scala/org/json4s/FormatsSpec.scala
Scala
apache-2.0
418
/* Scala.js compiler * Copyright 2013 LAMP/EPFL * @author Sébastien Doeraene */ package org.scalajs.core.compiler import scala.collection.mutable import scala.tools.nsc._ import org.scalajs.core.ir import ir.{Trees => js, Types => jstpe} import util.ScopedVar import ScopedVar.withScopedVars /** Encoding of sy...
mdedetrich/scala-js
compiler/src/main/scala/org/scalajs/core/compiler/JSEncoding.scala
Scala
bsd-3-clause
9,150
import scala.tools.partest._ import java.io.File object Test extends StoreReporterDirectTest { def code = ??? def compileCode(code: String) = { val classpath = pathOf(sys.props("partest.lib"), testOutput.path) compileString(newCompiler("-cp", classpath))(code) } def library1 = """ package pack1 ...
scala/scala
test/files/run/t6440b.scala
Scala
apache-2.0
1,494
package org.bfn.ninetynineprobs import org.scalatest._ class P65Spec extends UnitSpec { // TODO }
bfontaine/99Scala
src/test/scala/P65Spec.scala
Scala
mit
105
/* * 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/src/main/scala/org/apache/flink/table/runtime/functions/DateTimeFunctions.scala
Scala
apache-2.0
5,278
package org.randi3.model object ActionType extends Enumeration{ val LOGIN, LOGIN_FAILED, LOGOUT, CREATE, UPDATE, DELETE, RANDOMIZE, ADD_RESPONSE = Value }
dschrimpf/randi3-core
src/main/scala/org/randi3/model/ActionType.scala
Scala
gpl-3.0
160
package io.taig.android.graphic import android.graphics.Color._ case class Color(color: Int) extends AnyVal { def darken(amount: Float) = { val hsv = new Array[Float](3) colorToHSV(color, hsv) hsv(2) *= 1 - amount Color(HSVToColor(hsv)) } } object Color { val Black = Color(BLACK) val Blue = ...
Taig/Toolbelt
graphic/src/main/scala/io/taig/android/graphic/Color.scala
Scala
mit
695
package com.twitter.finagle.redis.integration import com.twitter.finagle.redis.naggati.RedisClientTest import com.twitter.finagle.redis.protocol.BitOp import com.twitter.finagle.redis.tags.{RedisTest, ClientTest} import com.twitter.util.Await import com.twitter.finagle.redis.util.{CBToString, StringToChannelBuffer} im...
a-manumohan/finagle
finagle-redis/src/test/scala/com/twitter/finagle/redis/commands/string/StringClientIntegrationSuite.scala
Scala
apache-2.0
7,237
package tests object Example { def foo(o: AnyRef) { o == null<caret> } }
JetBrains/intellij-scala
scala/scala-impl/testdata/postfixTemplate/tabCompletion/else.scala
Scala
apache-2.0
82
package services.crunch.deskrecs import actors.acking.AckingReceiver.{Ack, StreamInitialized} import akka.NotUsed import akka.actor.{Actor, ActorRef, Props} import akka.stream.Materializer import akka.stream.scaladsl.Source import akka.testkit.TestProbe import controllers.ArrivalGenerator import drt.shared.CrunchApi.D...
UKHomeOffice/drt-scalajs-spa-exploration
server/src/test/scala/services/crunch/deskrecs/DynamicRunnableDeskRecsSpec.scala
Scala
apache-2.0
10,615
/** * 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...
gf53520/kafka
core/src/test/scala/unit/kafka/log/LogCleanerParameterizedIntegrationTest.scala
Scala
apache-2.0
15,379
package com.twitter.gizzard.scheduler import org.specs.Specification import org.specs.mock.{ClassMocker, JMocker} import com.twitter.json.Json import com.twitter.gizzard.ConfiguredSpecification class JsonJobParserSpec extends ConfiguredSpecification with JMocker with ClassMocker { "JsonJobParser" should { val ...
kangkot/gizzard
src/test/scala/com/twitter/gizzard/scheduler_new/JsonJobParserSpec.scala
Scala
apache-2.0
2,514
package com.github.j5ik2o.dddbase.memory import com.github.j5ik2o.dddbase.{ AggregateMultiSoftDeletable, AggregateMultiWriter } import monix.eval.Task trait AggregateMultiSoftDeleteFeature extends AggregateMultiSoftDeletable[Task] with AggregateBaseReadFeature { this: AggregateMultiWriter[Task] with AggregateSingle...
j5ik2o/scala-ddd-base-functional
nosql/memory/src/main/scala/com/github/j5ik2o/dddbase/memory/AggregateMultiSoftDeleteFeature.scala
Scala
mit
455
/* * SPDX-License-Identifier: Apache-2.0 * * Copyright 2015-2021 Andre White. * * 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 * * https://www.apache.org/licenses/LICENSE...
adarro/ddo-calc
subprojects/common/ddo-core/src/main/scala/io/truthencode/ddo/model/feats/EpicSkills.scala
Scala
apache-2.0
987
package ghpages.examples import ghpages.examples.util.SingleSide import japgolly.scalajs.react._ import japgolly.scalajs.react.vdom.prefix_<^._ import org.scalajs.dom /** * Example of using Touch events. * * TouchList is JavaScript collection, so it is converted to Scala IndexedSeq. * Showing only top 10 events, ...
gshakhn/scalajs-react
gh-pages/src/main/scala/ghpages/examples/TouchExample.scala
Scala
apache-2.0
4,423
/* The Computer Language Benchmarks Game * http://shootout.alioth.debian.org/ * original contributed by Kenneth Jonsson */ import scala.actors.Actor import scala.actors.Actor._ class Worker(size: Int) extends Actor { private val bytesPerRow = (size + 7) >> 3 private val maxIterations = 50 private val l...
kragen/shootout
bench/mandelbrot/mandelbrot.scala-3.scala
Scala
bsd-3-clause
2,581
package lila.tournament import org.joda.time.DateTime import play.api.libs.iteratee._ import reactivemongo.bson._ import scala.concurrent.duration._ import lila.common.Maths import lila.common.paginator.Paginator import lila.db.BSON._ import lila.db.dsl._ import lila.db.paginator.Adapter import lila.rating.PerfType i...
clarkerubber/lila
modules/tournament/src/main/LeaderboardApi.scala
Scala
agpl-3.0
3,568
package spinoco.protocol.http.header.value import scodec.codecs._ import scodec.{Attempt, Codec, Err} import spinoco.protocol.http.codec.helper._ sealed case class EntityTag(tag: String, weak: Boolean) object EntityTag { val codec: Codec[EntityTag] = { val weakTag: Codec[EntityTag] = { (asciiConstant(...
Spinoco/protocol
http/src/main/scala/spinoco/protocol/http/header/value/EntityTag.scala
Scala
mit
654
/* * Copyright (c) 2013 Christos KK Loverdos * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law...
loverdos/thrift3r
src/main/scala/com/ckkloverdos/thrift3r/codec/primitiveref/IntRefCodec.scala
Scala
apache-2.0
1,567
import sbt._ import Keys._ import org.scalatra.sbt._ import com.mojolly.scalate.ScalatePlugin._ import ScalateKeys._ object LunabotBuild extends Build { val Organization = "com.lunatech" val Name = "lunabot" val Version = "0.1.0-SNAPSHOT" val ScalaVersion = "2.11.7" val ScalatraVersion = "2.3.0" lazy val ...
mariadroman/lunabot
project/build.scala
Scala
apache-2.0
1,949
package io.eels.component.jdbc import java.sql.DriverManager import org.scalatest.{Matchers, WordSpec} import scala.util.Random class RangePartitionStrategyTest extends WordSpec with Matchers { Class.forName("org.h2.Driver") private val conn = DriverManager.getConnection("jdbc:h2:mem:rangetest") conn.create...
eel-lib/eel
eel-core/src/test/scala/io/eels/component/jdbc/RangePartitionStrategyTest.scala
Scala
mit
1,668
/* * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ package swave.docs import org.scalatest.{FreeSpec, Matchers} class DrainSpec extends FreeSpec with Matchers ...
sirthias/swave
docs/src/test/scala/swave/docs/DrainSpec.scala
Scala
mpl-2.0
1,149
package org.bitcoins.core.util import org.bitcoins.core.util.testprotocol._ import org.scalatest.{FlatSpec, MustMatchers} import spray.json._ import scala.io.Source /** * Created by tom on 5/17/16. */ class Base58Test extends FlatSpec with MustMatchers { "Base58" must "encode byte value of 0 to character of 1"...
bitcoin-s/bitcoin-s-core
core-test/src/test/scala/org/bitcoins/core/util/Base58Test.scala
Scala
mit
4,679
package com.github.kmizu.llwan import com.github.kmizu.llwan.Ast.Choices class GrammarAnalyzer(grammar: Ast.Grammar) { type FirstSetTable = Map[Symbol, Set[String]] private[this] val mapping: Map[Symbol, Choices] = grammar.rules.map{ rule => rule.name -> rule.body}.toMap def calculateFirstSet: FirstSetTable = ...
kmizu/llwan
src/main/scala/com/github/kmizu/llwan/GrammarAnalyzer.scala
Scala
mit
1,206
/** * Copyright 2017 Interel * * 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...
Interel-Group/core3
src/main/scala/core3/security/LocalAuthUserToken.scala
Scala
apache-2.0
1,472
/* * 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
mllib/src/main/scala/org/apache/spark/ml/feature/Bucketizer.scala
Scala
apache-2.0
5,823
package ru.dgolubets.neo4s.internal.iteratee import play.api.libs.iteratee.{Input, Iteratee, Step} import scala.concurrent.Future /** * Helper to feed iteratees. * Iteratee.feed method can return unfinished iteratee when it's async. * But this one returns only when that iteratee reported with Cont. */ class Iter...
DGolubets/neo4s
src/main/scala/ru/dgolubets/neo4s/internal/iteratee/IterateeFeeder.scala
Scala
apache-2.0
1,324
package edu.gemini.pit.ui.view.submit import edu.gemini.model.p1.immutable._ import edu.gemini.model.p1.submit.SubmitDestination.{Exchange, Ngo} import edu.gemini.pit.ui.robot.ProblemRobot._ import edu.gemini.model.p1.submit.{SubmitResult, SubmitDestination} import edu.gemini.model.p1.submit.SubmitResult.{Offline, Ser...
arturog8m/ocs
bundle/edu.gemini.pit/src/main/scala/edu/gemini/pit/ui/view/submit/SubmitStatus.scala
Scala
bsd-3-clause
6,311
/* * MUSIT is a museum database to archive natural and cultural history data. * Copyright (C) 2016 MUSIT Norway, part of www.uio.no (University of Oslo) * * 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 ...
kpmeen/musit
service_barcode/app/modules/HealthCheckModule.scala
Scala
gpl-2.0
2,003
package demo import org.scalajs.dom._ /* * Copyright (C) 24/08/16 // mathieu.leclaire@openmole.org * * 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...
mathieuleclaire/scaladget
demo/src/main/scala/demo/LabelDemo.scala
Scala
agpl-3.0
1,887
package unit.akka import scala.collection.immutable import scala.concurrent.duration.DurationInt import scala.util.Random import org.scalatest.BeforeAndAfterAll import org.scalatest.Matchers import org.scalatest.WordSpecLike import com.typesafe.config.ConfigFactory import akka.actor.Actor import akka.actor.ActorRef...
nidkil/akka-downloader
src/test/scala/unit/akka/TestkitExample.scala
Scala
apache-2.0
3,807
package net.rrm.ehour.persistence.retry import java.util.Random import org.apache.log4j.Logger import org.hibernate.HibernateException object ExponentialBackoffRetryPolicy { private final val MaxAttempts = 5 private final val Log = Logger.getLogger(ExponentialBackoffRetryPolicy.getClass) def retry[T](op: => T...
momogentoo/ehour
eHour-persistence/src/main/scala/net/rrm/ehour/persistence/retry/ExponentialBackoffRetryPolicy.scala
Scala
gpl-2.0
1,298
package com.eigengo.lift.exercise import java.nio.ByteBuffer import scodec.bits.{BitVector, ByteOrdering, ByteVector} import scalaz.\/ /** * The multi packet message follows a simple structure * * {{{ * header: UInt16 = 0xcab1 // + 2 B * count: Byte = ... // + 3 B * timestamp: UInt32 =...
lachatak/lift
server/exercise/src/main/scala/com/eigengo/lift/exercise/MultiPacketDecoder.scala
Scala
apache-2.0
2,851
package com.github.bhanafee.whereami import scala.concurrent.duration._ import akka.actor._ import akka.pattern.ask import spray.routing._ import spray.http.StatusCodes import spray.httpx.SprayJsonSupport._ import spray.routing.RequestContext import TrackerProtocol._ class RestInterface(val gis: ActorRef, val trac...
bhanafee/whereami
app/src/main/scala/com/github/bhanafee/whereami/RestInterface.scala
Scala
apache-2.0
2,234