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 db
import javax.inject.{Inject, Singleton}
import io.flow.common.v0.models.UserReference
import io.flow.util.IdGenerator
import io.flow.postgresql.{Authorization, OrderBy, Query}
import anorm._
import io.flow.postgresql.play.db.DbHelpers
import play.api.db._
case class DependencyForm(
applicationId: String... | flowcommerce/registry | api/app/db/DependenciesDao.scala | Scala | mit | 4,035 |
package com.seanshubin.builder.domain
import java.nio.file.Path
import com.seanshubin.uptodate.console.ConfigurationDependencyInjection
import com.seanshubin.uptodate.logic.{Configuration, GroupArtifactVersion, SummaryReport}
class DependencyUpgraderImpl(baseDirectory: Path,
baseLogDirec... | SeanShubin/builder | domain/src/main/scala/com/seanshubin/builder/domain/DependencyUpgraderImpl.scala | Scala | unlicense | 1,399 |
package org.fayalite.util.dsl
import scala.collection.TraversableLike
// EXPERIMENTAL USE WITH CAUTION
// YOU'VE BEEN WARNED // AUTOGENERATED
trait MethodShorteners {
/*
implicit class SeqFix[T](s: Seq[T]) {
def m[Q](f: T => Q) = s map f
}
*/
implicit class TravExt[K](kv: Traversable[K]) {
def gb[B]... | ryleg/fayalite | common/src/main/scala/org/fayalite/util/dsl/MethodShorteners.scala | Scala | mit | 4,583 |
package katsconf
object ZipCodeService {
sealed trait Failure
case object IllegalZipCode extends Failure
def citiesInZipCode(zipCode: String): Either[Failure, Set[String]] =
if (zipCode matches "[0-9]{5}")
Right(zipCode.map(n => s"City $n").toSet)
else
Left(IllegalZipCode)
}
| larsrh/katsconf2017 | src/main/scala/ZipCodeService.scala | Scala | mit | 306 |
// 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 unde... | supriyantomaftuh/network | src/main/scala/com/cloudant/clouseau/AnalyzerService.scala | Scala | apache-2.0 | 1,720 |
/*
* 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/vat-registration-frontend | test/testHelpers/FormInspectors.scala | Scala | apache-2.0 | 1,524 |
package json.bench
import java.util.concurrent.TimeUnit
import json.bench.model.Data
import org.openjdk.jmh.annotations._
@BenchmarkMode(Array(Mode.Throughput))
@OutputTimeUnit(TimeUnit.SECONDS)
@Warmup(iterations = 4, time = 5, timeUnit = TimeUnit.SECONDS)
@Measurement(iterations = 4, time = 5, timeUnit = TimeUnit.... | tethys-json/tethys | modules/benchmarks/src/main/scala/json/bench/JmhWriterBench.scala | Scala | apache-2.0 | 1,278 |
import sbt._
import sbt.Keys._
object StageDist {
import java.nio.file._
lazy val stageDirectory = taskKey[File]("Target directory")
lazy val stageActions = taskKey[Seq[StageAction]]("Actions to build stage")
lazy val basicStage = taskKey[File]("Build stage for basic distributive")
lazy val runStage = task... | Hydrospheredata/mist | project/StageDist.scala | Scala | apache-2.0 | 2,912 |
/*
* Distributed as part of Scalala, a linear algebra library.
*
* Copyright (C) 2008- Daniel Ramage
*
* 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 ... | scalala/Scalala | src/main/scala/scalala/generic/collection/CanGetDouble.scala | Scala | lgpl-2.1 | 2,687 |
package com.forged.data
/**
* Created by visitor15 on 12/6/15.
*/
case class PortfolioProject(title: String, description: String, images: List[String]) | Visitor15/webPresence-scala | src/main/scala/com/forged/data/PortfolioData.scala | Scala | mit | 154 |
package com.ing.baker.runtime.akka.actor
import scala.collection.immutable.List
import scala.concurrent.{ExecutionContext, Future}
import scala.concurrent.duration._
import org.scalatest.matchers.should.Matchers._
class UtilSpec extends AkkaTestBase("UtilSpec") {
implicit def ec: ExecutionContext = system.dispatch... | ing-bank/baker | core/akka-runtime/src/test/scala/com/ing/baker/runtime/akka/actor/UtilSpec.scala | Scala | mit | 785 |
package spire.optional
import spire.algebra.Trig
import spire.math.Rational
object rationalTrig {
implicit val trigRational = new Trig[Rational] {
val r180 = Rational(180)
import spire.std.double._
def acos(a: Rational): Rational = Rational(spire.math.acos(a.toDouble))
def asin(a: Rational): Rationa... | AlecZorab/spire | core/src/main/scala/spire/optional/rationalTrig.scala | Scala | mit | 1,510 |
package fpinscala.datastructures
sealed trait Tree[+A]
case class Leaf[A](value: A) extends Tree[A]
case class Branch[A](left: Tree[A], right: Tree[A]) extends Tree[A]
object Tree {
def size[A]( t : Tree[A] ) : Int = t match {
case Leaf(value) => 1
case Branch(left, right) => size(left) + size(right) + 1
... | ramakocherlakota/fpinscala | exercises/src/main/scala/fpinscala/datastructures/Tree.scala | Scala | mit | 1,504 |
/**********************************************************************************************************************
* This file is part of Scrupal, a Scalable Reactive Web Application Framework for Content Management *
* ... | scrupal/scrupal | scrupal-utils/src/main/scala/scrupal/utils/Pluralizer.scala | Scala | apache-2.0 | 15,871 |
package scalacookbook.chapter02
/**
* Created by liguodong on 2016/6/12.
*/
object CompareFloatPointNum {
def main(args: Array[String]) {
val a = 0.3 //a: Double = 0.3
println(a)
val b = 0.1 + 0.2 //b: Double = 0.30000000000000004
println(b)
//判断浮点数是否相等
println(~=(a, b, 0.0001))... | liguodongIOT/java-scala-mix-sbt | src/main/scala/scalacookbook/chapter02/CompareFloatPointNum.scala | Scala | apache-2.0 | 1,466 |
package com.wavesplatform.lang.v1.repl.node.http.response
import com.wavesplatform.lang.v1.repl.node.http.response.model._
import com.wavesplatform.lang.v1.traits.domain.Recipient.Address
import com.wavesplatform.lang.v1.traits.domain.{BlockInfo, ScriptAssetInfo, Tx}
case class ImplicitMappings(chainId: Byte) {
pri... | wavesplatform/Waves | repl/shared/src/main/scala/com/wavesplatform/lang/v1/repl/node/http/response/ImplicitMappings.scala | Scala | mit | 1,446 |
package org.lords.classification
import java.io.PrintWriter
import org.apache.spark.SparkContext
import org.apache.spark.SparkContext._
import org.apache.spark.SparkConf
import org.apache.spark.rdd.RDD
import scala.util.parsing.json._
import scala.util.Random
object UserClassifier {
/**
Extract items from js... | Data-Scientist/LP01_DSWAC_0706 | ccp_spark/src/main/scala/org/lords/classification/UserClassifier.scala | Scala | mit | 8,207 |
/*
* Copyright 2001-2013 Artima, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agre... | scalatest/scalatest | jvm/scalatest-test/src/test/scala/org/scalatest/suiteprop/TwoTestsIgnoredExamples.scala | Scala | apache-2.0 | 20,507 |
package aecor.runtime.akkapersistence.serialization
/**
* Marker trait for all protobuf-serializable messages in `aecor.runtime.akkapersistence`.
*/
private[aecor] trait Message
| notxcain/aecor | modules/akka-persistence-runtime/src/main/scala/aecor/runtime/akkapersistence/serialization/Message.scala | Scala | mit | 183 |
/*
* 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 ... | jianran/spark | sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/FileFormatWriter.scala | Scala | apache-2.0 | 18,986 |
package protocbridge
object gens {
// Prevent the organization name from getting shaded...
// See https://github.com/scalapb/ScalaPB/issues/150
private val JavaProtobufArtifact: String =
"com+google+protobuf".replace('+', '.')
val cpp = BuiltinGenerator("cpp")
val csharp = BuiltinGenerator("csharp")
v... | trueaccord/protoc-bridge | bridge/src/main/scala/protocbridge/gens.scala | Scala | apache-2.0 | 1,388 |
package fr.montuelle.arduino.sensors
import com.google.inject.AbstractModule
import fr.montuelle.arduino.sensors.services.{SensorsServerImpl, SensorsServer}
class SensorsModule extends AbstractModule {
def configure() = {
bind(classOf[SensorsServer])
.to(classOf[SensorsServerImpl]).asEagerSingleton
}
} | bmontuelle/sensors-history | app/fr/montuelle/arduino/sensors/SensorsModule.scala | Scala | mit | 320 |
package pipelines.speech
import breeze.stats.distributions.{CauchyDistribution, RandBasis, ThreadLocalRandomGenerator}
import breeze.linalg.DenseVector
import org.apache.commons.math3.random.MersenneTwister
import scopt.OptionParser
import org.apache.spark.{SparkConf, SparkContext}
import org.apache.spark.rdd.RDD
im... | kcompher/keystone | src/main/scala/pipelines/speech/TimitPipeline.scala | Scala | apache-2.0 | 5,167 |
package smartbot
import scala.io.Source
import java.io.FileWriter
object LogParser {
def getDepth(s: String): Option[Int] = {
/** If the string is a number, returns the option of it,
* otherwise it returns None */
val IntRegEx = "(\\\\d+)".r
s match {
case IntRegEx(num) => Some(num.toInt)
... | jneen/smartbot | src/main/scala/logParser.scala | Scala | mit | 737 |
/**
* Copyright (C) 2007-2008 Scala OTP Team
*/
package scala.actors.behavior
sealed abstract class TestMessage
case object Ping extends TestMessage
case object Pong extends TestMessage
case object OneWay extends TestMessage
case object Die extends TestMessage
case object NotifySupervisorExit extends TestMessage
| bingoyang/scala-otp | behavior/src/test/scala/scala/actors/behavior/Messages.scala | Scala | bsd-3-clause | 318 |
/**
* Copyright 2012-2013 StackMob
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to i... | indykish/newman | src/main/scala/com/stackmob/newman/serialization/common/HeadersSerialization.scala | Scala | apache-2.0 | 2,365 |
/*
* 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... | gioenn/xSpark | sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/IncrementalExecution.scala | Scala | apache-2.0 | 3,177 |
package com.cloudray.scalapress.plugin.ecommerce.controller.renderers
import com.cloudray.scalapress.util.Scalate
/** @author Stephen Samuel */
object OrderStatusRenderer {
def form = Scalate.layout("/com/cloudray/scalapress/plugin/ecommerce/order_status.ssp")
}
| vidyacraghav/scalapress | src/main/scala/com/cloudray/scalapress/plugin/ecommerce/controller/renderers/OrderStatusRenderer.scala | Scala | apache-2.0 | 267 |
// scalac: -deprecation
//
//############################################################################
// Literals
//############################################################################
//############################################################################
object Test {
def check_success[A](name... | scala/scala | test/files/run/literals.scala | Scala | apache-2.0 | 5,010 |
/**
* 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... | airbnb/kafka | core/src/test/scala/unit/kafka/common/ZkNodeChangeNotificationListenerTest.scala | Scala | apache-2.0 | 2,961 |
package dev.budget.reconciler.finagle.filter
import com.twitter.finagle.{Filter, Service}
import com.twitter.io.Charsets
import com.twitter.util.Future
import org.jboss.netty.buffer.ChannelBuffers
import org.jboss.netty.handler.codec.http.{DefaultHttpResponse, HttpRequest, HttpResponse, HttpResponseStatus}
class Stri... | jhungerford/MintYnabReconciler | src/main/scala/dev/budget/reconciler/finagle/filter/StringToHttpResponseFilter.scala | Scala | apache-2.0 | 793 |
package org.openapitools.client.api
import argonaut._
import argonaut.EncodeJson._
import argonaut.DecodeJson._
import org.http4s.{EntityDecoder, EntityEncoder}
import org.http4s.argonaut._
import org.joda.time.DateTime
import GithubScmlinks._
case class GithubScmlinks (
self: Option[Link],
`class`: Option[Strin... | cliffano/swaggy-jenkins | clients/scalaz/generated/src/main/scala/org/openapitools/client/api/GithubScmlinks.scala | Scala | mit | 672 |
package org.ciroque.ccr.datastores
import java.util.UUID
import com.mongodb.casbah.Imports._
import com.mongodb.casbah.commons.{MongoDBList, MongoDBObject}
import com.mongodb.casbah.commons.conversions.scala.RegisterJodaTimeConversionHelpers
import com.mongodb.casbah.{MongoClient, MongoCollection}
import com.mongodb.... | ciroque/central-configuration-repository | src/main/scala/org/ciroque/ccr/datastores/MongoSettingsDataStore.scala | Scala | mit | 17,020 |
package inloopio.math.random
import java.io.BufferedOutputStream
import java.io.DataOutputStream
import java.io.File
import java.io.FileOutputStream
import java.io.IOException
import java.util.Random
/**
* Utility to generate an input file for the
* <a href="http://stat.fsu.edu/pub/diehard/" target="_top">DIEHARD</... | dcaoyuan/inloopio-libs | inloopio-math/src/main/scala/inloopio/math/random/DiehardInputGenerator.scala | Scala | bsd-3-clause | 1,965 |
package com.coiney.akka.rabbit.example
import akka.actor.{Props, ActorSystem}
import com.coiney.akka.rabbit.{QueueConfig, RabbitSystem}
import com.coiney.akka.rabbit.protocol._
object ConsumerExample1 extends App {
implicit val system = ActorSystem("ConsumerSystem")
val rabbitSystem = RabbitSystem()
// cre... | Coiney/akka-rabbit | akka-rabbit-example/src/main/scala/com/coiney/akka/rabbit/example/ConsumerExample1.scala | Scala | bsd-3-clause | 1,193 |
package me.yingrui.segment.util
import org.junit.Assert
import org.junit.Test
class RomanNumberTest {
@Test
def should_return_number_when_input_is_single_roman_numeral_character() {
Assert.assertEquals(1, RomanNumeral.getBasicSymbol("I"));
Assert.assertEquals(5, RomanNumeral.getBasicSymbol("V"));
Ass... | yingrui/mahjong | lib-segment/src/test/scala/me/yingrui/segment/util/RomanNumberTest.scala | Scala | gpl-3.0 | 871 |
package com.adendamedia.cornucopia
import akka.stream.scaladsl.Source
import akka.actor.{ActorRef, ActorSystem}
import akka.stream.{ActorMaterializer, ActorMaterializerSettings, Supervision}
import com.adendamedia.cornucopia.actors.CornucopiaSource
import com.typesafe.config.ConfigFactory
import org.slf4j.LoggerFactor... | sjking/cornucopia | src/main/scala/com/adendamedia/cornucopia/Config.scala | Scala | lgpl-3.0 | 1,800 |
import sbt._
import Keys._
object MyBuild extends Build {
lazy val buildSettings = Defaults.defaultSettings ++ Seq(
version := "0.1-SNAPSHOT",
organization := "com.simba",
scalaVersion := Option(System.getProperty("scala.version")).getOrElse("2.11.6")
)
lazy val clairvoyant = Project(
id = "clai... | ShiZhan/clairvoyant | project/Build.scala | Scala | apache-2.0 | 441 |
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 APICollectionCollectionNameTruncate {
def put(client: HttpClient, collectionName: ... | outr/arangodb-scala | api/src/main/scala/com/outr/arango/api/APICollectionCollectionNameTruncate.scala | Scala | mit | 559 |
package synereo.client.handlers
import diode.ActionResult.ModelUpdate
import diode.RootModelRW
import shared.dtos.Connection
import shared.models.ConnectionsModel
import synereo.client.UnitTest
import synereo.client.rootmodels.ConnectionsRootModel
/**
* Created by shubham.k on 29-08-2016.
*/
class ConnectionHandl... | LivelyGig/ProductWebUI | sclient/src/test/scala/synereo/client/handlers/ConnectionHandlerTest.scala | Scala | apache-2.0 | 1,163 |
package mesosphere.marathon
package api.validation
import com.wix.accord.validate
import mesosphere.UnitTest
import mesosphere.marathon.api.v2.AppNormalization
import mesosphere.marathon.api.v2.validation.AppValidation
import mesosphere.marathon.core.plugin.PluginManager
import mesosphere.marathon.raml.{ App, AppCCont... | natemurthy/marathon | src/test/scala/mesosphere/marathon/api/validation/AppUpdateValidatorTest.scala | Scala | apache-2.0 | 4,250 |
package se.gigurra.leavu3.interfaces
import java.util.UUID
import com.twitter.finagle.FailedFastException
import com.twitter.util.{Await, Duration, Future}
import com.github.gigurra.heisenberg.MapData.SourceData
import com.github.gigurra.heisenberg._
import se.gigurra.leavu3.datamodel.DlinkData._
import se.gigurra.le... | GiGurra/leavu3 | src/main/scala/se/gigurra/leavu3/interfaces/DcsRemote.scala | Scala | mit | 5,503 |
package lila.mailer
import akka.actor.ActorSystem
import io.methvin.play.autoconfig._
import play.api.i18n.Lang
import play.api.libs.mailer.{ Email, SMTPConfiguration, SMTPMailer }
import scala.concurrent.duration.{ span => _, _ }
import scala.concurrent.{ blocking, Future }
import scalatags.Text.all.{ html => htmlTag... | luanlv/lila | modules/mailer/src/main/Mailer.scala | Scala | mit | 4,926 |
package com.seanshubin.template.scala.web.domain
import java.time.ZonedDateTime
class ClockIntegration extends Clock {
override def zonedDateTimeNow: ZonedDateTime = ZonedDateTime.now()
}
| SeanShubin/template-scala-web | domain/src/main/scala/com/seanshubin/template/scala/web/domain/ClockIntegration.scala | Scala | unlicense | 192 |
/*
* Copyright 2001-2012 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... | travisbrown/scalatest | src/main/scala/org/scalatest/CompileMacro.scala | Scala | apache-2.0 | 15,375 |
package zoey
import scala.annotation.tailrec
import scala.concurrent.{ Await, ExecutionContext, Future, Promise }
import scala.concurrent.duration.{ Duration, FiniteDuration }
import org.apache.zookeeper.{ ZooKeeper, Watcher, WatchedEvent }
import java.util.concurrent.TimeoutException
import java.util.concurrent.atomi... | softprops/zoey | zoey-core/src/main/scala/NativeConnector.scala | Scala | mit | 4,761 |
package org.example.scalacommonslang
object App {
def main(args: Array[String]) {
print("Hello org.example.scala-commons-lang!")
}
}
| rshindo/scala-commons-lang | src/main/scala/App.scala | Scala | apache-2.0 | 149 |
package uk.gov.digital.ho.proving.financialstatus.api.validation
import java.time.LocalDate
import org.springframework.http.HttpStatus
import uk.gov.digital.ho.proving.financialstatus.domain._
trait ThresholdParameterValidator {
val serviceMessages: ServiceMessages
protected def validateInputs(studentType: Stu... | UKHomeOffice/pttg-fs-api | src/main/scala/uk/gov/digital/ho/proving/financialstatus/api/validation/ThresholdParameterValidator.scala | Scala | mit | 7,948 |
/*
* Copyright 2016 The BigDL 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 applicable law or agr... | 122689305/BigDL | spark/dl/src/main/scala/com/intel/analytics/bigdl/nn/Module.scala | Scala | apache-2.0 | 4,087 |
/*
* Copyright (C) 2014 - 2017 Contributors as noted in the AUTHORS.md file
*
* 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)... | Tensei-Data/tensei-agent | src/main/scala/com/wegtam/tensei/agent/generators/DrupalVanCodeGenerator.scala | Scala | agpl-3.0 | 4,687 |
package mesosphere.marathon
package integration
import java.io.File
import java.net.URL
import java.nio.file.Files
import akka.actor.{ActorSystem, Scheduler}
import akka.http.scaladsl.client.RequestBuilding.Get
import akka.stream.Materializer
import mesosphere.marathon.core.pod.{HostNetwork, MesosContainer, PodDefini... | gsantovena/marathon | tests/integration/src/test/scala/mesosphere/marathon/integration/UpgradeIntegrationTest.scala | Scala | apache-2.0 | 17,451 |
/*
* 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 ... | openwhisk/openwhisk | core/monitoring/user-events/src/test/scala/org/apache/openwhisk/core/monitoring/metrics/EventsTestHelper.scala | Scala | apache-2.0 | 1,915 |
/*
* Copyright (c) 2014 Contributor. All rights reserved.
*/
package org.scalaide.debug.internal.expression
package context
import scala.collection.JavaConversions._
import com.sun.jdi.ClassObjectReference
import com.sun.jdi.ClassType
import com.sun.jdi.ObjectReference
import javax.xml.bind.DatatypeConverter
/**
... | Kwestor/scala-ide | org.scala-ide.sdt.debug.expression/src/org/scalaide/debug/internal/expression/context/JdiClassLoader.scala | Scala | bsd-3-clause | 2,191 |
/***********************************************************************
* Copyright (c) 2013-2022 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... | locationtech/geomesa | geomesa-spark/geomesa-spark-jts/src/main/scala/org/apache/spark/sql/jts/AbstractGeometryUDT.scala | Scala | apache-2.0 | 1,631 |
package com.example
import akka.actor.{Actor,ActorLogging,PoisonPill,Props}
import spray.routing._
import spray.http._
import MediaTypes._
import spray.can.Http
import scala.concurrent.duration._
import akka.util.Timeout
import spray.routing.RequestContext
import spray.http.StatusCodes
// we don't implement our rout... | wtfleming/spray-template | src/main/scala/com/example/RestInterface.scala | Scala | mit | 2,614 |
package monocle.std
import monocle.{Iso, PIso, PPrism, Prism}
import scalaz.syntax.std.option._
import scalaz.{-\\/, Maybe, \\/-}
object maybe extends MaybeOptics
trait MaybeOptics {
final def pMaybeToOption[A, B]: PIso[Maybe[A], Maybe[B], Option[A], Option[B]] =
PIso((_: Maybe[A]).toOption)((_: Option[B]).to... | rperry/Monocle | core/shared/src/main/scala/monocle/std/Maybe.scala | Scala | mit | 747 |
package com.twitter.finagle.builder
import com.twitter.conversions.DurationOps._
import com.twitter.finagle.ChannelClosedException
import com.twitter.finagle.Service
import com.twitter.finagle.client.utils.StringClient
import com.twitter.finagle.server.utils.StringServer
import com.twitter.util.{Await, Future}
import ... | twitter/finagle | finagle-core/src/test/scala/com/twitter/finagle/builder/ServerChannelConfigurationTest.scala | Scala | apache-2.0 | 2,235 |
package beam.calibration.utils
import com.sigopt.exception.APIConnectionError
object SigOptApiToken {
def getClientAPIToken: String =
Option {
System.getenv("SIGOPT_API_TOKEN")
}.getOrElse(
throw new APIConnectionError(
"Correct developer client token must be present in environment as S... | colinsheppard/beam | src/main/scala/beam/calibration/utils/SigOptApiToken.scala | Scala | gpl-3.0 | 358 |
case class Foo protected(a: Int)
case class Bar private(a: Int) | som-snytt/dotty | tests/pos/i5827.scala | Scala | apache-2.0 | 64 |
package org.jetbrains.plugins.scala
package lang
package parser
package parsing
package top
import org.jetbrains.plugins.scala.lang.lexer.ScalaTokenTypes
import org.jetbrains.plugins.scala.lang.parser.parsing.builder.ScalaPsiBuilder
import org.jetbrains.plugins.scala.lang.parser.parsing.params.TypeParamClause
/**
* @... | ilinum/intellij-scala | src/org/jetbrains/plugins/scala/lang/parser/parsing/top/TraitDef.scala | Scala | apache-2.0 | 1,030 |
/*
* 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 ... | ueshin/apache-spark | sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkSQLCLIService.scala | Scala | apache-2.0 | 6,391 |
/*
* 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 ... | StephanEwen/incubator-flink | flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/planner/plan/utils/FlinkRelMdUtil.scala | Scala | apache-2.0 | 30,350 |
package mesosphere.marathon.health
import mesosphere.marathon.state.Timestamp
sealed trait HealthResult {
def taskId: String
def version: String
def time: Timestamp
}
case class Healthy(
taskId: String,
version: String,
time: Timestamp = Timestamp.now()) extends HealthResult
case class Unhealthy(
task... | HardikDR/marathon | src/main/scala/mesosphere/marathon/health/HealthResult.scala | Scala | apache-2.0 | 426 |
/*
* Copyright 2016 The BigDL 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 applicable law or agr... | wzhongyuan/BigDL | spark/dl/src/test/scala/com/intel/analytics/bigdl/nn/ops/RankSpec.scala | Scala | apache-2.0 | 3,160 |
package org.jetbrains.plugins.scala
package lang
package psi
import com.intellij.codeInsight.hint.HintManager
import com.intellij.lang.ASTNode
import com.intellij.openapi.progress.ProgressManager
import com.intellij.psi._
import com.intellij.psi.impl.source.codeStyle.CodeEditUtil
import com.intellij.psi.scope._
import... | double-y/translation-idea-plugin | src/org/jetbrains/plugins/scala/lang/psi/ScImportsHolder.scala | Scala | apache-2.0 | 25,883 |
/*
* 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/core/src/main/scala/org/apache/spark/sql/execution/ExplainUtils.scala | Scala | apache-2.0 | 9,901 |
/*
* Copyright 2014-2020 Rik van der Kleij
*
* 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... | rikvdkleij/intellij-haskell | src/main/scala/intellij/haskell/cabal/CabalFile.scala | Scala | apache-2.0 | 1,147 |
/*
* Copyright 2016 The BigDL 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 applicable law or agr... | yiheng/BigDL | spark/dl/src/main/scala/com/intel/analytics/bigdl/models/lenet/Utils.scala | Scala | apache-2.0 | 4,872 |
package core
import io.apibuilder.spec.v0.models.Method
import org.scalatest.{FunSpec, Matchers}
class BrokenSpec extends FunSpec with Matchers {
it("support arrays as types in fields") {
val json = """
{
"name": "API Builder",
"apidoc": { "version": "0.9.6" },
"models": {
"vendor... | gheine/apidoc | core/src/test/scala/core/BrokenSpec.scala | Scala | mit | 2,097 |
package sprawler.crawler.url
import sprawler.crawler.CrawlerSession
import sprawler.CrawlerExceptions.{ UnprocessableUrlException, RedirectLimitReachedException }
import scala.util.{ Success, Failure, Try }
import spray.http.Uri.Empty
import java.util.concurrent.ConcurrentHashMap
trait CheckUrlCrawlability { this: C... | daniel-trinh/sprawler | src/main/scala/sprawler/crawler/url/CheckUrlCrawlability.scala | Scala | mit | 3,250 |
/*
* 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 ... | ahnqirage/spark | core/src/main/scala/org/apache/spark/scheduler/local/LocalSchedulerBackend.scala | Scala | apache-2.0 | 6,123 |
/*
* 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
* distribute... | wvlet/airframe | airframe-canvas/src/test/scala/wvlet/airframe/canvas/OffHeapMemoryAllocatorTest.scala | Scala | apache-2.0 | 1,010 |
/*
* Distributed as part of Scalala, a linear algebra library.
*
* Copyright (C) 2008- Daniel Ramage
*
* 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 ... | scalala/Scalala | src/main/scala/scalala/tensor/mutable/Tensor1Col.scala | Scala | lgpl-2.1 | 2,318 |
package de.zalando.model
import de.zalando.apifirst.Application._
import de.zalando.apifirst.Domain._
import de.zalando.apifirst.ParameterPlace
import de.zalando.apifirst.naming._
import de.zalando.apifirst.Hypermedia._
import de.zalando.apifirst.Http._
import de.zalando.apifirst.Security
import java.net.URL
import Sec... | zalando/play-swagger | play-scala-generator/src/test/scala/model/resources.form_data_yaml.scala | Scala | mit | 7,504 |
/*
* Artificial Intelligence for Humans
* Volume 2: Nature Inspired Algorithms
* Java Version
* http://www.aifh.org
* http://www.jeffheaton.com
*
* Code repository:
* https://github.com/jeffheaton/aifh
*
* Copyright 2014 by Jeff Heaton
*
* Licensed under the Apache License, Version 2.0 (the "License");
* y... | PeterLauris/aifh | vol2/vol2-scala-examples/src/main/scala/com/heatonresearch/aifh/examples/selection/TournamentCompareExample.scala | Scala | apache-2.0 | 3,436 |
/*
* Copyright (c) 2014 Contributor. All rights reserved.
*/
package methodsInheritance
trait Base {
val foo = 1
def bar = 2
def baz() = 3
}
class Methods extends Base
class Overrides extends Base {
override val foo = 11
override def bar = 12
override def baz() = 13
}
object MethodsInheritance {
... | stephenh/scala-ide | org.scala-ide.sdt.core.tests/test-workspace/custom-highlighting/src/custom/MethodsInheritance.scala | Scala | bsd-3-clause | 425 |
package scife
package enumeration
package common.enumdef
import scife.{ enumeration => e }
import util._
import scife.util.logging._
import scife.util._
import org.scalatest._
import org.scalatest.prop._
import org.scalatest.Matchers._
import org.scalacheck.Gen
import scala.language.postfixOps
object RedBlackTreeE... | kaptoxic/SciFe | src/test/scala/scife/enumeration/common/enumdef/RedBlackTreeEnum.scala | Scala | gpl-2.0 | 26,515 |
package inloopio.math.algebra
trait VectorIterable extends Iterable[MatrixSlice] {
def iterateAll: Iterator[MatrixSlice]
def numSlices: Int
def numRows: Int
def numCols: Int
/**
* Return a new vector with cardinality equal to getNumRows() of this matrix which is the matrix product of the
* recipie... | dcaoyuan/inloopio-libs | inloopio-math/src/main/scala/inloopio/math/algebra/VectorIterable.scala | Scala | bsd-3-clause | 1,113 |
package net.ruippeixotog.structs
class SkewBinomialQueueSpec extends PriorityQueueSpec[SkewBinomialQueue] {
def queueName = "skew binomial queue"
}
| ruippeixotog/functional-brodal-queues | src/test/scala/net/ruippeixotog/structs/SkewBinomialQueueSpec.scala | Scala | mit | 151 |
/*
* Copyright 2010-2011 Vilius Normantas <[email protected]>
*
* This file is part of Crossbow library.
*
* Crossbow 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 ... | ViliusN/Crossbow | crossbow-core/test/lt/norma/crossbow/indicators/VariableSignalTest.scala | Scala | gpl-3.0 | 1,257 |
package com.twitter.finagle
import _root_.java.net.{InetSocketAddress, SocketAddress}
import com.twitter.concurrent.Broker
import com.twitter.conversions.time._
import com.twitter.finagle.client._
import com.twitter.finagle.dispatch.{SerialServerDispatcher, PipeliningDispatcher}
import com.twitter.finagle.memcached.pr... | stevegury/finagle | finagle-memcached/src/main/scala/com/twitter/finagle/Memcached.scala | Scala | apache-2.0 | 4,100 |
/*
* 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 ... | ConeyLiu/spark | core/src/main/scala/org/apache/spark/deploy/SparkHadoopUtil.scala | Scala | apache-2.0 | 19,854 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | wangmiao1981/spark | core/src/main/scala/org/apache/spark/storage/BlockManager.scala | Scala | apache-2.0 | 83,260 |
package scala.slick.test.ql.ql
import org.junit.Test
import org.junit.Assert._
import scala.slick.ql._
import scala.slick.ql.TypeMapper._
import scala.slick.driver.{ExtendedTable => Table}
import scala.slick.session._
import scala.slick.session.Database.threadLocalSession
import scala.slick.testutil._
import scala.sli... | szeiger/scala-query | src/test/scala/scala/slick/test/ql/ColumnDefaultTest.scala | Scala | bsd-2-clause | 1,043 |
package artisanal.pickle.maker
package stores
import tags._
import scala.reflect.internal.pickling._
import java.util.concurrent.ConcurrentHashMap
case class ThisTypeStore() {
val owners: scala.collection.concurrent.Map[String, ThisTpe_owner_] = scala.collection.convert.Wrappers.JConcurrentMapWrapper(new Concurr... | julianpeeters/artisanal-pickle-maker | src/main/scala/stores/ThisTypeStore.scala | Scala | apache-2.0 | 502 |
package org.apache.spark.mllib.treelib.core
import org.apache.spark._
import org.apache.spark.SparkContext._
import org.apache.spark.rdd._
import scala.collection.immutable.HashMap
import java.io._
import java.io.DataOutputStream
import java.io.FileOutputStream
import java.io.DataInputStream
import java.io.FileInputS... | bigfootproject/spark-dectree | spark/mllib/src/main/scala/org/apache/spark/mllib/treelib/core/RandomForestBuilder.scala | Scala | apache-2.0 | 9,414 |
/*
* Copyright 2001-2013 Artima, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agre... | travisbrown/scalatest | src/main/scala/org/scalatest/tools/IconEmbellishedListCellRenderer.scala | Scala | apache-2.0 | 10,492 |
/*
* Copyright 2013 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 applica... | anthonyccri/geomesa | geomesa-plugin/src/main/scala/geomesa/plugin/wfs/AccumuloDataStoreEditPanel.scala | Scala | apache-2.0 | 3,466 |
package com.pnns.vc3
import com.pnns.AlgorithmInstance
import com.pnns.Node
import scala.collection.immutable.HashSet
/**
* VC3 algorithm instance.
*/
class Vc3Instance(val node: Node) extends AlgorithmInstance[(State, State), (String, String)] {
private var wState: State = UR()
private var bState: State = UR()... | operutka/pn-network-simulator | src/main/scala/com/pnns/vc3/Vc3Instance.scala | Scala | mit | 3,460 |
/*
* Copyright 2016 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... | ahudspith-equalexperts/ct-calculations | src/main/scala/uk/gov/hmrc/ct/ct600/v2/B56.scala | Scala | apache-2.0 | 1,187 |
/*
* 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 ... | andrewor14/iolap | core/src/main/scala/org/apache/spark/PoolReweighterLoss.scala | Scala | apache-2.0 | 10,807 |
package com.ekuaibao.scalicicle
import java.io.{ByteArrayOutputStream, IOException}
import java.security.MessageDigest
import scala.collection.immutable.NumericRange
import scala.concurrent._
import scala.util.control.NoStackTrace
/**
* Generates IDs using Redis that have strong guarantees of k-ordering, and inclu... | ekuaibao/scalicicle | src/main/scala/com/ekuaibao/scalicicle/IdGenerator.scala | Scala | mit | 5,525 |
package org.reactivecouchbase.rs.scaladsl
import akka.util.ByteString
import io.circe._
import io.circe.syntax._
import io.circe.parser._
import com.couchbase.client.java.document.json._
import org.reactivecouchbase.rs.scaladsl.json._
import scala.language.implicitConversions
package object circejson {
private de... | ReactiveCouchbase/reactivecouchbase-rs-core | src/main/scala/org/reactivecouchbase/rs/scaladsl/json/circejson.scala | Scala | apache-2.0 | 4,234 |
package no.uio.musit.models
import org.scalatest.{Inside, MustMatchers, WordSpec}
class CaseNumbersSpec extends WordSpec with MustMatchers with Inside {
"CaseNumber" should {
"have pipe separator around one id" in {
CaseNumbers(Seq("a")).toDbString mustBe "|a|"
}
"have pipe separator between mul... | MUSIT-Norway/musit | musit-models/src/test/scala/no/uio/musit/models/CaseNumbersSpec.scala | Scala | gpl-2.0 | 513 |
/*
SirRre.scala
PDE approximation for a SIR epidemic model
Numerical solution of an SPDE
*/
package rd
object SirRre {
import smfsb._
import breeze.linalg.{Vector => BVec, _}
import breeze.numerics._
def main(args: Array[String]): Unit = {
val r = 250; val c = 300
val model = sir[DoubleState]()
... | darrenjw/blog | reaction-diffusion/src/main/scala/rd/SirRre.scala | Scala | apache-2.0 | 720 |
/*
* 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 ... | hhbyyh/spark | sql/core/src/main/scala/org/apache/spark/sql/execution/CacheManager.scala | Scala | apache-2.0 | 11,679 |
/*
* Copyright (C) 2012 e-Research Laboratory, School of ITEE,
* The University of Queensland
*
* 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 versio... | recurse/qldarch | src/main/scala/net/metadata/qldarch/snippet/Resources.scala | Scala | agpl-3.0 | 1,742 |
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package sky.localnode
import akka.actor.Actor
import akka.actor.ActorLogging
import akka.util.Timeout
import scala.concurrent.Await
i... | szekai/akka-example | AkkaRemotingExample/LocalNodeApp/src/main/scala/sky/localnode/LocalActor.scala | Scala | apache-2.0 | 853 |
package org.scalacoin.marshallers.rpc.bitcoincore.wallet
import org.scalacoin.protocol.rpc.bitcoincore.wallet.{WalletInfo, WalletInfoImpl}
import spray.json._
/**
* Created by Tom on 1/6/2016.
*/
object WalletMarshaller extends DefaultJsonProtocol {
val walletVersionKey = "walletversion"
val balanceKey = "balan... | TomMcCabe/scalacoin | src/main/scala/org/scalacoin/marshallers/rpc/bitcoincore/wallet/WalletMarshaller.scala | Scala | mit | 1,844 |
package ch.wsl.box.model.shared
case class EntityKind(kind:String){
def isEntity:Boolean = entityOrForm == "entity"
def entityOrForm = kind match{
case "table"|"view" => "entity"
case _ => kind
}
def plural:String = kind match {
case "entity" => "entities"
case "boxentity" => "boxentities"
... | Insubric/box | shared/src/main/scala/ch/wsl/box/model/shared/EntityKind.scala | Scala | apache-2.0 | 781 |
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.