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 dev.budget.reconciler
import dev.budget.reconciler.modules.{JsonModule, ApplicationModule, ElasticSearchModule}
import scaldi.Injectable
object Main {
def main(args: Array[String]) {
implicit val mainInjector = new ApplicationModule :: new ElasticSearchModule :: new JsonModule
val application: Reco... | jhungerford/MintYnabReconciler | src/main/scala/dev/budget/reconciler/Main.scala | Scala | apache-2.0 | 415 |
package io.ddf.flink.content
import io.ddf.DDF
import io.ddf.exception.DDFException
import io.ddf.flink.BaseSpec
import scala.collection.JavaConversions._
class ViewHandlerSpec extends BaseSpec {
val airlineDDF = loadAirlineDDF()
val yearNamesDDF = loadYearNamesDDF()
it should "project after remove columns " i... | milliondreams/ddf-with-flink | flink/src/test/scala/io/ddf/flink/content/ViewHandlerSpec.scala | Scala | apache-2.0 | 1,815 |
/*
* Copyright 2017 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... | liquidarmour/ct-calculations | src/test/scala/uk/gov/hmrc/ct/accounts/frs102/BoxesFixture.scala | Scala | apache-2.0 | 3,917 |
package breeze.data;
import java.net.URL;
import scala.io.Source;
/*
Copyright 2009 David Hall, Daniel Ramage
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/license... | tjhunter/scalanlp-core | process/src/main/scala/breeze/data/DataMatrix.scala | Scala | apache-2.0 | 2,591 |
/**
* Copyright (c) 2007-2011 Eric Torreborre <etorreborre@yahoo.com>
*
* 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 us... | stuhood/specs | src/test/scala/org/specs/mock/returnValues.scala | Scala | mit | 3,219 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | zzcclp/carbondata | integration/spark/src/main/scala/org/apache/spark/sql/execution/command/table/CarbonCreateTableCommand.scala | Scala | apache-2.0 | 8,721 |
package mq
import akka.actor._
import akka.cluster.{MemberStatus, Cluster}
import akka.contrib.pattern.ClusterSingletonProxy
import com.typesafe.config.ConfigFactory
import mq.ClusterProtocol._
import mq.util.{RemoteAddressExtension, HashRingNode, HashRing}
import scala.util.Try
import akka.pattern.ask
import akka.uti... | ElasticQueue/ElasticQueue | src/main/scala/mq/BrokerMaster.scala | Scala | mit | 5,072 |
package io.fintrospect.util
import com.twitter.finagle.http.{Message, Response, Status}
object HttpRequestResponseUtil {
def contentFrom(msg: Message): String = msg.contentString
def statusAndContentFrom(msg: Response): (Status, String) = (msg.status, msg.contentString)
def headersFrom(msg: Message): Map[Stri... | daviddenton/fintrospect | core/src/main/scala/io/fintrospect/util/HttpRequestResponseUtil.scala | Scala | apache-2.0 | 488 |
class Foo[A] {
def map(f: (A) => Int)(i: Int)(j: Int): A = null.asInstanceOf[A]
def fooz(i: Int)(s: String) = 42
def fooz(i: Int)(j: Int) = 43
def puk[A, B](a:A)(b:B) = null
def gul[A](a:A): A = null.asInstanceOf[A]
def gul(i:Int) : Int = i
def pal(i: Int)(s: String) = null
def pal(i: String)(j: I... | ilinum/intellij-scala | testdata/resolve/functions/typeParam2/tp2.scala | Scala | apache-2.0 | 679 |
package com.crackcell.jiezi.dict.loader.io
import java.io.InputStream
/**
* InputStream
*
* @author Menglong TAN
*/
class StreamToStream extends ToStream[InputStream] {
override def toStream(source: InputStream) = source
}
| crackcell/jiezi | core/src/main/scala/com/crackcell/jiezi/dict/loader/io/StreamToStream.scala | Scala | apache-2.0 | 235 |
/*
* 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 | benchmarks/shared/src/main/scala/monix/benchmarks/TaskSequenceBenchmark.scala | Scala | apache-2.0 | 4,415 |
package xyz.hyperreal.spraytemplate
import akka.actor.Actor
import spray.routing._
import spray.http._
import spray.json._
import DefaultJsonProtocol._
import spray.httpx.SprayJsonSupport
import MediaTypes._
import scala.collection.mutable.ArrayBuffer
// we don't implement our route structure directly in the service ... | edadma/angularjs-sass-coffeescript-spray-template | src/main/scala/MyService.scala | Scala | mit | 1,763 |
/**
* Copyright 2013 Gianluca Amato
*
* This file is part of JANDOM: JVM-based Analyzer for Numerical DOMains
* JANDOM 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
... | amato-gianluca/Jandom | core/src/main/scala/it/unich/jandom/targets/jvmasm/UnsupportedASMInsnException.scala | Scala | lgpl-3.0 | 1,166 |
object Script {
val main =
composelistT(
tryruleT(seq)*,
substT*,
nonarithcloseT
)
}
| keymaerad/KeYmaeraD | examples/medrobot/nonpr_ex2.dl.scala | Scala | bsd-3-clause | 103 |
/*
* 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 ... | lxsmnv/spark | sql/core/src/test/scala/org/apache/spark/sql/execution/streaming/MemorySinkSuite.scala | Scala | apache-2.0 | 11,549 |
/*
* Copyright 2008 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 la... | wso2as-developer/scala-samples | lift-jpa/spa/src/main/scala/org/wso2/as/model/Book.scala | Scala | apache-2.0 | 1,213 |
/* Copyright (c) 2016 Lucas Satabin
*
* 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... | satabin/lingua | lexikon/src/main/scala/lingua/lexikon/phases/Parser.scala | Scala | apache-2.0 | 1,248 |
package memnets.ml
import breeze.stats.distributions.Uniform
import scala.math.round
object DataGens {
val uniform = new Uniform(0.0, 1.0)
def cont2Features(feats: Int, size: Int, prob: Double = 0.95): Data = contFunc(feats, size, prob) { pt =>
pt(feats / 4) = 1.0
pt(feats / 2) = 1.0
}
def cont3Featu... | MemoryNetworks/memnets | api/src/main/scala/memnets/ml/DataGens.scala | Scala | apache-2.0 | 2,256 |
package io.sqooba.oss.timeseries.immutable
import io.sqooba.oss.timeseries.TimeSeriesTestBench
import org.scalatest.matchers.should.Matchers
import org.scalatest.flatspec.AnyFlatSpec
class GorillaBlockTimeSeriesSpec extends AnyFlatSpec with Matchers with TimeSeriesTestBench {
private val entries = Seq(TSEntry(1, 1... | Shastick/scala-timeseries-lib | src/test/scala/io/sqooba/oss/timeseries/immutable/GorillaBlockTimeSeriesSpec.scala | Scala | apache-2.0 | 2,030 |
package org.jetbrains.plugins.scala
package debugger
import com.intellij.debugger.NameMapper
import com.intellij.openapi.application.ApplicationManager
import com.intellij.openapi.util.Computable
import com.intellij.psi.PsiClass
import org.jetbrains.annotations.NotNull
import org.jetbrains.plugins.scala.lang.psi.api.t... | triggerNZ/intellij-scala | src/org/jetbrains/plugins/scala/debugger/ScalaJVMNameMapper.scala | Scala | apache-2.0 | 896 |
package controllers
import java.util.UUID
import play.api.data.Form
import play.api.libs.json.Json
import play.api.mvc.{Action, AnyContent, Controller}
import security.UserAuthAction
import services.{ReadService, TagEventProducer}
import scala.util.{Failure, Success}
/**
*
* TagController class
* <p/>
* Des... | getArtemUsername/play-and-events | app/controllers/TagController.scala | Scala | mit | 1,676 |
object Test {
def main(args: Array[String]): Unit = {
val u = null.asInstanceOf[Unit]
val b = null.asInstanceOf[Byte]
val c = null.asInstanceOf[Char]
val s = null.asInstanceOf[Short]
val i = null.asInstanceOf[Int]
val l = null.asInstanceOf[Long]
val f = null.asInstanceOf[Float]
val d =... | folone/dotty | tests/run/nullAsInstanceOf.scala | Scala | bsd-3-clause | 531 |
/**
* 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/main/scala/com/sumologic/sumobot/plugins/BotPlugin.scala | Scala | apache-2.0 | 9,067 |
package test {
object NotNoPrefix {
final class Id[A](val a: A) extends AnyVal
final class Ids[A](val as: Seq[A]) extends AnyVal
final class Bid[A, B](val ab: Map[A, B]) extends AnyVal
}
}
object Test extends App {
import test.NotNoPrefix._
def check[A](cls: Class[A])(implicit tag: reflect.Class... | scala/scala | test/files/run/t10551.scala | Scala | apache-2.0 | 1,237 |
package com.twitter.inject.server.tests
import com.twitter.finagle.http.Status
import com.twitter.inject.server.{EmbeddedTwitterServer, FeatureTest, TwitterServer}
/** Test an injectable TwitterServer with the [[FeatureTest]] trait */
class FeatureTestTest extends FeatureTest {
override val server: EmbeddedTwitter... | twitter/finatra | inject/inject-server/src/test/scala/com/twitter/inject/server/tests/FeatureTestTest.scala | Scala | apache-2.0 | 1,204 |
package codacy.plugins.test
import java.io.{File => JFile}
import java.nio.file.Path
import better.files._
import com.codacy.analysis.core.model.{FileError, Issue, Pattern, ToolResult, ToolSpec}
import com.codacy.plugins.api._
import com.codacy.plugins.api.languages.{Language, Languages}
import com.codacy.plugins.res... | codacy/codacy-plugins-test | src/main/scala/codacy/plugins/test/ITest.scala | Scala | mit | 6,599 |
/*
* 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 ... | MLnick/spark | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/regexpExpressions.scala | Scala | apache-2.0 | 15,588 |
/* ====================================================================
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 Y... | orbeon/orbeon-forms | form-runner/jvm/src/test/scala/org/orbeon/oxf/fr/excel/NumberToTextConversionExamples.scala | Scala | lgpl-2.1 | 15,195 |
package isabelle.eclipse.launch.tabs
import org.eclipse.core.runtime.{IPath, IProgressMonitor, IStatus, Status}
import org.eclipse.core.runtime.jobs.{ISchedulingRule, Job}
import org.eclipse.debug.core.{ILaunchConfiguration, ILaunchConfigurationWorkingCopy}
import org.eclipse.jface.dialogs.IDialogConstants
import org.... | andriusvelykis/isabelle-eclipse | isabelle.eclipse.launch/src/isabelle/eclipse/launch/tabs/SessionSelectComponent.scala | Scala | epl-1.0 | 10,990 |
package lila.rating
case class RatingRange(min: Int, max: Int) {
def contains(rating: Int) = rating >= min && rating <= max
def notBroad: Option[RatingRange] = (this != RatingRange.broad) option this
override def toString = "%d-%d".format(min, max)
}
object RatingRange {
val min = 800
val max = 2900
... | bjhaid/lila | modules/rating/src/main/RatingRange.scala | Scala | mit | 903 |
package com.cloudray.scalapress.media
import java.io.InputStream
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.stereotype.Component
import org.springframework.web.multipart.MultipartFile
import com.cloudray.scalapress.framework.ScalapressContext
/** @author Stephen Samuel */... | vidyacraghav/scalapress | src/main/scala/com/cloudray/scalapress/media/AssetService.scala | Scala | apache-2.0 | 2,482 |
package com.datawizards.sparklocal.rdd.pair
import com.datawizards.sparklocal.SparkLocalBaseTest
import com.datawizards.sparklocal.rdd.RDDAPI
import org.apache.spark.HashPartitioner
import org.junit.runner.RunWith
import org.scalatest.junit.JUnitRunner
@RunWith(classOf[JUnitRunner])
class CogroupTest extends SparkLoc... | piotr-kalanski/spark-local | src/test/scala/com/datawizards/sparklocal/rdd/pair/CogroupTest.scala | Scala | apache-2.0 | 5,433 |
package dtc
import java.time.{LocalDate, LocalTime}
import simulacrum.typeclass
import scala.language.implicitConversions
/**
* Provides a way to capture `java.time` based instant into a value of type A.
*/
@typeclass trait Capture[A] {
/**
* Java time based constructor for values of type A.
* Result... | vpavkin/dtc | core/shared/src/main/scala/dtc/Capture.scala | Scala | apache-2.0 | 776 |
/*
* Copyright (C) Lightbend Inc. <https://www.lightbend.com>
*/
package play.it.action
import akka.stream.scaladsl.Source
import play.shaded.ahc.io.netty.handler.codec.http.HttpHeaders
import org.specs2.mutable.Specification
import play.api.http.HeaderNames._
import play.api.http.Status._
import play.api.libs.ws.W... | marcospereira/playframework | core/play-integration-test/src/it/scala/play/it/action/HeadActionSpec.scala | Scala | apache-2.0 | 5,874 |
package example
import org.scalatest.FunSuite
import org.junit.runner.RunWith
import org.scalatest.junit.JUnitRunner
/**
* This class implements a ScalaTest test suite for the methods in object
* `Lists` that need to be implemented as part of this assignment. A test
* suite is simply a collection of individual te... | spolnik/scala-workspace | scala-learning/example/src/test/scala/example/ListsSuite.scala | Scala | apache-2.0 | 4,448 |
/*
* 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... | JerryYanWan/BigDL | spark/dl/src/test/scala/com/intel/analytics/bigdl/dataset/MiniBatchSpec.scala | Scala | apache-2.0 | 3,547 |
/*
* 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 | sql/catalyst/src/main/scala/org/apache/spark/sql/connector/write/PhysicalWriteInfoImpl.scala | Scala | apache-2.0 | 940 |
package demo.akka.mapreduce.actor
import akka.actor.actorRef2Scala
import akka.actor.Actor
import akka.actor.ActorRef
import demo.akka.mapreduce.data.MapData
import demo.akka.mapreduce.data.ReduceData
import java.util.ArrayList
import scala.collection.mutable.HashMap
import demo.akka.mapreduce.data.WordCount
import sc... | jianwu-github/akka-mapreduce-demo | src/main/scala/demo/akka/mapreduce/actor/ReduceActor.scala | Scala | cc0-1.0 | 882 |
package com.wavesplatform.api.http.requests
import com.wavesplatform.account.PublicKey
import com.wavesplatform.lang.ValidationError
import com.wavesplatform.transaction.Proofs
import com.wavesplatform.transaction.lease.LeaseCancelTransaction
import play.api.libs.functional.syntax._
import play.api.libs.json._
case c... | wavesplatform/Waves | node/src/test/scala/com/wavesplatform/api/http/requests/SignedLeaseCancelV1Request.scala | Scala | mit | 1,400 |
package org.bitcoins.core.gcs
import org.bitcoins.core.crypto.DoubleSha256Digest
import org.bitcoins.core.number.{UInt64, UInt8}
import org.bitcoins.core.protocol.{CompactSizeUInt, NetworkElement}
import org.bitcoins.core.protocol.blockchain.Block
import org.bitcoins.core.protocol.script.{EmptyScriptPubKey, ScriptPubK... | bitcoin-s/bitcoin-s-core | core/src/main/scala/org/bitcoins/core/gcs/GolombFilter.scala | Scala | mit | 5,868 |
package blended.streams.worklist
import akka.NotUsed
import akka.actor.ActorSystem
import akka.stream.scaladsl.{Flow, Keep, Sink, Source}
import akka.stream.{ActorMaterializer, KillSwitches, Materializer, OverflowStrategy}
import akka.testkit.TestKit
import blended.testsupport.scalatest.LoggingFreeSpecLike
import blen... | lefou/blended | blended.streams/src/test/scala/blended/streams/worklist/WorklistSpec.scala | Scala | apache-2.0 | 4,112 |
package org.vitrivr.adampro.data.entity
import org.apache.spark.sql.functions.{col, udf}
import org.apache.spark.sql.types.{LongType, StructField, StructType}
import org.apache.spark.sql.{DataFrame, Row, SaveMode}
import org.apache.spark.storage.StorageLevel
import org.vitrivr.adampro.config.AttributeNames
import org.... | dbisUnibas/ADAMpro | src/main/scala/org/vitrivr/adampro/data/entity/Entity.scala | Scala | mit | 24,441 |
package com.github.wartman4404.gldraw
import java.util.concurrent.atomic.AtomicBoolean
import android.graphics.SurfaceTexture
import android.os.{Handler, Looper, Message, SystemClock}
import android.util.Log
import android.graphics.Bitmap
import unibrush.Layer
import MainActivity.Rotation
class TextureSurfaceThread(s... | wartman4404/everybody-draw | src/main/scala/TextureSurfaceRenderer.scala | Scala | apache-2.0 | 8,159 |
/*
* 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 ... | mahak/spark | sql/core/src/main/scala/org/apache/spark/sql/execution/history/SQLEventFilterBuilder.scala | Scala | apache-2.0 | 6,205 |
/*******************************************************************************
* Copyright 2013 Simon Todd <simon@sltodd.co.uk>.
*
* 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
*
*... | SLTodd/genetic-akka | src/test/scala/uk/co/sltodd/geneticakka/HostTest.scala | Scala | apache-2.0 | 1,733 |
package collins.models.asset
import play.api.libs.json.JsObject
import play.api.libs.json.JsString
import play.api.libs.json.JsValue
import play.api.libs.json.Json
import collins.models.Asset
import collins.models.AssetMeta
import collins.models.AssetMetaValue
import collins.models.IpAddresses
import collins.models.I... | byxorna/collins | app/collins/models/asset/AllAttributes.scala | Scala | apache-2.0 | 2,894 |
package opennlp.scalabha.tag
import scala.collection.SeqLike
import scala.collection.generic.CanBuildFrom
object TagUtils {
class Enriched_ended_Seq[A, Repr](self: SeqLike[A, Repr]) {
def ended[That](implicit bf: CanBuildFrom[Repr, Option[A], That]): That = {
val b = bf(self.asInstanceOf[Repr])
b.s... | utcompling/Scalabha | src/main/scala/opennlp/scalabha/tag/TagUtils.scala | Scala | apache-2.0 | 532 |
/*
* 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 | examples/src/main/scala/org/apache/spark/examples/bagel/PageRankUtils.scala | Scala | apache-2.0 | 3,823 |
import sbt._
import Keys._
object CommonSettings {
private val SparkVersion = "2.1.0"
val sparkDependencies: Seq[ModuleID] = Seq(
"org.apache.spark" %% "spark-core" % SparkVersion,
"org.apache.spark" %% "spark-sql" % SparkVersion
)
val commonLibDependencies: Seq[ModuleID] = Seq(
"com.github.nscal... | salceson/iosr-distributed-data-processing | project/CommonSettings.scala | Scala | mit | 742 |
/*
* Copyright (C) 2014-2015 by Nokia.
* See the LICENCE.txt file distributed with this work for additional
* information regarding copyright ownership.
*
* 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 o... | elyast/wookie | spark-api/src/main/scala/wookie/spark/SparkRuntime.scala | Scala | apache-2.0 | 1,535 |
/*
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 in writing, software
distr... | surabhiiyer/summingbird | summingbird-online/src/main/scala/com/twitter/summingbird/online/SummingQueueCache.scala | Scala | apache-2.0 | 2,317 |
package org.jetbrains.jps.incremental.scala.model.impl
import org.jetbrains.jps.incremental.scala.model.JpsSbtModuleExtension
import org.jetbrains.jps.model.ex.{JpsElementBase, JpsElementChildRoleBase}
import org.jetbrains.jps.model.{JpsElement, JpsElementChildRole}
final class JpsSbtModuleExtensionImpl extends JpsEl... | JetBrains/intellij-scala | scala/compiler-jps/src/org/jetbrains/jps/incremental/scala/model/impl/JpsSbtModuleExtensionImpl.scala | Scala | apache-2.0 | 685 |
package edu.cmu.cs.oak.nodes
import edu.cmu.cs.oak.value.OakValue
import edu.cmu.cs.oak.value.Choice
import edu.cmu.cs.oak.value.StringValue
case class LiteralNode(sv: String, file: String, lineNr: Int) extends DNode {
//assert(lv.location != null)
def getChildren(): Seq[DNode] = null
def toXml: scala.xml.... | smba/oak | edu.cmu.cs.oak/src/main/scala/edu/cmu/cs/oak/nodes/LiteralNode.scala | Scala | lgpl-3.0 | 563 |
/*
* Licensed to Elasticsearch under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this fi... | elastic/elasticsearch-hadoop | spark/sql-20/src/main/scala/org/elasticsearch/spark/sql/streaming/EsStreamQueryWriter.scala | Scala | apache-2.0 | 3,270 |
/*
Copyright 2014 - 2015 Janek Bogucki
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 o... | janekdb/scalacraft-domain | src/main/scala/com/scalacraft/domain/v2/internal/ex/NullConstructorArgumentException.scala | Scala | apache-2.0 | 954 |
import sbt._
import Keys._
import play.Project._
object ApplicationBuild extends Build {
val appName = "book_exchange"
val appVersion = "1.0-SNAPSHOT"
val appDependencies = Seq(
// Add your project dependencies here,
javaCore,
javaJdbc,
javaEbean,
"org.webjars" % "webjars-play" % "2.1.0",
... | ttaomae/book-exchange | project/Build.scala | Scala | bsd-2-clause | 551 |
package com.socrata.datacoordinator.common
import java.security.SecureRandom
object StandardObfuscationKeyGenerator extends (() => Array[Byte]) {
val rng = new SecureRandom
val len = 72 /* Magic */
def apply(): Array[Byte] = {
val cs = new Array[Byte](len)
rng.nextBytes(cs)
cs
}
}
| socrata-platform/data-coordinator | coordinatorlib/src/main/scala/com/socrata/datacoordinator/common/StandardObfuscationKeyGenerator.scala | Scala | apache-2.0 | 305 |
package com.stulsoft.serialization
/**
* @author Yuriy Stul.
*/
case class Message3(content:String) extends MessageTrait
| ysden123/poc | pserialization/src/main/scala/com/stulsoft/serialization/Message3.scala | Scala | mit | 126 |
package com.twitter.finagle.zipkin.core
import com.twitter.finagle.tracing._
import com.twitter.util._
import org.mockito.Mockito._
import org.scalacheck.{Gen, Arbitrary}
import org.scalatest.FunSuite
import org.scalatestplus.mockito.MockitoSugar
import org.scalatestplus.scalacheck.ScalaCheckDrivenPropertyChecks
impor... | luciferous/finagle | finagle-zipkin-core/src/test/scala/com/twitter/finagle/zipkin/core/SamplingTracerTest.scala | Scala | apache-2.0 | 2,817 |
/**
* 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... | Esquive/kafka | core/src/test/scala/unit/kafka/log/LogCleanerTest.scala | Scala | apache-2.0 | 70,717 |
package org.http4s.internal
import scala.collection.immutable
import scala.collection.mutable
import scala.collection.mutable.ListBuffer
private[http4s] object CollectionCompat {
type LazyList[A] = scala.collection.immutable.LazyList[A]
val LazyList = scala.collection.immutable.LazyList
def pairsToMultiParams[... | aeons/http4s | core/src/main/scala-2.13/org/http4s/internal/CollectionCompat.scala | Scala | apache-2.0 | 851 |
package models.generator
import io.apibuilder.generator.v0.models.InvocationForm
import io.apibuilder.spec.v0.models.Interface
import models.TestHelper
import org.scalatest.funspec.AnyFunSpec
import org.scalatest.matchers.should.Matchers
import scala.generator.{ScalaCaseClasses, ScalaService}
class ScalaCaseClassesI... | mbryzek/apidoc-generator | scala-generator/src/test/scala/models/generator/ScalaCaseClassesInterfacesSpec.scala | Scala | mit | 1,767 |
package edu.gemini.itc.web.baseline
import edu.gemini.itc.baseline._
import edu.gemini.itc.baseline.util._
import edu.gemini.itc.shared._
import edu.gemini.itc.web.baseline.Baseline._
import org.scalacheck.{Arbitrary, Gen}
import org.specs2.ScalaCheck
import org.specs2.mutable.Specification
import org.specs2.scalachec... | spakzad/ocs | bundle/edu.gemini.itc.web/src/test/scala/edu/gemini/itc/web/baseline/BaselineAllSpec.scala | Scala | bsd-3-clause | 4,535 |
/**
* 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... | rhauch/kafka | core/src/test/scala/other/kafka/StressTestLog.scala | Scala | apache-2.0 | 3,939 |
/*
* 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 ... | pgandhi999/spark | sql/core/src/test/scala/org/apache/spark/sql/SQLContextSuite.scala | Scala | apache-2.0 | 5,330 |
package com.github.mdr.mash.view.render.help
import com.github.mdr.mash.functions.MashFunction
import com.github.mdr.mash.view.render.{ CallingSyntaxRenderer, MashRenderer }
import com.github.mdr.mash.screen.{ Line, StyledString }
import com.github.mdr.mash.utils.LineInfo
object FunctionHelpRenderer extends AbstractH... | mdr/mash | src/main/scala/com/github/mdr/mash/view/render/help/FunctionHelpRenderer.scala | Scala | mit | 1,697 |
/*
* 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 | core/src/main/scala/org/apache/spark/scheduler/ShuffleMapStage.scala | Scala | apache-2.0 | 5,741 |
/*
* Copyright 2015 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... | xnejp03/releaser | src/main/scala/uk/gov/hmrc/releaser/domain/package.scala | Scala | apache-2.0 | 808 |
/*
* Scala (https://www.scala-lang.org)
*
* Copyright EPFL and Lightbend, Inc.
*
* Licensed under Apache License 2.0
* (http://www.apache.org/licenses/LICENSE-2.0).
*
* See the NOTICE file distributed with this work for
* additional information regarding copyright ownership.
*/
package scala
package reflect
... | scala/scala | src/reflect/scala/reflect/api/Types.scala | Scala | apache-2.0 | 39,567 |
package io.eels.component.parquet
import java.nio.{ByteBuffer, ByteOrder}
import java.time._
import java.time.temporal.ChronoUnit
import com.sksamuel.exts.Logging
import io.eels.coercion._
import io.eels.schema._
import org.apache.parquet.io.api.{Binary, RecordConsumer}
import scala.math.BigDecimal.RoundingMode.Roun... | sksamuel/eel-sdk | eel-core/src/main/scala/io/eels/component/parquet/RecordWriter.scala | Scala | apache-2.0 | 9,192 |
package cpup.mc.oldenMagic.api.oldenLanguage.runeParsing
import cpup.mc.oldenMagic.api.oldenLanguage.runes.TRune
import cpup.mc.oldenMagic.api.oldenLanguage.casting.conditions.{TCondition, TConditionType}
trait TConditionRune extends TRune {
def conditionTypes: Set[TConditionType]
def filter(conditions: Set[TCondit... | CoderPuppy/oldenmagic-mc | src/main/scala/cpup/mc/oldenMagic/api/oldenLanguage/runeParsing/TConditionRune.scala | Scala | mit | 336 |
object InitialHamiltonian {
def construct(n: Int): HybridMatrix = {
val size = Size(n)
val positions = IndexedSeq.fill[collection.mutable.Buffer[Int]](size.dim)(collection.mutable.Buffer.empty)
recurse(size.dim, 0, 0) { (x, y, xOff, yOff) =>
positions(x + xOff) += y + yOff
}
HybridMa... | stevenheidel/recquasim | scala/src/main/scala/InitialHamiltonian.scala | Scala | apache-2.0 | 938 |
/*
* 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 ... | sryza/spark | examples/src/main/scala/org/apache/spark/examples/BroadcastTest.scala | Scala | apache-2.0 | 2,269 |
package scala.collection
package mutable
/** This class implements mutable maps with `Long` keys based on a hash table with open addressing.
*
* Basic map operations on single entries, including `contains` and `get`,
* are typically substantially faster with `LongMap` than [[HashMap]]. Methods
* that act ... | rorygraves/perf_tester | corpus/scala-library/src/main/scala/collection/mutable/LongMap.scala | Scala | apache-2.0 | 19,776 |
/*
* Copyright (C) 2015 Romain Reuillon
*
* 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) any later version.
*
* This progra... | ISCPIF/PSEExperiments | openmole-src/openmole/plugins/org.openmole.plugin.method.modelfamily/src/main/scala/org/openmole/plugin/method/modelfamily/ga/ModelFamilyMutation.scala | Scala | agpl-3.0 | 1,168 |
package info.hupel.isabelle
import scala.concurrent._
import scala.concurrent.duration._
import scala.util.control.Exception._
import cats.arrow.FunctionK
import monix.execution.{Cancelable, CancelableFuture, FutureUtils, Scheduler}
import org.log4s._
import info.hupel.isabelle.api._
/** Functions to build and cr... | larsrh/libisabelle | modules/libisabelle/src/main/scala/System.scala | Scala | apache-2.0 | 10,201 |
/*
* 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/ast/rewriters/DeMorganRewriterTest.scala | Scala | apache-2.0 | 1,714 |
/*
* Copyright 2012 Comcast Cable Communications Management, 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 require... | Comcast/money | money-core/src/main/scala/com/comcast/money/core/handlers/SpanLogFormatter.scala | Scala | apache-2.0 | 3,865 |
package io.hydrosphere.mist.worker.runners
import java.nio.file.{Files, Paths}
import akka.http.scaladsl.Http
import akka.http.scaladsl.model.{HttpRequest, HttpResponse, StatusCodes}
import akka.stream.scaladsl.Flow
import org.apache.commons.codec.digest.DigestUtils
import org.apache.commons.io.FileUtils
import org.s... | Hydrospheredata/mist | mist/worker/src/test/scala/io/hydrosphere/mist/worker/runners/ArtifactDownloaderSpec.scala | Scala | apache-2.0 | 4,853 |
package org.jetbrains.plugins.scala.traceLogger
package protocol
import SerializationApi.{ReadWriter => RW, _}
import upickle.implicits.key
import scala.annotation.nowarn
/*
final case class TraceLoggerMsg(msg: String,
values: Seq[ValueDesc],
stackTraceD... | JetBrains/intellij-scala | scala/traceLogger/src/org/jetbrains/plugins/scala/traceLogger/protocol/Messages.scala | Scala | apache-2.0 | 2,184 |
package spire
package math
import spire.math.ArbitrarySupport.{Positive, NonNegative}
import scala.util.Try
import org.scalatest.FunSuite
import spire.implicits.{eqOps => _, _}
import spire.laws.arb.{interval => interval_, rational}
import spire.random.{Uniform, Dist}
import org.scalatest.Matchers
import org.scalac... | tixxit/spire | tests/src/test/scala/spire/math/IntervalTest.scala | Scala | mit | 23,308 |
package com.rocketfuel.sdbc.cassandra
import com.rocketfuel.sdbc.Cassandra._
import com.rocketfuel.sdbc.Cassandra.syntax._
import org.scalatest.FunSuite
class syntaxSpec extends FunSuite {
test("syntax works") {
implicit def x: Queryable[Int, Int] = ???
implicit def session: Session = ???
assertCompil... | rocketfuel/sdbc | cassandra/src/test/scala/com/rocketfuel/sdbc/cassandra/syntaxSpec.scala | Scala | bsd-3-clause | 350 |
object OhNoes {
sealed trait F
sealed abstract class FA extends F
sealed abstract class FB extends F
case object FA1 extends FA
case object FB1 extends FB
case object FB2 extends FB
sealed trait G
case object G1 extends G
case object G2 extends G
sealed trait H
case class H1(a: FB, b: G) exten... | som-snytt/dotty | tests/patmat/t9411b.scala | Scala | apache-2.0 | 709 |
/*
* Copyright (C) 2015 Stratio (http://stratio.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 app... | danielcsant/sparta | plugins/src/test/scala/com/stratio/sparta/plugin/parser/datetime/DateTimeParserTest.scala | Scala | apache-2.0 | 3,775 |
import sbt._
import Keys._
object ExtraProjectPluginExample2 extends AutoPlugin {
// Enable this plugin by default
override def requires: Plugins = sbt.plugins.CorePlugin
override def trigger = allRequirements
override def derivedProjects(proj: ProjectDefinition[_]): Seq[Project] =
// Make sure to exclude... | som-snytt/xsbt | sbt/src/sbt-test/project/extra-projects/project/ExtraProjectPluginExample2.scala | Scala | bsd-3-clause | 568 |
package com.nulabinc.backlog.r2b.redmine.service
import javax.inject.Inject
import com.nulabinc.backlog.migration.common.utils.Logging
import com.nulabinc.backlog.r2b.redmine.conf.RedmineApiConfiguration
import com.taskadapter.redmineapi.RedmineManager
import com.taskadapter.redmineapi.bean.News
import scala.jdk.Col... | nulab/BacklogMigration-Redmine | redmine/src/main/scala/com/nulabinc/backlog/r2b/redmine/service/NewsServiceImpl.scala | Scala | mit | 748 |
package org.excala.tests
import org.scalatest.Tag
/**
* Contains all of the tags for tests that we'll use.
*/
trait ExpectTags {
object TimedTest extends Tag("org.excala.TimedTest")
}
| edmundnoble/Excala | src/org/excala/tests/ExpectTags.scala | Scala | bsd-3-clause | 190 |
package org.jetbrains.plugins.scala.lang.psi.controlFlow.impl
import com.intellij.psi.PsiNamedElement
import org.jetbrains.plugins.scala.lang.psi.controlFlow.ScControlFlowPolicy
/**
* Nikolay.Tropin
* 2014-04-14
*/
object AllVariablesControlFlowPolicy extends ScControlFlowPolicy {
override def isElementAccepted(... | gtache/intellij-lsp | intellij-lsp-dotty/src/org/jetbrains/plugins/scala/lang/psi/controlFlow/impl/AllVariablesControlFlowPolicy.scala | Scala | apache-2.0 | 362 |
package org.powlab.jeye.utils
import org.powlab.jeye.core.Opcodes._
import org.powlab.jeye.decode.RuntimeOpcode
import org.powlab.jeye.decode.RuntimeOpcodes._
import org.powlab.jeye.decode.graph.OpcodeNodes._
import org.powlab.jeye.decode.graph.OpcodeTree
import scala.collection.mutable.Map
import org.powlab.jeye.deco... | powlab/jeye | src/main/scala/org/powlab/jeye/utils/PrintUtils.scala | Scala | apache-2.0 | 1,773 |
/*
* Copyright 2011-2022 GatlingCorp (https://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 appli... | gatling/gatling | gatling-http/src/main/scala/io/gatling/http/feeder/SitemapParser.scala | Scala | apache-2.0 | 2,582 |
/*
* 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/iht-frontend | app/iht/controllers/application/assets/insurancePolicy/InsurancePolicyDetailsMoreThanMaxValueController.scala | Scala | apache-2.0 | 3,876 |
package timetrace.math
import timetrace.math.Vector4.Normalized
import timetrace.math.Vector4.SpatiallyNormalized
import scala.math.{ min, max }
object Vector4 {
class Normalized(x: Double, y: Double, z: Double, t: Double) extends Vector4(x, y, z, t) {
assume(Math.abs(magnitude - 1.0) < 1e-6)
override def n... | pauldoo/scratch | timetrace/core/src/main/scala/timetrace/math/Vector4.scala | Scala | isc | 2,259 |
/*
Copyright 2012 Georgia Tech Research Institute
Author: lance.gatlin@gtri.gatech.edu
This file is part of org.gtri.util.xmlbuilder library.
org.gtri.util.xmlbuilder library is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published ... | gtri-iead/org.gtri.util.xmlbuilder | impl/src/main/scala/org/gtri/util/xmlbuilder/impl/events/EndXmlElementEvent.scala | Scala | gpl-3.0 | 1,590 |
package ops.android.app
import android.app.Fragment
import android.content.Context
trait FragmentOps extends ContextOps {
self: Fragment =>
override implicit lazy val context: Context = getActivity
override def _getString(resId: Int, args: AnyRef*): String = getString(resId, args: _*)
}
| raizu/AndroidOps | src/main/scala/ops/android/app/FragmentOps.scala | Scala | apache-2.0 | 312 |
package models.view
import models.view.cache.EncryptedCacheHandling
/**
* Creates an object which has access to methods for saving to and getting
* from the cache. The CachedChangeOfCircs trait implements the cacheKey method required
* for getting from the cache.
* See Language (controller) and LanguageSpec (test... | Department-for-Work-and-Pensions/ClaimCapture | c3/app/models/view/CacheHandlingWithCircs.scala | Scala | mit | 434 |
/***********************************************************************
* Copyright (c) 2013-2017 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... | ronq/geomesa | geomesa-process/geomesa-process-wps/src/main/scala/org/locationtech/geomesa/process/GeoMesaProcessFactory.scala | Scala | apache-2.0 | 1,106 |
// Copyright: 2010 - 2016 https://github.com/ensime/ensime-server/graphs
// Licence: http://www.gnu.org/licenses/gpl-3.0.en.html
package org.ensime.core
import akka.actor._
import akka.event.slf4j.SLF4JLogging
import com.google.common.io.ByteStreams
import java.io.{ File, IOException }
import java.util.jar.JarFile
imp... | j-mckitrick/ensime-sbt | src/sbt-test/ensime-sbt/ensime-server/core/src/main/scala/org/ensime/core/DocResolver.scala | Scala | apache-2.0 | 6,287 |
/*
* Copyright 2009-2017. DigitalGlobe, 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 ... | ngageoint/mrgeo | mrgeo-mapalgebra/mrgeo-mapalgebra-rastermath/src/main/scala/org/mrgeo/mapalgebra/binarymath/DivMapOp.scala | Scala | apache-2.0 | 2,908 |
package io.scalac.wtf.domain
import io.scalac.wtf.domain.tables.Users
import org.scalatest.{BeforeAndAfter, FlatSpec, Matchers}
import slick.driver.H2Driver.api._
import scala.concurrent.ExecutionContext.Implicits.global
import slick.driver.H2Driver._
import scala.concurrent.Await
import scala.concurrent.ExecutionCo... | ScalaConsultants/whisky-tango-foxtrot | src/test/scala/io/scalac/wtf/domain/UserServiceSpec.scala | Scala | cc0-1.0 | 4,191 |
/*
* 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 ... | wangmiao1981/spark | sql/catalyst/src/main/scala/org/apache/spark/sql/types/DayTimeIntervalType.scala | Scala | apache-2.0 | 4,186 |
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.