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.tribbloids.spookystuff.utils.locality
import com.tribbloids.spookystuff.SpookyEnvFixture
import com.tribbloids.spookystuff.TestBeans._
import org.apache.spark
import org.apache.spark.rdd.RDD
import org.apache.spark.{HashPartitioner, RangePartitioner, SparkException}
import org.scalatest.Assertions
import ... | tribbloid/spookystuff | core/src/test/scala/com/tribbloids/spookystuff/utils/locality/LocalityImplSuite.scala | Scala | apache-2.0 | 9,820 |
package org.broadinstitute.dsde.firecloud.model
import akka.http.scaladsl.marshallers.sprayjson.SprayJsonSupport
import akka.http.scaladsl.model.StatusCode
import akka.http.scaladsl.model.StatusCodes._
import akka.http.scaladsl.server.Directives._
import akka.http.scaladsl.server.{MalformedRequestContentRejection, Rej... | broadinstitute/firecloud-orchestration | src/main/scala/org/broadinstitute/dsde/firecloud/model/ModelJsonProtocol.scala | Scala | bsd-3-clause | 17,650 |
package com.typesafe.slick.docs
import scala.language.higherKinds
import scala.slick.driver.H2Driver.simple._
/**
* A simple example that uses statically typed queries against an in-memory
* H2 database. The example data comes from Oracle's JDBC tutorial at
* http://download.oracle.com/javase/tutorial/jdbc/basics/... | dvinokurov/slick | src/sphinx/code/Connection.scala | Scala | bsd-2-clause | 3,545 |
package auth.controllers
import com.mohiva.play.silhouette.test._
import core.AuthSpecification
import play.api.i18n.Messages
import play.api.test.{ FakeRequest, WithApplication }
import test.ApiSpecification
/**
* Test case for the [[SignOutController]] class.
*/
class SignOutControllerSpec extends ApiSpecificatio... | akkie/silhouette-play-react-seed | app-auth/src/test/scala/auth/controllers/SignOutControllerSpec.scala | Scala | mit | 1,197 |
package toguru.app
import akka.actor.{Props, ActorSystem, Actor}
import toguru.app.HealthActor.HealthStatus
import org.scalatestplus.play._
import play.api.mvc._
import play.api.test._
import play.api.test.Helpers._
import scala.concurrent.Future
class ApplicationSpec extends PlaySpec with Results {
"health chec... | andreas-schroeder/toguru | test/toguru/app/ApplicationSpec.scala | Scala | mit | 2,159 |
package org.scaladebugger.api.dsl.threads
import org.scaladebugger.api.lowlevel.events.data.JDIEventDataResult
import org.scaladebugger.api.lowlevel.requests.JDIRequestArgument
import org.scaladebugger.api.pipelines.Pipeline
import org.scaladebugger.api.profiles.traits.info.events.ThreadDeathEventInfo
import org.scala... | ensime/scala-debugger | scala-debugger-api/src/test/scala/org/scaladebugger/api/dsl/threads/ThreadDeathDSLWrapperSpec.scala | Scala | apache-2.0 | 3,071 |
package chandu0101.scalajsreact
/**
* Created by chandrasekharkode on 11/29/14.
*/
object GeneratorTest {
}
| chandu0101/reactjs-to-scalajs | src/test/scala/chandu0101/scalajsreact/GeneratorTest.scala | Scala | apache-2.0 | 111 |
package org.nlogo.extensions.webview
import org.scalatest.FunSuite
import org.scalatest.concurrent.AsyncAssertions
import java.io.File
import java.net.URL
import javafx.application.Platform
import javafx.beans.value.{ ChangeListener, ObservableValue }
import javafx.concurrent.Worker
import javafx.embed.swing.JFXPane... | NetLogo/webview | src/test/scala/JavaFXWebViewTest.scala | Scala | cc0-1.0 | 4,700 |
/* *\\
** \\ \\ / _) \\ \\ / \\ | **
** \\ \\ / | __ \\ _ \\ __| \\ \\ / |\\/ | **
** \\ \\ / | | | __/ | \\ \\ / | | **
** \\_/ _| .__/ \\___| _| \\_/ _| _| **
** _| ... | hsyl20/Scala_ViperVM | src/main/scala/org/vipervm/platform/host/Processor.scala | Scala | gpl-3.0 | 1,188 |
/*
* 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 ... | rekhajoshm/spark | sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/analysis/TypeCoercionSuite.scala | Scala | apache-2.0 | 71,050 |
package org.jetbrains.plugins.scala
package refactoring.changeSignature
import java.io.File
import com.intellij.openapi.util.io.FileUtilRt
import com.intellij.openapi.vfs.{CharsetToolkit, VfsUtil}
import com.intellij.psi._
import com.intellij.psi.impl.source.PostprocessReformattingAspect
import com.intellij.refactori... | advancedxy/intellij-scala | test/org/jetbrains/plugins/scala/refactoring/changeSignature/ChangeSignatureTestBase.scala | Scala | apache-2.0 | 5,276 |
/** *****************************************************************************
* This is part of ltlfo2mon (https://github.com/jckuester/ltlfo2mon).
*
* Copyright (c) 2013 by Jan-Christoph Kuester <kuester@sdf.org>
*
* Ltlfo2mon is free software: you can redistribute it and/or modify
* it under the terms... | jckuester/ltlfo2mon | src/main/scala/ltlfo2mon/monitor/optimised/RunTransition.scala | Scala | gpl-3.0 | 1,257 |
/*
* 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/test/scala/org/scalactic/ExplicitlySpecHelpers.scala | Scala | apache-2.0 | 1,900 |
/*
* 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/play-conditional-form-mapping | src/test/scala/uk/gov/voa/play/form/onlyIfAny.scala | Scala | apache-2.0 | 1,881 |
package com.mindcandy.data.jobs.trends
import com.datastax.spark.connector.SelectableColumnRef
import com.mindcandy.data.Launcher
import com.mindcandy.data.jobs.FolderProducerBaseJob
import com.twitter.algebird.SpaceSaver
import com.typesafe.config.Config
import org.apache.spark.streaming.StreamingContext
import org.a... | lvicentesanchez/fast-gt-perfect | src/main/scala/com/mindcandy/data/jobs/trends/TrendsJobLauncher.scala | Scala | mit | 968 |
import sbt._
object Configs {
val IntegrationTest = config("it") extend Runtime
val EndToEndTest = config("e2e") extend Runtime
val BenchmarkTest = config("bt") extend Runtime
val all = Seq(IntegrationTest, EndToEndTest, BenchmarkTest)
} | alexandrnikitin/aerospike-client-scala | project/Configs.scala | Scala | mit | 246 |
/* sbt -- Simple Build Tool
* Copyright 2011 Mark Harrah
*/
package sbt.internal.util
import scala.language.existentials
import Types._
sealed trait Settings[Scope] {
def data: Map[Scope, AttributeMap]
def keys(scope: Scope): Set[AttributeKey[_]]
def scopes: Set[Scope]
def definingScope(scope: Scope, key: ... | Duhemm/util | internal/util-collection/src/main/scala/sbt/internal/util/Settings.scala | Scala | bsd-3-clause | 35,590 |
package scamr.io.lib
import java.io.IOException
import org.apache.hadoop.mapreduce._
/**
* An OutputFormat that throws an IOException on all write attempts. Use this for jobs that use MultipleOutputs
* exclusively, and want to guarantee that the code doesn't accidentally write to a non-functioning OutputFormat,
* ... | ooyala/scamr | src/main/scala/scamr/io/lib/NoWritesAllowedOutputFormat.scala | Scala | apache-2.0 | 1,296 |
/*
* Copyright (c) 2016 by its authors. Some rights reserved.
* See the project homepage at: https://sincron.org
*
* 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.apa... | monixio/sincron | sincron-atomic/jvm/src/main/scala/org/sincron/atomic/AtomicNumberAny.scala | Scala | apache-2.0 | 3,478 |
package sss.db
import java.sql.{Blob, ResultSet, ResultSetMetaData}
import java.sql.ResultSetMetaData.columnNoNulls
import java.util.Locale
import scala.annotation.tailrec
object Rows {
val empty: Rows = IndexedSeq.empty
def apply(rs: ResultSet, freeBlobsEarly: Boolean): Rows = parse(rs, freeBlobsEarly)
d... | mcsherrylabs/sss.db | src/main/scala/sss/db/Rows.scala | Scala | gpl-3.0 | 1,520 |
package net.benmur.riemann.client
import scala.collection.JavaConversions.asJavaIterable
import org.scalatest.FunSuite
import org.scalatest.Matchers
import com.aphyr.riemann.Proto
import testingsupport.SerializersFixture.event1
import testingsupport.SerializersFixture.event2
import testingsupport.SerializersFixture... | benmur/riemann-scala-client | src/test/scala/net/benmur/riemann/client/SerializersTest.scala | Scala | mit | 9,304 |
package ohnosequences
import expr._
import ohnosequences.cosas._, fns._
case object rewriting {
trait AnyRewriteStrategy extends AnyDepFn1 {
type In1 = AnyExpr
type Out = AnyExpr
}
// This is a synonim for App1
case class Rewrite[
S <: AnyRewriteStrategy{
type In1 >: IE
type Out >: ... | laughedelic/rephrase | src/main/scala/rewriting.scala | Scala | agpl-3.0 | 1,172 |
package com.microsoft.awt.components
import com.microsoft.awt.models._
import com.microsoft.awt.ui.MainTab
import org.scalajs.angularjs.AngularJsHelper._
import org.scalajs.angularjs._
import org.scalajs.angularjs.toaster.Toaster
import org.scalajs.dom.browser.console
import org.scalajs.nodejs.util.ScalaJsHelper._
imp... | ldaniels528/awt | app-angularjs/src/main/scala/com/microsoft/awt/components/MainController.scala | Scala | apache-2.0 | 9,337 |
package com.lucidchart.open.nark.models
import com.lucidchart.open.nark.models.records.{Tag}
import com.lucidchart.open.nark.models.records.Dashboard
import java.util.UUID
import AnormImplicits._
import anorm._
import anorm.SqlParser._
import play.api.Play.current
import play.api.Play.configuration
import play.api.db... | lucidsoftware/nark | app/com/lucidchart/open/nark/models/DashboardTagsModel.scala | Scala | apache-2.0 | 3,544 |
package com.jensraaby.sxt
class XmlNodeSpec extends SXTSuite with XmlNodeGenerators {
import XmlNode._
"Name method" should "return simple names" in {
XmlElement("label", Nil, Set.empty).name shouldBe "Element"
XmlComment("aa").name shouldBe "Comment"
XmlData("bb").name shouldBe "Data"
XmlProcess... | jensraaby/SXT | src/test/scala/com/jensraaby/sxt/XmlNodeSpec.scala | Scala | apache-2.0 | 2,538 |
extension NameOps on (name: String):
def isWildcard = ???
end NameOps
extension on (name: String):
def f = ???
end extension
| som-snytt/dotty | tests/pos/i8241.scala | Scala | apache-2.0 | 130 |
// Copyright 2013
//
// 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, ... | mandar2812/ScalaSemanticEmbeddings | word2vec/src/main/scala/org/kuleuven/mai/word2vec/read_word_vectors.scala | Scala | apache-2.0 | 4,381 |
/*
* 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/QueryExecution.scala | Scala | apache-2.0 | 10,757 |
package com.sksamuel.elastic4s.requests.searches.suggestion
import com.sksamuel.exts.OptionImplicits._
sealed trait SortBy
object SortBy {
case object Score extends SortBy
case object Frequency extends SortBy
}
sealed trait SuggestMode
object SuggestMode {
def valueOf(str: String): SuggestMode = str.toUp... | stringbean/elastic4s | elastic4s-core/src/main/scala/com/sksamuel/elastic4s/requests/searches/suggestion/TermSuggestion.scala | Scala | apache-2.0 | 3,994 |
package update
case class CopyTask(
srcPath: String,
destPath: String
) {
var uptodate = 0
var changed = 0
var direxists = 0
var createdir = 0
}
object Update extends App {
val sep = java.io.File.separator
val del = "----------------------------------------"
def fullPath(root: String, path: Stri... | serversideapps/silhmojs | update/src/main/scala/update.scala | Scala | apache-2.0 | 9,044 |
/*
@meta {
"processorId": "org.helgoboss.scala_bundle:1.0.0",
"projectId": "org.helgoboss:registry-osgi:1.0-SNAPSHOT",
"dependencies": [
"com.weiglewilczek.scala-lang-osgi:scala-library:2.9.1",
"org.helgoboss:commons-scala-osgi:1.0-SNAPSHOT",
"org.helgoboss:registry:1.0-SNAPSHOT"
],
... | helgoboss/registry-osgi | org.helgoboss.registry-osgi.scala | Scala | mit | 1,584 |
/*
* Copyright 2011 Hui Wen Han, 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... | huiwenhan/PrefStore | src/test/scala/me/huiwen/prefz/unit/PrefSpec.scala | Scala | apache-2.0 | 1,809 |
/**
* This file is part of the TA Buddy project.
* Copyright (c) 2013-2014 Alexey Aksenov ezh@ezh.msk.ru
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Affero General Global License version 3
* as published by the Free Software Foundation with the addition... | digimead/digi-TABuddy-desktop | part-view-modification/src/main/scala/org/digimead/tabuddy/desktop/view/modification/ui/dialog/filtered/ColumnProperty.scala | Scala | agpl-3.0 | 3,930 |
import sbt._
import Keys._
import Tests._
import com.twitter.scrooge.ScroogeSBT
import com.typesafe.sbt.SbtSite.site
import com.typesafe.sbt.site.SphinxSupport.Sphinx
import pl.project13.scala.sbt.JmhPlugin
import sbtunidoc.Plugin.UnidocKeys._
import sbtunidoc.Plugin.{ScalaUnidoc, unidocSettings}
import scoverage.Scove... | travisbrown/finagle | project/Build.scala | Scala | apache-2.0 | 20,629 |
package net.snowflake.spark.snowflake
import java.io.{PrintWriter, StringWriter}
import java.sql.Connection
import java.util.regex.Pattern
import net.snowflake.client.jdbc.SnowflakeSQLException
import net.snowflake.client.jdbc.telemetry.{Telemetry, TelemetryClient}
import org.apache.spark.sql.catalyst.plans.logical._... | snowflakedb/spark-snowflake | src/main/scala/net/snowflake/spark/snowflake/SnowflakeTelemetry.scala | Scala | apache-2.0 | 21,642 |
package chapter1
import java.io.File
/**
* Created by A12975 on 11/10/15.
*/
class Rational(val n: Int, val d: Int) {
require(d != 0)
override def toString = s"$n / $d"
def add(that: Rational): Rational = new Rational(n * that.d + that.n * d, d * that.d)
def gcd(a: Int, b: Int): Int = if(b ==0) a else gcd(... | gongbp/scala-in-practice | src/main/scala/chapter1/Rational.scala | Scala | apache-2.0 | 334 |
// Copyright (c) 2020 Ben Zimmer. All rights reserved.
// Orbits InteractiveView
package bdzimmer.orbits
import java.awt.{BorderLayout, Color, Dimension, FlowLayout, Font, Graphics, GridLayout, Image, Toolkit}
import java.awt.event._
import java.awt.image.BufferedImage
import java.text.SimpleDateFormat
import java.u... | bdzimmer/orbits | src/main/scala/bdzimmer/orbits/InteractiveView.scala | Scala | bsd-3-clause | 25,093 |
package org.scalameta.tests
import scala.collection.mutable
import scala.util.Try
import java.util.concurrent.atomic.AtomicInteger
import scala.collection.JavaConverters._
import org.scalameta.paradise.converters.ConvertException
import org.scalatest.exceptions.TestFailedException
object LotsOfProjects extends Conv... | Dveim/paradise | tests/converter/src/test/scala/org/scalameta/tests/LotsOfProjects.scala | Scala | bsd-3-clause | 2,354 |
package controllers.c1
import play.api.mvc._
/**
* Created by trydofor on 7/1/15.
* @see https://playframework.com/documentation/2.4.x/ScalaSessionFlash
* @see https://github.com/playframework/playframework/blob/2.4.x/documentation/manual/working/scalaGuide/main/http/code/ScalaSessionFlash.scala
*/
class S4Scala... | moilioncircle/playframework-2.4.x-scala | app/controllers/c1/S4ScalaSessionFlash.scala | Scala | apache-2.0 | 1,581 |
package com.mindcandy.waterfall
import org.joda.time.DateTime
/**
* Testing format, read/write 3 params from/into Seq[String]
* @param id Int, the row id
* @param name String, the name
* @param added DateTime, the time when the row is added
*/
case class TestFormat(id: Int, name: String, added: DateTime)
object... | mindcandy/waterfall | src/test/scala/com/mindcandy/waterfall/TestFormat.scala | Scala | mit | 668 |
/*
* ScalaRay - Ray tracer based on pbrt (see http://pbrt.org) written in Scala
* Copyright (C) 2009, 2010, 2011 Jesper de Jong
*
* 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 ve... | jesperdj/scalaray | src/main/scala/org/jesperdj/scalaray/texture/Texture.scala | Scala | gpl-3.0 | 965 |
package org.jetbrains.plugins.scala
package testingSupport
import com.intellij.openapi.diagnostic.Logger
import com.intellij.openapi.editor.Editor
import com.intellij.openapi.module.Module
import com.intellij.openapi.project.Project
import com.intellij.psi.{PsiClass, PsiFile, PsiPackage}
import com.intellij.testIntegr... | JetBrains/intellij-scala | scala/scala-impl/src/org/jetbrains/plugins/scala/testingSupport/ScalaTestCreator.scala | Scala | apache-2.0 | 1,906 |
/*
* 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 | core/src/main/scala/org/apache/spark/deploy/SparkSubmit.scala | Scala | apache-2.0 | 55,910 |
package cpup.poland.runtime
import cpup.poland.runtime.userdata.{PString, PSymbol, Send}
case class LiteralsMetaFn(fallback: (Send, PObject) => Option[PObject]) extends ((Send, PObject) => Option[PObject]) {
override def apply(send: Send, self: PObject) = {
// println("name", send.msg.name)
send.msg.name.userdata... | CoderPuppy/poland-scala | src/main/scala/cpup/poland/runtime/LiteralsMetaFn.scala | Scala | mit | 1,165 |
package io.vamp.operation.workflow
import io.vamp.common.akka._
import io.vamp.model.artifact.Workflow
import io.vamp.operation.notification._
import io.vamp.operation.workflow.WorkflowActor.Update
import io.vamp.operation.workflow.WorkflowSynchronizationActor.SynchronizeAll
import io.vamp.persistence.{ ArtifactPagina... | dragoslav/vamp | operation/src/main/scala/io/vamp/operation/workflow/WorkflowSynchronizationActor.scala | Scala | apache-2.0 | 1,402 |
package com.typesafe.sbt.packager.docker
/**
* This class represents a Docker alias.
* It generates a string in the form of {{{[REGISTRY_HOST/][USERNAME/]NAME[:TAG]}}},
* e.g. ''my-registry.com:1234/my-user/my-service:1.0.0'' or just ''my-service:1.0.0''.
* @param registryHost Optional hostname of the registry... | fsat/sbt-native-packager | src/main/scala/com/typesafe/sbt/packager/docker/DockerAlias.scala | Scala | bsd-2-clause | 1,145 |
package fpinscala.datastructures
sealed trait List[+A]
// `List` data type, parameterized on a type, `A`
case object Nil extends List[Nothing]
// A `List` data constructor representing the empty list
/* Another data constructor, representing nonempty lists. Note that `tail` is another `List[A]`,
which may be `Nil` o... | hyleung/fpinscala | exercises/src/main/scala/fpinscala/datastructures/List.scala | Scala | mit | 4,348 |
package data_structures
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 {
/** Count the number of nodes (leaves and branches) in a tree
* My initial implementation is a bit rudimental but does */
def size[A](t... | IamGianluca/functional_programming_in_scala | src/main/scala/data_structures/Tree.scala | Scala | mit | 1,118 |
package bigquery4s
import com.google.api.client.util.Data
import com.google.api.services.bigquery.model.TableCell
/**
* TableCell wrapper
*/
case class WrappedTableCell(private val underlying: TableCell) {
lazy val value: Option[AnyRef] = {
if (Data.isNull(underlying.getV)) None
else Some(underlying.getV... | seratch/bigquery4s | src/main/scala/bigquery4s/WrappedTableCell.scala | Scala | mit | 328 |
package mesosphere.marathon
package integration.setup
import akka.actor.{ActorSystem, Scheduler}
import akka.http.scaladsl.client.RequestBuilding
import akka.http.scaladsl.client.RequestBuilding.Get
import akka.http.scaladsl.model.HttpResponse
import akka.stream.Materializer
import com.typesafe.scalalogging.StrictLogg... | gsantovena/marathon | tests/integration/src/test/scala/mesosphere/marathon/integration/setup/AppMockFacade.scala | Scala | apache-2.0 | 1,170 |
package im.actor.server.model.auth
case class GateAuthCode(transactionHash: String, codeHash: String, isDeleted: Boolean = false)
| EaglesoftZJ/actor-platform | actor-server/actor-models/src/main/scala/im/actor/server/model/auth/GateAuthCode.scala | Scala | agpl-3.0 | 131 |
package smt.migration
import sbt._
import smt.util.Util._
object FileMigration {
def apply(name: String, scripts: Seq[File], tests: Seq[Test]): Migration = {
def script(dir: File, filename: String): Script = Script(name = dir.getName, content = bytesToString(IO.readBytes(dir / filename)))
Migration(name = ... | davidpeklak/smt | src/main/scala/smt/migration/FileMigration.scala | Scala | mit | 452 |
/*
* Copyright (C) 2016 Eugene Yokota
*
* 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... | eed3si9n/sjson-new | support/spray/src/test/scala/sjsonnew/support/spray/UnionFormatSpec.scala | Scala | apache-2.0 | 3,515 |
/**
* Copyright (c) 2013-2016 Extended Mind Technologies Oy
*
* This file is part of Extended Mind.
*
* Extended Mind 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
* Li... | ttiurani/extendedmind | backend/src/main/scala/org/extendedmind/db/ListDatabase.scala | Scala | agpl-3.0 | 23,015 |
package monocle.std
import monocle.function._
import monocle.{Optional, Prism}
import scalaz.std.vector._
object vector extends VectorOptics
trait VectorOptics {
implicit def vectorEmpty[A]: Empty[Vector[A]] = new Empty[Vector[A]] {
def empty = Prism[Vector[A], Unit](v => if(v.isEmpty) Some(()) else None)(_ ... | NightRa/Monocle | core/src/main/scala/monocle/std/Vector.scala | Scala | mit | 1,405 |
import sbt._
import Keys._
object FPInScalaBuild extends Build {
val opts = Project.defaultSettings ++ Seq(
scalaVersion := "2.11.5",
resolvers += "Typesafe Repository" at "http://repo.typesafe.com/typesafe/releases/",
scalacOptions ++= Seq(
"-feature",
"-language:implicitConversions",
... | Errorific/fpinscala | project/Build.scala | Scala | mit | 1,711 |
package scorex.transaction
import akka.actor.ActorSystem
import akka.testkit.{ImplicitSender, TestActorRef, TestKit}
import org.scalamock.scalatest.MockFactory
import org.scalatest.{BeforeAndAfterAll, Matchers, OneInstancePerTest, WordSpecLike}
import play.api.libs.json.{JsObject, Json}
import scorex.account.PublicKey... | B83YPoj/Waves | src/test/scala/scorex/transaction/UnconfirmedPoolSynchronizerSpecification.scala | Scala | apache-2.0 | 3,357 |
package com.scalaAsm.x86
package Instructions
package General
// Description: Jump short if not less/greater or equal (SF=OF)
// Category: general/branch/cond
trait JGE extends InstructionDefinition {
val mnemonic = "JGE"
}
object JGE extends OneOperand[JGE] with JGEImpl
trait JGEImpl extends JGE {
implicit obj... | bdwashbu/scala-x86-inst | src/main/scala/com/scalaAsm/x86/Instructions/General/JGE.scala | Scala | apache-2.0 | 651 |
package com.github.vladminzatu.surfer.persist
import com.github.vladminzatu.surfer.Score
import org.apache.spark.rdd.RDD
abstract class Persister extends Serializable {
def persist(scores: RDD[(String, Score)]): Unit
}
| VladMinzatu/surfer | src/main/scala/com/github/vladminzatu/surfer/persist/Persister.scala | Scala | mit | 224 |
package com.company.toosheh.actors
import akka.actor.Actor
import akka.event.Logging
import com.bisphone.util.LongCodec
import com.company.toosheh.messages._
import scala.collection.mutable
object Long extends LongCodec.BigEndianDecoder with LongCodec.BigEndianEncoder
/**
* @author Milad Khajavi <khajavi@gmail.co... | khajavi/Toosheh | src/main/scala/com/company/toosheh/actors/DB.scala | Scala | mit | 1,719 |
package com.github.ldaniels528.trifecta
/**
* Trifecta Application Constants
* @author lawrence.daniels@gmail.com
*/
object AppConstants {
val VERSION = "0.22.0rc10c"
val KAFKA_VERSION = "0.8.2.0"
/////////////////////////////////////////////////////////
// Events
/////////////////////////////////////... | ldaniels528/trifecta | app-common/src/main/scala/com/github/ldaniels528/trifecta/AppConstants.scala | Scala | apache-2.0 | 454 |
/*
*************************************************************************************
* Copyright 2011 Normation SAS
*************************************************************************************
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero Ge... | jooooooon/rudder | rudder-core/src/main/scala/com/normation/rudder/services/servers/PolicyServerManagementService.scala | Scala | agpl-3.0 | 5,294 |
/*
* Copyright (c) 2016 SnappyData, Inc. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you
* may not use this file except in compliance with the License. You
* may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by ap... | vjr/snappydata | cluster/src/test/scala/io/snappydata/benchmark/memsql/TPCH_Memsql_StreamExecution.scala | Scala | apache-2.0 | 34,692 |
package com.jesperancinha.imagecontour.filters
import java.awt.image.BufferedImage
import java.io.{ByteArrayInputStream, InputStream}
import java.nio.file.{Files, Paths}
import javax.imageio.ImageIO
object ImageTestUtils {
def getBufferedResource(resourcePath: String): BufferedImage = {
val fileBytes = Files.... | jesperancinha/image-contour | service/src/test/scala/com/jesperancinha/imagecontour/filters/ImageTestUtils.scala | Scala | apache-2.0 | 563 |
package org.littlewings.javaee7.batch
import java.io.Serializable
import javax.batch.api.BatchProperty
import javax.batch.api.partition.PartitionCollector
import javax.batch.runtime.context.StepContext
import javax.enterprise.context.Dependent
import javax.inject.{Inject, Named}
import scala.collection.mutable.ArrayB... | kazuhira-r/javaee7-scala-examples | jbatch-partitioned/src/main/scala/org/littlewings/javaee7/batch/MyPartitionCollector.scala | Scala | mit | 954 |
package be.mygod.view
import android.content.Context
import android.support.v4.view.{PagerAdapter, ViewPager => Base}
import android.util.AttributeSet
import android.view.{ViewGroup, MotionEvent, View}
import android.view.ViewGroup.LayoutParams
/**
* A useful ViewPager for Views.
*
* @author mygod
*/
class Vi... | Mygod/mygod-lib-android | src/main/scala/be/mygod/view/ViewPager.scala | Scala | gpl-3.0 | 1,275 |
object S
{
val y: Int = J.x
}
| matheshar/simple-build-tool | src/sbt-test/source-dependencies/java-static/changes/S.scala | Scala | bsd-3-clause | 31 |
/***********************************************************************
* Copyright (c) 2015-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... | geomesa/geomesa-nifi | geomesa-accumulo-bundle/geomesa-accumulo-processors/src/main/scala/org/geomesa/nifi/processors/accumulo/AvroToPutGeoMesaAccumulo.scala | Scala | apache-2.0 | 1,005 |
/* The following code was generated by JFlex 1.5.0-SNAPSHOT (+scala) on 7/24/14 3:35 PM */
/**
* This class is a scanner generated by
* <a href="http://www.jflex.de/">JFlex</a> 1.5.0-SNAPSHOT (+scala)
* on 7/24/14 3:35 PM from the specification file
* <tt>Calc.lex</tt>
*/
class CalcScanner(private var zzReader :... | djspiewak/scala-bison | examples/CalcScanner.scala | Scala | apache-2.0 | 17,099 |
package mesosphere.marathon.core.launcher
import org.apache.mesos.Protos.{ OfferID, TaskInfo }
/**
* A TaskLauncher launches tasks on an offer or declines an offer.
*/
trait TaskLauncher {
/**
* Launch the given tasks on the given offer. The offer is consumed afterwards and
* cannot be used anymore.
... | sepiroth887/marathon | src/main/scala/mesosphere/marathon/core/launcher/TaskLauncher.scala | Scala | apache-2.0 | 615 |
package test
import org.junit.Assert._
import org.junit.Test
class LibTest:
@Test
def square(): Unit =
assertEquals(9, Lib.square(3))
@Test
def color(): Unit =
val c: Lib.Color = Lib.Color.Red
assertEquals("Red", c.toString())
end LibTest
| scala-js/scala-js | sbt-plugin/src/sbt-test/scala3/junit/src/test/scala/test/LibTest.scala | Scala | apache-2.0 | 262 |
//
// Taranos Cloud Sonification Framework: Service Core
// Copyright (C) 2018 David Hinson, Netrogen Blue LLC (dhinson@netrogenblue.com)
//
// 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 F... | taranos/taranoscsf-core | src/main/scala/org/taranos/mc/trunk/intraprocess/SignalLink.scala | Scala | agpl-3.0 | 12,091 |
package org.jetbrains.jps.incremental.scala.model.impl
import org.jetbrains.jps.incremental.scala.model.{JpsSbtExtensionService, JpsSbtModuleExtension}
import org.jetbrains.jps.model.module.JpsModule
final class JpsSbtExtensionServiceImpl extends JpsSbtExtensionService {
override def getExtension(module: JpsModule... | JetBrains/intellij-scala | scala/compiler-jps/src/org/jetbrains/jps/incremental/scala/model/impl/JpsSbtExtensionServiceImpl.scala | Scala | apache-2.0 | 815 |
package breeze.data
import breeze.linalg.SparseVector
import io.Source
import collection.mutable.ArrayBuffer
import breeze.serialization.TextSerialization.Readable
import breeze.serialization.{SerializationFormat, TextSerialization}
import breeze.io.TextReader
/**
* Dataset of the form <label> [featureIndex:featureV... | tjhunter/scalanlp-core | process/src/main/scala/breeze/data/SparseFeatureDataset.scala | Scala | apache-2.0 | 1,959 |
/*
* Licensed to Intel Corporation under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* Intel Corporation licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use t... | zhichao-li/BigDL | dl/src/test/scala/com/intel/analytics/bigdl/torch/ViewSpec.scala | Scala | apache-2.0 | 2,755 |
//############################################################################
// Programmation IV - 2002 - Week 06
//############################################################################
/** Two-dimensional vector. */
class Vector (_x: Double, _y: Double) {
def x: Double = _x;
def y: Double = _y;
def +(t... | yusuke2255/dotty | tests/run/Course-2002-06.scala | Scala | bsd-3-clause | 8,769 |
package org.zalando.grafter
package object syntax {
object all extends
RewriterSyntax with
QuerySyntax with
VisualizeSyntax
object rewriter extends RewriterSyntax
object query extends QuerySyntax
object visualize extends VisualizeSyntax
}
| jcranky/grafter | core/src/main/scala/org/zalando/grafter/syntax/package.scala | Scala | mit | 271 |
package com.danielasfregola.twitter4s.entities.enums
object TweetMode extends Enumeration {
type TweetMode = Value
val Extended = Value("extended")
val Classic = Value("")
}
| DanielaSfregola/twitter4s | src/main/scala/com/danielasfregola/twitter4s/entities/enums/TweetMode.scala | Scala | apache-2.0 | 182 |
package org.scalaide.ui.internal.actions
import org.eclipse.core.commands.AbstractHandler
import org.eclipse.core.commands.ExecutionEvent
import org.eclipse.core.resources.IProject
import org.eclipse.core.runtime.IAdaptable
import org.eclipse.jface.action.IAction
import org.eclipse.jface.viewers.ISelection
import org.... | Kwestor/scala-ide | org.scala-ide.sdt.core/src/org/scalaide/ui/internal/actions/AbstractPopupAction.scala | Scala | bsd-3-clause | 1,991 |
package scala.meta
package internal.hosts.scalac
package converters
import org.scalameta.invariants._
import org.scalameta.unreachable
import scala.language.implicitConversions
import scala.{Seq => _}
import scala.collection.immutable.Seq
import scala.tools.nsc.{Global => ScalaGlobal}
import scala.meta.semantic.{Conte... | beni55/scalameta | scalahost/src/main/scala/scala/meta/internal/hosts/scalac/converters/ToMname.scala | Scala | bsd-3-clause | 1,821 |
/*
* Copyright (c) 2014. Regents of the University of California
*
* 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 require... | hammerlab/avocado | avocado-core/src/main/scala/org/bdgenomics/avocado/input/AlignedReadsInputStage.scala | Scala | apache-2.0 | 1,665 |
/*
* Copyright (c) 2013 Habla Computing
*
* 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... | hablapps/updatable | src/main/scala/org/hablapps/updatable/UnderlyingModifiable.scala | Scala | apache-2.0 | 3,682 |
package org.jetbrains.plugins.scala.testingSupport.test.sbt
import java.io.OutputStream
import com.intellij.execution.process.{OSProcessHandler, ProcessEvent, ProcessHandler, ProcessListener}
import scala.collection.mutable
/** Process wrapper used to imitate termination of process so that 'stop' button in UI stops... | jastice/intellij-scala | scala/scala-impl/src/org/jetbrains/plugins/scala/testingSupport/test/sbt/SbtProcessHandlerWrapper.scala | Scala | apache-2.0 | 1,836 |
object demo {
trait Reader[A]
given Reader[Int]()
inline def summonReader[T <: Tuple]: List[Reader[_]] = inline compiletime.erasedValue[T] match {
case _: EmptyTuple => Nil
case _: (t *: ts) => compiletime.summonInline[Reader[t]] :: summonReader[ts]
}
class CombinedReader[A](
m: deriving.Mirro... | dotty-staging/dotty | tests/run/i11542.scala | Scala | apache-2.0 | 981 |
package com.outr.arango.api.model
import io.circe.Json
case class GetAPIReturnRc200(server: String,
details: Option[VersionDetailsStruct] = None,
version: Option[String] = None) | outr/arangodb-scala | api/src/main/scala/com/outr/arango/api/model/GetAPIReturnRc200.scala | Scala | mit | 238 |
package com.ebay.hackathon.endpoints
import com.ebay.hackathon.controllers.{AuthController, NeedyController, DeliveryController}
import org.scalatra.servlet.FileUploadSupport
/**
* Author sreejith on 09/11/14 7:27 AM.
*/
class NeedyEndPoint extends ApiEndpoint with HttpSessionSupport with FileUploadSupport {
pri... | sreejithp/i.us.we | iuswe/src/main/scala/com/ebay/hackathon/endpoints/NeedyEndPoint.scala | Scala | apache-2.0 | 889 |
package com.enkidu.lignum.parsers.ast.expression.discardable.binary.assignment
import com.enkidu.lignum.parsers.ast.expression.Expression
case class Binding(target: Expression, source: Expression) extends Assignment {
override def dispatch(visitor: Visitor): Unit = {
target.dispatch(visitor)
source.dispatch... | marek1840/java-parser | src/main/scala/com/enkidu/lignum/parsers/ast/expression/discardable/binary/assignment/Binding.scala | Scala | mit | 355 |
/*
* 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-workbench-outdated/src/main/scala/de/fuberlin/wiwiss/silk/workbench/lift/snippet/EditorToolbar.scala | Scala | apache-2.0 | 1,121 |
package section1
import org.scalatest.FunSuite
class CollectionsSpec extends FunSuite {
import Collections._
test("toUpper converts every parameter to its upper case representation") {
val result = toUpper("Hi", "there", "how", "are", "you")
assert(result === Seq("HI", "THERE", "HOW", "ARE", "YOU"))
}... | DarkToast/scala-workshop | workshop/src/test/scala/section1/CollectionsSpec.scala | Scala | mit | 2,094 |
package io.getquill.norm
import io.getquill.Spec
import io.getquill.testContext.implicitOrd
import io.getquill.testContext.qr1
import io.getquill.testContext.quote
import io.getquill.testContext.unquote
class OrderTermsSpec extends Spec {
"doesn't reorder groupBy.map" in {
val q = quote {
qr1.map(b => b.... | jcranky/quill | quill-core/src/test/scala/io/getquill/norm/OrderTermsSpec.scala | Scala | apache-2.0 | 928 |
/*
* Copyright (C) 2014 - 2020 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)... | DFASDL/dfasdl-utils | src/main/scala/org/dfasdl/utils/StructureElementType.scala | Scala | agpl-3.0 | 1,067 |
package object Macros {
def foo: Unit = macro Impls.foo
}
object Test extends App {
import Macros._
foo
}
| martijnhoekstra/scala | test/files/run/macro-term-declared-in-package-object/Macros_Test_2.scala | Scala | apache-2.0 | 113 |
/*
* Copyright (c) 2016 BBC Design and Engineering
*
* 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,... | bbc/scheduler-plus | src/main/scala/bbc/schedulerplus/system/JobManager.scala | Scala | mit | 2,163 |
/*
* Copyright (c) 2016. Fengguo (Hugo) Wei and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Detailed co... | arguslab/argus-cit-intellij | src/main/scala/org/argus/cit/intellij/jawa/lang/psi/types/JawaTypeSystem.scala | Scala | epl-1.0 | 949 |
package sri.mobile.components
import sri.core.{React, ReactNode}
import sri.mobile._
import scala.scalajs.js
case class TouchableNativeFeedback(key: U[String] = undefined,
style: U[js.Any] = undefined,
ref: U[TouchableNativeFeedbackM => _] = unde... | hamazy/sri | mobile/src/main/scala/sri/mobile/components/TouchableNativeFeedback.scala | Scala | apache-2.0 | 2,189 |
/*
* Copyright 2012 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... | lanrion/zipkin | zipkin-server/src/test/scala/com/twitter/zipkin/common/AnnotationSpec.scala | Scala | apache-2.0 | 1,649 |
package com.sageserpent.plutonium
import java.lang.reflect.Method
import java.time.Instant
import com.sageserpent.americium.randomEnrichment._
import com.sageserpent.americium.{Finite, Unbounded}
import com.sageserpent.plutonium
import com.sageserpent.plutonium.ItemExtensionApi.UniqueItemSpecification
import com.sage... | sageserpent-open/open-plutonium | src/test/scala/com/sageserpent/plutonium/PatchRecorderSpec.scala | Scala | mit | 16,372 |
/*
* Copyright (C) 2016-2019 Lightbend Inc. <https://www.lightbend.com>
*/
package com.lightbend.lagom.internal.persistence
import java.util.concurrent.TimeUnit
import com.typesafe.config.Config
import play.api.Configuration
import scala.concurrent.duration._
case class ReadSideConfig(
offsetTimeout: Fi... | rstento/lagom | persistence/core/src/main/scala/com/lightbend/lagom/internal/persistence/ReadSideConfig.scala | Scala | apache-2.0 | 1,203 |
package org.jetbrains.plugins.scala
package lang
package psi
package impl
import java.util
import java.util.concurrent.ConcurrentMap
import com.intellij.ProjectTopics
import com.intellij.ide.highlighter.JavaFileType
import com.intellij.openapi.components.ProjectComponent
import com.intellij.openapi.diagnostic.Logger
... | jastice/intellij-scala | scala/scala-impl/src/org/jetbrains/plugins/scala/lang/psi/impl/ScalaPsiManager.scala | Scala | apache-2.0 | 20,668 |
/*
* Copyright (c) 2002-2018 "Neo Technology,"
* Network Engine for Objects in Lund AB [http://neotechnology.com]
*
* This file is part of Neo4j.
*
* Neo4j 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... | HuangLS/neo4j | community/cypher/cypher-compiler-2.3/src/test/scala/org/neo4j/cypher/internal/compiler/v2_3/planDescription/RenderTreeTableTest.scala | Scala | apache-2.0 | 23,325 |
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.