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 |
|---|---|---|---|---|---|
/**
* Copyright (c) Michael Steindorfer <Centrum Wiskunde & Informatica> and Contributors.
* All rights reserved.
*
* This file is licensed under the BSD 2-Clause License, which accompanies this project
* and is available under https://opensource.org/licenses/BSD-2-Clause.
*/
package dom
import java.io.{FileInpu... | msteindorfer/criterion | src/main/scala/dom/DominatorsScala_Default.scala | Scala | bsd-2-clause | 13,702 |
package util
import java.io.File
/**
* Created by marcin on 5/5/17.
*/
case class NotADirectoryException(file: File) extends Exception
case class NotAFileException(file: File) extends Exception
case class ChunksMissingException(list: List[Int]) extends Exception
| mprzewie/cloudia-utils | src/main/scala/util/Exceptions.scala | Scala | mit | 272 |
/*
* Copyright 2011-2018 GatlingCorp (http://gatling.io)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applic... | wiacekm/gatling | gatling-recorder/src/main/scala/io/gatling/recorder/http/flows/PlainWithProxyMitmActor.scala | Scala | apache-2.0 | 2,546 |
/**
* Copyright 2015 Yahoo Inc. Licensed under the Apache License, Version 2.0
* See accompanying LICENSE file.
*/
package controllers
import java.util.Properties
import kafka.manager.ActorModel.TopicIdentity
import kafka.manager.utils.TopicConfigs
import kafka.manager.{Kafka_0_8_2_1, ApiError, Kafka_0_8_2_0, Kaf... | cvcal/kafka-manager | app/controllers/Topic.scala | Scala | apache-2.0 | 14,040 |
/* Copyright 2009-2021 EPFL, Lausanne */
import stainless.lang._
object Existentials {
def exists[A](p: A => Boolean): Boolean = !forall((x: A) => !p(x))
def check1(y: BigInt, p: BigInt => Boolean) : Boolean = {
p(y) == exists[BigInt]((y1:BigInt) => p(y1))
}.holds
/*
def check2(y: BigInt, p: BigInt =... | epfl-lara/stainless | frontends/benchmarks/verification/invalid/Existentials.scala | Scala | apache-2.0 | 404 |
package com.github.mdr.ascii.graph
import org.scalacheck._
import org.scalacheck.Gen.Parameters
import scala.util.Random
import com.github.mdr.ascii.layout.cycles.CycleRemover
import org.scalacheck.rng.Seed
object GraphGenerators {
implicit val graphGen: Gen[Graph[String]] = Gen.choose(0, 9999999).map { seed ⇒ Ra... | mdr/ascii-graphs | src/test/scala/com/github/mdr/ascii/graph/GraphGenerators.scala | Scala | mit | 858 |
package code.snippet
import net.liftweb.http.RequestVar
import net.liftweb.http.js.JE.{ElemById, JsNull, JsVal}
import net.liftweb.http.js.JsCmd
import net.liftweb.http.js.JsCmds.{SetHtml, SetValById}
import net.liftweb.util.Helpers._
import net.liftweb.http.SHtml._
import scala.xml.Text
object TestReqVar extends Re... | joescii/lift-jetty-cluster | src/main/scala/code/snippet/ReqVarSnip.scala | Scala | apache-2.0 | 790 |
/*
* Copyright 2022 HM Revenue & Customs
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or a... | hmrc/vat-registration-frontend | test/forms/ApplicationReferenceFormSpec.scala | Scala | apache-2.0 | 1,779 |
package com.opower.hadoop.hbase.query
import org.apache.hadoop.hbase.util.Bytes
import scala.util.parsing.combinator.RegexParsers
protected[query] class QueryParser(private val queryBuilder : QueryBuilder) extends RegexParsers {
def query : Parser[~[~[List[Column], String], Option[RowConstraint]]] = scanClause ~ f... | jeffkole/odoop | hbase-filters/src/main/scala/com/opower/hadoop/hbase/query/QueryParser.scala | Scala | apache-2.0 | 3,372 |
package scutil.jcollection.extension
import java.util.{ Map => JMap }
import scala.collection.immutable.HashMap
object JMapImplicits extends JMapImplicits
trait JMapImplicits {
implicit final class JMapExt[K,V](peer:JMap[K,V]) {
def toHashMap:Map[K,V] = {
var out = HashMap.empty[K,V]
val keyIter = peer.ke... | ritschwumm/scutil | modules/jdk/src/main/scala/scutil/jcollection/extension/JMapImplicits.scala | Scala | bsd-2-clause | 501 |
package ucesoft.cbm.expansion
import ucesoft.cbm.cpu.Memory
import ucesoft.cbm.ChipID
import ucesoft.cbm.Log
import ucesoft.cbm.cpu.RAMComponent
import ucesoft.cbm.CBMComponentType
import ucesoft.cbm.formats.Cartridge
import java.io.ObjectOutputStream
import java.io.ObjectInputStream
object ExpansionPortType extends... | abbruzze/kernal64 | Kernal64/src/ucesoft/cbm/expansion/ExpansionPort.scala | Scala | mit | 6,190 |
package edu.oregonstate.mutation.statementHistory
import org.eclipse.jgit.api.Git
import org.eclipse.jgit.treewalk.TreeWalk
import org.eclipse.jgit.treewalk.filter.PathSuffixFilter
import scala.collection.mutable.ListBuffer
object FileFinder {
def findIn(git: Git, commit: String = "HEAD", extension: String = ".ja... | caiusb/statement-history | src/main/scala/edu/oregonstate/mutation/statementHistory/FileFinder.scala | Scala | mit | 752 |
import scala.of.coq.lang._
import Nat._
import Pairs._
import Bools._
import MoreLists._
import scala.concurrent.Future
import MoreFutures._
object CoqInitNat {
sealed abstract class Nat
case object Zero extends Nat
case class S(n: Nat) extends Nat
type t = Nat
def zero: Nat = Zero
def one: Nat = S(Zero)
... | JBakouny/Scallina | src/test/resources/scala/of/coq/generated/code/CoqInitNat.scala | Scala | gpl-3.0 | 4,756 |
package tu.knowledge.frame
/**
* @author max
* date 2012-05-06
* time: 11:14 PM
*/
import org.junit.runner.RunWith
import org.scalatest.junit.JUnitRunner
import org.scalatest.FunSuite
import tu.model.knowledge.primitive.KnowledgeString
import tu.model.knowledge.semanticnetwork.{SemanticNetworkLink... | keskival/2 | model.knowledge/src/test/scala/tu/knowledge/frame/TransFrameTest.scala | Scala | gpl-3.0 | 1,822 |
/*
* Copyright 2010 LinkedIn
*
* 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... | tcrayford/hafka | kafka/core/src/test/scala/unit/kafka/integration/FetcherTest.scala | Scala | bsd-3-clause | 3,455 |
package aia.state
import akka.actor.{ ActorRef, Actor, FSM }
import math.min
import scala.concurrent.duration._
// events
case class BookRequest(context: AnyRef, target: ActorRef)
case class BookSupply(nrBooks: Int)
case object BookSupplySoldOut
case object Done
case object PendingRequests
//responses
case object Pu... | RayRoestenburg/akka-in-action | chapter-state/src/main/scala/aia/state/Inventory.scala | Scala | mit | 6,370 |
/**
* Licensed to Big Data Genomics (BDG) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The BDG licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use ... | erictu/adam | adam-cli/src/main/scala/org/bdgenomics/adam/cli/Vcf2ADAM.scala | Scala | apache-2.0 | 3,387 |
package ml.sparkling.graph.operators.measures.vertex.betweenness.hua.struct.messages
import org.apache.spark.graphx.VertexId
/**
* Created by mth on 5/6/17.
*/
class BFSExpandMessage(val parent: VertexId) extends NOMessage[VertexId] {
override val source: VertexId = parent
override val content: VertexId = pa... | sparkling-graph/sparkling-graph | operators/src/main/scala/ml/sparkling/graph/operators/measures/vertex/betweenness/hua/struct/messages/BFSExpandMessage.scala | Scala | bsd-2-clause | 562 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | openwhisk/openwhisk | common/scala/src/main/scala/org/apache/openwhisk/core/database/s3/S3AttachmentStore.scala | Scala | apache-2.0 | 10,350 |
/*
Copyright 2014 Commonwealth Bank of Australia
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 ... | CommBank/six | src/main/scala/au/com/cba/omnia/six/Dictionary.scala | Scala | apache-2.0 | 2,484 |
package fpinscala.state
import annotation.tailrec
trait RNG {
def nextInt: (Int, RNG) // Should generate a random `Int`. We'll later define other functions in terms of `nextInt`.
}
object RNG {
// NB - this was called SimpleRNG in the book text
case class Simple(seed: Long) extends RNG {
def nextInt: (Int,... | gpaturel/FPiS | exercises/src/main/scala/fpinscala/state/State.scala | Scala | mit | 8,711 |
/*
* 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 ... | abhishek-ch/incubator-ignite | examples/src/main/scala/org/apache/ignite/scalar/examples/ScalarCacheAffinityExample.scala | Scala | apache-2.0 | 3,854 |
/*
*************************************************************************************
* 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... | Kegeruneku/rudder | rudder-core/src/main/scala/com/normation/rudder/domain/queries/GroupCategory.scala | Scala | agpl-3.0 | 2,328 |
package graf.gremlin
package process.traversal.dsl.graph
import java.util.{ List ⇒ JList, Optional }
import graf.gremlin.structure.convert.wrapAll._
import org.apache.tinkerpop.gremlin.process.computer.GraphComputer
import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource
import org.apache... | dkrieg/Graf | src/main/scala/graf/gremlin/process/traversal/dsl/graph/GrafGraphTraversalSource.scala | Scala | apache-2.0 | 2,461 |
// Copyright 2017 EPFL DATA Lab (data.epfl.ch)
//
// 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... | epfldata/squid | src/main/scala/squid/ir/CurryEncoding.scala | Scala | apache-2.0 | 3,168 |
package evaluation
import java.io.File
import java.io._
import epic.sequences.SemiCRF
import epic.sequences.SemiConllNerPipeline
import scala.util.control.Breaks._
/**
* Created by elin on 23/03/16.
*/
object EvaluateNegativeAdditions {
def main(args: Array[String]): Unit = {
val modelFileName: String = "... | langkilde/epic | src/main/scala/evaluation/EvaluateNegativeAdditions.scala | Scala | apache-2.0 | 3,839 |
/*
* 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-execution/jvm/src/main/scala/monix/execution/cancelables/ChainedCancelable.scala | Scala | apache-2.0 | 7,284 |
package foo
package object bar {
type IOException = Object
type Bippy[T] = List[T]
}
package object baz {
type Bippy[+T] = List[T]
}
package baz {
import java.io.*
import foo.bar.*
object Test {
def f = new IOException // genuinely different
}
}
package baz2 {
import bar.*
import baz.*
obj... | dotty-staging/dotty | tests/untried/neg/t3836.scala | Scala | apache-2.0 | 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 may ... | maropu/spark | mllib/src/main/scala/org/apache/spark/ml/util/DatasetUtils.scala | Scala | apache-2.0 | 2,705 |
package net.usersource.vbad.lib
import org.scalatest.matchers.MustMatchers
import org.scalatest.{FeatureSpec, GivenWhenThen}
import org.joda.time.format.DateTimeFormat
class CruisePipelineBDDSpec extends FeatureSpec with GivenWhenThen with MustMatchers {
val data = <Projects>
<Project name="Pipel... | glenford/vBaD | src/test/scala/net/usersource/vbad/lib/CruisePipelineBDDSpec.scala | Scala | apache-2.0 | 11,464 |
package skinny.micro.rl
import java.util.Locale.ENGLISH
trait UriScheme extends UriNode {
def scheme: String
def normalize: UriScheme
def apply(): String = scheme
}
case object NoScheme extends UriScheme {
val scheme = ""
val uriPart = scheme
def normalize: NoScheme.type = this
}
object Scheme {
... | xerial/skinny-micro | micro/src/main/scala/skinny/micro/rl/UriScheme.scala | Scala | bsd-2-clause | 972 |
/*
* Scala.js (https://www.scala-js.org/)
*
* Copyright EPFL.
*
* Licensed under Apache License 2.0
* (https://www.apache.org/licenses/LICENSE-2.0).
*
* See the NOTICE file distributed with this work for
* additional information regarding copyright ownership.
*/
package java.security
trait Guard {
def che... | scala-js/scala-js | javalib/src/main/scala/java/security/Guard.scala | Scala | apache-2.0 | 344 |
package notebook
package client
import java.io.{File, FileWriter}
import scala.concurrent.duration._
import scala.util.{Try, Success=>TSuccess, Failure=>TFailure}
import akka.actor.{ActorLogging, Props, Actor}
import kernel._
import sbt._
import notebook.util.{CustomResolvers, Deps, Match}
import notebook.front._
... | jayfans3/spark-notebook | modules/kernel/src/main/scala-2.10/notebook/ReplCalculator.scala | Scala | apache-2.0 | 13,376 |
package client.appstate.groups
import client.appstate.Groups
import diode.data.Pot
import shared.{SelectedPage, TotalPages}
case class GroupComponentZoomedModel (
groups: Pot[Groups],
totalPages: TotalPages,
selectedPage: SelectedPage
)
| beikern/foulkon-ui | client/src/main/scala/client/appstate/groups/GroupComponentZoomedModel.scala | Scala | apache-2.0 | 245 |
package com.tpalanga.newsletter.route
import akka.actor.ActorRef
import akka.http.scaladsl.marshallers.sprayjson.SprayJsonSupport
import akka.http.scaladsl.model.StatusCodes
import akka.http.scaladsl.server.Directives._
import akka.http.scaladsl.server.{Route, ValidationRejection}
import akka.pattern.ask
import akka.u... | tpalanga/akka-http-microservice | newsletterService/src/main/scala/com/tpalanga/newsletter/route/SubscriberRoute.scala | Scala | unlicense | 4,362 |
/*
* 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 ... | mzl9039/spark | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/hints.scala | Scala | apache-2.0 | 2,196 |
package japgolly.scalajs.react.component.builder
import japgolly.microlibs.compiletime.MacroUtils
import japgolly.scalajs.react.Children
import scala.reflect.macros.blackbox.Context
final class ComponentBuilderMacros(val c: Context) extends MacroUtils {
import c.universe._
private def createBackend[B: c.WeakType... | japgolly/scalajs-react | coreGeneric/src/main/scala-2/japgolly/scalajs/react/component/builder/ComponentBuilderMacros.scala | Scala | apache-2.0 | 5,071 |
/**
* Copyright (C) 2014-2015 Really Inc. <http://really.io>
*/
package io.really
import com.typesafe.config.{ ConfigFactory, Config }
import org.scalatest.{ BeforeAndAfterAll, WordSpecLike }
import org.scalatest.Matchers
import akka.remote.testkit.MultiNodeSpecCallbacks
/**
* Hooks up MultiNodeSpec with ScalaTest... | reallylabs/really | modules/really-core/src/test/scala/io/really/STMultiNodeSpec.scala | Scala | apache-2.0 | 1,094 |
package koncept.http.web
trait RequestResources[R] {
def requestStart(): R
def requestEnd(resources: R) : Unit
} | nkrul/http-router | src/main/scala/koncept/http/web/RequestResources.scala | Scala | mit | 128 |
/*
* Scala.js (https://www.scala-js.org/)
*
* Copyright EPFL.
*
* Licensed under Apache License 2.0
* (https://www.apache.org/licenses/LICENSE-2.0).
*
* See the NOTICE file distributed with this work for
* additional information regarding copyright ownership.
*/
package org.scalajs.linker.backend... | scala-js/scala-js | linker/js/src/main/scala-ide-stubs/org/scalajs/linker/backend/emitter/PrivateLibHolder.scala | Scala | apache-2.0 | 440 |
/*
* Copyright (C) 2016-2019 Lightbend Inc. <https://www.lightbend.com>
*/
package com.lightbend.lagom.javadsl.persistence.jdbc
import com.lightbend.lagom.javadsl.persistence.AbstractPersistentEntityActorSpec
class JdbcPersistentEntityActorSpec extends JdbcPersistenceSpec with AbstractPersistentEntityActorSpec
| rstento/lagom | persistence-jdbc/javadsl/src/test/scala/com/lightbend/lagom/javadsl/persistence/jdbc/JdbcPersistentEntityActorSpec.scala | Scala | apache-2.0 | 317 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | ueshin/apache-spark | core/src/main/scala/org/apache/spark/deploy/master/ui/MasterPage.scala | Scala | apache-2.0 | 14,201 |
/**
*
*
*
* 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")... | unix1986/universe | tool/kafka-0.8.1.1-src/core/src/main/scala/kafka/metrics/KafkaCSVMetricsReporter.scala | Scala | bsd-2-clause | 2,694 |
package com.github.j5ik2o.dddbase.example.repository.free
import java.time.ZonedDateTime
import cats.free.Free
import com.github.j5ik2o.dddbase.example.model._
import com.github.j5ik2o.dddbase.example.repository.{ IdGenerator, SpecSupport, UserAccountRepository }
import com.github.j5ik2o.dddbase.example.repository.ut... | j5ik2o/scala-ddd-base-functional | example/src/test/scala/com/github/j5ik2o/dddbase/example/repository/free/UserAccountRepositoryByFreeSpec.scala | Scala | mit | 1,968 |
/*
* AudioFileCache.scala
* (SysSon)
*
* Copyright (c) 2013-2017 Institute of Electronic Music and Acoustics, Graz.
* Copyright (c) 2014-2019 Hanns Holger Rutz. All rights reserved.
*
* This software is published under the GNU General Public License v3+
*
*
* For further information, please contact Hanns ... | iem-projects/sysson | src/main/scala/at/iem/sysson/sound/AudioFileCache.scala | Scala | gpl-3.0 | 1,242 |
/*
* Copyright 2001-2008 Artima, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agre... | hubertp/scalatest | src/main/scala/org/scalatest/SuiteRerunner.scala | Scala | apache-2.0 | 5,382 |
package at.logic.gapt.proofs.lk
import at.logic.gapt.expr._
import at.logic.gapt.examples.induction.{ numbers, lists }
import at.logic.gapt.proofs.SequentMatchers
import org.specs2.mutable.Specification
class MakeInductionExplicitTest extends Specification with SequentMatchers {
"numeral induction" in {
import... | gebner/gapt | tests/src/test/scala/at/logic/gapt/proofs/lk/MakeInductionExplicitTest.scala | Scala | gpl-3.0 | 1,015 |
package pgep.GeneticOperators.Mutators
class PartialTransposition(transpositionProbability: Double, maxTransposonLen: Int, selection: GenotypeSelector) extends Mutator(selection) {
require(maxTransposonLen > 0)
require(transpositionProbability >= 0)
require(transpositionProbability <= 1)
protected[Mutators]... | khernyo/PGEP | src/pgep/GeneticOperators/Mutators/PartialTransposition.scala | Scala | gpl-3.0 | 1,082 |
sealed trait HList
case class C[H, T <: HList](hd : H, tl : T) extends HList
case object N extends HList
sealed abstract class Zip[A,B,R] {
def do_zip(a : A, b : B) : R
}
object Zip {
implicit val basecase
= new Zip[N.type, N.type, N.type] {
def do_zip(n1 : N.type, n2 : N.type) = N
}
implicit ... | kralikba/scala-implicits | 4-hlist-zip-values.scala | Scala | bsd-2-clause | 702 |
/*
* 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... | ericchang/incubator-toree | project/Common.scala | Scala | apache-2.0 | 8,547 |
/* Copyright 2009-2016 EPFL, Lausanne */
import leon.annotation._
import leon.lang._
object Functions1 {
def square(x: Int): Int = x * x
def apply(fun: Int => Int, x: Int): Int = fun(x)
@extern
def main(args: Array[String]): Unit = _main()
def _main(): Int = {
val y = 5
apply({ x: Int => square(... | epfl-lara/leon | src/test/resources/regression/genc/invalid/Functions1.scala | Scala | gpl-3.0 | 365 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | sachintyagi22/spark | core/src/main/scala/org/apache/spark/scheduler/TaskSchedulerImpl.scala | Scala | apache-2.0 | 28,359 |
package org.jetbrains.plugins.scala
package lang
package parser
package parsing
package expressions
import com.intellij.lang.PsiBuilder
import lexer.ScalaTokenTypes
import builder.ScalaPsiBuilder
import annotation.tailrec
import util.ParserUtils
import com.intellij.psi.tree.IElementType
/**
* @author Alexander Podkha... | consulo/consulo-scala | src/org/jetbrains/plugins/scala/lang/parser/parsing/expressions/Block.scala | Scala | apache-2.0 | 2,964 |
package spire.optional
import spire.algebra.PartialOrder
object powerSetPartialOrder {
/** Set partial order defined as follows:
*
* S <= T if S is a subset of T.
*/
class PowerSetPartialOrder[A] extends PartialOrder[Set[A]] {
override def eqv(x: Set[A], y: Set[A]): Boolean = (x == y)
override... | AlecZorab/spire | core/src/main/scala/spire/optional/powerSetPartialOrder.scala | Scala | mit | 901 |
package com.datastax.driver.spark.rdd.reader
import java.lang.reflect.Constructor
import scala.reflect.runtime.universe._
import scala.util.{Failure, Success, Try}
/** Factory for creating objects of any type by invoking their primary constructor.
* Unlike Java reflection Methods or Scala reflection Mirrors, this ... | bovigny/cassandra-driver-spark | src/main/scala/com/datastax/driver/spark/rdd/reader/AnyObjectFactory.scala | Scala | apache-2.0 | 2,239 |
/*
* Copyright 2017 Datamountaineer.
*
* 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... | CodeSmell/stream-reactor | kafka-connect-hazelcast/src/test/scala/com/datamountaineer/streamreactor/connect/hazelcast/sink/TestHazelCastWriter.scala | Scala | apache-2.0 | 7,727 |
/* ___ _ ___ _ _ *\\
** / __| |/ (_) | | The SKilL Generator **
** \\__ \\ ' <| | | |__ (c) 2013 University of Stuttgart **
** |___/_|\\_\\_|_|____| see LICENSE ... | XyzNobody/skill | src/main/scala/de/ust/skill/generator/scala/internal/streams/OutBufferMaker.scala | Scala | bsd-3-clause | 3,991 |
package org.jetbrains.plugins.scala
package codeInsight.intention.imports
import com.intellij.psi._
import com.intellij.psi.util.PsiTreeUtil
import org.jetbrains.plugins.scala.lang.psi.api.toplevel.imports.ScImportExpr
import org.jetbrains.plugins.scala.lang.psi.api.base.{ScStableCodeReferenceElement, ScReferenceEleme... | consulo/consulo-scala | src/org/jetbrains/plugins/scala/codeInsight/intention/imports/ImportMembersUtil.scala | Scala | apache-2.0 | 5,828 |
package test
import org.scalatest.FunSuite
import scala.offheap._
trait AlignmentSuite extends FunSuite {
val alloc: Allocator
test("allocate aligned 1") {
val addr1 = alloc.allocate(1, alignment = 1)
val addr2 = alloc.allocate(1, alignment = 1)
val addr3 = alloc.allocate(1, alignment = 1)
val ad... | adamwy/scala-offheap | tests/src/test/scala/AlignmentSuite.scala | Scala | bsd-3-clause | 3,078 |
#!/usr/bin/env scala-script
//#include included-top.scala
object FromHere {
override def toString = "from-here"
}
println(FromHere)
println(FromTop)
println(FromOne)
println(FromTwo)
println(FromDeeper)
println(FolderIncluded)
println(FolderSourced)
println(FolderContent)
import com.example.two.ExampleTwo
import co... | rvanider/scala-script | test/test.scala | Scala | mit | 408 |
package play.boilerplate.generators.support
import org.scalatest.{FlatSpec, Matchers}
import play.boilerplate.generators._
import play.boilerplate.parser.backend.swagger.SwaggerBackend
class JodaSupportTest extends FlatSpec with Matchers with PrintSyntaxString {
"Joda types support" should "model" in {
val sc... | Romastyi/sbt-play-boilerplate | sbt-plugin/lib/src/test/scala/play/boilerplate/generators/support/JodaSupportTest.scala | Scala | apache-2.0 | 2,130 |
package de.htwg.zeta.server.model.modelValidator.validator.rules.metaModelIndependent
import scala.collection.immutable.Seq
import de.htwg.zeta.common.models.project.concept.elements.AttributeValue
import de.htwg.zeta.common.models.project.concept.elements.AttributeValue.StringValue
import de.htwg.zeta.common.models.... | Zeta-Project/zeta | api/server/test/de/htwg/zeta/server/model/modelValidator/validator/rules/metaModelIndependent/EdgesAttributesNamesNotEmptyTest.scala | Scala | bsd-2-clause | 1,659 |
package apps
/** The `activity` package contains example applications for activity oriented
* simulation models.
*/
package object activity { }
| NBKlepp/fda | scalation_1.3/scalation_models/src/main/scala/apps/activity/package.scala | Scala | mit | 151 |
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you ... | bwsw/sj-platform | core/sj-common/src/main/scala/com/bwsw/sj/common/si/model/service/RestService.scala | Scala | apache-2.0 | 3,804 |
package orz.mongo.tochka.dsl
import com.mongodb.casbah.Imports._
private[tochka]
class IdField(protected val __prefix: String = "") extends Field {
protected
type FieldType = ObjectId
/**
* ObjectIdは特別対応
* https://gist.github.com/fkmt-disk/3e30fc7e9e77d30ce2b7
*/
override
def ==(value: FieldT... | fkmt-disk/tochka | src/main/scala/orz/mongo/tochka/dsl/IdField.scala | Scala | mit | 394 |
package mllib.perf
import org.json4s.JsonAST._
import org.json4s.JsonDSL._
import org.apache.spark.SparkContext
import org.apache.spark.ml.PredictionModel
import org.apache.spark.ml.classification.{GBTClassificationModel, GBTClassifier, RandomForestClassificationModel, RandomForestClassifier}
import org.apache.spark.... | arijitt/spark-perf | mllib-tests/v1p5/src/main/scala/mllib/perf/MLAlgorithmTests.scala | Scala | apache-2.0 | 29,596 |
/*
* 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... | jenniew/BigDL | spark/dl/src/main/scala/com/intel/analytics/bigdl/nn/HardSigmoid.scala | Scala | apache-2.0 | 2,587 |
package org.jetbrains.plugins.scala
package lang
package parser
package parsing
package params
import org.jetbrains.plugins.scala.lang.lexer.ScalaTokenTypes
import org.jetbrains.plugins.scala.lang.parser.parsing.builder.ScalaPsiBuilder
import org.jetbrains.plugins.scala.lang.parser.parsing.expressions.Annotation
impor... | whorbowicz/intellij-scala | src/org/jetbrains/plugins/scala/lang/parser/parsing/params/TypeParam.scala | Scala | apache-2.0 | 2,226 |
package io.youi.component.types
import io.youi.Stringify
object BorderStyle extends Stringify[BorderStyle] {
case object None extends BorderStyle("none")
case object Hidden extends BorderStyle("hidden")
case object Dotted extends BorderStyle("dotted")
case object Dashed extends BorderStyle("dashed")
case ob... | outr/youi | gui/src/main/scala/io/youi/component/types/BorderStyle.scala | Scala | mit | 972 |
/**
* Copyright 2017 ZuInnoTe (Jörn Franke) <zuinnote@gmail.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 required... | ZuInnoTe/spark-hadoopoffice-ds | src/test/scala/org/zuinnote/spark/office/excel/SparkHadoopOfficeExcelDSSpec.scala | Scala | apache-2.0 | 1,281 |
package scodec
package codecs
import scodec.bits.BitVector
/**
* Codec that provides a constant value from decode and ignores the value to encode.
*
* Useful as a combinator with [[DiscriminatorCodec]].
*/
private[codecs] final class ProvideCodec[A](value: A) extends Codec[A] {
override def sizeBound = SizeBoun... | reactific/scodec | shared/src/main/scala/scodec/codecs/ProvideCodec.scala | Scala | bsd-3-clause | 527 |
package example
object Bar {
def bar(x: Int): Int = x
}
| som-snytt/xsbt | sbt/src/sbt-test/source-dependencies/macro-nonarg-dep/macro-client/Bar.scala | Scala | bsd-3-clause | 59 |
package java.lang
import scalanative.runtime.{select, divULong, remULong, undefined, Intrinsics}
final class Long(val longValue: scala.Long)
extends Number
with Comparable[Long] {
@inline def this(s: String) =
this(Long.parseLong(s))
@inline override def byteValue(): scala.Byte =
longValue.toByte... | cedricviaccoz/scala-native | javalib/src/main/scala/java/lang/Long.scala | Scala | bsd-3-clause | 10,385 |
/*
* 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 ... | jkbradley/spark | streaming/src/test/scala/org/apache/spark/streaming/scheduler/ReceiverTrackerSuite.scala | Scala | apache-2.0 | 8,126 |
import java.util.Date
import java.util.concurrent.TimeUnit
import org.apache.spark.SparkContext
import org.apache.spark.broadcast.Broadcast
import org.apache.spark.mllib.linalg.Vectors
import org.apache.spark.mllib.linalg.Vector
import org.apache.spark.rdd.RDD
import scala.collection.mutable.ArrayBuffer
import scala.... | Spikhalskiy/hackaton | src/main/scala/DataPreparingHelpers.scala | Scala | gpl-3.0 | 6,007 |
/**
* Copyright (C) 2010-2011 LShift Ltd.
*
* 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... | 0x6e6562/diffa | agent/src/test/scala/net/lshift/diffa/agent/itest/support/TestEnvironment.scala | Scala | apache-2.0 | 11,482 |
package zmq.test
import org.zeromq.ZMQ
import org.zeromq.ZMQ.{Context,Socket}
object PushPullTestServer {
def main(args : Array[String]) {
val context = ZMQ.context(1)
val push_socket = context.socket(ZMQ.PUSH)
val pull_socket = context.socket(ZMQ.PULL)
println ("starting")
pull_socket.bind ("tc... | nasa-nccs-cds/EDAS | src/main/scala/zmq/test/PushPullTest.scala | Scala | gpl-2.0 | 1,445 |
package quizleague.web.shared
import quizleague.web.core.Component
object MarkdownComponent extends Component {
val name = "ql-markdown"
val template = """
<vue-showdown :markdown="text" :options="settings.options" :flavor="settings.flavor" :vueTemplate="settings.vueTemplate"></vue-showdown>
"""
data("... | gumdrop/quizleague-maintain | js/src/main/scala/quizleague/web/shared/MarkdownComponent.scala | Scala | mit | 373 |
package de.sciss.fscape
import de.sciss.fscape.graph.NormalizeWindow._
import de.sciss.kollflitz.Vec
import scala.annotation.{switch, tailrec}
import scala.concurrent.Promise
import scala.util.Success
class NormalizeWindowSpec extends UGenSpec {
def mkExpected(win: Vector[Double], mode: Int): Vector[Double] = {
... | Sciss/FScape-next | core/jvm/src/test/scala/de/sciss/fscape/NormalizeWindowSpec.scala | Scala | agpl-3.0 | 3,244 |
package org.atnos.eff
package syntax
import cats._
import cats.data.Writer
/**
* Operations of Eff[R, A] values
*/
object eff extends eff
trait eff extends effOperations with effCats
trait effOperations {
implicit final def toEffOps[R, A](e: Eff[R, A]): EffOps[R, A] = new EffOps(e)
implicit final def toEffT... | etorreborre/eff-cats | shared/src/main/scala/org/atnos/eff/syntax/eff.scala | Scala | mit | 4,553 |
/**
* Copyright (C) 2014 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... | martinluther/orbeon-forms | src/main/scala/org/orbeon/oxf/http/Headers.scala | Scala | lgpl-2.1 | 7,435 |
package main.scala.com.cabrol.francois.mural
import java.awt.{Point, Toolkit}
import com.cabrol.francois.libjamu.musictheory.entity.scaleNote.{Chord, Scale}
import com.cabrol.francois.melvi.factory.{GraphicsType, MelodyVisualiserFactory}
import com.cabrol.francois.melvi.view.VisualiserView
import com.cabrol.francois.... | francoiscabrol/MURAL | src/main/scala/com/cabrol/francois/mural/Test.scala | Scala | gpl-3.0 | 2,771 |
package discussion
import blog._
import config._
import com.mongodb.casbah.Imports._
class DiscussionStoreDB(config: DiscussionQueryBuilderConfig)
extends DiscussionStore
{
val collDiscussion = config.mongoClient.getDB("blog")("discussion")
def insert(discussionStarted: DiscussionStarted) = {
collDiscussi... | enpassant/rapids | modules/discussion-query-builder/src/main/scala/topic/DiscussionStoreDB.scala | Scala | apache-2.0 | 1,496 |
package io.udash.auth
import com.avsystem.commons.serialization.{HasGenCodec, transparent}
@transparent
case class PermissionId(value: String) extends AnyVal
object PermissionId extends HasGenCodec[PermissionId]
| UdashFramework/udash-core | auth/src/main/scala/io/udash/auth/PermissionId.scala | Scala | apache-2.0 | 214 |
package dao.helper
import java.util.UUID
import dao.AbstractDao
import dao.helper.TableFilter.labworkFilter
import database.{LabworkIdTable, UniqueTable}
import models.UniqueDbEntity
import slick.jdbc.PostgresProfile.api._
import scala.concurrent.Future
trait CrossInvalidated[T <: Table[DbModel] with UniqueTable wi... | THK-ADV/lwm-reloaded | app/dao/helper/CrossInvalidated.scala | Scala | mit | 647 |
/*
* 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 ... | u2009cf/spark-radar | external/kafka-0-10-sql/src/test/scala/org/apache/spark/sql/kafka010/KafkaSourceOffsetSuite.scala | Scala | apache-2.0 | 4,035 |
package org.littlewings.hazelcast.mapstore
import org.scalatest.FunSpec
import org.scalatest.Matchers._
class NoMapStoreSpec extends FunSpec with HazelcastSpecSupport {
describe("no map-store spec") {
it("start put down, size") {
withHazelcast { hazelcast =>
val map = hazelcast.getMap[String, Stri... | kazuhira-r/hazelcast-examples | hazelcast-mapstore/src/test/scala/org/littlewings/hazelcast/mapstore/NoMapStoreSpec.scala | Scala | mit | 587 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | goldmedal/spark | sql/core/src/test/scala/org/apache/spark/sql/JoinHintSuite.scala | Scala | apache-2.0 | 22,209 |
package info.spielproject.spiel
import android.graphics.Rect
import android.os._
import Build.VERSION
import android.util.Log
import android.view.accessibility._
import AccessibilityNodeInfo._
case class Action(val id:Int)
object Action {
val AccessibilityFocus = Action(ACTION_ACCESSIBILITY_FOCUS)
val ClearAcces... | beqabeqa473/Asra | src/main/scala/RichNode.scala | Scala | apache-2.0 | 6,782 |
/**
* 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... | SumoLogic/sumobot | src/test/scala/com/sumologic/sumobot/core/ReceptionistTest.scala | Scala | apache-2.0 | 6,781 |
val left = Vector("a", "b", "c", "d")
val right = Vector("q", "r", "s", "t")
println(left.zip(right))
println(left.zip(0 to 4))
println(left.zipWithIndex)
def number(s: String) = Range(0, s.length).zip(s)
println(number("Howdy"))
case class Person(name: String, ID: Int)
val names = Vector("Bob", "Jill", "Jim")
... | mkoltsov/AtomicScala | Collections/SequencesZip.scala | Scala | mit | 407 |
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you ... | bwsw/sj-platform | core/sj-common/src/main/scala/com/bwsw/sj/common/dal/model/stream/ESStreamDomain.scala | Scala | apache-2.0 | 1,421 |
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 ProgrammingSubmission entity.
*/
class ProgrammingSu... | ls1intum/ArTEMiS | src/test/gatling/user-files/simulations/ProgrammingSubmissionGatlingTest.scala | Scala | mit | 3,674 |
package tpl.hostiledrops
import net.minecraftforge.common.Configuration
class ConfigurationProxy(cfg: Configuration) {
def getItem(name: String, default: Int) : Int = {
cfg.getItem(name, default).getInt()
}
def getBoolean(category: String, name: String, default: Boolean) : Boolean = {
cfg.get(category, name, ... | piotrb/hostiledrops | src/main/scala/tpl/hostiledrops/ConfigurationProxy.scala | Scala | bsd-2-clause | 353 |
package org.finra.datagenerator.scaffolding.dependency
import java.util.UUID
/**
* Created by dkopel on 10/7/16.
*/
case class Domain(label: String, id: UUID=UUID.randomUUID()) | FINRAOS/DataGenerator | rubber-scaffolding/rubber-dependency/src/main/scala/org/finra/datagenerator/scaffolding/dependency/Domain.scala | Scala | apache-2.0 | 182 |
package ore.db
import slick.lifted.{Rep, TableQuery}
trait AssociationQuery[Assoc <: OreProfile#AssociativeTable[P, C], P, C] {
def baseQuery: TableQuery[Assoc]
def parentRef(t: Assoc): Rep[DbRef[P]]
def childRef(t: Assoc): Rep[DbRef[C]]
}
object AssociationQuery {
def apply[Assoc <: OreProfile#AssociativeTa... | SpongePowered/Ore | db/src/main/scala/ore/db/AssociationQuery.scala | Scala | mit | 904 |
package org.jetbrains.plugins.scala
package base
import java.io.File
import java.util
import com.intellij.ide.startup.impl.StartupManagerImpl
import com.intellij.openapi.application.ApplicationManager
import com.intellij.openapi.module.Module
import com.intellij.openapi.project.Project
import com.intellij.openapi.pro... | triggerNZ/intellij-scala | test/org/jetbrains/plugins/scala/base/ScalaLibraryLoader.scala | Scala | apache-2.0 | 7,421 |
/*
* 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 t... | pteichman/zipkin | zipkin-sampler/src/test/scala/com/twitter/zipkin/sampler/AdaptiveSamplerTest.scala | Scala | apache-2.0 | 3,396 |
package club.diybio.bank.domain
sealed trait CloningInfo
case class RestrictionEnzymeCloningInfo(
fivePrimeSite: Option[RestrictionCloningSite],
threePrimeSite: Option[RestrictionCloningSite],
fivePrimeSequencingPrimer: Option[Primer],
threePrimeSequencingPrimer: Option[Primer]) extends CloningInfo
| denigma/plasmid-bank | shared/src/main/scala/club/diybio/bank/domain/CloningInfo.scala | Scala | mpl-2.0 | 310 |
package name.namefix
import name.GensymPure._
import name._
import name.namegraph.NameGraphModular
import name.namegraph.NameGraphModular.Nodes
class NameFixModular[I <: NameInterface] {
protected def findRelations(n: Identifier,g: NameGraphModular[I], result: Nodes = Set()): Nodes = {
var newResult = result + ... | seba--/hygienic-transformations | scala/src/main/scala/name/namefix/NameFixModular.scala | Scala | lgpl-3.0 | 5,740 |
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.