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.thetestpeople.trt.webdriver
import org.junit.runner.RunWith
import com.thetestpeople.trt.model.impl.DummyData
import com.thetestpeople.trt.mother.{ IncomingFactory ⇒ F }
import com.thetestpeople.trt.tags.SlowTest
import org.scalatest.junit.JUnitRunner
import com.thetestpeople.trt.webdriver.screens.TestsScr... | thetestpeople/trt | test/com/thetestpeople/trt/webdriver/IgnoreTestTest.scala | Scala | mit | 4,342 |
package com.overviewdocs.models.tables
import com.overviewdocs.database.Slick.api._
import com.overviewdocs.models.Node
class NodesImpl(tag: Tag) extends Table[Node](tag, "node") {
def id = column[Long]("id", O.PrimaryKey)
def rootId = column[Long]("root_id")
def parentId = column[Option[Long]]("parent_id")
d... | overview/overview-server | common/src/main/scala/com/overviewdocs/models/tables/Nodes.scala | Scala | agpl-3.0 | 616 |
package info.mukel.telegrambot4s.examples
import akka.actor.{Actor, ActorRef, Props, Terminated}
import info.mukel.telegrambot4s.Implicits._
import info.mukel.telegrambot4s.actors.ActorBroker
import info.mukel.telegrambot4s.api.{AkkaDefaults, Commands, Polling}
import info.mukel.telegrambot4s.methods.SendMessage
impor... | hugemane/telegrambot4s | src/test/scala/info/mukel/telegrambot4s/examples/PerChatRequestsBot.scala | Scala | apache-2.0 | 1,691 |
object test1:
trait Trait
trait Managed[T](x: T) {
def flatMap(f: T => Managed[T]): Managed[T] = new Managed[T](x) {
def make() = new Trait {
val t: T = x
val u =
try {
f(t)
} catch {
case e: Exception => ()
}
}
}
}
obj... | dotty-staging/dotty | tests/run/i8931.scala | Scala | apache-2.0 | 1,057 |
import sbt._
import Keys._
object MetamorphicSlickH2Build extends Build {
val thisV = "0.0-SNAPSHOT"
val metamorphicV = "0.0-SNAPSHOT"
val paradiseV = "2.1.0-M5"
val h2V = "1.3.170"
lazy val h2CompileDependencies = Seq(
"com.h2database" % "h2" % h2V
)
lazy val baseSettings = Seq(
scalaV... | frroliveira/metamorphic | metamorphic-slick/h2/project/Build.scala | Scala | mit | 1,372 |
package slate.app
import akka.actor.ActorSystem
import akka.event.{Logging, LoggingAdapter}
import akka.http.scaladsl.{Http}
import akka.http.scaladsl.model._
import akka.http.scaladsl.server.{Directives, Route}
import akka.stream.ActorMaterializer
import slate.common.{AppSupport, About, Config}
import scala.concurre... | kishorereddy/akka-http | src/main/scala/slate/app/WebApp.scala | Scala | mit | 6,256 |
/*
* 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
* distribut... | copygrinder/copygrinder_server | src/main/scala/org/copygrinder/pure/copybean/persistence/JsonReadUtils.scala | Scala | apache-2.0 | 4,302 |
/**
* 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... | stealthly/kafka | core/src/main/scala/kafka/utils/CommandLineUtils.scala | Scala | apache-2.0 | 2,194 |
/**
* Copyright 2015 Thomson Reuters
*
* Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or ag... | thomsonreuters/CM-Well | tools/export-neptune-tool/src/main/scala/cmwell/tools/neptune/export/ExportToNeptuneManager.scala | Scala | apache-2.0 | 13,581 |
package spire
package algebra
// scalatest
import org.scalatest.FunSuite
// we need to disable our own === to avoid messing up ScalaTest.
import spire.math.{Rational, Algebraic, Complex}
import spire.implicits.{eqOps => _, _}
// nice alias
import java.math.MathContext
class SignedTest extends FunSuite {
def ru... | rklaehn/spire | tests/src/test/scala/spire/algebra/SignedTest.scala | Scala | mit | 2,221 |
package loaders
import java.awt.image.BufferedImage
import java.io.{InputStream, ByteArrayInputStream}
import java.net.URI
import java.util.zip.GZIPInputStream
import javax.imageio.ImageIO
import loaders.VOCLoader._
import org.apache.commons.compress.archivers.ArchiveStreamFactory
import org.apache.commons.compress.a... | o0neup/keystone | src/main/scala/loaders/ImageLoaderUtils.scala | Scala | apache-2.0 | 3,337 |
object test {
final class HKTVar[+T[_]]
def foo[F[_], G[_], X](m : HKTVar[G]) = m match {
case _ : HKTVar[F] =>
val fx : F[X] = ???
val gx : G[X] = fx
}
}
| dotty-staging/dotty | tests/pos/gadt-hkt-ordering.scala | Scala | apache-2.0 | 178 |
package org.epl_lang.bytecode
import org.epl_lang.bytecode.util.TypeBound.TypeBound
import org.epl_lang.bytecode.util.TypeVariance.TypeVariance
import org.epl_lang.bytecode.util.Visitor
/**
* TypeParameterVisitor
*
* A representation of a visitor which visits generic type parameters.
*
* A type parameter co... | epl-lang/epl-compiler | src/main/scala/org/epl_lang/bytecode/TypeParameterVisitor.scala | Scala | apache-2.0 | 2,066 |
package works.weave.socks.aws.orders.dataaccess.dynamo
import com.amazonaws.services.dynamodbv2.model.AttributeValue
import com.amazonaws.services.dynamodbv2.model.GetItemResult
import com.amazonaws.services.dynamodbv2.model.QueryRequest
import java.time.LocalDateTime
import java.util.UUID
import org.springframework.s... | Compositional/orders-aws | src/main/scala/works.weave.socks.aws.orders/dataaccess/dynamo/DynamoOrderRepository.scala | Scala | apache-2.0 | 2,961 |
/**
* Copyright (C) 2016 Orbeon, Inc.
*
* This program is free software; you can redistribute it and/or modify it under the terms of the
* GNU Lesser General Public License as published by the Free Software Foundation; either version
* 2.1 of the License, or (at your option) any later version.
*
* This program i... | orbeon/orbeon-forms | form-runner/jvm/src/main/scala/org/orbeon/oxf/fr/persistence/relational/Provider.scala | Scala | lgpl-2.1 | 9,300 |
/*
* projections.scala
*
*/
package at.logic.gapt.proofs.ceres
import at.logic.gapt.expr._
import at.logic.gapt.proofs._
import at.logic.gapt.proofs.ceres.Pickrule._
import at.logic.gapt.proofs.lk._
object Projections {
// This method computes the standard projections according to the original CERES definition... | gebner/gapt | core/src/main/scala/at/logic/gapt/proofs/ceres/projections.scala | Scala | gpl-3.0 | 16,584 |
package com.javachen.spark.examples.mllib
import java.util.Random
import org.apache.spark.mllib.recommendation.{ALS, MatrixFactorizationModel, Rating}
import org.apache.spark.rdd._
import org.apache.spark.{SparkConf, SparkContext}
/**
* see:https://github.com/mohit-shrma/RandomSamples/blob/d9f1117bc21bb09d9fa858bc6... | javachen/learning-spark | src/main/scala/com/javachen/spark/examples/mllib/ScalaMovieLensALS.scala | Scala | apache-2.0 | 6,853 |
/*
* Copyright 2015 Netflix, 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 t... | rspieldenner/atlas | atlas-core/src/test/scala/com/netflix/atlas/core/stacklang/MapSuite.scala | Scala | apache-2.0 | 1,021 |
package io.fintrospect.configuration
/**
* Simple username/password used for Basic Authentication
*/
case class Credentials(username: String, password: String)
| daviddenton/fintrospect | core/src/main/scala/io/fintrospect/configuration/Credentials.scala | Scala | apache-2.0 | 165 |
package components
import cassandra.{CassandraConnector, CassandraConnectionUri}
import com.datastax.driver.core.Session
import models.ProductModel
import play.api.inject.ApplicationLifecycle
import play.api.{Configuration, Environment, Mode}
import repositories.{Repository, ProductsRepository}
import scala.concurrent... | manuelkiessling/play2-compiletime-cassandra-di | app/components/CassandraRepositoryComponents.scala | Scala | mit | 1,862 |
package scalaz.stream.mongodb.update
import com.mongodb.DBObject
trait FindAndModifySyntax {
def updateOne(ps: UpdatePair*): FindAndModifyAction = FindAndModifyAction(PairSimpleUpdate(ps))
def updateOne(o: DBObject): FindAndModifyAction = FindAndModifyAction(ReplaceDocument(o))
def removeOne: FindAndRemove... | Spinoco/scalaz-stream-mongodb | core/src/main/scala/scalaz/stream/mongodb/update/FindAndModifySyntax.scala | Scala | mit | 354 |
/*
* 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/enhancement/KnightOfTheChalice.scala | Scala | apache-2.0 | 762 |
package filodb.coordinator
import akka.actor._
import akka.cluster.Cluster
import akka.cluster.ClusterEvent._
import akka.event.LoggingReceive
import scala.collection.mutable.HashMap
import scala.concurrent.duration._
import filodb.core.ErrorResponse
object NodeClusterActor {
// Forwards message to one random reci... | markhamstra/FiloDB | coordinator/src/main/scala/filodb.coordinator/NodeClusterActor.scala | Scala | apache-2.0 | 5,562 |
package reactivemongo.api.commands
import reactivemongo.api.{ PackSupport, SerializationPack }
trait UpsertedFactory[P <: SerializationPack] {
_self: PackSupport[P] =>
/** An upserted element */
final class Upserted private (
_index: Int,
__id: pack.Value) {
/** The index of the upserted element *... | ReactiveMongo/ReactiveMongo | driver/src/main/scala/api/commands/UpsertedFactory.scala | Scala | apache-2.0 | 1,511 |
/*
* 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 | connector/src/main/scala/quasar/connector/datasource/LightweightDatasource.scala | Scala | apache-2.0 | 912 |
package com.owtelse
/**
* Created by IntelliJ IDEA.
* User: robertk
*/
object MyMain {
def main(args:Array[String]) {
System.out.println("hello World out again");
}
} | karlroberts/splat2 | src/main/scala/com/owtelse/MyMain.scala | Scala | bsd-3-clause | 180 |
package jp.seraphr.fileupload.dispatch
import scala.scalajs.js
import scala.scalajs.js.annotation.JSName
class FluxDispatcher[T] extends Dispatcher[T] {
import FluxDispatcher._
private[this] val mCore = new JsFluxDispatcher()
override def dispatch(message: T): Unit = mCore.dispatch(message)
override def reg... | seraphr/scalatra-reactjs-fileupload | client-view/src/main/scala/jp/seraphr/fileupload/dispatch/FluxDispatcher.scala | Scala | bsd-2-clause | 861 |
package distopt.logistic.LbfgsTest
// spark-core
import org.apache.spark.SparkContext
import org.apache.spark.SparkContext._
import org.apache.spark.rdd._
import org.apache.spark.broadcast._
// breeze
import breeze.linalg._
import breeze.numerics._
// scala data structure
import scala.collection.mutable.Queue
/**
* ... | wangshusen/SparkGiant | src/main/scala/logistic/LbfgsTest.scala | Scala | mit | 11,431 |
package com.trueaccord.scalapb
import com.trueaccord.scalapb.textformat.{AstUtils, Printer, ProtoAsciiParser}
import fastparse.core.{ParseError, Parsed}
case class TextFormatError(msg: String)
class TextFormatException(msg: String) extends RuntimeException(msg)
object TextFormat {
private def indexToLineCol(input... | eiennohito/ScalaPB | scalapb-runtime/shared/src/main/scala/com/trueaccord/scalapb/TextFormat.scala | Scala | apache-2.0 | 1,376 |
import _root_.io.gatling.core.scenario.Simulation
import ch.qos.logback.classic.{Level, LoggerContext}
import io.gatling.core.Predef._
import io.gatling.http.Predef._
import org.slf4j.LoggerFactory
import scala.concurrent.duration._
/**
* Performance test for the SshKey entity.
*/
class SshKeyGatlingTest extends Si... | javicacheiro/hadoop-on-demand-rest-jhipster | src/test/gatling/simulations/SshKeyGatlingTest.scala | Scala | mit | 3,288 |
/*
* 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... | wangyixiaohuihui/spark2-annotation | resource-managers/yarn/src/test/scala/org/apache/spark/network/shuffle/ShuffleTestAccessor.scala | Scala | apache-2.0 | 2,533 |
package scalacookbook.chapter04
/**
* 你想为类定义一个equals方法,因此你能够比较对象实例。
*
* Created by liguodong on 2016/7/3.
*/
object DefineEqualMethod extends App{
import section15._
// these first two instances should be equal
val nimoy = new Person("Leonard Nimoy", 82)
val nimoy2 = new Person("Leonard Nimoy", 82)
val... | liguodongIOT/java-scala-mix-sbt | src/main/scala/scalacookbook/chapter04/DefineEqualMethod.scala | Scala | apache-2.0 | 2,403 |
package com.artclod.mathml.scalar
import org.junit.runner.RunWith
import org.scalatestplus.play._
import play.api.test.Helpers._
import org.junit.runner.RunWith
import play.api.test._
import play.api.test.Helpers._
import com.artclod.mathml._
import com.artclod.mathml.scalar._
import org.scalatest.junit.JUnitRunner
c... | kristiankime/calc-tutor | test/com/artclod/mathml/scalar/FSpec.scala | Scala | mit | 485 |
package notebook.front.third
import io.continuum.bokeh.{Glyph, Widget => BWidget, _}
import notebook._
import notebook.front._
import play.api.libs.json._
/**
* Created by gerrit on 15.11.14.
*/
class LowLevelBokeh[A](data: Seq[A], plottingScript: String)
(override implicit val singleCodec: Codec[JsValue, A])
... | radek1st/spark-notebook | modules/common/src/main/scala/notebook/front/third/Bokeh.scala | Scala | apache-2.0 | 5,025 |
package com.datastax.spark.connector.cql
import com.datastax.spark.connector._
import com.datastax.spark.connector.mapper.ColumnMapper
import org.apache.spark.Logging
import scala.collection.JavaConversions._
import scala.language.existentials
import com.datastax.driver.core.{ColumnMetadata, Metadata, TableMetadata, ... | nvoron23/spark-cassandra-connector | spark-cassandra-connector/src/main/scala/com/datastax/spark/connector/cql/Schema.scala | Scala | apache-2.0 | 7,281 |
/*
* 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... | intel-analytics/BigDL | scala/dllib/src/main/scala/com/intel/analytics/bigdl/dllib/nn/Square.scala | Scala | apache-2.0 | 1,089 |
/*
* Copyright (C) Lightbend Inc. <https://www.lightbend.com>
*/
package com.lightbend.lagom.internal.javadsl.pubsub
import akka.actor.ActorSystem
import akka.cluster.pubsub.DistributedPubSub
import com.typesafe.config.Config
import javax.inject.Inject
import javax.inject.Singleton
import com.lightbend.lagom.javad... | lagom/lagom | pubsub/javadsl/src/main/scala/com/lightbend/lagom/internal/javadsl/pubsub/PubSubRegistryImpl.scala | Scala | apache-2.0 | 924 |
/*
* ____ ____ _____ ____ ___ ____
* | _ \\ | _ \\ | ____| / ___| / _/ / ___| Precog (R)
* | |_) | | |_) | | _| | | | | /| | | _ Advanced Analytics Engine for NoSQL Data
* | __/ | _ < | |___ | |___ |/ _| | | |_| | Copyright (C) 2010 - 2013 SlamData, In... | precog/platform | mimir/src/test/scala/com/precog/mimir/FullStdLibModule.scala | Scala | agpl-3.0 | 1,322 |
/*
* 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 ... | bwsw/cs-vault-server | src/test/scala/com/bwsw/cloudstack/vault/server/MockConfig.scala | Scala | apache-2.0 | 1,945 |
package pt1.week4
import breeze.linalg.DenseMatrix
import common.Propagation
import scala.math.{exp, sqrt}
object SharePriceLattice {
def generate(initialPrice: Double, termInYears: Double, volatility: Double,
numberOfPeriods: Int, interestRate: Double, dividendYield: Double): DenseMatrix[Double] =... | ligasgr/fe-and-rm | src/main/scala/pt1/week4/SharePriceLattice.scala | Scala | apache-2.0 | 522 |
package org.jetbrains.plugins.scala
package annotator
package template
import com.intellij.codeInsight.intention.IntentionAction
import com.intellij.codeInspection.ProblemHighlightType
import com.intellij.lang.annotation.AnnotationHolder
import com.intellij.openapi.editor.Editor
import com.intellij.openapi.project.Pro... | ilinum/intellij-scala | src/org/jetbrains/plugins/scala/annotator/template/CaseClassWithoutParamList.scala | Scala | apache-2.0 | 3,330 |
/*
* chocola library
*
* Copyright (C) 2013 hanny
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the “Software”), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify... | hanny24/chocola | src/test/scala/com/chocola/constraints/LinearExprTest.scala | Scala | mit | 4,373 |
/**
* Copyright (C) 2012 Orbeon, Inc.
*
* This program is free software; you can redistribute it and/or modify it under the terms of the
* GNU Lesser General Public License as published by the Free Software Foundation; either version
* 2.1 of the License, or (at your option) any later version.
*
* This prog... | ajw625/orbeon-forms | src/main/scala/org/orbeon/oxf/xforms/analytics/RequestStats.scala | Scala | lgpl-2.1 | 3,395 |
// Copyright (C) 2019 MapRoulette contributors (see CONTRIBUTORS.md).
// Licensed under the Apache License, Version 2.0 (see LICENSE).
package org.maproulette.controllers.api
import javax.inject.Inject
import org.maproulette.Config
import org.maproulette.data.ActionManager
import org.maproulette.models.dal._
import or... | Crashfreak/maproulette2 | app/org/maproulette/controllers/api/TaskReviewController.scala | Scala | apache-2.0 | 13,604 |
package com.github.ghik.silencer
import java.util.regex.PatternSyntaxException
import scala.collection.mutable
import scala.collection.mutable.ListBuffer
import scala.reflect.internal.util.Position
import scala.reflect.io.AbstractFile
import scala.tools.nsc.plugins.{Plugin, PluginComponent}
import scala.tools.nsc.{Gl... | ghik/silencer | silencer-plugin/src/main/scala/com/github/ghik/silencer/SilencerPlugin.scala | Scala | apache-2.0 | 9,395 |
package com.michalrus.nofatty
import org.parboiled.errors.ErrorUtils
import org.parboiled.scala._
object Calculator extends Parser {
final case class Error(msg: String)
def apply(expression: String): Either[Error, Double] = {
val result = ReportingParseRunner(Input).run(expression)
result.result match {... | michalrus/nofatty | src/main/scala/com/michalrus/nofatty/Calculator.scala | Scala | apache-2.0 | 1,446 |
package ml.sparkling.graph
import com.typesafe.sbt._
import sbt.Keys._
import sbt._
object Publish extends AutoPlugin {
override lazy val projectSettings = Seq(
SbtGit.GitKeys.useGitDescribe := true,
licenses := Seq("BSD 2-Clause" -> url("http://opensource.org/licenses/BSD-2-Clause")),
homepage := Some... | sparkling-graph/sparkling-graph | project/Publish.scala | Scala | bsd-2-clause | 694 |
import sbt._, Keys._
object Publish {
val settings = Seq[Setting[_]](
publishMavenStyle := true,
publishTo := {
if (isSnapshot.value)
Some(Opts.resolver.sonatypeSnapshots)
else
Some(Opts.resolver.sonatypeStaging)
},
licenses := Seq(
"Apache License, Version 2.0" -> u... | kxbmap/lombok-java8-extensions | project/Publish.scala | Scala | apache-2.0 | 995 |
/*
* Copyright 2017 Simeon Simeonov and Swoop, 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 applicab... | swoop-inc/spark-records | src/main/scala/com/swoop/spark/records/DriverContext.scala | Scala | apache-2.0 | 2,383 |
package db
import anorm.SqlParser._
import anorm._
import models.{CruitedProduct, Price}
import play.api.Logger
import play.api.Play.current
import play.api.db.DB
import services.GlobalConfig
object CruitedProductDto {
private val commonClause = "price_currency_code = '" + GlobalConfig.paymentCurrencyCode + "'"
... | PanzerKunst/redesigned-cruited.com-frontend | website/app/db/CruitedProductDto.scala | Scala | gpl-3.0 | 3,414 |
/*
*
* Copyright 2014 David Hall
*
* Licensed under the Apache License, Version 2.0 (the "License")
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed ... | chen0031/breeze | benchmark/src/main/scala/breeze/linalg/SparseVectorBenchmark.scala | Scala | apache-2.0 | 2,056 |
/*
* 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/LSTMPeephole.scala | Scala | apache-2.0 | 6,490 |
/*
* Copyright 2018 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/worldpay-downloader | app/Module.scala | Scala | apache-2.0 | 1,648 |
package au.com.agiledigital.toolform.reader
import java.io.File
import au.com.agiledigital.toolform.model.Project
import org.scalatest.EitherValues._
import org.scalatest.Inside.inside
import org.scalatest._
class ProjectReaderTest extends FlatSpec with Matchers {
val testFile = pathToFile("/testprojects/ins... | agiledigital/toolform | src/test/scala/au/com/agiledigital/toolform/reader/ProjectReaderTest.scala | Scala | apache-2.0 | 1,856 |
//package com.github.sorhus.webalytics.cruft.batch
//
//import java.io._
//import java.nio.MappedByteBuffer
//import java.nio.channels.FileChannel.MapMode
//import java.util.UUID
//import java.util.concurrent.TimeUnit
//
//import akka.actor.{ActorRef, ActorSystem}
//import com.github.sorhus.webalytics.akka.model._
//im... | sorhus/webalytics | service/src/main/scala/com/github/sorhus/webalytics/cruft/batch/BitsetLoader.scala | Scala | gpl-3.0 | 7,471 |
package com.github.frankivo
import utest.{ArrowAssert, TestSuite, Tests, test}
object TestWordCount extends TestSuite {
def getText(filename: String): String = {
val s = scala.io.Source.fromFile("src/test/resources/" + filename)
val lines = s.getLines.mkString(" ")
s.close
lines
}
v... | frankivo/dailyprogrammer | perl81/src/test/scala/com/github/frankivo/TestWordCount.scala | Scala | gpl-3.0 | 974 |
package mesosphere.marathon
package raml
import mesosphere.UnitTest
import mesosphere.marathon.test.MarathonTestHelper
import mesosphere.mesos.protos.{ScalarResource, TextAttribute}
import org.apache.mesos.{Protos => Mesos}
class OfferConversionTest extends UnitTest {
"OfferConversion" should {
"A scala value i... | mesosphere/marathon | src/test/scala/mesosphere/marathon/raml/OfferConversionTest.scala | Scala | apache-2.0 | 2,559 |
//
// Game Gardens - a platform for hosting simple multiplayer Java games
// Copyright (c) 2005-2013, Three Rings Design, Inc. - All rights reserved.
// https://github.com/threerings/game-gardens/blob/master/LICENSE
package com.threerings.gardens.user
import react.RFuture
import com.samskivert.depot.PersistenceConte... | threerings/game-gardens | server/src/main/scala/com/threerings/gardens/user/UserManager.scala | Scala | bsd-3-clause | 1,381 |
/* *\\
** Squants **
** **
** Scala Quantities and Units of Measure Library and DSL **
** (c) 2013-2015, G... | derekmorr/squants | shared/src/main/scala/squants/space/SolidAngle.scala | Scala | apache-2.0 | 2,136 |
/*
* 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 ... | hortonworks-spark/cloud-integration | cloud-examples/src/main/scala/com/cloudera/spark/cloud/s3/S3ATestSetup.scala | Scala | apache-2.0 | 2,670 |
package models.json
import play.api.libs.json.{JsNull, JsValue}
case class ErrorResponse(message: String, details: JsValue = JsNull)
| moatra/stagert | app/models/json/ErrorResponse.scala | Scala | mit | 135 |
package com.vivint.ceph
import scala.concurrent.ExecutionContext
object SameThreadExecutionContext extends ExecutionContext {
def execute(r: Runnable): Unit =
r.run()
override def reportFailure(t: Throwable): Unit =
throw new IllegalStateException("problem in internal callback", t)
}
| vivint-smarthome/ceph-on-mesos | src/main/scala/com/vivint/ceph/SameThreadExecutionContext.scala | Scala | apache-2.0 | 299 |
/*
* 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/ui/UISeleniumSuite.scala | Scala | apache-2.0 | 31,935 |
package io.continuum.bokeh
package sampledata
package iris
object Flowers extends CSVSampleData {
def load(): FlowersData = {
val List(sepal_length, sepal_width, petal_length, petal_width, species) = loadRows("iris.csv").transpose
FlowersData(petal_length.map(_.toDouble),
petal_... | bokeh/bokeh-scala | sampledata/src/main/scala/Iris.scala | Scala | mit | 657 |
/*
* 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 ... | shuangshuangwang/spark | sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/codegen/CodeBlockSuite.scala | Scala | apache-2.0 | 7,247 |
/*
* Copyright (C) 2009-2017 Lightbend Inc. <https://www.lightbend.com>
*/
package play.api.cache
import play.api.mvc.{ Result, Results }
import play.api.test._
class SerializableResultSpec extends PlaySpecification {
sequential
"SerializableResult" should {
def serializeAndDeserialize(result: Result): R... | Shruti9520/playframework | framework/src/play-ehcache/src/test/scala/play/api/cache/SerializableResultSpec.scala | Scala | apache-2.0 | 1,685 |
/*
* 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... | kevinwright/scalatest | src/test/scala/org/scalatest/PrivateMethodTesterSpec.scala | Scala | apache-2.0 | 3,415 |
/*
* 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 ... | yelshater/hadoop-2.3.0 | spark-core_2.10-1.0.0-cdh5.1.0/src/main/scala/org/apache/spark/SparkSaslClient.scala | Scala | apache-2.0 | 5,039 |
package com.imaginea.activegrid.core.models
import com.typesafe.scalalogging.Logger
import org.neo4j.graphdb.Node
import org.slf4j.LoggerFactory
/**
* Created by shareefn on 7/10/16.
*/
case class KeyValueInfo(override val id: Option[Long], key: String, value: String) extends BaseEntity
object KeyValueInfo {
... | eklavya/activeGrid | src/main/scala/com/imaginea/activegrid/core/models/KeyValueInfo.scala | Scala | apache-2.0 | 1,373 |
package io.fintrospect.parameters
import com.twitter.finagle.http.Request
import io.fintrospect.util.ExtractionError.Missing
import io.fintrospect.util.{Extracted, ExtractionFailed}
import org.scalatest.{FunSpec, Matchers}
class ExtractedRouteRequestTest extends FunSpec with Matchers {
describe("ExtractedRouteRe... | daviddenton/fintrospect | core/src/test/scala/io/fintrospect/parameters/ExtractedRouteRequestTest.scala | Scala | apache-2.0 | 963 |
package at.logic.gapt.proofs.resolution
import at.logic.gapt.expr._
import at.logic.gapt.expr.fol.FOLSubstitution
import at.logic.gapt.formats.prover9.Prover9TermParserLadrStyle.parseFormula
import at.logic.gapt.proofs._
import at.logic.gapt.provers.prover9.Prover9
import org.specs2.mutable._
class FixDerivationTest ... | loewenheim/gapt | src/test/scala/at/logic/gapt/proofs/resolution/fixDerivationTest.scala | Scala | gpl-3.0 | 5,460 |
/*
* 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 ... | zzcclp/carbondata | integration/spark/src/main/scala/org/apache/spark/sql/execution/command/management/CarbonCleanFilesCommand.scala | Scala | apache-2.0 | 4,723 |
package net.sansa_stack.rdf.common.partition.core
import java.time.format.DateTimeFormatter
import net.sansa_stack.rdf.common.partition.layout.{TripleLayout, TripleLayoutBoolean, TripleLayoutDecimal, TripleLayoutDouble, TripleLayoutFloat, TripleLayoutLong, TripleLayoutString, TripleLayoutStringDate, TripleLayoutStri... | SANSA-Stack/SANSA-RDF | sansa-rdf/sansa-rdf-common/src/main/scala/net/sansa_stack/rdf/common/partition/core/RdfPartitionerComplex.scala | Scala | apache-2.0 | 2,983 |
package ohnosequencesBundles.statika
import ohnosequences.statika._, bundles._, instructions._
case object git extends Bundle() {
def install: Results = {
Seq("yum", "install", "-y", "git") ->-
success(s"${bundleName} is installed")
}
def clone(repo: String, dir: String = ""): Results =
Seq("git"... | ohnosequences-bundles/git | src/main/scala/git.scala | Scala | agpl-3.0 | 382 |
package com.getjenny.starchat.analyzer.atoms
import com.getjenny.analyzer.atoms
import com.getjenny.analyzer.atoms.{AbstractAtomic, ExceptionAtomic}
import com.getjenny.analyzer.entities.{AnalyzersDataInternal, Result, StateVariables}
import org.apache.tika.langdetect.OptimaizeLangDetector
import org.apache.tika.langu... | GetJenny/starchat | src/main/scala/com/getjenny/starchat/analyzer/atoms/LanguageGuesserAtomic.scala | Scala | gpl-2.0 | 2,155 |
package com.rouesnel.typedsql.examples
import com.rouesnel.typedsql.{DataSource, SqlQuery}
@SqlQuery
object ExplodeExample {
def query() =
"""
SELECT EXPLODE(MAP("v", 1, "k", 2))
"""
}
| laurencer/typedsql | examples/src/main/scala/com/rouesnel/typedsql/examples/ExplodeExample.scala | Scala | apache-2.0 | 204 |
package com.twitter.finagle.loadbalancer.aperture
/**
* Ring allows us to map indices uniformly across a ring topology. An index
* can be queried via the `apply` method. Given a position on the ring, various
* [[Iterator Iterators]] are available that traverse the ring. These traversals
* are useful to derive an o... | koshelev/finagle | finagle-core/src/main/scala/com/twitter/finagle/loadbalancer/aperture/Ring.scala | Scala | apache-2.0 | 3,118 |
package controllers.localdb
import anorm._
import play.api.db.DB
import play.api.Play.current // to get Application for DB access
object SQLLocalDatabase extends LocalDatabase {
def fetchThreadKeyFromDatNumber(datNumber: Long): Option[Array[Byte]] = {
val threadKeyList = DB.withConnection {
implicit c ⇒
... | windymelt/p2p2ch | app/controllers/localdb/SQLLocalDatabase.scala | Scala | bsd-3-clause | 3,005 |
package com.esri.spark
import org.apache.spark.{SparkConf, SparkContext}
import org.scalatest.{BeforeAndAfterAll, FunSuite}
/**
*/
class StatSuite extends FunSuite with BeforeAndAfterAll {
@transient var sc: SparkContext = _
override def beforeAll() {
super.beforeAll()
val conf = new SparkConf()
... | mraad/spark-stat | src/test/scala/com/esri/spark/StatSuite.scala | Scala | apache-2.0 | 1,168 |
/*
* Copyright (C) 2005, The OpenURP Software.
*
* 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 3 of the License, or
* (at your option) any later version.
*
* This... | openurp/api | edu/src/main/scala/org/openurp/edu/course/model/SyllabusStatus.scala | Scala | lgpl-3.0 | 1,097 |
package scala.meta
package internal
package prettyprinters
import scala.meta.prettyprinters._
import Show.{ sequence => s, repeat => r, indent => i, newline => n }
import scala.meta.tokens._
object TokensSyntax {
def apply[T <: Tokens](dialect: Dialect, options: Options): Syntax[T] = {
Syntax { xs => r(xs.toLis... | Dveim/scalameta | scalameta/tokens/src/main/scala/scala/meta/internal/prettyprinters/TokensSyntax.scala | Scala | bsd-3-clause | 396 |
package so.modernized.whip.testing
import java.io.{BufferedWriter, File, FileWriter}
import java.net.URL
import cc.factorie.app.nlp.lexicon.{LexiconsProvider, StaticLexicons}
import cc.factorie.app.nlp.load.{BILOUChunkDomain, BILOUChunkTag, LoadConll2003}
import cc.factorie.app.nlp.ner._
import cc.factorie.app.nlp.se... | JackSullivan/whip | src/main/scala/so/modernized/whip/testing/Runagate.scala | Scala | apache-2.0 | 29,504 |
package org.jetbrains.plugins.scala
package lang
package psi
package impl
package toplevel
package templates
import api.base.types.ScSelfTypeElement
import api.statements.{ScDeclaredElementsHolder, ScFunction, ScTypeAlias}
import com.intellij.lang.ASTNode
import org.jetbrains.plugins.scala.lang.psi.api.toplevel.templa... | consulo/consulo-scala | src/org/jetbrains/plugins/scala/lang/psi/impl/toplevel/templates/ScTemplateBodyImpl.scala | Scala | apache-2.0 | 3,119 |
/* __ *\
** ________ ___ / / ___ Scala API **
** / __/ __// _ | / / / _ | (c) 2003-2013, LAMP/EPFL **
** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\___/_/ |_/... | felixmulder/scala | src/library/scala/concurrent/impl/ExecutionContextImpl.scala | Scala | bsd-3-clause | 8,905 |
package com.mesosphere.universe.bijection
import com.mesosphere.universe
import io.lemonlabs.uri.Uri
import com.twitter.bijection.Bijection
import com.twitter.bijection.Conversion
import com.twitter.bijection.Conversion.asMethod
import com.twitter.bijection.Injection
import scala.util.Failure
import scala.util.Success... | dcos/cosmos | cosmos-common/src/main/scala/com/mesosphere/universe/bijection/UniverseConversions.scala | Scala | apache-2.0 | 17,682 |
package com.github.tminglei.slickpg
package array
import slick.ast.TypedType
import slick.ast.Library.{SqlFunction, SqlOperator}
import slick.lifted.ExtensionMethods
import slick.jdbc.{JdbcType, JdbcTypesComponent, PostgresProfile}
trait PgArrayExtensions extends JdbcTypesComponent { driver: PostgresProfile =>
impo... | TimothyKlim/slick-pg | core/src/main/scala/com/github/tminglei/slickpg/array/PgArrayExtensions.scala | Scala | bsd-2-clause | 2,399 |
package aima.core.environment.map2d
import org.specs2.mutable.Specification
/**
* @author Shawn Garner
*/
class LabeledGraphSpec extends Specification {
"add vertex" in {
val graph = new LabeledGraph[Int, (Int, Int)]
graph.vertexLabels must beEmpty
graph.addVertex(2)
graph.vertexLabels must h... | aimacode/aima-scala | core/src/test/scala/aima/core/environment/map2d/LabeledGraphSpec.scala | Scala | mit | 2,030 |
/* Copyright (c) 2015 Andrée Ekroth.
* Distributed under the MIT License (MIT).
* See accompanying file LICENSE or copy at
* http://opensource.org/licenses/MIT
*/
package com.github.ekroth
package songkick
trait Songkick {
val SongkickAPI: Commands with Extensions = new Commands with Extensions
}
| ekroth/play-songkick | src/main/scala/com/github/ekroth/songkick/Songkick.scala | Scala | mit | 307 |
package com.sksamuel.scapegoat
import scala.reflect.internal.util.Position
import scala.tools.nsc.Global
/**
* @author
* Stephen Samuel
*/
abstract class Inspection(
val text: String,
val defaultLevel: Level,
val description: String,
val explanation: String
) {
val self: Inspection = this
def inspe... | sksamuel/scapegoat | src/main/scala/com/sksamuel/scapegoat/Inspection.scala | Scala | apache-2.0 | 4,580 |
package org.scalajs.core.compiler.test
import org.scalajs.core.compiler.test.util._
import org.junit.Test
import org.junit.Ignore
// scalastyle:off line.size.limit
class JSInteropTest extends DirectTest with TestHelpers {
override def preamble: String =
"""import scala.scalajs.js
"""
@Test
def noInn... | jmnarloch/scala-js | compiler/src/test/scala/org/scalajs/core/compiler/test/JSInteropTest.scala | Scala | bsd-3-clause | 10,417 |
import java.io.File
package object systemTestingDSL {
val NEW_LINE = "\\n"
val SPACE = " "
val DEFAULT_TEST_OUTPUT_SEPARATOR = ","
val MATCHER_OLD = "O"
val MATCHER_NEW = "N"
val DOT = "."
val SCRIPT_EXTENSION = "sh"
val REDIRECTION_OPERATOR = ">"
val SCRIPT_PRELUDE = "#!/bin/bash"
} | rohitmukherjee/High-Performance-DSLs | src/main/scala/systemTestingDSL/package.scala | Scala | mit | 303 |
package io.waylay.influxdb
import java.time.Instant
/**
* Influx related models
*/
object Influx {
type Version = String
sealed trait IFieldValue
case class IInteger(value: Long) extends IFieldValue
case class IFloat(value: Double) extends IFieldValue
case class IBoolean(value: Boolean) extends IF... | waylayio/influxdb-scala | src/main/scala/io/waylay/influxdb/Influx.scala | Scala | mit | 1,840 |
package org.dyne.danielsan.openblockchain.client
import org.dyne.danielsan.openblockchain.UnitTest
import org.json4s.jackson.JsonMethods._
import org.json4s.{DefaultFormats, _}
/**
* Created by dan_mi_sun on 10/03/2016.
*/
class BitcoinClientTest extends UnitTest {
implicit val formats = DefaultFormats
desc... | open-blockchain/scanner | src/test/scala/org/dyne/danielsan/openblockchain/client/BitcoinClientTest.scala | Scala | agpl-3.0 | 2,348 |
package com.atomist.rug.kind.python3
object Python3ParserTest {
val simplestDotPy =
"""import os
|import sys
""".stripMargin
val simplestDotPyWithInitialNewLine =
"""
|import os
|import sys
""".stripMargin
val setupDotPy =
"""
|import os
|import sys
|try... | atomist/rug | src/test/scala/com/atomist/rug/kind/python3/Python3ParserTest.scala | Scala | gpl-3.0 | 1,641 |
package com.twitter.finagle.memcached.unit.protocol.text.client
import org.junit.runner.RunWith
import org.scalatest.FunSuite
import org.scalatest.junit.JUnitRunner
import org.scalatest.mock.MockitoSugar
import com.twitter.finagle.memcached.protocol.text.client.Decoder
import com.twitter.finagle.memcached.protocol.te... | sveinnfannar/finagle | finagle-memcached/src/test/scala/com/twitter/finagle/memcached/unit/protocol/text/client/DecoderTest.scala | Scala | apache-2.0 | 3,422 |
/**
* Copyright 2016, deepsense.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 applicable law or agreed ... | deepsense-io/seahorse-workflow-executor | sparkutils1.6.1/src/main/scala/io/deepsense/sparkutils/readwritedataframe/DeepsenseDefaultSource.scala | Scala | apache-2.0 | 5,470 |
object Problem {
def main(args: Array[String]) {
val start = System.currentTimeMillis
val champernownesConstant = 0 + (1 to 1000000).mkString
println((0 to 6).map(x => champernownesConstant(scala.math.pow(10, x).toInt).toInt - '0').product)
val stop = System.currentTimeMillis
println("Time taken: ... | Jiri-Kremser/euler | 040/Problem.scala | Scala | gpl-2.0 | 353 |
package a64.减法
import a64.基础._
case class Item(name: Int) {
override def toString: String = s"$name"
}
object Runner {
def numberZero[T]: Number[T] = {
lazy val zero: Number[T] = NumberT(() => zero)
zero
}
def fromInt(n: List[Int], tailNumber: Number[Item]): Number[Item] = n match {
case head :... | djx314/ubw | a64-模仿四法/src/main/scala/a64/减法/Runner.scala | Scala | bsd-3-clause | 1,009 |
package core.services.conf.dotenv
import java.util.Collections
import scala.util.{Failure, Success, Try}
import scala.util.control.NonFatal
import scala.collection.JavaConverters._
/**
* Extends internal Map with custom environment variable values, so that they could be accessed via the "sys.env". <br/>
* <br/>
... | sysgears/apollo-universal-starter-kit | modules/core/server-scala/src/main/scala/core/services/conf/dotenv/SysEnvExtender.scala | Scala | mit | 2,767 |
package org.finra.datagenerator.scaffolding.transformer.graph.rules
import org.finra.datagenerator.scaffolding.transformer.graph.nodes.{EdgeContainer, ElementContainer, VertexContainer}
/**
* Created by dkopel on 11/2/16.
*/
abstract class TransformerRuleCondition[C <: ElementContainer[T], T <: Any](clazz: Class[... | FINRAOS/DataGenerator | rubber-scaffolding/rubber-transformer/src/main/scala/org/finra/datagenerator/scaffolding/transformer/graph/rules/TransformerRuleCondition.scala | Scala | apache-2.0 | 1,017 |
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.