code stringlengths 5 1M | repo_name stringlengths 5 109 | path stringlengths 6 208 | language stringclasses 1
value | license stringclasses 15
values | size int64 5 1M |
|---|---|---|---|---|---|
package sk.koval.nifi.processors
import cats.Applicative
import cats.instances.vector._
import cats.syntax.functor._
import cats.syntax.traverse._
import io.circe._
import io.circe.optics.JsonTraversalPath
import io.circe.optics.all._
import monocle.Traversal
import scala.language.higherKinds
package object utils {
... | tonykoval/nifi-utils-bundle | nifi-utils-processors/src/main/scala/sk/koval/nifi/processors/utils/package.scala | Scala | apache-2.0 | 1,274 |
/*
* Copyright 2014–2020 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 agr... | slamdata/quasar | foundation/src/main/scala/quasar/contrib/cats/hash.scala | Scala | apache-2.0 | 791 |
package org.eso.ias.sink
import java.util.concurrent._
import java.util.concurrent.atomic.{AtomicBoolean, AtomicLong}
import com.typesafe.scalalogging.Logger
import org.eso.ias.cdb.pojos.{IasDao, IasioDao, TemplateDao}
import org.eso.ias.command.kafka.CommandManagerKafkaImpl
import org.eso.ias.command.{CommandManager... | IntegratedAlarmSystem-Group/ias | SinkClient/src/main/scala/org/eso/ias/sink/IasValueProcessor.scala | Scala | lgpl-3.0 | 24,933 |
package cromwell.engine.workflow.lifecycle.execution.job.preparation
import akka.testkit.{ImplicitSender, TestActorRef}
import cats.syntax.validated._
import cromwell.core.TestKitSuite
import cromwell.core.callcaching.{DockerWithHash, FloatingDockerTagWithoutHash}
import cromwell.docker.DockerHashActor.DockerHashSucce... | ohsu-comp-bio/cromwell | engine/src/test/scala/cromwell/engine/workflow/lifecycle/execution/job/preparation/JobPreparationActorSpec.scala | Scala | bsd-3-clause | 7,701 |
package com.hyenawarrior.oldnorsedictionary.model.persister.inmemory
import com.hyenawarrior.oldnorsedictionary.model.persister.Persister
/**
* Created by HyenaWarrior on 2017.11.16..
*/
class InMemoryPersister extends Persister {
private val myserData = new InMemorySerData
private val myStringInterner = new... | HyenaSoftware/IG-Dictionary | app/src/main/scala/com/hyenawarrior/oldnorsedictionary/model/persister/inmemory/InMemoryPersister.scala | Scala | lgpl-3.0 | 431 |
/* tuProlog - Copyright (C) 2001-2002 aliCE team at deis.unibo.it
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any late... | zakski/project-soisceal | scala-core/src/main/scala/com/szadowsz/gospel/util/exception/lib/InvalidLibraryException.scala | Scala | lgpl-3.0 | 1,172 |
/**
* 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/action/Feed.scala | Scala | apache-2.0 | 1,134 |
package com.alexknvl.libconfig.parser
import com.alexknvl.libconfig.ast._
import org.parboiled2.Parser.DeliveryScheme.Throw
import org.scalatest._
import org.scalatest.junit._
import org.scalatest.prop._
class ParserTest extends FunSuite with Matchers {
test("Parsing simple types.") {
new ConfigParser("true").... | alexknvl/scala-libconfig | src/test/scala/Parser.scala | Scala | mit | 2,034 |
/*
* Copyright (C) 2009-2018 Lightbend Inc. <https://www.lightbend.com>
*/
package play.api.routing
import org.specs2.mutable.Specification
import play.api.mvc.Handler
import play.api.routing.Router.Routes
import play.api.routing.sird._
import play.core.test.FakeRequest
class RouterSpec extends Specification {
"... | Shenker93/playframework | framework/src/play/src/test/scala/play/api/routing/RouterSpec.scala | Scala | apache-2.0 | 2,319 |
package com.cave.metrics.data
import com.cave.metrics.data.influxdb.{InfluxClientFactory, InfluxClient}
import com.cave.metrics.data.postgresql.{AbstractDataManagerSpec, PostgresCacheDataManagerImpl}
import org.mockito.Matchers._
import org.mockito.Mockito._
import org.scalatest.mockito.MockitoSugar
import scala.concu... | gilt/cave | core/src/test/scala/com/cave/metrics/data/AlertManagerSpec.scala | Scala | mit | 7,950 |
// Copyright 2011 Foursquare Labs Inc. All Rights Reserved.
package io.fsq.rogue.lift.test
import com.mongodb.{DB, DBCollection}
import io.fsq.rogue.{LatLong, LegacyMongo, ShardKey, Sharded}
import io.fsq.rogue.connection.{BlockingMongoClientManager, DefaultMongoIdentifier}
import io.fsq.rogue.index.{Asc, Desc, Index... | foursquare/fsqio | test/jvm/io/fsq/rogue/lift/test/TestModels.scala | Scala | apache-2.0 | 7,824 |
package com.tsukaby.bean_validation_scala
import javax.validation.constraints.Pattern
import scala.annotation.meta.field
class PatternValidatorForOptionSpec extends BaseSpec {
private[this] case class TestBean(
@(Pattern@field)(regexp = "abc")
... | bean-validation-scala/bean-validation-scala | src/test/scala/com/tsukaby/bean_validation_scala/PatternValidatorForOptionSpec.scala | Scala | mit | 604 |
package com.example.cloud.model
case class BookedCar(userId: String,
carId: String) | okharkovskyi/scala-cloud-skeleton | booking-service/src/main/scala/com/example/cloud/model/BookedCar.scala | Scala | apache-2.0 | 105 |
/*
* Copyright 2014 nidkil
*
* 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 ... | nidkil/scala-downloader | src/main/scala/com/nidkil/downloader/manager/State.scala | Scala | apache-2.0 | 819 |
package org.bitcoins.protocol.script
import org.bitcoins.crypto.ECFactory
import org.bitcoins.marshallers.script.RawScriptSignatureParser
import org.bitcoins.script.constant._
import org.bitcoins.script.crypto.{SIGHASH_SINGLE, SIGHASH_ALL}
import org.bitcoins.util.{BitcoinScriptUtil, TransactionTestUtil, TestUtil}
im... | Christewart/scalacoin | src/test/scala/org/bitcoins/protocol/script/ScriptSignatureTest.scala | Scala | mit | 5,261 |
package spire.algebra
import scala.{ specialized => spec }
/**
* This type class models a metric space `V`. The distance between 2 points in
* `V` is measured in `R`, which should be real (ie. `IsReal[R]` exists).
*/
trait MetricSpace[V, @spec(Int, Long, Float, Double) R] extends Any {
def distance(v: V, w: V): ... | woparry/spire | core/src/main/scala/spire/algebra/MetricSpace.scala | Scala | mit | 1,177 |
package org.http4s
package bench
import cats.implicits._
import java.nio.charset.{UnsupportedCharsetException, Charset => NioCharset}
import java.util.{HashMap, Locale}
import java.util.concurrent.TimeUnit
import org.openjdk.jmh.annotations._
import scala.collection.mutable
import scala.collection.JavaConverters._
@F... | reactormonk/http4s | bench/src/main/scala/org/http4s/bench/NioCharsetBench.scala | Scala | apache-2.0 | 1,872 |
package mvgk.moviesearch
import akka.actor.Actor
import org.openqa.selenium.firefox.FirefoxDriver
/**
* @author Got Hug
*/
object QueryActor {
case class Query(query: MovieQuery)
}
class QueryActor(firefoxDriver: Option[FirefoxDriver] = None) extends Actor {
import mvgk.moviesearch.QueryActor._
override def... | gothug/movie-geek | src/main/scala/mvgk/moviesearch/QueryActor.scala | Scala | apache-2.0 | 402 |
package com.incra.spark
import org.apache.log4j.{Level, Logger}
import org.apache.spark.mllib.classification.LogisticRegressionWithLBFGS
import org.apache.spark.mllib.classification.SVMWithSGD
import org.apache.spark.mllib.evaluation.BinaryClassificationMetrics
import scopt.OptionParser
import org.apache.spark.{Spark... | JeffRisberg/spark-template | src/main/scala/com/incra/spark/LogisticRegression.scala | Scala | apache-2.0 | 3,680 |
package compact_enumeration
import FieldOps._
import scala.language.implicitConversions
/**
* @author gadgil
* Formal Elementary functions
*/
sealed trait FormalElemFunction {
/**
* concrete elementary functions of type A,
* A must have field operations, composition and Elementary Functions of type ... | siddhartha-gadgil/ProvingGround | realfunctions/src/main/scala/compact_enumeration/FormalElemFunction.scala | Scala | mit | 8,028 |
package org.jetbrains.plugins.scala
package project.gradle
import java.io.File
import java.util
import com.intellij.openapi.externalSystem.model.{DataNode, ExternalSystemException, ProjectKeys}
import com.intellij.openapi.externalSystem.service.notification.{ExternalSystemNotificationManager, NotificationSource, Noti... | SergeevPavel/intellij-scala | src/org/jetbrains/plugins/scala/project/gradle/ScalaGradleDataService.scala | Scala | apache-2.0 | 4,369 |
package com.prealpha.pipe.math
import scala.util.parsing.input.Positional
private[math] sealed trait MathExpr extends Positional
private[math] abstract class Wrapper(val c: Seq[MathExpr], val left: String, val right: String) extends MathExpr
private[math] object Wrapper {
def unapply(wrapper: Wrapper): Option[(Seq... | TyOverby/Pipe | math/src/main/scala/com/prealpha/pipe/math/MathExpr.scala | Scala | mpl-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 ... | manuzhang/incubator-gearpump | experiments/akkastream/src/main/scala/org/apache/gearpump/akkastream/task/SingleSourceTask.scala | Scala | apache-2.0 | 1,324 |
package rere.ql.options
import rere.ql.queries.values
trait MaxBatchSecondsOptions {
sealed trait MaxBatchSecondsOptions extends ComposableOptions
case object DefaultMaxBatchSeconds extends MaxBatchSecondsOptions with DefaultOption
case class MaxBatchSeconds(seconds: Double) extends MaxBatchSecondsOptions wi... | pbaun/rere | modules/ql/src/main/scala/rere/ql/options/MaxBatchSecondsOptions.scala | Scala | apache-2.0 | 415 |
/*
* 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.collection.mutab... | scala/scala | src/library/scala/collection/mutable/MultiMap.scala | Scala | apache-2.0 | 3,857 |
package filters
import javax.inject.Inject
import akka.stream.Materializer
import play.api.Logger
import play.api.mvc._
import scala.concurrent.{ExecutionContext, Future}
class LoggingFilter @Inject()(implicit val mat: Materializer, ec: ExecutionContext) extends Filter {
def apply(nextFilter: RequestHeader => Fu... | UKGovernmentBEIS/das-alpha-client-mock | src/main/scala/filters/LoggingFilter.scala | Scala | mit | 837 |
/* Copyright 2017-18, Emmanouil Antonios Platanios. 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 ... | eaplatanios/tensorflow | tensorflow/scala/api/src/main/scala/org/platanios/tensorflow/api/ops/rnn/cell/ResidualWrapper.scala | Scala | apache-2.0 | 2,055 |
/*
* (C) Copyright 2015 Atomic BITS (http://atomicbits.io).
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the GNU Affero General Public License
* (AGPL) version 3.0 which accompanies this distribution, and is available in
* the LICENSE file or at htt... | rcavalcanti/scraml | project/Dependencies.scala | Scala | agpl-3.0 | 2,004 |
/*
* 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 ... | dotunolafunmiloye/spark | core/src/test/scala/org/apache/spark/SparkContextSchedulerCreationSuite.scala | Scala | apache-2.0 | 4,591 |
/*
*
* * Copyright 2014 Commonwealth Computer Research, 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
* *
* ... | jwkessi/geomesa | geomesa-minicluster/src/main/scala/org/locationtech/geomesa/core/integration/data/DataType.scala | Scala | apache-2.0 | 2,031 |
package org.jetbrains.plugins.scala.codeInspection
import com.intellij.codeInspection.{LocalQuickFix, ProblemDescriptor}
import com.intellij.openapi.project.Project
import org.jetbrains.plugins.scala.lang.psi.impl.ScalaPsiElementFactory.createElementFromText
/**
* @author Pavel Fatin
*/
class ReplaceQuickFix(fami... | ilinum/intellij-scala | src/org/jetbrains/plugins/scala/codeInspection/ReplaceQuickFix.scala | Scala | apache-2.0 | 649 |
/*
* 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 | common/src/main/scala/es/tid/cosmos/common/Octal.scala | Scala | apache-2.0 | 853 |
package polyite.export
object JSONExporter {
/**
* Generates JSON-code from the given abstract syntax tree. An object is
* represented by a Map[String, Any]. A List by a List[Any]. An Object of any
* other kind is converted to a String-literal by calling toString.
* @param absSyn the abstract syntax ... | stganser/polyite | src/polyite/export/JSONExporter.scala | Scala | mit | 2,971 |
package app.restlike.rtm
import app.restlike.common.{History, Script, Tracker}
import net.liftweb.common.Full
import net.liftweb.http._
import net.liftweb.http.rest.RestHelper
import org.json4s.native.JsonMethods
import server.ServiceFactory
object Rtm extends RestHelper {
import app.restlike.common.Responder._
... | alltonp/reprobate | src/main/scala/app/restlike/rtm/Rtm.scala | Scala | apache-2.0 | 1,168 |
package controllers
import javax.inject.Inject
import org.joda.time.DateTime
import scala.concurrent.Future
import play.api.Logger
import play.api.Play.current
import play.api.i18n.{ I18nSupport, MessagesApi }
import play.api.mvc.{ Action, Controller, Request }
import play.api.libs.concurrent.Execution.Implicits.de... | sgodbillon/reactivemongo-demo-app | app/controllers/Articles.scala | Scala | apache-2.0 | 8,010 |
package ch.wsl.box.rest.io.xls
import java.io.ByteArrayOutputStream
import akka.http.scaladsl.model.{HttpEntity, HttpResponse, MediaTypes}
import akka.http.scaladsl.model.headers.{ContentDispositionTypes, `Content-Disposition`}
import akka.http.scaladsl.server.Directives.{complete, get, parameters, path, respondWithH... | Insubric/box | server/src/main/scala/ch/wsl/box/rest/io/xls/XLS.scala | Scala | apache-2.0 | 869 |
import sbt._
import sbt.Keys._
import Publish.{settings => publishSettings}
import Release.{settings => releaseSettings}
object Settings {
lazy val basicSettings: Seq[Setting[_]] = Seq(
scalaVersion := Globals.scalaVersion,
crossScalaVersions := Globals.crossScalaVersions,
resolvers ++=... | Coiney/akka-mailer | project/Settings.scala | Scala | bsd-3-clause | 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 ... | MLnick/spark | sql/core/src/test/scala/org/apache/spark/sql/DataFrameSuite.scala | Scala | apache-2.0 | 69,646 |
/*
* Copyright 2001-2008 Artima, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agre... | hubertp/scalatest | src/test/scala/org/scalatest/matchers/ShouldIncludeSubstringSpec.scala | Scala | apache-2.0 | 16,146 |
package im.actor.server.dialog
import akka.actor._
import akka.http.scaladsl.util.FastFuture
import akka.pattern.pipe
import akka.util.Timeout
import com.github.benmanes.caffeine.cache.Cache
import im.actor.api.rpc.misc.ApiExtension
import im.actor.concurrent.{ ActorFutures, AlertingActor, StashingActor }
import im.ac... | EaglesoftZJ/actor-platform | actor-server/actor-core/src/main/scala/im/actor/server/dialog/DialogProcessor.scala | Scala | agpl-3.0 | 6,499 |
/*
* 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 ... | GJL/flink | flink-table/flink-table-planner-blink/src/test/scala/org/apache/flink/table/planner/plan/rules/logical/PushPartitionIntoLegacyTableSourceScanRuleTest.scala | Scala | apache-2.0 | 6,033 |
/* __ *\\
** ________ ___ / / ___ Scala API **
** / __/ __// _ | / / / _ | (c) 2002-2013, LAMP/EPFL **
** __\\ \\/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\\___/_/... | felixmulder/scala | src/library/scala/Function12.scala | Scala | bsd-3-clause | 2,166 |
package japgolly.scalajs.react.facade
import scala.scalajs.js
import scala.scalajs.js.annotation.JSGlobal
@js.native
trait Interaction extends js.Object {
val __count : Int = js.native
val id : Int = js.native
val name : String = js.native
val timestamp: Double = js.native
}
object Profiler... | japgolly/scalajs-react | facadeMain/src/main/scala/japgolly/scalajs/react/facade/Profiler.scala | Scala | apache-2.0 | 1,145 |
/***********************************************************************
* 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/XZ2Index.scala | Scala | apache-2.0 | 2,037 |
/*
* 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 | common/src/main/scala/es/tid/cosmos/common/database.scala | Scala | apache-2.0 | 2,599 |
package pl.touk.nussknacker.engine.util
import shapeless._
import scala.language.implicitConversions
//https://github.com/milessabin/shapeless/blob/master/examples/src/main/scala/shapeless/examples/basecopy.scala
object copySyntax {
class CopySyntax[T](t: T) {
object copy extends RecordArgs {
def applyRe... | TouK/nussknacker | utils/utils-internal/src/main/scala/pl/touk/nussknacker/engine/util/copySyntax.scala | Scala | apache-2.0 | 1,936 |
/*
* 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 ... | WangTaoTheTonic/flink | flink-libraries/flink-table/src/test/scala/org/apache/flink/table/AggregationTest.scala | Scala | apache-2.0 | 6,710 |
// Project: angulate2-examples
// Module:
// Description:
// Copyright (c) 2017. Distributed under the MIT License (see included LICENSE file).
package routing.admin
import angulate2.common.CommonModule
import angulate2.std._
import routing.AuthGuard
@NgModule(
imports = @@[CommonModule,AdminRoutingModule... | jokade/angulate2-examples | routing/src/main/scala/routing/admin/AdminModule.scala | Scala | mit | 938 |
/***********************************************************************
* Copyright (c) 2017-2019 IBM
* 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 ac... | elahrvivaz/geomesa | geomesa-cassandra/geomesa-cassandra-datastore/src/main/scala/org/locationtech/geomesa/cassandra/index/CassandraColumnMapper.scala | Scala | apache-2.0 | 3,196 |
package com.kelebra.github.impatient.scala.katas
import scala.language.implicitConversions
/**
* Chapter 5: Classes
*/
/**
* Extend class Counter to eliminate integer overflow
*/
class Counter {
protected var value = 0
def increment(): Unit = value += 1
def current(): Int = value
}
/**
* Write cl... | kelebra/impatient-scala-katas | src/main/scala/com/kelebra/github/impatient/scala/katas/Classes.scala | Scala | mit | 2,985 |
import org.apache.spark.{SparkConf, SparkContext}
import org.apache.spark.sql.functions.unix_timestamp
import learnemoji.EmojiLDA
import java.time._
object EmojiClusterAnalysis {
def main(args: Array[String]): Unit = {
// sparkInit("local", "EmojiClusterAnalysis", emojiClusterAnalysis _)
sparkInit("local... | joyoyoyoyoyo/EmojiClusterAnalysis | src/main/scala/EmojiClusterAnalysis.scala | Scala | apache-2.0 | 1,744 |
package coursier
package test
import utest._
import scala.async.Async.{async, await}
import coursier.core.{Classifier, Configuration, Extension, Type}
import coursier.graph.{Conflict, ModuleTree}
import coursier.test.compatibility._
import coursier.util.{Artifact, Print, Tree}
import scala.concurrent.Future
object ... | alexarchambault/coursier | modules/tests/shared/src/test/scala/coursier/test/CentralTests.scala | Scala | apache-2.0 | 56,491 |
package cs4r.labs.learningscala.adventofcode
/**
* Created by cs4r on 5/09/16.
*/
object AdventOfCode19 extends App {
val puzzleInput =
"""Al => ThF
|Al => ThRnFAr
|B => BCa
|B => TiB
|B => TiRnFAr
|Ca => CaCa
|Ca => PB
|Ca => PRnFAr
|Ca => SiRnFYFAr
|C... | Cs4r/AdventOfCode | src/main/scala/cs4r/labs/learningscala/adventofcode/AdventOfCode19.scala | Scala | gpl-3.0 | 2,807 |
/*
* 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 ... | ajbozarth/incubator-livy | server/src/main/scala/org/apache/livy/server/batch/CreateBatchRequest.scala | Scala | apache-2.0 | 2,559 |
import stainless.lang._
object CallerReadsNotSubsumingCalleeReadsExample {
case class Node(var v: BigInt) extends AnyHeapRef
def read1(n1: Node, n2: Node): BigInt = {
reads(Set(n1, n2))
n1.v + n2.v
}
def read2(n1: Node, n2: Node): BigInt = {
reads(Set(n1))
read1(n1, n2)
}
}
| epfl-lara/stainless | frontends/benchmarks/full-imperative/invalid/CallerReadsNotSubsumingCalleeReads.scala | Scala | apache-2.0 | 304 |
/*
* 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/gmp-frontend | app/controllers/ScenarioController.scala | Scala | apache-2.0 | 3,746 |
package de.frosner.broccoli.instances.storage
import de.frosner.broccoli.logging
import de.frosner.broccoli.models.Instance
import play.api.Logger
import scala.util.Try
trait InstanceStorage {
protected def log: Logger
private def ifNotClosed[T](f: => T): T =
if (!isClosed) {
f
} else {
thr... | FRosner/cluster-broccoli | server/src/main/scala/de/frosner/broccoli/instances/storage/InstanceStorage.scala | Scala | apache-2.0 | 2,260 |
/***
* Excerpted from "Seven Concurrency Models in Seven Weeks",
* published by The Pragmatic Bookshelf.
* Copyrights apply to this code. It may not be used to create training material,
* courses, books, articles, and the like. Contact us if you are in doubt.
* We make no guarantees that this code is fit for any ... | XBOOS/concurrency | code/ActorsScala/WordCountFaultTolerant/src/main/scala/com/paulbutcher/WordCount.scala | Scala | gpl-2.0 | 1,872 |
/*
* Copyright (c) 2016 eBay Software Foundation.
*
* 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... | keshin/RTran | rtran-maven/src/main/scala/com/ebay/rtran/maven/MavenRemoveManagedDependenciesRule.scala | Scala | apache-2.0 | 1,982 |
/*
* 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 ... | guoxiaolongzte/spark | core/src/main/scala/org/apache/spark/ui/jobs/StageTable.scala | Scala | apache-2.0 | 17,389 |
package avrohugger
package format
package specific
package trees
import matchers.{ DefaultParamMatcher, DefaultValueMatcher }
import methods.{ GetGenerator, GetSchemaGenerator, PutGenerator }
import treehugger.forest._
import definitions._
import treehuggerDSL._
import org.apache.avro.Schema
import scala.collection... | ppearcy/avrohugger | avrohugger-core/src/main/scala/format/specific/trees/SpecificCaseClassTree.scala | Scala | apache-2.0 | 2,060 |
package com.twitter.finagle.exp.mysql.transport
import org.junit.runner.RunWith
import org.scalatest.FunSuite
import org.scalatest.junit.JUnitRunner
@RunWith(classOf[JUnitRunner])
class PacketTest extends FunSuite {
val seq = 2.toShort
val bytes = Array[Byte](0x01, 0x02, 0x03, 0x04)
val body = Buffer(bytes)
v... | lukiano/finagle | finagle-mysql/src/test/scala/com/twitter/finagle/mysql/unit/transport/PacketTest.scala | Scala | apache-2.0 | 589 |
package im.actor.server.history
import akka.actor.ActorSystem
import akka.util.Timeout
import im.actor.api.rpc.AuthorizedClientData
import im.actor.server.group.{ GroupExtension, GroupOffice, GroupUtils }
import im.actor.server.{ models, persist }
import org.joda.time.DateTime
import slick.dbio.DBIO
import scala.conc... | dut3062796s/actor-platform | actor-server/actor-core/src/main/scala/im/actor/server/history/HistoryUtils.scala | Scala | mit | 6,384 |
package yuuto.enhancedinventories.compat.craftguide
import java.util;
import net.minecraft.item.crafting.{CraftingManager, IRecipe}
import uristqwerty.CraftGuide.{RecipeGeneratorImplementation, DefaultRecipeTemplate}
import uristqwerty.CraftGuide.api.{RecipeGenerator, RecipeProvider, CraftGuideAPIObject}
import uristq... | AnimeniacYuuto/EnhancedInventories | src/main/scala/yuuto/enhancedinventories/compat/craftguide/EIRecipeProvider.scala | Scala | gpl-2.0 | 1,882 |
/**
* 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 prog... | evlist/orbeon-forms | src/test/scala/org/orbeon/oxf/xforms/analysis/VariableDependenciesTest.scala | Scala | lgpl-2.1 | 2,464 |
package core
import com.redis.RedisClient
import models.Session
import models.Tick
import akka.util.Timeout
import com.redis.serialization.DefaultFormats
import com.redis.serialization.Format
import scala.concurrent.ExecutionContext
import scala.util.Failure
import scala.util.Success
class Cache(db: RedisClient)(impl... | opyate/taximeter | src/main/scala/core/Cache.scala | Scala | mit | 1,422 |
package scalanlp.stats
package distributions;
/*
Copyright 2009 David Hall, Daniel Ramage
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
Unle... | MLnick/scalanlp-core | learn/src/main/scala/scalanlp/stats/distributions/Gamma.scala | Scala | apache-2.0 | 4,693 |
/*
* 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 ... | bdrillard/spark | mllib/src/main/scala/org/apache/spark/ml/regression/DecisionTreeRegressor.scala | Scala | apache-2.0 | 12,616 |
/*
* 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 ... | hequn8128/flink | flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/calcite/CalciteConfig.scala | Scala | apache-2.0 | 10,878 |
package app.restlike.rtm
import server.ServiceFactory._
import app.restlike.common.Colours._
import app.restlike.common._
object Commander {
def process(value: String, who: String, currentModel: Model, /*refProvider: RefProvider,*/ token: String): Out = {
val bits = value.split(" ").map(_.trim).filterNot(_.isEm... | alltonp/reprobate | src/main/scala/app/restlike/rtm/Commander.scala | Scala | apache-2.0 | 22,766 |
package bank2
import akka.bita.Scheduler
import akka.actor.{ ActorSystem, Actor, Props, ActorRef }
import akka.bita.pattern.Patterns._
import akka.dispatch.Await
import akka.util.duration._
import akka.util.Timeout
import akka.dispatch.DefaultPromise
import akka.dispatch.{ Promise, Future }
import bita.{ ScheduleEnvel... | Tjoene/thesis | benchmark/src/test/scala/bank2/MoreDelayBankSpec.scala | Scala | gpl-2.0 | 774 |
/*
Copyright 2016-17, Hasso-Plattner-Institut fuer Softwaresystemtechnik GmbH
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... | bpn1/ingestion | src/main/scala/de/hpi/ingestion/deduplication/models/Block.scala | Scala | apache-2.0 | 3,302 |
package ch.descabato.utils
import java.io.{InputStream, OutputStream}
import ch.descabato.CustomByteArrayOutputStream
import ch.descabato.hashes.BuzHash
object Streams extends Utils {
abstract class ChunkingOutputStream(func: BytesWrapper => _, private val initialSize: Int = 100 * 1024) extends OutputStream {
... | Stivo/DeScaBaTo | core/src/main/scala/ch/descabato/utils/Streams.scala | Scala | gpl-3.0 | 3,786 |
/*
* Copyright 2014 Commonwealth Computer Research, 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 applicabl... | kevinwheeler/geomesa | geomesa-core/src/test/scala/org/locationtech/geomesa/core/filter/TestFilters.scala | Scala | apache-2.0 | 18,824 |
package code.rest
import net.liftweb.http.rest.RestHelper
import net.liftweb.http._
import code.model.PonyService
import net.liftweb.json.Extraction
class PonyRest extends RestHelper {
serve {
case Req("rest" :: "pony" :: "best" :: Nil, _, GetRequest) =>
PonyService.getRandomPony.map(pony => Extraction.de... | htmldoug/ng-lift-proxy | src/main/scala/code/rest/PonyRest.scala | Scala | apache-2.0 | 341 |
package org.http4s.server.middleware.authentication
import cats.data.Kleisli
import fs2.Task
import org.http4s.server.AuthMiddleware
import org.http4s._
import org.http4s.dsl._
class AuthMiddlewareSpec extends Http4sSpec {
type User = Long
"AuthMiddleware" should {
"fall back to onAuthFailure when authentic... | ZizhengTai/http4s | server/src/test/scala/org/http4s/server/middleware/authentication/AuthMiddlewareSpec.scala | Scala | apache-2.0 | 2,353 |
/*
* Copyright 2011-2021 GatlingCorp (https://gatling.io)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by appli... | sgoeschl/gatling-blueprint-project | src/test/scala/computerdatabase/advanced/AdvancedSimulationStep01.scala | Scala | apache-2.0 | 2,854 |
import scala.reflect.Typeable
def unionTypeTest[T: Typeable](m: Int|T) =
m match
case x: Int => println("Got Int")
case t: T => println("Got T")
@main def run =
unionTypeTest(())
| dotty-staging/dotty | tests/patmat/i12279.scala | Scala | apache-2.0 | 189 |
package controllers.your_income
import controllers.CarersForms._
import controllers.mappings.Mappings
import controllers.mappings.Mappings._
import models.domain.{YourIncomes, FosteringAllowance, Claim}
import models.view.ClaimHandling._
import models.view.{CachedClaim, Navigable}
import play.api.Play._
import play.ap... | Department-for-Work-and-Pensions/ClaimCapture | c3/app/controllers/your_income/GFosteringAllowance.scala | Scala | mit | 4,143 |
/**
* MIT License
*
* Copyright (c) 2016-2018 James Sherwood-Jones <james.sherwoodjones@gmail.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, includi... | jSherz/lsd-members | backend/src/test/scala/com/jsherz/luskydive/apis/MemberApiSpec.scala | Scala | mit | 10,403 |
package onion.compiler
import java.util._
import java.util
import scala.jdk.CollectionConverters._
/**
*/
object IRT {
/**
* This interface represents an internal representation node of onion program.
* @author Kota Mizushima
*/
sealed trait Node
/**
* @author Kota Mizushima
*/
class Array... | onionlang/onion | src/main/scala/onion/compiler/IRT.scala | Scala | bsd-3-clause | 35,681 |
package io.vamp.model.parser
import org.junit.runner.RunWith
import org.scalatest._
import org.scalatest.junit.JUnitRunner
@RunWith(classOf[JUnitRunner])
class RouteSelectorParserSpec extends FlatSpec with Matchers {
val parser = new RouteSelectorParser()
"RouteSelectorParser" should "parse" in {
parser.par... | magneticio/vamp | model/src/test/scala/io/vamp/model/parser/RouteSelectorParserSpec.scala | Scala | apache-2.0 | 2,560 |
package scalaprops
import scalaz._
import scalaz.std.anyVal._
import ScalapropsScalaz._
object OneAndTest extends Scalaprops {
val testIList = {
type F[A] = OneAnd[IList, A]
Properties.list(
scalazlaws.order.all[F[Int]],
scalazlaws.monad.all[F],
scalazlaws.zip.all[F],
scalazlaws.tra... | scalaprops/scalaprops | scalaz/src/test/scala/scalaprops/OneAndTest.scala | Scala | mit | 1,146 |
package org.scalex
package util
import scala.util.Try
import akka.actor._
trait SequentialActor extends Actor {
type ReceiveAsync = PartialFunction[Any, Fu[Unit]]
def process: ReceiveAsync
def idle: Receive = {
case msg ⇒ {
context become busy
processThenDone(msg)
}
}
def busy: Rec... | kzys/scalex | src/main/scala/util/SequentialActor.scala | Scala | mit | 1,123 |
/*
* Copyright 2015 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 applicab... | arkadius/micro-burn | src/test/scala/org/github/microburn/domain/generator/BoardChangesGenerator.scala | Scala | apache-2.0 | 3,843 |
/*
* Copyright (C) 2016 Christopher Batey and Dogan Narinc
*
* 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... | mikefero/cpp-driver | gtests/src/integration/scassandra/server/server/src/main/scala/org/scassandra/server/priming/ErrorConstants.scala | Scala | apache-2.0 | 1,227 |
package com.robocubs4205.cubscout.i18n
case class ConstantInterpolator(value:String) extends Interpolator{
override val arity = 0
override def apply(values: Either[Key,String]*) = value
}
| robocubs4205/cubscout-server | client/app/com/robocubs4205/cubscout/i18n/ConstantInterpolator.scala | Scala | mit | 193 |
package org.jetbrains.plugins.scala
package lang
package psi
package impl
package base
import com.intellij.lang.ASTNode
import com.intellij.psi._
import com.intellij.psi.impl.source.tree.LeafPsiElement
import com.intellij.psi.util.PsiTreeUtil
import com.intellij.util.IncorrectOperationException
import org.jetbrains.pl... | katejim/intellij-scala | src/org/jetbrains/plugins/scala/lang/psi/impl/base/ScStableCodeReferenceElementImpl.scala | Scala | apache-2.0 | 10,811 |
/*
* 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 ... | bwsw/sj-platform | core/sj-engine-core/src/test/scala-2.12/com/bwsw/sj/engine/batch/benchmark/read_kafka/storm/StormBenchmarkRunner.scala | Scala | apache-2.0 | 3,521 |
package org.denigma.preview
import org.denigma.binding.extensions.sq
import org.denigma.binding.views.BindableView
import org.denigma.binding.views.utils.ViewInjector
import org.querki.jquery._
import org.scalajs.dom
import org.scalajs.dom.raw.HTMLElement
import org.denigma.binding.extensions._
import org.semantic.Sid... | antonkulaga/semantic-ui-facade | preview/js/src/main/scala/org/denigma/preview/FrontEnd.scala | Scala | mpl-2.0 | 2,059 |
import java.io.File
import org.apache.catalina.startup.Tomcat
object TomcatLauncher extends App {
val tomcat = new Tomcat()
val webAppDir = "src/test/webapp"
var port = System.getenv("PORT")
if (port == null || port.isEmpty) port = "8080"
tomcat.setPort(port.toInt)
tomcat.addWebapp("/", new File(webA... | debop/debop4s | debop4s-web-spring/src/test/scala/TomcatLauncher.scala | Scala | apache-2.0 | 392 |
/*
* 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/main/scala/org/apache/spark/sql/catalyst/util/DateTimeFormatterHelper.scala | Scala | apache-2.0 | 5,465 |
import javax.inject._
import com.google.inject.AbstractModule
import net.codingwell.scalaguice.ScalaModule
import play.api.{Configuration, Environment}
import v1.wikiq._
/**
* Sets up custom components for Play.
*
* https://www.playframework.com/documentation/latest/ScalaDependencyInjection
*/
class Module(en... | igor-dobrovolskiy-epam/wikipedia-analysis-scala-core | web/app/Module.scala | Scala | apache-2.0 | 526 |
package com.redbubble.pricer.http
import cats.data.NonEmptyList
import com.redbubble.pricer.common.{BaseProduct, Cart, Pricer}
import io.finch.{Endpoint, Ok, get, jsonBody, post}
abstract class Endpoints(pricer: Pricer) extends Codecs {
val api = "v1" :: (prices :+: price)
private def prices: Endpoint[NonEmptyLi... | tomjadams/scala-workshop | example_code/src/main/scala/com/redbubble/pricer/http/Endpoints.scala | Scala | bsd-3-clause | 511 |
/*
* Copyright (c) 2017. Universidad Politecnica de Madrid
*
* @author Badenes Olmedo, Carlos <cbadenes@fi.upm.es>
*
*/
package org.librairy.modeler.lda.graph
import com.typesafe.scalalogging.slf4j.Logger
import org.apache.spark.graphx._
import org.apache.spark.graphx.lib.ShortestPaths
import org.apache.spark.rd... | librairy/modeler-lda | src/main/scala/org/librairy/modeler/lda/graph/PregelSSSP.scala | Scala | apache-2.0 | 3,306 |
/***********************************************************************
* 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-index-api/src/main/scala/org/locationtech/geomesa/index/metadata/package.scala | Scala | apache-2.0 | 2,057 |
package com.whiteprompt.persistence
import java.util.UUID
import com.whiteprompt.domain.TaskEntity
import scala.collection.mutable
import scala.concurrent.{ExecutionContext, Future}
class TaskRepositoryImpl(implicit val ec: ExecutionContext) extends TaskRepository {
override val store = new mutable.HashMap[UUID, ... | whiteprompt/akka-http-vs-play | core/src/main/scala/com/whiteprompt/persistence/TaskRepository.scala | Scala | apache-2.0 | 634 |
import scala.annotation.tailrec
object Solution extends App {
@tailrec
def mingling(s1: String, s2: String): Unit = {
if (s1.size != 0){
print(s1.head)
print(s2.head)
mingling(s1.tail, s2.tail)
}
}
val words = io.Source.stdin.getLines().take(2)
mingling(words.next, words.next)
pri... | clemus90/competitive-programming | hackerRank/FunctionalProgramming/StringMingling.scala | Scala | mit | 329 |
package scife.enumeration
package iterable
trait ResetIter[+A] extends Iter[A] {
_: Enum[A] =>
def hasStarted = ind >= -1
def reset = ind = -1
}
//trait ResetIterFinite[+A] extends Finite[A] with ResetIter[A] | kaptoxic/SciFe | src/main/scala/scife/enumeration/iterable/ResetIter.scala | Scala | gpl-2.0 | 230 |
// Copyright (C) 2011-2012 the original author or authors.
// 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 ... | scalastyle/scalastyle | src/main/scala/org/scalastyle/scalariform/NullChecker.scala | Scala | apache-2.0 | 1,620 |
Subsets and Splits
Filtered Scala Code Snippets
The query filters and retrieves a sample of code snippets that meet specific criteria, providing a basic overview of the dataset's content without revealing deeper insights.