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 com.google.protobuf
import java.io.IOException
@SerialVersionUID(-1616151763072450476L)
class InvalidProtocolBufferException(description: String)
extends IOException(description)
object InvalidProtocolBufferException {
def truncatedMessage(): InvalidProtocolBufferException = {
new InvalidProtocolB... | trueaccord/protobuf-scala-runtime | shared/src/main/scala/com/google/protobuf/InvalidProtocolBufferException.scala | Scala | apache-2.0 | 2,294 |
/*
* Part of NDLA image-api
* Copyright (C) 2017 NDLA
*
* See LICENSE
*/
package no.ndla.imageapi.model.api
import java.util.Date
import org.scalatra.swagger.annotations.ApiModel
import org.scalatra.swagger.runtime.annotations.ApiModelProperty
import scala.annotation.meta.field
// format: off
@ApiModel(descri... | NDLANO/image-api | src/main/scala/no/ndla/imageapi/model/api/ImageMetaInformationV2.scala | Scala | gpl-3.0 | 2,084 |
package uber.nosurge.actors
import akka.actor.{Actor, ActorRef, Props}
import uber.domain.auth.ServerToken
import uber.entities.PriceEstimate
import uber.nosurge.Settings
import uber.nosurge.actors.Message.{CheckPrice, Terminate}
import uber.nosurge.actors.Models.InitialData
import uber.nosurge.actors.PriceChecker.pri... | allantl/uber-nosurge-notifications | backend/src/main/scala/uber/nosurge/actors/PriceChecker.scala | Scala | apache-2.0 | 2,406 |
package definiti.common.ast
case class ParameterDefinition(
name: String,
typeReference: AbstractTypeReference,
location: Location
)
| definiti/definiti-core | src/main/scala/definiti/common/ast/ParameterDefinition.scala | Scala | mit | 140 |
// Scala provides extra special conveniences
// for converting methods ("functions") to Functions
object Foo {
def isGood(x: Int): Boolean = { x % 2 == 0 }
}
val predicate: Int => Boolean = x => Foo.isGood(x)
| agconti/scala-school | 04-functions-as-values/slides/slide058.scala | Scala | mit | 217 |
package es.weso.shex.validation
import es.weso.shex.ManifestRunner
import org.scalatest._
import es.weso.manifest._
import com.typesafe.config._
import util._
import es.weso.utils.FileUtils._
class AllFromManifest extends RDF2Manifest
with FunSpecLike
with Matchers
with TryValues
with ManifestRunner ... | labra/ShExcala | src/compat/scala/es/weso/shex/validation/AllFromManifest.scala | Scala | mit | 1,017 |
package com.github.diegopacheco.scala3.playground.features
@main def MatchTypesMain():Unit = {
type Elem[X] = X match
case String => Char
case Array[t] => t
case Iterable[t] => t
val c:Elem[String] = 'a'
println(c)
val arr:Elem[Array[Int]] = 1
println(arr)
}
| diegopacheco/scala-playground | scala-3-playground/scala-3-playground/src/main/scala/com/github/diegopacheco/scala3/playground/features/MatchTypesMain.scala | Scala | unlicense | 290 |
/*
* 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
* distrib... | fusepoolP3/p3-silk | silk-core/src/main/scala/de/fuberlin/wiwiss/silk/config/package.scala | Scala | apache-2.0 | 650 |
package org.bitcoins.testkitcore.gen
import org.bitcoins.core.number._
import org.bitcoins.core.protocol.{BigSizeUInt, CompactSizeUInt}
import org.bitcoins.core.script.constant.ScriptNumber
import org.bitcoins.core.util.NumberUtil
import org.scalacheck.Arbitrary.arbitrary
import org.scalacheck.Gen
import scodec.bits.{... | bitcoin-s/bitcoin-s | testkit-core/src/main/scala/org/bitcoins/testkitcore/gen/NumberGenerator.scala | Scala | mit | 4,362 |
/*
* 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/EnergyResistanceFire.scala | Scala | apache-2.0 | 1,310 |
package breeze.optimize.proximal
import breeze.linalg.{DenseVector, DenseMatrix}
import breeze.optimize.DiffFunction
import breeze.stats.distributions.Rand
/**
* @author debasish83
*/
object LogisticGenerator {
case class Cost(data: DenseMatrix[Double],
labels: DenseVector[Double]) extends Diff... | wstcpyt/breeze | math/src/main/scala/breeze/optimize/proximal/LogisticGenerator.scala | Scala | apache-2.0 | 1,366 |
package com.twitter.diffy
import com.google.inject.Stage
import com.twitter.finatra.http.test.EmbeddedHttpServer
import com.twitter.inject.Test
class StartupFeatureTest extends Test {
val server = new EmbeddedHttpServer(
stage = Stage.PRODUCTION,
twitterServer = new MainService {
},
extraArgs = Seq... | ljbx/diffy | src/test/scala/com/twitter/diffy/StartupFeatureTest.scala | Scala | apache-2.0 | 548 |
package sisdn.service
import akka.actor.{ActorSystem, Props}
import akka.http.scaladsl.model.headers.HttpCredentials
import akka.http.scaladsl.Http
import akka.http.scaladsl.model.HttpResponse
import akka.http.scaladsl.model.StatusCodes._
import akka.http.scaladsl.model.headers._
import akka.http.scaladsl.model.HttpMe... | mhashimm/backend | src/main/scala/sisdn/service/ServiceRoute.scala | Scala | agpl-3.0 | 3,232 |
/*******************************************************************************
Copyright (c) 2013-2014, S-Core, KAIST.
All rights reserved.
Use is subject to license terms.
This distribution may include materials developed by third parties.
*********************************************************... | darkrsw/safe | src/main/scala/kr/ac/kaist/jsaf/analysis/typing/models/jquery/JQueryData.scala | Scala | bsd-3-clause | 7,292 |
package rl
package expand
import org.jboss.netty.channel.{ChannelFutureListener, ChannelHandlerContext}
import org.jboss.netty.handler.codec.http._
import org.jboss.netty.handler.codec.http.HttpHeaders.Names
import org.jboss.netty.buffer.ChannelBuffers
import akka.dispatch.Await
import akka.util.duration._
import org.... | scalatra/rl | expand/src/test/scala/rl/expand/UrlExpanderspec.scala | Scala | mit | 5,520 |
/* *\\
** _____ __ _____ __ ____ FieldKit **
** / ___/ / / /____/ / / / \\ (c) 2009, field **
** / ___/ /_/ /____/ / /__ / / / http://www.field.io ... | field/FieldKit.scala | src.p5/field/kit/p5/Recorder.scala | Scala | lgpl-3.0 | 5,924 |
package chapter1
import org.scalatest.{FreeSpec, Matchers}
class Question2Spec extends FreeSpec with Matchers {
import Question2._
"Should be reversed" in {
reverse("abc") shouldEqual "cba"
reverse("abcdfe") shouldBe "efdcba"
}
}
| alexandrnikitin/algorithm-sandbox | scala/src/test/scala/chapter1/Question2Spec.scala | Scala | mit | 246 |
package com.twitter.finatra.kafka.test.utils
object ThreadUtils {
def fork(func: => Unit): Unit = {
new Thread {
override def run(): Unit = {
func
}
}.start()
}
}
| twitter/finatra | kafka/src/test/scala/com/twitter/finatra/kafka/test/utils/ThreadUtils.scala | Scala | apache-2.0 | 198 |
package com.twitter.finagle
import com.twitter.conversions.time._
import com.twitter.finagle.util.DefaultTimer
import com.twitter.util.{Await, Future}
import scala.math.Ordering
import scala.util.control.NoStackTrace
/**
* Status tells the condition of a networked endpoint. They are used
* to indicate the health of... | spockz/finagle | finagle-core/src/main/scala/com/twitter/finagle/Status.scala | Scala | apache-2.0 | 3,833 |
import sbt.{ State => _, Configuration => _, Show => _, _ }
import Keys._
trait OcsBundle {
// Bundle projects.
// Inter-project dependencies must be declared here.
lazy val bundle_edu_gemini_ags_servlet =
project.in(file("bundle/edu.gemini.ags.servlet")).dependsOn(
bundle_edu_gemini_shared_skyobj... | arturog8m/ocs | project/OcsBundle.scala | Scala | bsd-3-clause | 24,742 |
package scalapb.grpc
import io.grpc.stub.StreamObserver
import io.grpc.{CallOptions, Channel, MethodDescriptor}
import scala.collection.JavaConverters._
import scala.concurrent.Future
object ClientCalls {
def blockingUnaryCall[ReqT, RespT](
channel: Channel,
method: MethodDescriptor[ReqT, RespT],
... | dotty-staging/ScalaPB | scalapb-runtime-grpc/src/main/scala/scalapb/grpc/ClientCalls.scala | Scala | apache-2.0 | 2,118 |
// Copyright (c) 2016 Yuichiroh Matsubayashi
package yuima.nuimo.action
sealed class Key(val code: Int, val char: String = null) {
val symbol = if (char != null) char else toString
}
object Key {
object Modifier extends Enumeration {
val command, control, shift, option = Value
}
case object Zero extend... | Yuichiroh/nuimo-manager | src/main/scala/yuima/nuimo/action/Key.scala | Scala | mit | 4,678 |
object Holder {
private class C
}
import Holder._
println(/* resolved: false */ C)
println(classOf[/* accessible: false */ C])
| ilinum/intellij-scala | testdata/resolve2/import/access/PrivateClassAll.scala | Scala | apache-2.0 | 132 |
import sbt._
object Version {
val lift = "3.1.0"
val h2 = "1.4.196"
val jetty = "9.4.6.v20170531"
val servlet = "3.1.0"
val logback = "1.2.3"
}
object Library {
val liftWebkit = "net.liftweb" %% "lift-webkit" % Version.lift
val liftMapper = "net.liftweb" %% "lift-mapper" ... | davenatx/mc-price | project/dependencies.scala | Scala | gpl-3.0 | 805 |
package com.equalinformation.scala.programs.test
/**
* Created by bpupadhyaya on 6/13/16.
*/
object TestObj4 {
//TODO
}
| bpupadhyaya/scala-programs-collection | scala-programs-collection/src/test/scala-2.11/com/equalinformation/scala/programs/test/TestObj.scala | Scala | apache-2.0 | 127 |
package com.arcusys.valamis.util.mustache
import scala.io.Source
/**
* template
*/
class Mustache(
root: Token) extends MustacheHelperSupport {
def this(source: Source, open: String = "{{", close: String = "}}") =
this((new Parser {
val src = source
var otag = open
... | ViLPy/Valamis | valamis-util/src/main/scala/com/arcusys/valamis/util/mustache/Mustache.scala | Scala | lgpl-3.0 | 2,127 |
package io.getquill.context.jdbc.sqlite
import io.getquill.context.sql.DistinctSpec
import org.scalatest.matchers.should.Matchers._
class DistinctJdbcSpec extends DistinctSpec {
val context = testContext
import testContext._
override def beforeAll = {
testContext.transaction {
testContext.run(query[... | getquill/quill | quill-jdbc/src/test/scala/io/getquill/context/jdbc/sqlite/DistinctJdbcSpec.scala | Scala | apache-2.0 | 2,391 |
/***********************************************************************
* 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-features/geomesa-feature-avro/src/test/scala/org/locationtech/geomesa/features/avro/AvroSimpleFeatureTest.scala | Scala | apache-2.0 | 8,700 |
/*
* 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 | app/utils/SystemDate.scala | Scala | apache-2.0 | 898 |
/*
* 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 ... | zouzias/spark-lucenerdd | src/test/scala/org/zouzias/spark/lucenerdd/analyzers/AnalyzersConfigurableSpec.scala | Scala | apache-2.0 | 2,195 |
package com.tuvistavie.xserver.backend.model
class Resource (
val id: Int
) {
}
object Resource {
private[this] var allocated: Map[Int, Resource] = Map.empty
def canAllocate(id: Int) = !allocated.contains(id)
def isAllocated(id: Int) = allocated contains(id)
def allocate(id: Int, resource: Resource): Bo... | tuvistavie/scala-x-server | backend/src/main/scala/com/tuvistavie/xserver/model/Resource.scala | Scala | mit | 570 |
/*
* Copyright 2009-2010 LinkedIn, Inc
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed ... | linkedin-sna/norbert | java-cluster/src/main/scala/com/linkedin/norbert/javacompat/package.scala | Scala | apache-2.0 | 2,406 |
package sample.snippet
import scala.xml.{NodeSeq,Text}
import net.liftweb.http.js.JsExp
import net.liftweb.http.js.JsCmds.{Alert,Script,Run,SetHtml,JsIf}
import net.liftweb.http.js.JE.{JsNotEq,Num}
class BasicJavascript {
def one(xhtml: NodeSeq): NodeSeq =
Script(Alert("1: Important Alert Goes Here!"))
d... | timperrett/lift-in-action | chapter-9/src/main/scala/sample/snippet/BasicJavaScript.scala | Scala | apache-2.0 | 600 |
/*
* 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 ... | akopich/spark | sql/core/src/main/scala/org/apache/spark/sql/execution/SparkStrategies.scala | Scala | apache-2.0 | 21,521 |
/*
* scala-swing (https://www.scala-lang.org)
*
* Copyright EPFL, Lightbend, Inc., contributors
*
* 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... | scala/scala-swing | src/main/scala/scala/swing/event/FontChanged.scala | Scala | apache-2.0 | 420 |
package org.vitrivr.adampro.utils.exception
import org.vitrivr.adampro.data.index.Index.IndexName
/**
* adamtwo
*
* Ivan Giangreco
* August 2015
*/
case class IndexNotExistingException(message : String = "Index not existing.") extends GeneralAdamException(message)
object IndexNotExistingException {
def withIn... | dbisUnibas/ADAMpro | src/main/scala/org/vitrivr/adampro/utils/exception/IndexNotExistingException.scala | Scala | mit | 449 |
package com.rrdinsights.scalabrine.parameters
import com.rrdinsights.scalabrine.TestSpec
import org.junit.runner.RunWith
import org.scalatest.junit.JUnitRunner
@RunWith(classOf[JUnitRunner])
class ParameterTest extends TestSpec {
test("toUrl") {
assert(LeagueIdParameter.NBA.toUrl === "LeagueID=00")
assert(... | rd11490/Scalabrine | src/test/scala/com/rrdinsights/scalabrine/parameters/ParameterTest.scala | Scala | mit | 539 |
package com.github.gmspacagna.scalatable.descriptors
trait HiveTableDescriptor extends HiveTableOperators {
def tableName: String
def dbName: String
def fullTableName = dbName + "." + tableName
}
trait HiveTableOperators {
case object Select extends HQLOperator("SELECT")
case object From extends HQLOperator... | gm-spacagna/scala-table-clients | src/main/scala/com/github/gmspacagna/scalatable/descriptors/HiveTableDescriptor.scala | Scala | apache-2.0 | 2,427 |
import org.scalastyle.sbt.ScalastylePlugin
import sbt._
import sbt.Keys._
import com.typesafe.sbt.SbtScalariform.{ ScalariformKeys, _ }
object CommonSettings {
private lazy val defaultSettings = Seq(
scalaVersion := BuildCommon.scalaVersion,
scalacOptions := BuildCommon.scalacOption,
javac... | vishnusaran/scala-repl-man-pages | project/CommonSettings.scala | Scala | mit | 2,301 |
package scala.collection.convert
import java.util.{concurrent => juc}
import java.{lang => jl, util => ju}
import org.junit.Test
import org.junit.runner.RunWith
import org.junit.runners.JUnit4
import scala.collection.JavaConverters._
import scala.collection.{concurrent, mutable}
// scala/bug#9113: tests to insure t... | martijnhoekstra/scala | test/junit/scala/collection/convert/NullSafetyToJavaTest.scala | Scala | apache-2.0 | 2,050 |
import common._
package object scalashop {
/** The value of every pixel is represented as a 32 bit integer. */
type RGBA = Int
/** Returns the red component. */
def red(c: RGBA): Int = (0xff000000 & c) >>> 24
/** Returns the green component. */
def green(c: RGBA): Int = (0x00ff0000 & c) >>> 16
/** R... | comprakash/learning-scala | scalashop/src/main/scala/scalashop/package.scala | Scala | gpl-3.0 | 1,366 |
/*
* 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 | streaming/src/main/scala/org/apache/gearpump/streaming/dsl/task/TransformTask.scala | Scala | apache-2.0 | 1,933 |
/*
mls: basic machine learning algorithms for Scala
Copyright (C) 2014 Davi Pereira dos Santos
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your opt... | active-learning/active-learning-scala | src/main/scala/ml/classifiers/BestClassifCV100.scala | Scala | gpl-2.0 | 2,453 |
package gitbucket.core.model
import gitbucket.core.model.CommitState._
import org.scalatest.FunSpec
class CommitStateSpec extends FunSpec {
describe("CommitState") {
it("should combine empty must eq PENDING") {
assert(combine(Set()) == PENDING)
}
it("should combine includes ERROR must eq FAILURE")... | McFoggy/gitbucket | src/test/scala/gitbucket/core/model/CommitStateSpec.scala | Scala | apache-2.0 | 762 |
package keemun.models
/**
* Copyright (c) Nikita Kovaliov, maizy.ru, 2014
* See LICENSE.txt for details.
*/
//TODO: or use other superclass?
class ConfigError(message: String) extends Exception(message)
| maizy/keemun | app/keemun/models/ConfigError.scala | Scala | mit | 208 |
package models
import org.specs2._
import org.specs2.specification.script.{StandardDelimitedStepParsers, GWT, StepParser}
import java.time.{Duration, LocalTime}
/**
* User: ctranxuan
* Date: 17/05/14
*
* http://www.slideshare.net/etorreborre/specs2-whirlwindtour (40)
* http://etorreborre.github.io/specs2/guide/... | ctranxuan/swc | test/models/MarketSpec.scala | Scala | apache-2.0 | 3,800 |
package sLaCa3
/**
* This sLaCa3 program counts the number of occurences of "01" in the binary string stored at memory location
* 0x3100 and writes the count into 0x3101.
*/
object count01sTest extends sLaCa3{
def main(args: Array[String]): Unit = {
//Different test inputs with their binary representation and ... | davidmaw/sLaCa3 | count01sTest.scala | Scala | mit | 1,404 |
/*
* 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 ... | iiisthu/sparkSdn | core/src/main/scala/org/apache/spark/rdd/PartitionPruningRDD.scala | Scala | apache-2.0 | 2,885 |
package lila
package analyse
import chess.Color
import chess.format.Uci
import lila.tree.Eval
case class Info(
ply: Int,
eval: Eval,
// variation is first in UCI, then converted to PGN before storage
variation: List[String] = Nil
) {
def cp = eval.cp
def mate = eval.mate
def best = eval.best... | ornicar/lichess-db | src/main/scala/lila/analyse/Info.scala | Scala | agpl-3.0 | 2,283 |
package pt.charactor
import akka.actor.ActorSystem
import akka.actor.Props
import akka.testkit.{TestActorRef, TestKit, ImplicitSender}
import org.scalatest.WordSpecLike
import org.scalatest.Matchers
import org.scalatest.BeforeAndAfterAll
import pt.charactor.MoverArbiter.CurrentWorldMap
class Vector2DSpec(_system: Act... | PiotrTrzpil/charactor-clustered | src/test/scala/pt/charactor/Vector2DSpec.scala | Scala | apache-2.0 | 950 |
package grammarcomp
package clients
import grammar._
import utils._
import CFGrammar._
import generators._
import generators.RandomAccessGenerator._
import parsing._
import scala.collection.mutable.{ Map => MutableMap }
import java.util.Random
object AmbiguityChecker {
sealed abstract class AmbiguityFeedback[+T]
... | epfl-lara/GrammarComparison | src/main/scala/grammarcomp/clients/AmbiguityChecker.scala | Scala | mit | 11,362 |
package org.atnos.eff
import cats._
import data._
import cats.implicits._
import Eff._
import Interpret._
/**
* Effect for logging values alongside computations
*
* Compared to traditional Writer monad which accumulates values by default
* this effect can be interpreted in different ways:
*
* - log values to t... | etorreborre/eff | shared/src/main/scala/org/atnos/eff/WriterEffect.scala | Scala | mit | 4,368 |
//package codesniffer.deckard.vgen
//
//import java.lang.reflect.Modifier
//
//import codesniffer.deckard.{WeightedVec, CharacVec, ArrayVec}
//import codesniffer.api.Node
//import codesniffer.api.body.MethodDeclaration
//import codesniffer.api.stmt.Statement
//import codesniffer.api.visitor.VoidVisitorAdapter
... | xkommando/CodeSniffer | deckard/src/main/scala/codesniffer/deckard/vgen/SlicerVecGen.scala | Scala | lgpl-3.0 | 6,944 |
/*
* This interface is primarily used for implementing storage adapters where
* row data is partitioned by a time stamp column and also contains one or more key
* columns
*
*/
package com.ligadata.StorageBase
import com.ligadata.KvBase.{ Key, Value, TimeRange }
import com.ligadata.Utils.{ KamanjaLoaderInfo }
impo... | traytonwhite/Kamanja | trunk/Storage/StorageBase/src/main/scala/com/ligadata/StorageBase/StorageAdapterBase.scala | Scala | apache-2.0 | 3,597 |
/*
* 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 ... | ZxlAaron/mypros | mllib/src/main/scala/org/apache/spark/ml/r/AFTSurvivalRegressionWrapper.scala | Scala | apache-2.0 | 5,343 |
package score.discord.canti.command.api
import com.codedx.util.MapK
final case class CommandInvocation(
prefix: String,
name: String,
args: MapK[ArgSpec, [T] =>> T],
invoker: CommandInvoker
):
def jda = invoker.user.getJDA
| ScoreUnder/canti-bot | src/main/scala/score/discord/canti/command/api/CommandInvocation.scala | Scala | agpl-3.0 | 235 |
package com.github.mdr.mash.view.render.browser
object ArrowHelper {
def addUpArrow(s: String): String = setMiddleCharacter(s, '↑')
def addDownArrow(s: String): String = setMiddleCharacter(s, '↓')
private def setMiddleCharacter(s: String, c: Char): String =
if (s.isEmpty) s else s.updated(s.length / 2, c)... | mdr/mash | src/main/scala/com/github/mdr/mash/view/render/browser/ArrowHelper.scala | Scala | mit | 328 |
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 ExtensionClassContainerImpl1links._
case class ExtensionClassContainerImpl1links (
sel... | cliffano/swaggy-jenkins | clients/scalaz/generated/src/main/scala/org/openapitools/client/api/ExtensionClassContainerImpl1links.scala | Scala | mit | 900 |
package se.stagehand.swing.gui
import scala.swing._
import se.stagehand.swing.lib.Vector2
import java.awt.MouseInfo
import se.stagehand.lib.Log
class BetterDialog extends Dialog {
protected val log = Log.getLog(this.getClass())
def centerOn(component:Component) {
centerOn(GUIUtils.rectCenter(component.bou... | evilcandybag/Stagehand-core | src/main/scala/se/stagehand/swing/gui/BetterDialog.scala | Scala | gpl-2.0 | 938 |
package com.blinkbox.books.spray
import spray.http.{MediaType, MediaTypes}
package object v2 {
/**
* The version 2 media type.
*/
val `application/vnd.blinkbox.books.v2+json` = MediaTypes.register(MediaType.custom(
mainType = "application",
subType = "vnd.blinkbox.books.v2+json",
binary = true,... | blinkboxbooks/common-spray.scala | src/main/scala/com/blinkbox/books/spray/v2/package.scala | Scala | mit | 411 |
/*
* 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 ... | chuckchen/spark | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/LogicalPlanVisitor.scala | Scala | apache-2.0 | 2,752 |
/*
* 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 | examples/src/main/scala/org/apache/spark/examples/graphx/SynthBenchmark.scala | Scala | apache-2.0 | 5,522 |
package evaluation
/**
* <pre>
* Created on 2016/12/16.
* </pre>
*
* @author K.Sakamoto
*/
object MicroAveraging {
def summaryStatistics(metrics: Array[Seq[Double]]): SummaryStatistics = {
SummaryStatistics(metrics.flatten, metrics.length)
}
def summaryStatistics(metrics: Seq[Double]): SummarySt... | ktr-skmt/FelisCatusZero | src/main/scala/evaluation/MicroAveraging.scala | Scala | apache-2.0 | 373 |
package ai.verta.repository
final case class IllegalCommitSavedStateException(
private val message: String = "",
private val cause: Throwable = None.orNull
) extends Exception(message, cause)
| mitdbg/modeldb | client/scala/src/main/scala/ai/verta/repository/IllegalCommitSavedStateException.scala | Scala | mit | 197 |
package com.twitter.finagle.param
import com.twitter.concurrent.AsyncSemaphore
import com.twitter.finagle.Stack
import com.twitter.finagle.filter.RequestSemaphoreFilter
/**
* A collection of methods for configuring the server-side admission control modules
* of Finagle servers.
*
* @tparam A a [[Stack.Parameteriz... | koshelev/finagle | finagle-core/src/main/scala/com/twitter/finagle/param/ServerAdmissionControlParams.scala | Scala | apache-2.0 | 1,210 |
package org.joshjoyce.gasbag
import scala.io.Source
class ScrobbleFileSource(file: String) extends Traversable[SongInfo] {
override def foreach[B](f: (SongInfo) => B) {
val source = Source.fromFile(file)
val lines = source.getLines
// header lines
lines.drop(3)
lines.foreach {
line ... | jnj/gasbag | src/main/scala/org/joshjoyce/gasbag/ScrobbleFileSource.scala | Scala | apache-2.0 | 1,015 |
package spgui.widgets.akuten
import spgui.communication.BackendCommunication
import spgui.widgets.ToAndFrom
import sp.erica._
import sp.domain._
import Logic._
/**
* Created by kristofer on 2017-05-02.
*/
object PatientModel {
import rx._
implicit val ctx: Ctx.Owner = Ctx.Owner.safe()
val model = new Pati... | kristoferB/SP | sperica/frontend/src/main/scala/spgui/widgets/akuten/PatientModel.scala | Scala | mit | 1,535 |
package com.twitter.finagle.netty4.ssl.client
import com.twitter.finagle.Address
import com.twitter.finagle.ssl._
import com.twitter.finagle.ssl.client.SslClientConfiguration
import com.twitter.io.TempFile
import java.io.File
import java.net.InetSocketAddress
import java.security.KeyStore
import javax.net.ssl.{KeyMana... | luciferous/finagle | finagle-netty4/src/test/scala/com/twitter/finagle/netty4/ssl/client/Netty4ClientEngineFactoryTest.scala | Scala | apache-2.0 | 8,538 |
package de.zalando.swagger
import java.io.File
import java.net.URI
import de.zalando.swagger.strictModel.SwaggerModel
import org.scalatest.{FunSpec, MustMatchers}
class StrictParseExamplesTest extends FunSpec with MustMatchers with ExpectedResults {
val fixtures = new File(resourcesPath + "examples").listFiles ++... | zalando/play-swagger | swagger-parser/src/test/scala/de/zalando/swagger/StrictParseExamplesTest.scala | Scala | mit | 713 |
/*
* Copyright 2012-2015 Pellucid Analytics
* Copyright 2015 Daniel W. H. James
*
* 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
*
* ... | liruqi/aws-wrap | integration/src/it/scala/dynamodb/ForumThread.scala | Scala | apache-2.0 | 4,176 |
/**
* FILE: UnitDAOTest.scala
* PERCORSO /Codice/sgad/servertier/src/test/scala/sgad/servertier/dataaccess/databaseaccess/shareddatadao
* DATA CREAZIONE: 20 Febbraio 2014
* AUTORE: ProTech
* EMAIL: protech.unipd@gmail.com
*
* Questo file è proprietà del gruppo ProTech, viene rilasciato sotto licenza Apache v2.
... | protechunipd/SGAD | Codice/sgad/servertier/src/test/scala/sgad/servertier/dataaccess/databaseaccess/shareddatadao/UnitDAOTest.scala | Scala | apache-2.0 | 3,950 |
package org.tribbloid.spookystuff.pages
import org.apache.spark.SparkEnv
import org.tribbloid.spookystuff.SpookyEnvSuite
import org.tribbloid.spookystuff.actions._
import org.tribbloid.spookystuff.dsl
/**
* Created by peng on 11/30/14.
*/
class TestUnstructured extends SpookyEnvSuite {
import dsl._
lazy val p... | chenUT/spookystuff | core/src/test/scala/org/tribbloid/spookystuff/pages/TestUnstructured.scala | Scala | apache-2.0 | 3,485 |
package models.services
import java.util.UUID
import javax.inject.Inject
import com.mohiva.play.silhouette.api.LoginInfo
import models.daos.UserDAO
import models.user.User
import play.api.libs.concurrent.Execution.Implicits._
import scala.concurrent.Future
/**
* Handles actions to users.
*
* @param userDAO The u... | danZzyy/SidewalkWebpage | sidewalk-webpage/app/models/services/UserServiceImpl.scala | Scala | mit | 886 |
/*
* Copyright (c) 2014-2020 by The Monix Project Developers.
* See the project homepage at: https://monix.io
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache... | alexandru/monifu | monix-reactive/shared/src/main/scala/monix/reactive/internal/consumers/FoldLeftConsumer.scala | Scala | apache-2.0 | 2,059 |
package io.muvr
import akka.actor._
import com.typesafe.config.ConfigFactory
import scala.collection.JavaConversions._
/**
* CLI application for the exercise app
*/
object MuvrApp extends App with Muvr with ProxyScaffolding {
lazy val config = {
val role = "muvr-monolith"
val clusterShardingConfig = Con... | boonhero/muvr-server | main/src/main/scala/io/muvr/MuvrApp.scala | Scala | bsd-3-clause | 785 |
package poly.collection
import cats.implicits._
import poly.collection.mut._
/**
* Represents an iterable collection that is sorted according to a specific order every time it is iterated.
* @author Tongfei Chen
* @since 0.1.0
*/
trait SortedIterable[T] extends Iterable[T] { self =>
/** Returns the order under... | ctongfei/poly-collection | core/src/main/scala/poly/collection/SortedIterable.scala | Scala | mit | 3,654 |
package io.getquill.context.sql
import io.getquill.Spec
case class Id(value: Long) extends AnyVal
trait ProductSpec extends Spec {
val context: SqlContext[_, _]
import context._
case class Product(id: Long, description: String, sku: Long)
val product = quote {
query[Product]
}
val productInsert ... | mentegy/quill | quill-sql/src/test/scala/io/getquill/context/sql/ProductSpec.scala | Scala | apache-2.0 | 846 |
package com.technophobia.substeps.domain.execution
import com.technophobia.substeps.domain._
import org.mockito.runners.MockitoJUnitRunner
import org.mockito.{Matchers, Spy, Mockito, Mock}
import org.junit.runner.RunWith
import org.junit.{Assert, Test}
import com.technophobia.substeps.domain.execution.RunResult.{Faile... | G2G3Digital/substeps-scala-core | src/test/scala/com/technophobia/substeps/domain/execution/FeatureWithMultipleScenarioTest.scala | Scala | lgpl-3.0 | 2,613 |
package com.eny.ooo.manager.connection
import javax.inject.{Inject, Named, Singleton}
import com.github.mauricio.async.db.Configuration
import com.github.mauricio.async.db.mysql.MySQLConnection
import com.github.mauricio.async.db.mysql.pool.MySQLConnectionFactory
import com.github.mauricio.async.db.pool.{ConnectionPo... | nyavro/ooo-master | dbImpl/src/main/scala/com/eny/ooo/manager/connection/DbImpl.scala | Scala | apache-2.0 | 836 |
package io.github.voidcontext.bricksetclient.client
import io.github.voidcontext.bricksetclient.api._
import scala.concurrent.Future
import scala.util.{Failure, Success}
case class InvalidCredentialsError(message: String) extends Exception(message)
class BricksetClient(val apiKey: String) {
/**
* Soap client
... | voidcontext/scala-brickset-client | src/main/scala/io/github/voidcontext/bricksetclient/client/BricksetClient.scala | Scala | mit | 2,531 |
/*
* Copyright 2013 Twitter Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License. You may obtain
* a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to... | twitter/storehaus | storehaus-dynamodb/src/main/scala/com/twitter/storehaus/dynamodb/DynamoStringStore.scala | Scala | apache-2.0 | 1,277 |
package com.challenges
/** LuhnChecker is an object with methods that apply the Luhn algorithm to determine
* whether a given string is a valid credit card number or not.
*
*/
object LuhnChecker {
/**
* Verify that a credit card number is valid by applying the Luhn algorithm.
*
* Return true if th... | obryan5598/scala-challenges | src/main/scala/com/challenges/LuhnChecker.scala | Scala | mit | 797 |
import java.io.File
import com.madgag.textmatching.{Glob, TextMatcher}
import scopt.OptionParser
import scalax.file.ImplicitConversions._
import scalax.file.Path
import scalax.file.defaultfs.DefaultPath
object BenchmarkConfig {
val parser = new OptionParser[BenchmarkConfig]("benchmark") {
opt[File]("resources-... | digitalquest/bfg-repo-cleaner | bfg-benchmark/src/main/scala/BenchmarkConfig.scala | Scala | gpl-3.0 | 2,329 |
package specmethods
class BankAccount(private var mBalance:Int) {
def deposit(amount:Int):Unit = {
require(amount>=0, "Can't make negative deposit.")
// Logging here
mBalance += amount
}
def withdraw(amount:Int):Unit = {
require(amount>=0, "Can't make negative withdrawl.")
require(amount<=mB... | conorheffron/scala-course | src/specmethods/BankAccount.scala | Scala | gpl-3.0 | 698 |
package zhongl.websockit
import org.scalatest.FunSpec
import org.scalatest.matchers.ShouldMatchers
class StubSpec extends FunSpec with ShouldMatchers {
describe("Stub DSL") {
it("should create stub with customized rules") {
val s = new Stub {
($".name" =~ "jason") >> json"2"
($".name" =~ "... | zhongl/websockit | src/test/scala/zhongl/websockit/StubSpec.scala | Scala | apache-2.0 | 1,812 |
object prob {
opaque type Probability = Double
object Probability {
def apply(n: Double): Option[Probability] =
if (0.0 <= n && n <= 1.0) Some(n) else None
def unsafe(p: Double): Probability = {
require(0.0 <= p && p <= 1.0, s"probabilities lie in [0, 1] (got $p)")
p
}
def asDou... | som-snytt/dotty | tests/pos/opaque-propability.scala | Scala | apache-2.0 | 1,250 |
package com.twitter.finatra.http.filters
import com.twitter.finagle.http.{Method => HttpMethod, Request, Response, Status}
import com.twitter.finagle.stats.{Counter, Stat, StatsReceiver}
import com.twitter.finagle.{Service, SimpleFilter}
import com.twitter.finatra.http.contexts.RouteInfo
import com.twitter.finatra.htt... | syamantm/finatra | http/src/main/scala/com/twitter/finatra/http/filters/StatsFilter.scala | Scala | apache-2.0 | 3,827 |
/*
* 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 ... | caneGuy/spark | core/src/test/scala/org/apache/spark/scheduler/DAGSchedulerSuite.scala | Scala | apache-2.0 | 132,609 |
package com.github.luzhuomi.regex.deriv
import com.github.luzhuomi.scalazparsec.NonBacktracking._
import com.github.luzhuomi.regex.pderiv.{ RE => PD, Common => PC }
import com.github.luzhuomi.regex.deriv.{ RE => D, Common => C }
import com.github.luzhuomi.regex.pderiv.ExtPattern._
import com.github.luzhuomi.regex.pder... | luzhuomi/scala-deriv | src/main/scala/com/github/luzhuomi/regex/deriv/Parse.scala | Scala | apache-2.0 | 1,248 |
package org.workcraft.gui
import javax.swing.JFileChooser
import org.workcraft.services.ModelServiceProvider
import org.workcraft.services.GlobalServiceProvider
import org.workcraft.services.GlobalServiceManager
import org.workcraft.services.ExporterService
import javax.swing.JOptionPane
import java.awt.Window
import j... | mechkg/workcraft | Gui/src/main/scala/org/workcraft/gui/SaveDialog.scala | Scala | gpl-3.0 | 4,603 |
/*
* Copyright 2015-2016 IBM Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agree... | xin-cai/openwhisk | core/controller/src/main/scala/whisk/core/controller/Rules.scala | Scala | apache-2.0 | 17,907 |
/*
* Copyright (C) 2015 47 Degrees, LLC http://47deg.com hello@47deg.com
*
* 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... | 47deg/functional-views-android | src/main/scala/com/fortysevendeg/android/functionalview/ui/main/MainBusinessLogic.scala | Scala | apache-2.0 | 1,312 |
package com.etsy.cascading
import com.twitter.scalding._
import org.specs._
class InstrumentedMapJob(args : Args) extends TracingJob(args) {
trace(Tsv("input", ('x, 'y)), Tsv("subsample"))
.mapTo(('x, 'y) -> 'z){ x : (Int, Int) => x._1 + x._2 }
.write(Tsv("output"))
}
class InstrumentedMapTest extends ... | rjhall/cascading-trace | src/test/scala/com/etsy/cascading/InputTracingTest.scala | Scala | mit | 7,876 |
package dpla.ingestion3.enrichments
import dpla.ingestion3.enrichments.normalizations.StringNormalizationUtils._
import dpla.ingestion3.enrichments.normalizations.FilterList
import org.scalatest.{BeforeAndAfter, FlatSpec}
class StringNormalizationUtilsTest extends FlatSpec with BeforeAndAfter {
// Helper objects
... | dpla/ingestion3 | src/test/scala/dpla/ingestion3/enrichments/StringNormalizationUtilsTest.scala | Scala | mit | 14,960 |
/*
* Part of NDLA learningpath-api.
* Copyright (C) 2016 NDLA
*
* See LICENSE
*
*/
package no.ndla.learningpathapi.service
import no.ndla.learningpathapi.LearningpathApiProperties.DefaultLanguage
import java.util.Date
import java.util.concurrent.Executors
import no.ndla.learningpathapi.integration.{SearchApiCl... | NDLANO/learningpath-api | src/main/scala/no/ndla/learningpathapi/service/UpdateService.scala | Scala | gpl-3.0 | 17,093 |
package com.github.andr83.parsek.pipe
import java.security.KeyPairGenerator
import javax.crypto.Cipher
import com.github.andr83.parsek._
import com.typesafe.config.ConfigFactory
import org.apache.commons.lang.RandomStringUtils
import org.scalatest.{FlatSpec, Inside, Matchers}
import scala.collection.JavaConversions.... | andr83/parsek | core/src/test/scala/com/github/andr83/parsek/pipe/DecryptRsaSpec.scala | Scala | mit | 1,684 |
package repository
import java.util.UUID
import models.{Task, User}
import org.specs2.specification.Scope
import play.api.test.PlaySpecification
import reactivemongo.api.indexes.IndexType
import reactivemongo.bson.BSONObjectID
import utils.StartedFakeApplication
class TaskRepositoryISpec extends PlaySpecification wi... | timothygordon32/reactive-todolist | it/repository/TaskRepositoryISpec.scala | Scala | mit | 3,623 |
/*
* Copyright (c) 2015 Alexandros Pappas p_alx hotmail com
*
* 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... | gnostix/freeswitch-monitoring | src/main/scala/gr/gnostix/freeswitch/actors/DialCodesActor.scala | Scala | apache-2.0 | 2,687 |
/*
* Happy Melly Teller
* Copyright (C) 2013, Happy Melly http://www.happymelly.com
*
* This file is part of the Happy Melly Teller.
*
* Happy Melly Teller 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 Foundatio... | cvogt/teller | app/controllers/Organisations.scala | Scala | gpl-3.0 | 7,112 |
/*
* Copyright 2011 Delving B.V.
*
* 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... | delving/culture-hub | modules/dos/app/processors/Processor.scala | Scala | apache-2.0 | 1,765 |
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.