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) 2014-2015 by its authors. Some rights reserved.
* See the project homepage at: http://www.monifu.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://... | sergius/monifu | core/js/src/main/scala/monifu/concurrent/atomic/padded/Atomic.scala | Scala | apache-2.0 | 1,735 |
package scala.meta.trees
import com.intellij.psi.{PsiElement, PsiFile}
import org.jetbrains.plugins.scala.lang.psi.api.base._
import org.jetbrains.plugins.scala.lang.psi.api.base.patterns._
import org.jetbrains.plugins.scala.lang.psi.api.base.types._
import org.jetbrains.plugins.scala.lang.psi.api.expr._
import org.je... | JetBrains/intellij-scala | scala/scala-impl/src/scala/meta/trees/TreeConverterBuilder.scala | Scala | apache-2.0 | 9,353 |
/*
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 to in writing, software
distr... | lucamilanesio/scalding | scalding-core/src/main/scala/com/twitter/scalding/FileSource.scala | Scala | apache-2.0 | 14,894 |
package org.jetbrains.plugins.scala.projectHighlighting
import org.jetbrains.plugins.scala.HighlightingTests
import org.junit.experimental.categories.Category
/**
* Nikolay.Tropin
* 01-Aug-17
*/
@Category(Array(classOf[HighlightingTests]))
class BetterFilesProjectHighlighingTest extends GithubSbtAllProjectHighl... | loskutov/intellij-scala | test/org/jetbrains/plugins/scala/projectHighlighting/BetterFilesProjectHighlighingTest.scala | Scala | apache-2.0 | 510 |
package handlers.server
import handlers.GameClient
import handlers.packets.{PacketWriter, ServerCodes}
import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.Future
/**
* Created by franblas on 14/04/17.
*/
class NonHybridSpellLines(gameClient: GameClient) {
def process(): Future[Arr... | franblas/NAOC | src/main/scala/handlers/server/NonHybridSpellLines.scala | Scala | mit | 681 |
package io.criticality.cookbook.scala
import java.io._
import org.apache.commons._
import org.apache.http._
import org.apache.http.client._
import org.apache.http.client.methods.HttpPost
import org.apache.http.impl.client.DefaultHttpClient
import java.util.ArrayList
import org.apache.http.message.BasicNameValuePair
im... | schmiegelow/scala-cookbook | src/main/scala/io/criticality/cookbook/scala/SimpleHttpClient.scala | Scala | gpl-2.0 | 3,830 |
package test
import edu.mit.csail.cap.query._
import util._
import org.scalatest._
import java.util.concurrent.Executors
class IntervalSpec extends FunSuite {
val POOL_SIZE = 4
// Increase N for a larger scope of model checking
val N = 2
val intervals: Seq[Interval] =
(for (i <- 0 to N; j <- i + 1 to N) ... | kyessenov/semeru | src/test/scala/test/IntervalSpec.scala | Scala | gpl-3.0 | 3,191 |
package org.pico.twiddle.syntax
import org.pico.twiddle.FixedInt2FixedInt
package object fixedInt2FixedInt {
implicit class FixedInt2FixedIntOps[A](val self: A) extends AnyVal {
def fixAs[B](implicit ev: FixedInt2FixedInt[A, B]): B = ev.fixAs(self)
}
}
| newhoggy/pico-cuckoo-filter | pico-twiddle/src/main/scala/org/pico/twiddle/syntax/fixedInt2FixedInt/package.scala | Scala | bsd-3-clause | 263 |
package ml.combust.mleap.core.tree
/** Trait for a decision tree.
*/
trait DecisionTree extends Serializable {
/** Root node of the decision tree.
*
* @return root node
*/
def rootNode: Node
}
| combust-ml/mleap | mleap-core/src/main/scala/ml/combust/mleap/core/tree/DecisionTree.scala | Scala | apache-2.0 | 212 |
/*
* 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... | yyuu/scalatest | src/test/scala/org/scalatest/matchers/ShouldPlusOrMinusSpec.scala | Scala | apache-2.0 | 83,973 |
package com.bwsw.tstreamstransactionserver.options
import com.bwsw.tstreamstransactionserver.netty.client.Client
import com.bwsw.tstreamstransactionserver.options.ClientOptions._
import com.bwsw.tstreamstransactionserver.options.CommonOptions.ZookeeperOptions
import org.apache.curator.framework.CuratorFramework
clas... | bwsw/tstreams-transaction-server | src/main/scala/com/bwsw/tstreamstransactionserver/options/ClientBuilder.scala | Scala | apache-2.0 | 1,653 |
package org.receiver2d.engine.graphics
case class RGBA(r: Float, g: Float, b: Float, a: Float) {
private val arr = Array(r,g,b,a)
def apply(i: Int) = arr.apply(i)
/* TODO: more useful color functions */
}
object RGBA {
final def red = RGBA(1,0,0,1)
final def green = RGBA(0,1,0,1)
final def blue = RGBA(0,0... | Prince781/Receiver2D | src/main/scala/org/receiver2d/engine/graphics/RGBA.scala | Scala | gpl-2.0 | 361 |
/*
* 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 ... | ron8hu/spark | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/nullExpressions.scala | Scala | apache-2.0 | 13,709 |
package de.htwg.zeta.server.model.modelValidator.generator.consistencyRules
import scala.collection.immutable.Seq
import de.htwg.zeta.common.models.project.concept.elements.MClass
import de.htwg.zeta.common.models.project.concept.Concept
import org.scalatest.flatspec.AnyFlatSpec
import org.scalatest.matchers.should.M... | Zeta-Project/zeta | api/server/test/de/htwg/zeta/server/model/modelValidator/generator/consistencyRules/NoCyclicInheritanceTest.scala | Scala | bsd-2-clause | 3,955 |
package monocle.std
import monocle.MonocleSuite
import monocle.law.discipline.IsoTests
import monocle.law.discipline.function._
import scalaz.Cofree
import scalaz.std.option.optionInstance
class CofreeSpec extends MonocleSuite {
checkAll("cofreeToStream", IsoTests(cofreeToStream[Int]))
checkAll("cofreeToTree",... | japgolly/Monocle | test/src/test/scala/monocle/std/CofreeSpec.scala | Scala | mit | 512 |
/*
* 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/test/scala/com/intel/analytics/bigdl/dllib/utils/tf/loaders/TruncateDivSpec.scala | Scala | apache-2.0 | 1,329 |
package autolift.cats
import autolift.{LiftMergeWith, LiftedMergeWith, LiftMergeWithSyntax, LiftMergeWithContext}
import cats.{Functor, Apply}
trait CatsLiftMergeWith[Obj1, Obj2, Fn] extends LiftMergeWith[Obj1, Obj2, Fn]
with Serializable
object CatsLiftMergeWith extends LowPriorityCatsLiftMergeWith{
def apply[... | wheaties/AutoLifts | autolift-cats/src/main/scala/autolift/cats/LiftMergeWith.scala | Scala | apache-2.0 | 1,563 |
/*
* Copyright 2014, by Vladimir Kostyukov and Contributors.
*
* This file is a part of a Finch library that may be found at
*
* https://github.com/finagle/finch
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
* You may... | trane/finch | core/src/test/scala/io/finch/ServiceOpsSpec.scala | Scala | apache-2.0 | 1,422 |
/*
* Copyright 2015 Dennis Vriend
*
* 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... | dnvriend/activiti-test | helloworld/src/test/scala/com/github/dnvriend/HistoryServiceTest.scala | Scala | apache-2.0 | 1,551 |
package cakesolutions.kafka.akka
import java.time.LocalDateTime
import java.time.temporal.ChronoUnit
import akka.actor._
import cakesolutions.kafka.KafkaConsumer
import com.typesafe.config.Config
import org.apache.kafka.clients.consumer.{CommitFailedException, KafkaConsumer => JKafkaConsumer}
import org.apache.kafka.... | simonsouter/scala-kafka-client | akka/src/main/scala/cakesolutions/kafka/akka/KafkaConsumerActor.scala | Scala | mit | 41,215 |
import org.opencv.imgcodecs.Imgcodecs
import org.opencv.features2d.DescriptorExtractor
import org.opencv.features2d.Features2d
import org.opencv.core.MatOfKeyPoint
import org.opencv.core.Mat
import org.opencv.features2d.FeatureDetector
import org.opencv.features2d.DescriptorMatcher
import org.opencv.core.MatOfDMatch
im... | DamianPilot382/Rubiks-Cube-Solver | opencv/sources/samples/java/sbt/src/main/scala/ScalaCorrespondenceMatchingDemo.scala | Scala | apache-2.0 | 2,879 |
/*
* 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 ... | yew1eb/flink | flink-libraries/flink-table/src/main/scala/org/apache/flink/table/codegen/ExpressionReducer.scala | Scala | apache-2.0 | 4,903 |
package cmdreader.std
import cmdreader._
import types._
import util._
import java.math.BigInteger
class OAvg extends CommandOperator {
override def getName(): String = "avg"
override def getOpAlias() = "@"
override def isValidArg0(n: Int): Boolean = n == 2
override def apply(args: Array[Type]): Type = {
M... | bluebear94/bag | src/main/scala/cmdreader/std/OAvg.scala | Scala | gpl-3.0 | 520 |
/*
Author:
Matei Zaharia
Developed as part of the SNAP project (http://snap.cs.berkeley.edu/)
*/
package siren
import scala.collection.mutable.ArrayBuffer
object Utils {
/** Count how many bytes in the array are equal to a given value */
def count(bytes: Array[Byte], value: Byte): Int = {
var i = 0... | fnothaft/siren-release | src/main/scala/siren/Utils.scala | Scala | bsd-2-clause | 4,629 |
package org.functionalkoans.forscala
import org.functionalkoans.forscala.support.KoanFunSuite
import org.scalatest.Matchers
class AboutLazySequences extends KoanFunSuite with Matchers {
koan("Creating a lazy collection form a strict collection") {
val strictList = List(10, 20, 30)
val lazyList = strictList... | pharmpress/codingdojo | scala-koans/src/test/scala/org/functionalkoans/forscala/AboutLazySequences.scala | Scala | apache-2.0 | 1,574 |
/*
* 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 ... | matthewfranglen/spark | streaming/src/main/scala/org/apache/spark/streaming/ui/AllBatchesTable.scala | Scala | mit | 6,627 |
package io.buoyant.linkerd
import com.twitter.finagle.service.Retries
import com.twitter.util.Duration
import io.buoyant.config.Parser
import io.buoyant.router.RetryBudgetConfig
import org.scalatest.FunSuite
class RetriesConfigTest extends FunSuite {
def parse(yaml: String): RetriesConfig = {
val mapper = Pars... | denverwilliams/linkerd | linkerd/core/src/test/scala/io/buoyant/linkerd/RetriesConfigTest.scala | Scala | apache-2.0 | 1,851 |
package com.rasterfoundry.database
import com.rasterfoundry.datamodel._
import com.rasterfoundry.common.Generators.Implicits._
import com.rasterfoundry.database.Implicits._
import doobie.implicits._
import cats.implicits._
import org.scalacheck.Prop.forAll
import org.scalatest._
import org.scalatestplus.scalacheck.Che... | aaronxsu/raster-foundry | app-backend/db/src/test/scala/com/azavea/rf/database/ProjectDaoSpec.scala | Scala | apache-2.0 | 23,679 |
package org.sisioh.config
import com.typesafe.config.ConfigResolveOptions
object ConfigurationResolveOptions {
private[config] def apply(
useSystemEnvironment: Boolean): ConfigurationResolveOptions =
new ConfigurationResolveOptionsImpl(useSystemEnvironment)
def defaults: ConfigurationResolveOptions = ... | sisioh/sisioh-config | config/src/main/scala/org/sisioh/config/ConfigurationResolveOptions.scala | Scala | apache-2.0 | 1,074 |
object Test {
def prettyPrintArray(x: Array[_]) = println("Array(" + x.mkString(", ") + ")")
def main(args: Array[String]): Unit = {
prettyPrintArray(Array(1,2,3) :+ 4)
prettyPrintArray(1 +: Array(2,3,4))
prettyPrintArray(Array() :+ 1)
prettyPrintArray(1 +: Array())
}
}
| yusuke2255/dotty | tests/run/array-addition.scala | Scala | bsd-3-clause | 295 |
/*
* Copyright (C) FuseSource, Inc.
* http://fusesource.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 by ... | janstey/fuse | fabric/fabric-camel-dslio/src/main/scala/org/fusesource/fabric/camel/dslio/JavaDslWriter.scala | Scala | apache-2.0 | 2,393 |
/*
* Copyright 2014 JHC Systems Limited
*
* 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... | jhc-systems/sqlest | sqlest/src/test/scala/sqlest/executor/ExecutorSpec.scala | Scala | apache-2.0 | 17,993 |
package cl.asa.yaml.cchart
class Cchart {
var form: Array[String] = Array.empty
var ctype: String = ""
def setForm(list: Array[String]) {
this.form = list
}
def setCtype(str: String) {
this.ctype = str
}
} | Takeuchi-Lab-LM/scala_asa3 | ASA/src/main/scala/cl/asa/yaml/cchart/Cchart.scala | Scala | mit | 218 |
package mesosphere.marathon
package core.task.update.impl.steps
import akka.Done
import mesosphere.UnitTest
import mesosphere.marathon.core.instance.TestInstanceBuilder
import mesosphere.marathon.core.instance.update.{ InstanceChange, InstanceChangeHandler }
import mesosphere.marathon.core.task.bus.TaskStatusUpdateTes... | guenter/marathon | src/test/scala/mesosphere/marathon/core/task/update/impl/steps/ContinueOnErrorStepTest.scala | Scala | apache-2.0 | 2,792 |
package rugloom.rug
/**
* RugLoom - Explorative analysis pipeline prototype
* Created by oliverr on 8/11/2015.
*/
object VariStats {
def apply(vari: Variation, ns: Map[Int, Int]): VariStats =
VariStats(vari, ns.getOrElse(0, 0), ns.getOrElse(1, 0), ns.getOrElse(2, 0))
}
case class VariStats(vari: Variation, n... | curoli/rugloom-client | app/rugloom/rug/VariStats.scala | Scala | mit | 748 |
package epic.sequences
import epic.framework.LossAugmentation
import epic.constraints.LabeledSpanConstraints
import breeze.util.{OptionIndex, Index}
/**
* TODO
*
* @author dlwh
**/
class HammingLossAugmentation[L, W](startSymbol: L, labelIndex: Index[L],
precisionScale: Double ... | langkilde/epic | src/main/scala/epic/sequences/HammingLossAugmentation.scala | Scala | apache-2.0 | 1,509 |
/*
* 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 ... | michalsenkyr/spark | core/src/main/scala/org/apache/spark/ExecutorAllocationManager.scala | Scala | apache-2.0 | 38,653 |
package com.outr.arango.api.model
import io.circe.Json
case class DeleteAPIAqlfunctionRc200(error: Boolean,
code: Option[Long] = None,
deletedCount: Option[Long] = None) | outr/arangodb-scala | api/src/main/scala/com/outr/arango/api/model/DeleteAPIAqlfunctionRc200.scala | Scala | mit | 246 |
package org.clulab.twitter4food
import org.clulab.twitter4food.util._
object TestDownloadAccounts {
def main(args: Array[String]): Unit = {
val keyset = args(0).toInt
val numWindows = args(1).toInt
val (api, config) = Utils.init(keyset)
val hlMap = Utils.loadHandles(s"${config.getString("classifier"... | clulab/twitter4food | src/test/scala/org/clulab/twitter4food/TestDownloadAccounts.scala | Scala | apache-2.0 | 605 |
/*
* 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 ... | DieBauer/flink | flink-libraries/flink-table/src/main/scala/org/apache/flink/table/catalog/InMemoryExternalCatalog.scala | Scala | apache-2.0 | 5,075 |
package scintuit.contrib.play.data.api
import play.api.libs.json._
import scintuit.data.api.institution._
import scintuit.contrib.play.data.raw
object institution {
object InstitutionFormats extends InstitutionFormats
trait InstitutionFormats {
import raw.institution.{InstitutionFormats => RawInstitutionFo... | drbild/scintuit | contrib/play-json/src/main/scala/scintuit/contrib/play/data/api/institution.scala | Scala | apache-2.0 | 980 |
package com.github.wakfudecrypt.types.data
import com.github.wakfudecrypt._
@BinaryDecoder
case class HavenBagModelView(
id: Int,
restrictionWorld: Boolean,
restrictionMarket: Boolean,
backgroundMapId: Int,
innate: Boolean,
_5_float32: Float,
_6_float32: Float,
_7_float32: Float
)
object HavenBagMode... | jac3km4/wakfudecrypt | types/src/main/scala/com/github/wakfudecrypt/types/data/HavenBagModelView.scala | Scala | mit | 404 |
package com.github.ldaniels528.trifecta.util
import scala.util.{Failure, Success, Try}
/**
* Parsing Helper
* @author lawrence.daniels@gmail.com
*/
object ParsingHelper {
def deQuote(quotedString: String): String = {
quotedString match {
case s if s.startsWith("`") && s.endsWith("`") => s.drop(1).drop... | ldaniels528/trifecta | src/main/scala/com/github/ldaniels528/trifecta/util/ParsingHelper.scala | Scala | apache-2.0 | 4,177 |
package org.akoshterek.backgammon.agent.fa
import org.encog.neural.networks.BasicNetwork
abstract class AbsNeuralNetworkFA(val network: BasicNetwork) extends NeuralNetworkFA {
}
| akoshterek/MultiGammonJava | multi-gammon-core/src/main/java/org/akoshterek/backgammon/agent/fa/AbsNeuralNetworkFA.scala | Scala | gpl-3.0 | 183 |
package pdi.jwt
import scala.util.matching.Regex
import java.time.Clock
/** Test implementation of [[JwtCore]] using only Strings. Most of the time, you should use a lib
* implementing JSON and shouldn't be using this object. But just in case you need pure Scala support,
* here it is.
*
* To see a full list o... | pauldijou/jwt-scala | core/src/main/scala/Jwt.scala | Scala | apache-2.0 | 4,920 |
package ionroller.deployment.eb
import java.io.{ByteArrayInputStream, ByteArrayOutputStream}
import java.util.zip.{ZipEntry, ZipOutputStream}
import com.amazonaws.services.elasticbeanstalk.AWSElasticBeanstalk
import com.amazonaws.services.elasticbeanstalk.model._
import com.amazonaws.services.s3.AmazonS3
import com.a... | browngeek666/ionroller | core/src/main/scala/ionroller/deployment/eb/EBSDeployer.scala | Scala | mit | 5,512 |
package com.hindog.grid.repo
class ResourceNotAcceptedException(val resource: Resource, val repository: Repository, reason: String) extends RuntimeException(s"Resource $resource was rejected by repository $repository (reason: $reason)")
object ResourceNotAcceptedException {
def readOnly(resource: Resource, repo: Rep... | hindog/grid-executor | grid-executor/src/main/scala/com/hindog/grid/repo/ResourceNotAcceptedException.scala | Scala | apache-2.0 | 864 |
package cgta.oscala
package extensions
//////////////////////////////////////////////////////////////
// Copyright (c) 2014 Ben Jackman
// All Rights Reserved
// please contact ben@jackman.biz
// for licensing inquiries
// Created by bjackman @ 8/11/14 3:27 AM
/////////////////////////////////////////////////////////... | cgta/open | oscala/shared/src/main/scala/cgta/oscala/extensions/BooleanExtensions.scala | Scala | mit | 601 |
package ca.innovativemedicine.vcf.solr
import org.apache.solr.common.SolrInputDocument
import org.apache.solr.client.solrj.SolrServer
import org.apache.solr.client.solrj.impl.ConcurrentUpdateSolrServer
import scala.collection.mutable
/**
* Provides instances of `SolrServer`s that can be used to query and update
*... | innovativemedicine/vcfimp | vcfimp-solr/src/main/scala/ca/innovativemedicine/vcf/solr/SolrServerProvider.scala | Scala | bsd-2-clause | 2,261 |
package examples1
case class VarArgsCaseClass(args: String *)
| pharmpress/codingdojo | scala-case/src/main/scala/examples1/VarArgsCaseClass.scala | Scala | apache-2.0 | 63 |
package lila.video
case class TagNb(_id: Tag, nb: Int) {
def tag = _id
def empty = nb == 0
def isNumeric = tag forall (_.isDigit)
}
case class Filter(tags: List[String]) {
def toggle(tag: String) =
copy(
tags = if (tags contains tag) tags filter (tag !=) else tags :+ tag
)
}
case class User... | luanlv/lila | modules/video/src/main/control.scala | Scala | mit | 774 |
/**
* Copyright 2016 www.alaraph.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 by applicable ... | maumorelli/alaraph | util/test/com/alaraph/util/ATAvg.scala | Scala | apache-2.0 | 1,571 |
/*
* Copyright 2017 helloscala.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 by applicable law or agreed ... | helloscala/helloscala | hs-core/src/main/scala/helloscala/common/data/IdValue.scala | Scala | apache-2.0 | 674 |
/* sbt -- Simple Build Tool
* Copyright 2009, 2010, 2011 Mark Harrah
*/
package xsbt.api
import scala.util
import xsbti.api._
import util.MurmurHash
import TagTypeVariables.TypeVars
import HashAPI.Hash
object HashAPI
{
type Hash = Int
def apply(a: SourceAPI): Hash =
{
/** de Bruijn levels for type parameters i... | kuochaoyi/xsbt | compile/api/HashAPI.scala | Scala | bsd-3-clause | 9,144 |
package wom.types
import spray.json.{JsNumber, JsString}
import wom.values.{WomFloat, WomString}
import scala.util.{Success, Try}
case object WomFloatType extends WomPrimitiveType {
val toDisplayString: String = "Float"
override protected def coercion = {
case f: Float => WomFloat(f.toDouble)
case d: Do... | ohsu-comp-bio/cromwell | wom/src/main/scala/wom/types/WomFloatType.scala | Scala | bsd-3-clause | 2,098 |
/*
* 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 ... | dotunolafunmiloye/spark | core/src/main/scala/org/apache/spark/storage/BlockFetcherIterator.scala | Scala | apache-2.0 | 14,163 |
/*
* 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 ... | hequn8128/flink | flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/plan/rules/physical/batch/EnforceLocalHashAggRule.scala | Scala | apache-2.0 | 3,115 |
/*
* 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 ... | mylog00/flink | flink-libraries/flink-table/src/test/scala/org/apache/flink/table/api/stream/table/stringexpr/AggregateStringExpressionTest.scala | Scala | apache-2.0 | 4,513 |
/*
* Copyright (c) 2014 Robert Conrad - All Rights Reserved.
* Unauthorized copying of this file, via any medium is strictly prohibited.
* This file is proprietary and confidential.
* Last modified by rconrad, 12/24/14 6:06 PM
*/
package base.entity.auth.context
/**
* Parameters for setting auth context values
... | robconrad/base-api | project-entity/src/main/scala/base/entity/auth/context/AuthContextParams.scala | Scala | mit | 405 |
package gv.jleon
package facade
trait JLeonImports {
type Mirror = domain.Mirror
val Mirror = domain.Mirror
type Storage = domain.Storage
val Storage = domain.Storage
type FetchManager = domain.FetchManager
val FetchManager = domain.FetchManager
type MirrorRepository = domain.MirrorRepository
type ... | mouchtaris/jleon | src/main/scala-2.12/gv/jleon/facade/JLeonImports.scala | Scala | mit | 466 |
package basic.bundles
import scala.reflect.macros.blackbox.Context
/**
* マクロバンドルの実装
*
* http://docs.scala-lang.org/ja/overviews/macros/basic.bundles.html
*/
class BundlesSample01Impl(val c: Context) {
def mono = c.literalUnit
def poly[T: c.WeakTypeTag] = c.literal(c.weakTypeOf[T].toString)
}
object BundlesSa... | thachi/scala-macro-sample | macro/src/main/scala/basic/bundles/BundlesSample01.scala | Scala | apache-2.0 | 603 |
package wandou.math.timeseries
import akka.actor.Actor
import wandou.math.timeseries.descriptor.Content
import wandou.actors.Publisher
/**
*
* @author Caoyuan Deng
*/
trait Thing extends Actor with Publisher {
def identifier: String
def name: String
def description: String
def description_=(description:... | wandoulabs/wandou-math | wandou-math/src/main/scala/wandou/math/timeseries/Thing.scala | Scala | apache-2.0 | 765 |
/***********************************************************************
* Copyright (c) 2013-2022 Commonwealth Computer Research, Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Apache License, Version 2.0
* which accompanies this distribution and... | locationtech/geomesa | geomesa-tools/src/main/scala/org/locationtech/geomesa/tools/status/VersionCommand.scala | Scala | apache-2.0 | 1,283 |
package org.jetbrains.sbt.language.completion
import com.intellij.codeInsight.completion._
import com.intellij.codeInsight.lookup.{LookupElement, LookupElementBuilder}
import com.intellij.codeInsight.template._
import com.intellij.codeInsight.template.impl.ConstantNode
import com.intellij.openapi.project.Project
impor... | JetBrains/intellij-scala | scala/scala-impl/src/org/jetbrains/sbt/language/completion/SbtScalacOptionsCompletionContributor.scala | Scala | apache-2.0 | 8,078 |
package dao.alertwatcherpacs
import slick.lifted.TableQuery
import scala.concurrent.Future
/**
* Defines base dao structure every dao should have.
*/
trait BaseDao[T <: Any] {
def toTable(): TableQuery[_]
def findAll(): Future[Seq[T]]
def remove(id: Long): Future[Int]
def insert(o: T): Future[Unit]
def up... | tnddn/iv-web | portal/rest-portal/app/dao/alertwatcherpacs/BaseDao.scala | Scala | apache-2.0 | 391 |
package amora.backend.indexer
import java.io.ByteArrayInputStream
import java.nio.charset.StandardCharsets
import scala.concurrent.Await
import scala.concurrent.Promise
import scala.concurrent.duration.Duration
import scala.util.Failure
import scala.util.Success
import org.apache.jena.query.QuerySolution
import org.... | sschaef/scalajs-test | backend/src/test/scala/amora/backend/indexer/RestApiTest.scala | Scala | mit | 16,846 |
package org.improving.scalify
import Scalify._
import org.eclipse.jdt.core._
import org.eclipse.jdt.core.dom
import scala.collection.mutable.{ HashMap, HashSet }
import scala.collection.immutable
// import scalaz.OptionW._
object Global {
private var members: Members = _
var javaProject: IJavaProject = _
def setM... | mbana/scalify | src/main/core/Global.scala | Scala | isc | 3,433 |
package com.trafficland.augmentsbt.versionmanagement
import sbt.SettingKey
trait VersionManagementKeys {
val versionSettingRegexes: SettingKey[Seq[String]] = SettingKey[Seq[String]](
"version-setting-regexes",
"a list of regexes to use to replace versions"
)
}
| trafficland/augment-sbt | src/main/scala/com/trafficland/augmentsbt/versionmanagement/VersionManagementKeys.scala | Scala | apache-2.0 | 275 |
/*
Copyright 2012 Anton Kraievoy akraievoy@gmail.com
This file is part of Holonet.
Holonet is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later vers... | akraievoy/holonet | src/main/scala/org/akraievoy/holonet/exp/Named.scala | Scala | gpl-3.0 | 783 |
/*
* Copyright 2013 Twitter Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License. You may obtain
* a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to... | twitter/storehaus | storehaus-mysql/src/main/scala/com/twitter/storehaus/mysql/ValueMapper.scala | Scala | apache-2.0 | 6,481 |
package querious
import hedgehog._
import hedgehog.runner._
import StringInterpolation._
import fastparse.core.Parsed.{Failure, Success}
import eu.timepit.refined.auto._
import fastparse.core.Parsed
/**
* @author Kevin Lee
* @since 2017-07-22
*/
object StringCharsParserSpec extends Properties {
override def te... | Kevin-Lee/sql-parser-scala | src/test/scala/querious/StringCharsParserSpec.scala | Scala | mit | 1,953 |
/**
* Copyright 2017 WorldWide Conferencing, LLC
*
* 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 ... | liftmodules/kafka-actors | src/main/scala/net/liftmodules/kafkaactors/KafkaActor.scala | Scala | apache-2.0 | 6,593 |
package com.chinthaka.imagesimilarity.util
import org.bytedeco.javacpp.opencv_core._
import org.bytedeco.javacpp.opencv_imgproc._
import org.bytedeco.javacpp.{FloatPointer, IntPointer, PointerPointer}
/**
* Helper class that simplifies usage of OpenCV `calcHist` function for color images.
*
* See OpenCV [[http://o... | echinthaka/ImageSimilarity | src/main/scala/com/chinthaka/imagesimilarity/util/ColorHistogram.scala | Scala | apache-2.0 | 4,358 |
package dispatch.spec
import org.scalacheck._
import net.liftweb.json._
import JsonDSL._
import dispatch._
import org.asynchttpclient._
import org.mockito.Mockito._
object BasicSpecification extends Properties("Lift Json") {
import Prop.forAll
property("parse json") = forAll(Gen.alphaStr) { sample =>
val moc... | dispatch/reboot | liftjson/src/test/scala/json.scala | Scala | lgpl-3.0 | 571 |
///*
//active-learning-scala: Active Learning library for Scala
//Copyright (c) 2014 Davi Pereira dos Santos
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the L... | active-learning/active-learning-scala | src/main/scala/exp/tex/ALCAccAllClassif.scala | Scala | gpl-2.0 | 1,484 |
package com.datawizards.dqm.repository
import com.datawizards.dqm.alert.dto.SlackMessage
import org.json4s.{DefaultFormats, Formats}
import scalaj.http._
import org.json4s.jackson.Serialization
class SlackWebHookRepositoryImpl(webHookUrl: String) extends SlackWebHookRepository {
implicit val formats: Formats = Def... | piotr-kalanski/data-quality-monitoring | src/main/scala/com/datawizards/dqm/repository/SlackWebHookRepositoryImpl.scala | Scala | apache-2.0 | 610 |
import stainless.lang._
object ObjectParamMutation1 {
case class A(var y: Int)
def update(a: A): Int = {
a.y = 12
a.y
} ensuring(res => res == 12)
def f(): Int = {
val a = A(10)
update(a)
a.y
} ensuring(res => res == 12)
}
| epfl-lara/stainless | frontends/benchmarks/imperative/valid/ObjectParamMutation1.scala | Scala | apache-2.0 | 258 |
package com.datastax.spark.connector.util
object SpanningIteratorBenchmark extends App {
val iterator = Iterator.from(0)
val groupsOf1 = new SpanningIterator(iterator, (i: Int) => i)
val groupsOf10 = new SpanningIterator(iterator, (i: Int) => i / 10)
val groupsOf1000 = new SpanningIterator(iterator, (i: Int) ... | viirya/spark-cassandra-connector | spark-cassandra-connector/src/perf/scala/com/datastax/spark/connector/util/SpanningIteratorBenchmark.scala | Scala | apache-2.0 | 689 |
/*
* Copyright 2010 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... | hydro2k/ostrich | src/main/scala/com/twitter/ostrich/admin/config/AdminServiceConfig.scala | Scala | apache-2.0 | 4,641 |
/*
* This file is part of the ToolXiT project.
*
* 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... | gnieh/toolxit-bibtex | src/main/scala/toolxit/bibtex/renderer/XmlRenderer.scala | Scala | apache-2.0 | 848 |
/*
* 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 ... | trueyao/spark-lever | mllib/src/main/scala/org/apache/spark/mllib/util/MFDataGenerator.scala | Scala | apache-2.0 | 4,644 |
package com.wavesplatform.transaction
import com.wavesplatform.account.PublicKey
trait Authorized {
val sender: PublicKey
}
| wavesplatform/Waves | node/src/main/scala/com/wavesplatform/transaction/Authorized.scala | Scala | mit | 127 |
package org.jetbrains.plugins.scala
package util
import com.intellij.notification._
import com.intellij.openapi.project.Project
import org.jetbrains.annotations.{Nls, NonNls}
import java.net.URL
import javax.swing.event.HyperlinkEvent
import scala.collection.mutable
/**
* User: Dmitry Naydanov
* Date: 11/27/13
*/... | JetBrains/intellij-scala | scala/scala-impl/src/org/jetbrains/plugins/scala/util/NotificationUtil.scala | Scala | apache-2.0 | 3,007 |
/**
* Copyright 2014-2015 Martin Cooper
*
* 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 ... | martincooper/scala-datatable | src/test/scala/com/github/martincooper/datatable/DataSetSpecs/DataSetInsertTableSpec.scala | Scala | apache-2.0 | 3,713 |
package code.service
import code.model.{Role, User, UserRoles}
import net.liftweb.mapper.By
object UserService {
def nonAdmin(u: User): Boolean = {
val admin = Role.find(By(Role.name, "admin"))
val client = Role.find(By(Role.name, "client"))
UserRoles.findAll(By(UserRoles.role, admin), By(UserRoles.user... | dodie/time-admin | src/main/scala/code/service/UserService.scala | Scala | apache-2.0 | 427 |
package org.jetbrains.plugins.scala.debugger.evaluateExpression
import org.jetbrains.plugins.scala.debugger.{ScalaDebuggerTestCase, ScalaVersion_2_11, ScalaVersion_2_12}
/**
* User: Alefas
* Date: 19.10.11
*/
class ScalaExpressionsEvaluator extends ScalaExpressionsEvaluatorBase with ScalaVersion_2_11
class ScalaE... | double-y/translation-idea-plugin | test/org/jetbrains/plugins/scala/debugger/evaluateExpression/ScalaExpressionsEvaluator.scala | Scala | apache-2.0 | 8,587 |
package com.twitter.scalding.reducer_estimation
import org.apache.hadoop.mapred.JobConf
import org.slf4j.LoggerFactory
import scala.util.{ Failure, Success }
object RatioBasedEstimator {
/**
* RatioBasedEstimator optionally ignores history items whose input size is
* drastically different than the current jo... | chrismoulton/scalding | scalding-core/src/main/scala/com/twitter/scalding/reducer_estimation/RatioBasedEstimator.scala | Scala | apache-2.0 | 3,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 ... | guoxiaolongzte/spark | sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/util/DateTimeUtilsSuite.scala | Scala | apache-2.0 | 29,406 |
/*
* Copyright 2020 Precog Data
*
* 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 ... | mossprescott/slamengine-pathy | tests/src/test/scala/pathy/PlaceholderSpecs.scala | Scala | agpl-3.0 | 2,468 |
package info.fotm.clustering.implementations
import info.fotm.clustering.Clusterer
import info.fotm.clustering.Clusterer.Cluster
import info.fotm.util.MathVector
class ClosestPlusPlusClusterer extends Clusterer {
def init(input: Cluster, groupSize: Int): (Seq[Cluster], Cluster) = {
val nClusters: Int = input.s... | Groz/fotm-info | core/src/main/scala/info/fotm/clustering/implementations/ClosestPlusPlusClusterer.scala | Scala | mit | 1,351 |
package tapechart.dtc
/**
* Created with IntelliJ IDEA.
* User: guiga
* Date: 26/06/14
* Time: 19:33
*/
object TradeModeEnum extends Enumeration {
type TradeModeEnum = Value
val TRADE_MODE_DEMO = Value(1)
val TRADE_MODE_SIMULATED = Value(2)
val TRADE_MODE_LIVE = Value(3)
}
class s_LogonRequest {
impo... | 6qat/dtc-scala | src/main/scala/tapechart/dtc/s_LogonRequest.scala | Scala | gpl-2.0 | 1,204 |
package com.twitter.algebird
import org.scalacheck.Prop._
import org.scalacheck.{Arbitrary, Gen}
class SGDLaws extends CheckProperties {
import com.twitter.algebird.BaseProperties._
implicit val sgdMonoid =
new SGDMonoid(SGD.constantStep(0.001), SGD.linearGradient)
val zeroStepMonoid = new SGDMonoid(SGD.co... | nevillelyh/algebird | algebird-test/src/test/scala/com/twitter/algebird/SGDTest.scala | Scala | apache-2.0 | 2,378 |
/*
* 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 ... | sclearn/sclearn | sc/src/main/scala/io/github/sclearn/dataset/spark/sql/catalyst/util/TypeUtils.scala | Scala | apache-2.0 | 1,363 |
/*
* Copyright 2012 Eric Olander
*
* 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... | betandr/scala-midi | src/main/scala/com/googlecode/scala/sound/midi/message/MonoOn.scala | Scala | apache-2.0 | 766 |
package com.github.distributed_stumps.stumps.message.subscriber
import com.github.distributed_stumps.stumps.message.common.Resource
/**
* Represents an abstract resource that is / can-be requested from a subscriber. The specific details
* of the resource can only be defined by the resource-provider.
*
* @param na... | distributed-stumps/stumps-messages | src/main/scala/com/github/distributed_stumps/stumps/message/subscriber/ResourceIdentifier.scala | Scala | apache-2.0 | 662 |
import sbt._
import Keys._
object PomTest extends Build
{
lazy val custom = config("custom")
lazy val root = Project("root", file("root")) configs(custom) settings(
TaskKey[Unit]("check-pom") <<= checkPom,
libraryDependencies ++= Seq(
"a" % "a" % "1.0",
"b" % "b" % "1.0" % "runtime,optional",
"c" % "c" ... | jroper/sbt | sbt/src/sbt-test/dependency-management/pom-scope/project/PomTest.scala | Scala | bsd-3-clause | 1,926 |
package com.hitsoft.scala.android
/**
* User: smeagol
* Date: 24.05.15
* Time: 9:25
*/
trait WidgetImplicits {
}
| hitsoft/scala-android | src/main/scala/com/hitsoft/scala/android/WidgetImplicits.scala | Scala | mit | 119 |
/*
* Copyright 2020 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 | it/controllers/registration/attachments/Vat5LRequiredControllerISpec.scala | Scala | apache-2.0 | 1,314 |
import stainless.lang._
object ObjectParamMutation7 {
case class A(a: Int, var x: BigInt, var y: BigInt, var z: BigInt)
def inc(a: A): Unit = {
require(a.x >= 0 && a.y >= 0 && a.z >= 0)
a.x += 1
a.y += 1
a.z += 1
} ensuring(_ => a.x == old(a).x + 1 && a.y == old(a).y + 1 && a.z == old(a).z + 1)... | epfl-lara/stainless | frontends/benchmarks/imperative/valid/ObjectParamMutation7.scala | Scala | apache-2.0 | 469 |
object Bar:
type Fuzzy[W <: Int] = Int
opaque type BlaBla[W <: Int] <: Foo.BlaBla[Fuzzy[W], Int] =
Foo.BlaBla[Fuzzy[W], Int]
| dotty-staging/dotty | sbt-test/opaques/i12927/src/main/scala/Bar.scala | Scala | apache-2.0 | 133 |
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.