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 |
|---|---|---|---|---|---|
/*
* 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 ... | BryanCutler/spark | sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/orc/OrcSourceSuite.scala | Scala | apache-2.0 | 23,737 |
import scala.io.Source
object InvertedIndex {
/**
* Build an inverted index from a file with this format:
* doc0 w0 w1 ...
* doc1 w2 w4 ...
* Each elements of a line is separated by whitespaces
*
* @param path Path to the file containing data to invert
*
* @return An inverted index
* ... | Cowa/parallel-document-identification | src/main/scala/InvertedIndex.scala | Scala | mit | 683 |
/*
* Copyright 2013 http4s.org
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to i... | http4s/http4s | core/shared/src/main/scala-2.13/org/http4s/MediaTypePlaform.scala | Scala | apache-2.0 | 2,123 |
package coursier.util
import coursier.core.{Attributes, Classifier, Configuration, Reconciliation, Type}
import coursier.test.TestRunner
import coursier.graph.{DependencyTree, ReverseModuleTree}
import coursier.{Dependency, moduleString}
import utest._
import scala.async.Async.{async, await}
import scala.concurrent.E... | alexarchambault/coursier | modules/tests/shared/src/test/scala/coursier/util/PrintTests.scala | Scala | apache-2.0 | 6,056 |
/*
* Copyright 2011-2019 Asakusa Framework Team.
*
* 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 ... | ueshin/asakusafw-spark | compiler/src/main/scala/com/asakusafw/spark/compiler/operator/user/UserOperatorCompiler.scala | Scala | apache-2.0 | 1,489 |
package org.elasticmq.rest.sqs
import org.scalatest.flatspec.AnyFlatSpec
import org.scalatest.matchers.should.Matchers
class TagsModuleTest extends AnyFlatSpec with AttributesModule with Matchers {
"Key Value pair for tag" should "result in map with one entry " in {
val parameters = Map("Tag.1.Key" -> "Test", ... | adamw/elasticmq | rest/rest-sqs/src/test/scala/org/elasticmq/rest/sqs/TagsModuleTest.scala | Scala | apache-2.0 | 1,106 |
package gapt.examples.prime
import gapt.expr._
import gapt.expr.util.syntacticMatching
import gapt.proofs.Sequent
import gapt.proofs.gaptic._
import gapt.proofs.lk.LKProof
case class euclid( k: Int ) extends PrimeDefinitions {
def ldivprod( i: Int ): LKProof = {
val sequent = hols"linp: P $i l :- div: DIV l (... | gapt/gapt | examples/prime/euclid.scala | Scala | gpl-3.0 | 2,666 |
/**
* Copyright 2013-2015 PayPal
*
* 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 ... | 2rs2ts/cascade | common/src/test/scala/com/paypal/cascade/common/tests/util/CommonImmutableSpecificationContext.scala | Scala | apache-2.0 | 2,587 |
/*
* Copyright 2009-2010 LinkedIn, 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 ... | rhavyn/norbert | network/src/main/scala/com/linkedin/norbert/network/NetworkingException.scala | Scala | apache-2.0 | 2,347 |
// Copyright 2015-2016 Ricardo Gladwell.
// Licensed under the GNU Affero General Public License.
// See the LICENSE file for more information.
package com.is_hosted_by.api
import org.specs2.mutable.Specification
import org.specs2.specification.Scope
import test.TestConfiguration
import org.specs2.matcher.FutureMatch... | is-hosted-by/is-hosted-by-api | src/test/scala/com/is_hosted_by/api/AmazonNetworkSpec.scala | Scala | agpl-3.0 | 719 |
/*
* 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 ... | haohui/flink | flink-libraries/flink-table/src/test/scala/org/apache/flink/table/runtime/stream/sql/JoinITCase.scala | Scala | apache-2.0 | 16,234 |
package uk.gov.bis.levyApiMock.mongo
import javax.inject.Inject
import play.modules.reactivemongo.ReactiveMongoApi
import uk.gov.bis.levyApiMock.data.{AuthCodeOps, AuthCodeRow, TimeSource}
import play.api.libs.json._
import reactivemongo.play.json.compat._
import json2bson._
import org.joda.time.{DateTime}
import sc... | SkillsFundingAgency/das-alpha-hmrc-api-mock | src/main/scala/uk/gov/bis/levyApiMock/mongo/AuthCodeMongo.scala | Scala | mit | 1,323 |
/*
* Copyright 2018 Analytics Zoo 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... | intel-analytics/analytics-zoo | zoo/src/main/scala/com/intel/analytics/zoo/pipeline/api/keras/layers/UpSampling2D.scala | Scala | apache-2.0 | 2,680 |
/*
* Copyright (c) 2021, salesforce.com, inc.
* All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
*/
package com.krux.hyperion.aws
/**
* Defines AWS Data Pipeline Data Formats
*
* ref: htt... | realstraw/hyperion | core/src/main/scala/com/krux/hyperion/aws/AdpDataFormats.scala | Scala | bsd-3-clause | 3,780 |
package pl.writeonly.son2.patch.notation
import com.github.fge.jsonpatch.JsonPatch
import pl.writeonly.son2.apis.config.Meta
import pl.writeonly.son2.apis.notation.{NotationReader, Value}
import pl.writeonly.son2.jack.notation.NotationReaderObject
class NotationReaderPatch(patch: String)
extends NotationReader(Me... | writeonly/son2 | scallions-impl/scallions-patch/src/main/scala/pl/writeonly/son2/patch/notation/NotationReaderPatch.scala | Scala | apache-2.0 | 663 |
package utils.auth
import com.mohiva.play.silhouette.api.LoginInfo
import com.mohiva.play.silhouette.api.util.HTTPLayer
import com.mohiva.play.silhouette.impl.exceptions.ProfileRetrievalException
import com.mohiva.play.silhouette.impl.providers.{ CommonSocialProfile, CommonSocialProfileBuilder, OAuth2Info, OAuth2Provi... | vetafi/vetafi-web | app/utils/auth/IdMeProvider.scala | Scala | apache-2.0 | 4,128 |
/*
* Copyright 2001-2009 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... | vivosys/scalatest | src/test/scala/org/scalatest/fixture/PropSpecSpec.scala | Scala | apache-2.0 | 34,782 |
//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
/** @author John Miller
* @version 1.2
* @date Sat Sep 26 13:10:03 EDT 2015
* @see LICENSE (MIT style license file).
*/
package scalation.util.bld
import java.io.{File, PrintWriter}
//::::::::::::::::::::::::::::::::::::... | mvnural/scalation | src/main/scala/scalation/util/bld/BldMM_Array.scala | Scala | mit | 9,059 |
package com.github.jonfreedman.timeseries
import java.lang
import java.time.LocalDate
import java.util.concurrent.Executors
import com.github.jonfreedman.timeseries.ArrayTimeSeriesCollection.Builder
import com.github.jonfreedman.timeseries.interpolator.ZeroValueInterpolator
import com.github.jonfreedman.timeseries.lo... | jonfreedman/timeseries | src/test/scala/com/github/jonfreedman/timeseries/TestArrayTimeSeriesCollectionBuilder.scala | Scala | gpl-3.0 | 2,916 |
/*
* Copyright (c) 2014, Brook 'redattack34' Heisler
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, t... | Redattack34/TheGuide | src/main/scala/com/castlebravostudios/theguide/mod/TheGuide.scala | Scala | bsd-3-clause | 4,035 |
/*
* 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 collecti... | lrytz/scala | src/library/scala/collection/StrictOptimizedIterableOps.scala | Scala | apache-2.0 | 8,730 |
package com.github.andyglow.config.time
import java.time._
import java.{time => jt}
import com.github.andyglow.config.ConfType._
import com.github.andyglow.config.{ConfNum, ConfObj, ConfStr, ConfType}
import com.typesafe.config.ConfigException
private[config] trait LowPriorityJavaTimeConfTypes {
import LowPriorit... | andyglow/typesafe-config-scala | src/main/scala/com/github/andyglow/config/time/LowPriorityJavaTimeConfTypes.scala | Scala | gpl-3.0 | 7,121 |
/* Copyright 2009-2018 EPFL, Lausanne */
package inox
package utils
class TimeoutFor(it: Interruptible) {
private class Countdown(timeout: Long, onTimeout: => Unit) extends Thread {
private var keepRunning = true
override def run() : Unit = {
val startTime : Long = System.currentTimeMillis
var e... | romac/inox | src/main/scala/inox/utils/TimeoutFor.scala | Scala | apache-2.0 | 872 |
package module.dao
import org.slf4j.LoggerFactory
import org.specs2.mutable.Specification
import play.api.libs.ws.WS
import scala.util.{Failure, Success}
//Futures, Promises and goodies
class ApplicationITSpec extends Specification {
val log = LoggerFactory.getLogger(this.getClass)
// "Application" should {
// ... | boonhero/car-advert | test/module/dao/ApplicationITSpec.scala | Scala | mit | 664 |
/*
* 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 ... | markusthoemmes/openwhisk | core/standalone/src/main/scala/org/apache/openwhisk/standalone/StandaloneDockerSupport.scala | Scala | apache-2.0 | 8,576 |
package qrygraph.shared.nodes
import qrygraph.shared.data._
import scala.util.Random
/**
* Created by info on 12.04.2016.
*/
case class OrderNode(id: String = Random.nextInt.toString,
name: String = NodeHelper.createNodeName(),
orderBy: String = "",
... | Starofall/QryGraph | qrygraph/shared/src/main/scala/qrygraph/shared/nodes/OrderNode.scala | Scala | mit | 1,035 |
package com.spike.giantdataanalysis.flink.example.streaming.state
import java.util.concurrent.TimeUnit
import org.apache.flink.api.common.restartstrategy.RestartStrategies
import org.apache.flink.api.common.time.Time
import org.apache.flink.runtime.state.StateBackend
import org.apache.flink.runtime.state.memory.Memor... | zhoujiagen/giant-data-analysis | temporal-data-and-realtime-algorithm/scala-temporal-apache-flink/src/main/scala/com/spike/giantdataanalysis/flink/example/streaming/state/ExampleStreamingCheckpointingConfig.scala | Scala | mit | 2,286 |
/*
* 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 | sql/catalyst/src/test/scala/org/apache/spark/sql/types/MetadataSuite.scala | Scala | apache-2.0 | 2,989 |
package repositories
trait UserRepoFileComponent {
}
| yejingfu/whiteboard | src/middleware/app/repositories/UserRepoFileComponent.scala | Scala | mit | 55 |
package com.twitter.zipkin.storage.hbase.utils
import com.twitter.concurrent.NamedPoolThreadFactory
import java.util.concurrent._
/**
* Object to provide shared thread pools to the HBase storage system.
*/
object ThreadProvider {
/**
* Default executor used for most operations.
*/
lazy val defaultExecuto... | ajantis/zipkin | zipkin-hbase/src/main/scala/com/twitter/zipkin/storage/hbase/utils/ThreadProvider.scala | Scala | apache-2.0 | 1,594 |
package com.twitter.finatra.http.tests.filters
import com.twitter.conversions.DurationOps._
import com.twitter.finagle.http.{Request, Response}
import com.twitter.finagle.service.{ReqRep, ResponseClass, ResponseClassifier}
import com.twitter.finagle.stats.InMemoryStatsReceiver
import com.twitter.finagle.{Failure, Serv... | twitter/finatra | http-server/src/test/scala/com/twitter/finatra/http/tests/filters/StatsFilterTest.scala | Scala | apache-2.0 | 12,697 |
package pl.touk.nussknacker.ui.process.exception
import pl.touk.nussknacker.engine.api.deployment.ProcessActionType.ProcessActionType
import pl.touk.nussknacker.engine.api.deployment.ProcessState
import pl.touk.nussknacker.restmodel.process.ProcessIdWithName
import pl.touk.nussknacker.ui.IllegalOperationError
case cl... | TouK/nussknacker | ui/server/src/main/scala/pl/touk/nussknacker/ui/process/exception/ProcessIllegalAction.scala | Scala | apache-2.0 | 1,189 |
package text.analyzer.dep.chapas
import text.StringOption
import text.normalizer.NormalizedString
import util.Cache
/**
* @author Nakayama
* Created on 2015/12/20
*/
abstract class PasAnalyzer extends Cache {
def analyze(sentence: NormalizedString): Iterator[String]
def cabochaLattice(sentence: Nor... | ktr-skmt/FelisCatusZero | src/main/scala/text/analyzer/dep/chapas/PasAnalyzer.scala | Scala | apache-2.0 | 1,151 |
package io.ino.solrs
import org.scalatest.funspec.AnyFunSpec
import org.scalatest.matchers.should.Matchers
/**
* Created by magro on 4/29/14.
*/
class HttpUtilsSpec extends AnyFunSpec with Matchers with FutureAwaits {
describe("HttpUtils") {
import HttpUtils._
it("should return null charset for conten... | inoio/solrs | src/test/scala/io/ino/solrs/HttpUtilsSpec.scala | Scala | apache-2.0 | 746 |
/*
* Copyright 2015 Nicolas Rinaudo
*
* 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... | nrinaudo/scala-csv | laws/shared/src/main/scala/kantan/csv/laws/WriterEngineLaws.scala | Scala | mit | 1,199 |
package spec
import org.scalatest.matchers.should.Matchers
import org.scalatest.wordspec.AnyWordSpec
import java.util.TimeZone
import org.slf4j.{LoggerFactory, MDC}
import scribe.format._
import scribe.format
import scribe.handler.LogHandler
import scribe.output.LogOutput
import scribe.output.format.{ASCIIOutputForma... | outr/scribe | slf4j/src/test/scala/spec/SLF4JSpec.scala | Scala | mit | 2,844 |
package net.xtof.time
object Duration {
def apply(days: Int = 0, hours: Int = 0, minutes: Int = 0, seconds: Int = 0, milliseconds: Int = 0): Duration =
Duration(milliseconds +
seconds * Constants.MillisecondsPerSecond +
minutes * Constants.MillisecondsPerMinute +
hours * Constants.Milliseco... | xtofs/tiny-time | src/main/scala/net/xtof/time/Duration.scala | Scala | apache-2.0 | 2,015 |
package net.sansa_stack.rdf.common.io.hadoop
import java.io.{ Closeable, InputStream, IOException }
import java.util
import java.util.concurrent.{ SynchronousQueue, TimeUnit }
import java.util.concurrent.atomic.AtomicLong
import scala.collection.JavaConverters._
import net.sansa_stack.rdf.common.annotation.Experimen... | SANSA-Stack/Spark-RDF | sansa-rdf-common/src/main/scala/net/sansa_stack/rdf/common/io/hadoop/RiotFileInputFormat.scala | Scala | gpl-3.0 | 10,750 |
package com.sageserpent.plutonium
import java.time.Instant
import com.sageserpent.americium.PositiveInfinity
import com.sageserpent.americium.randomEnrichment._
import org.scalatest.exceptions.TestFailedException
import org.scalatest.prop.GeneratorDrivenPropertyChecks
import org.scalatest.{FlatSpec, LoneElement, Matc... | sageserpent-open/open-plutonium | src/test/scala/com/sageserpent/plutonium/Bugs.scala | Scala | mit | 27,134 |
/*
* 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 ... | milliman/spark | resource-managers/mesos/src/main/scala/org/apache/spark/deploy/mesos/MesosClusterDispatcherArguments.scala | Scala | apache-2.0 | 5,390 |
package client.logger
import scala.annotation.elidable
import scala.annotation.elidable._
trait Logger {
/*
* Use @elidable annotation to completely exclude functions from the compiler generated byte-code based on
* the specified level. In a production build most logging functions will simply disappear with n... | LivelyGig/ProductWebUI | client/src/main/scala/client/logger/LoggerFactory.scala | Scala | apache-2.0 | 1,903 |
package com.pathfinder.api
case class TransitPath(val transitEdges: List[TransitEdge]) extends java.io.Serializable {
} | oluies/ddd-sample-scala | src/main/scala/com/pathfinder/api/TransitPath.scala | Scala | mit | 123 |
/***********************************************************************
* Copyright (c) 2013-2022 Commonwealth Computer Research, Inc.
* Portions Crown Copyright (c) 2016-2022 Dstl
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Apache License, Version... | locationtech/geomesa | geomesa-features/geomesa-feature-kryo/src/test/scala/org/locationtech/geomesa/features/kryo/json/JsonPathFilterFunctionTest.scala | Scala | apache-2.0 | 14,412 |
package com.aimplicits.gallery
import java.awt.geom.AffineTransform
import java.awt.{Color, Font, RenderingHints}
import java.awt.image.{AffineTransformOp, BufferedImage}
import java.io.{ByteArrayInputStream, ByteArrayOutputStream}
import java.net.URLDecoder
import java.util.Base64
import javax.imageio.ImageIO
import... | paul-lysak/gallery-proto | gallery_resizer_lambda/src/main/scala/com/aimplicits/gallery/ResizerLambda.scala | Scala | apache-2.0 | 10,978 |
package lila.search
import com.sksamuel.elastic4s.requests.searches.{ SearchResponse => ESR }
case class Id(value: String)
case class StringQuery(value: String)
case class From(value: Int)
case class Size(value: Int)
case class SearchResponse(hitIds: List[String])
object SearchResponse {
def apply(res: ESR): Se... | ornicar/lila-search | app/model.scala | Scala | agpl-3.0 | 532 |
package com.chitingraphics.stingray.entities
import com.chitingraphics.stingray.utils.{Ar, Color}
abstract class Geometric extends Entity {
def setColor(newColor: Color): Entity
final def setColor(r: Ar.RealType, g: Ar.RealType, b: Ar.RealType): Entity = setColor(Color(r, g, b))
}
case class Mesh(private val tra... | acycliczebra/StingRay | src/main/scala-2.11/com/chitingraphics/stingray/entities/Geometric.scala | Scala | mit | 1,308 |
object Foo {
def isGood(x: Int): Boolean = { x % 2 == 0 }
}
object ArrayUtils {
def filter(xs: Array[Int], /* something */): Array[Int] = ???
}
// let's do it the Java7 way
| agconti/scala-school | 04-functions-as-values/slides/slide007.scala | Scala | mit | 183 |
/** Copyright 2015 TappingStone, 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 ... | alex9311/PredictionIO | core/src/main/scala/org/apache/predictionio/core/BaseDataSource.scala | Scala | apache-2.0 | 1,731 |
/*
* Copyright 2016-2020 47 Degrees Open Source <https://www.47deg.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 ... | 47deg/github4s | github4s/src/test/scala/github4s/unit/TeamsSpec.scala | Scala | apache-2.0 | 1,360 |
/*
* Copyright (c) 2020. StulSoft
*/
package com.stulsoft.poc.json.jackson
import com.fasterxml.jackson.databind.ObjectMapper
import com.fasterxml.jackson.databind.node.ArrayNode
import com.typesafe.scalalogging.StrictLogging
import scala.io.Source
/**
* @author Yuriy Stul
*/
object ParserEx1 extends App with ... | ysden123/poc | scala-json/src/main/scala/com/stulsoft/poc/json/jackson/ParserEx1.scala | Scala | mit | 1,355 |
package org.dele.text.maen.matchers
import org.dele.text.maen.ConfValueStringParser.Parsed
import org.dele.text.maen.matchers.StoppedByMatcherManager.StoppedByConfig
import org.dele.text.maen.matchers.SubMatchCheckerLib._
import org.dele.text.maen.test.TestAtom._
import org.dele.text.maen.{AtomPropMatcherLib, TAtom, T... | new2scala/text-util | maen/src/test/scala/org/dele/text/maen/matchers/RepeatableMatcherTest.scala | Scala | apache-2.0 | 4,547 |
package com.socrata.tileserver.mocks
import java.io.InputStream
import com.socrata.http.common.util.Acknowledgeable
import com.socrata.http.server.responses._
case class ThrowsResponse(ex: Exception, override val resultCode: Int)
extends EmptyResponse {
override def inputStream(ignored: Long = 0): InputStream ... | socrata-platform/tileserver | src/test/scala/com.socrata.tileserver/mocks/ThrowsResponse.scala | Scala | apache-2.0 | 614 |
package records.test
import org.scalatest._
import records.Rec
class UnapplyTest extends FlatSpec with Matchers {
"A record" should "extract fields with corresponding types" in {
val Rec(x, y) = Rec(x = 1, y = 2)
val xx: Int = x
val yy: Int = y
}
it should "be able to extract fields that are not i... | scala-records/scala-records | tests/src/test-2.11/scala/records/test/UnapplyTest.scala | Scala | bsd-3-clause | 1,322 |
package org.scalameta
package build
import java.lang.ProcessBuilder._
import java.nio.file._
import java.nio.file.Files._
import scala.collection.JavaConverters._
import sbt._
import sbt.Keys._
import sbt.plugins._
object Build extends AutoPlugin {
override def requires: Plugins = JvmPlugin
override def trigger: ... | scalameta/scalameta | project/Build.scala | Scala | bsd-3-clause | 2,162 |
/*
* Copyright 2016 Groupon, 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... | groupon/sparklint | src/main/scala/com/groupon/sparklint/ui/UIEventSourceNavigation.scala | Scala | apache-2.0 | 3,809 |
package cobalt.integration.snake
import java.nio.file.Paths
import cobalt.utils.CompilerUtil
object Snake {
def main(args: Array[String]): Unit = {
CompilerUtil.executeJava(Paths.get("snake/Snake"))
}
}
| Michael2109/cobalt | src/test/scala/cobalt/integration/snake/Snake.scala | Scala | lgpl-3.0 | 216 |
package org.mozartoz.bootcompiler
import java.io.BufferedOutputStream
import bytecode._
import oz._
import symtab._
class Serializer(program: Program, output: BufferedOutputStream) {
val nodeToIndex = new scala.collection.mutable.HashMap[OzValue, Int]
val indexCounter = new util.Counter(1)
// Top-level
def... | yjaradin/mozart2 | bootcompiler/src/main/scala/org/mozartoz/bootcompiler/Serializer.scala | Scala | bsd-2-clause | 5,285 |
/*
* 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 ... | prccaraujo/openwhisk | core/controller/src/main/scala/whisk/core/controller/Namespaces.scala | Scala | apache-2.0 | 5,062 |
/*
* 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 ... | JihongMA/incubator-carbondata | integration/spark-common-test/src/test/scala/org/apache/carbondata/integration/spark/testsuite/dataload/TestLoadDataGeneral.scala | Scala | apache-2.0 | 5,032 |
/*
* 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 ... | iiisthu/sparkSdn | mllib/src/main/scala/org/apache/spark/mllib/recommendation/ALS.scala | Scala | apache-2.0 | 29,413 |
/*
* 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 ... | spark-test/spark | resource-managers/yarn/src/test/scala/org/apache/spark/deploy/yarn/ClientSuite.scala | Scala | apache-2.0 | 27,908 |
import akka.actor.ActorSystem
import akka.stream.ActorMaterializer
import scala.concurrent.Await
import scala.util.{Failure, Success}
object Main extends App {
val host = "0.0.0.0"
val port = 9000
implicit val system: ActorSystem = ActorSystem(name="todoapi")
implicit val materializer: ActorMaterializer = A... | matija94/show-me-the-code | akka-http-quickstart/src/main/scala/Main.scala | Scala | mit | 894 |
package com.etsy.conjecture.scalding
import collection.mutable.PriorityQueue
import cascading.pipe.Pipe
import cascading.pipe.joiner.InnerJoin
import org.apache.commons.math3.linear.RealVector
/**
* Class provides functions for doing approximate K-nearest neighbors.
* hashes : The number of times to hash.
* plan... | aglne/Conjecture | src/main/scala/com/etsy/conjecture/scalding/LSH.scala | Scala | mit | 5,356 |
package net.liftweb.scalate
import _root_.net.liftweb.common._
import _root_.net.liftweb.util._
import _root_.net.liftweb.http._
import xml.NodeSeq
/**
* A {@link LiftView} which uses a <a href="http://scalate.fusesource.org/">Scalate</a>
* template engine to resolve a URI and render it as markup
*
* @version $Re... | wsaccaco/lift | framework/lift-modules/lift-scalate/src/main/scala/net/liftweb/scalate/ScalateView.scala | Scala | apache-2.0 | 2,685 |
package com.rasterfoundry.database
import com.rasterfoundry.datamodel._
import com.rasterfoundry.common.Generators.Implicits._
import com.rasterfoundry.datamodel.PageRequest
import doobie.implicits._
import cats.implicits._
import org.scalacheck.Prop.forAll
import org.scalatest._
import org.scalatestplus.scalacheck.... | azavea/raster-foundry | app-backend/db/src/test/scala/com/azavea/rf/database/SceneWithRelatedDaoSpec.scala | Scala | apache-2.0 | 6,553 |
package com.docurated.clustermc.sample.protocol
import com.docurated.clustermc.protocol.PolledMessage
sealed case class ArticleMessage(id: String,
receipt: String,
url: String,
longLink: Option[String] = None,
... | Docurated/clustermc | sample/src/main/scala/com/docurated/clustermc/sample/protocol/ArticleMessage.scala | Scala | apache-2.0 | 671 |
package com.campudus.vertx
import org.vertx.java.core.Handler
import org.vertx.java.core.AsyncResult
import org.vertx.java.core.AsyncResultHandler
import org.vertx.scala.core.json._
import scala.concurrent.Future
trait VertxScalaHelpers {
def json() = new JsonObject()
import scala.language.implicitConversions
... | campudus/vertx-mysql-postgresql | src/main/scala/com/campudus/vertx/VertxScalaHelpers.scala | Scala | apache-2.0 | 1,087 |
package table
import slick.driver.PostgresDriver.simple._
import core.BaseTable
import models.Collection
class CollectionTable(tag: Tag) extends BaseTable[Collection](tag, "collection") {
def title = column[String]("title")
def isDefaultSet = column[Boolean]("isdefaultset")
def * = (id.?, title, isDefaultSet... | fikrimuhal/animated-potato | backend/AnimatedPotatoBackend/app/table/CollectionTable.scala | Scala | gpl-3.0 | 366 |
/**
* Copyright (C) 2012 Inria, University Lille 1.
*
* This file is part of PowerAPI.
*
* PowerAPI 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... | abourdon/powerapi-akka | processors/device-aggregator/src/main/scala/fr/inria/powerapi/processor/aggregator/device/DeviceAggregator.scala | Scala | agpl-3.0 | 1,859 |
/*
* @author Philip Stutz
* @author Mihaela Verman
*
* Copyright 2015 University of Zurich
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apa... | elaverman/cuilt | src/main/scala/com/signalcollect/dcop/modules/StateTypes.scala | Scala | apache-2.0 | 15,714 |
package eventstore
package akka
package examples
import _root_.akka.actor.ActorSystem
import eventstore.akka.tcp.ConnectionActor
class APIsExample {
val system = ActorSystem()
def methodCall(): Unit = {
val connection = EsConnection(system)
val _ = connection apply ReadEvent(EventStream.Id("my-stream"), ... | EventStore/EventStore.JVM | examples/src/main/scala/eventstore/akka/examples/APIsExample.scala | Scala | bsd-3-clause | 518 |
package com.github.diegopacheco.sandbox.scala.akka.configs
import akka.actor.ActorSystem
object MultipleActorSystem extends App {
val system1:ActorSystem = ActorSystem("myapp1")
val system2:ActorSystem = ActorSystem("myapp2")
println(system1)
println(system2)
} | diegopacheco/scala-playground | scala_11_akka_23_full_playground/src/main/scala/com/github/diegopacheco/sandbox/scala/akka/configs/MultipleActorSystem.scala | Scala | unlicense | 280 |
import akka.http.scaladsl.model.Uri
import akka.http.scaladsl.model.Uri.Query
import cats.instances.future._
import cats.syntax.functor._
import com.bot4s.telegram.Implicits._
import com.bot4s.telegram.api.declarative.{ Commands, InlineQueries }
import com.bot4s.telegram.future.Polling
import com.bot4s.telegram.methods... | mukel/telegrambot4s | examples/src-jvm/LmgtfyBot.scala | Scala | apache-2.0 | 2,492 |
package com.softwaremill.macwire.internals
private[macwire] final class Logger {
var ident = 0
/** Log at `DEBUG` level */
def apply(msg: => String): Unit = apply(msg, DEBUG_LEVEL)
def trace(msg: => String) = apply(msg, TRACE_LEVEL)
def withBlock[T](msg: => String)(block: => T): T = {
apply(msg)
b... | adamw/macwire | macros/src/main/scala-3/com/softwaremill/macwire/internals/Logger.scala | Scala | apache-2.0 | 1,040 |
package template.client
import scalacss.Defaults._
import scalacss.mutable
/** Color scheme and universal styles */
class Theme(implicit r: mutable.Register) extends StyleSheet.Inline()(r) {
import dsl._
object Colors {
val lightGray = c"#ccc"
val darkGray = c"#333"
}
}
/** Base trait that provides acc... | markschaake/akka-http-scalajs | client/src/main/scala/client/StyleSheet.scala | Scala | mit | 450 |
// scalac: -Werror
object Test {
import pack._
// java.util.List not java.awt.List or pack.List
Foo.list().listIterator()
}
| lrytz/scala | test/files/pos/t7232e/Test.scala | Scala | apache-2.0 | 131 |
/*
* 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/carbondata/streamer/CarbonStreamerConfig.scala | Scala | apache-2.0 | 13,929 |
package bifrost.crypto
import bifrost.keygen.KeyFile
import bifrost.crypto.hash.FastCryptographicHash
import bifrost.keygen.KeyFile.uuid
import scala.reflect.io.Path
import scala.util.Try
import org.scalatest._
/*
* Test class for verifying BIP39 phrase translator class
*/
class Bip39Spec extends FlatSpec with Mat... | Topl/Project-Bifrost | src/test/scala/bifrost/crypto/Bip39Spec.scala | Scala | mpl-2.0 | 4,026 |
/* TestScores: Unit tests for the lazy search monad
*
* Scored[A] represents a lazy sorted list of Alt[A] pairs. These tests check that
* the representation is correct, even after the horrendous imperative engines of
* JavaScores.
*/
package tarski
import utility.Utility._
import utility.JavaUtils.hash
import t... | eddysystems/eddy | tests/src/tarski/TestScores.scala | Scala | bsd-2-clause | 6,696 |
package scalaxy.streams.test
import org.junit._
import org.junit.Assert._
class LoopsTest {
import scalaxy.streams.optimize
@Test
def test {
val n = 10
// val cols = for (i <- 0 to n) yield for (i <- 0)
// val s: Seq[Int] = optimize {
// for (i <- 1 to n; j <- 0 to n; val prod = i * j; if pro... | nativelibs4java/scalaxy-streams | src/test/scala/LoopsTest.scala | Scala | bsd-3-clause | 2,549 |
package mesosphere.marathon.integration.setup
import javax.inject.{ Inject, Named }
import javax.ws.rs.core.Response
import javax.ws.rs.{ GET, Path }
import akka.actor.ActorRef
import com.google.common.util.concurrent.Service
import com.google.inject._
import mesosphere.chaos.http.{ HttpConf, HttpModule, HttpService ... | yp-engineering/marathon | src/test/scala/mesosphere/marathon/integration/setup/ForwarderService.scala | Scala | apache-2.0 | 4,852 |
package com.github.ornicar.scalariver
import scala.util.{Try, Success, Failure}
import tiscaf._
object ScalariverServer extends HServer with App {
def port = args.toIndexedSeq lift 0 flatMap { p ⇒
Try(p.toInt).toOption
} getOrElse 8098
val apps = Seq(ScalariformApp, StaticApp)
val ports = Set(port)
ov... | ornicar/scalariver | src/main/scala/Scalariver.scala | Scala | mit | 2,031 |
package scala.meta.tests
package io
import scala.meta._
import scala.meta.internal.io._
import munit.FunSuite
class IOSuite extends FunSuite {
val buildSbt: AbsolutePath = RelativePath("build.sbt").toAbsolute
test("PathIO.workingDirectory") {
val obtained = PathIO.workingDirectory.toString
// assuming we... | scalameta/scalameta | tests/shared/src/test/scala/scala/meta/tests/io/IOSuite.scala | Scala | bsd-3-clause | 1,477 |
/*
* 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 ... | vjagadish/samza-clone | samza-core/src/main/scala/org/apache/samza/checkpoint/CheckpointTool.scala | Scala | apache-2.0 | 8,060 |
/*
* 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 ... | ravipesala/incubator-carbondata | integration/spark-common-test/src/test/scala/org/apache/carbondata/spark/testsuite/datacompaction/DataCompactionCardinalityBoundryTest.scala | Scala | apache-2.0 | 4,468 |
/*
* Copyright 2001-2013 Artima, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agre... | cheeseng/scalatest | examples/src/main/scala/org/scalatest/examples/flatspec/diskall/SetSpec.scala | Scala | apache-2.0 | 956 |
/*
* 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 ... | shaoxuan-wang/flink | flink-table/flink-table-planner/src/test/scala/org/apache/flink/table/api/stream/sql/GroupWindowTest.scala | Scala | apache-2.0 | 10,303 |
package charactor.core.model.objects.charactor
import _root_.objects.core.model.WorldMap
import actors.Actor
import _root_.charactor.core.messages._
import charactor.core.model.objects.charactor.attributes.Attribute
import _root_.charactor.core.model._
import objects.{Energy, Moveable}
import parts._
object Characto... | PiotrTrzpil/charactor | src/charactor/core/model/objects/charactor/Charactor.scala | Scala | apache-2.0 | 3,915 |
package org.jetbrains.plugins.scala
package lang
package parser
package parsing
package types
import com.intellij.lang.PsiBuilder
import com.intellij.psi.tree.IElementType
import org.jetbrains.plugins.scala.lang.lexer.ScalaTokenTypes._
import org.jetbrains.plugins.scala.lang.lexer.{ScalaTokenType, ScalaTokenTypes}
imp... | JetBrains/intellij-scala | scala/scala-impl/src/org/jetbrains/plugins/scala/lang/parser/parsing/types/StableId.scala | Scala | apache-2.0 | 5,676 |
package com.seanshubin.server
import org.eclipse.jetty.server.handler.AbstractHandler
import org.eclipse.jetty.server.Request
import javax.servlet.http.{HttpServletResponse, HttpServletRequest}
class SimplifiedHandlerAdaptor(simplifiedTransformer: SimplifiedTransformer,
simplifiedHandle... | SeanShubin/schulze | server/src/main/scala/com/seanshubin/server/SimplifiedHandlerAdaptor.scala | Scala | unlicense | 1,377 |
/**
* 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... | lindong28/kafka | core/src/test/scala/unit/kafka/integration/KafkaServerTestHarness.scala | Scala | apache-2.0 | 7,456 |
/*
* Copyright (c) 2013-2014 Telefónica Investigación y Desarrollo S.A.U.
*
* 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
*
* Unles... | telefonicaid/fiware-cosmos-platform | infinity/driver/src/test/scala/es/tid/cosmos/infinity/streams/InfinityInputStreamTest.scala | Scala | apache-2.0 | 3,073 |
/*
* 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... | ajantis/zipkin | zipkin-common/src/main/scala/com/twitter/zipkin/storage/util/SpanStoreValidator.scala | Scala | apache-2.0 | 6,188 |
import leon.lang._
import leon.lang.synthesis._
import leon.annotation._
object Union {
sealed abstract class List
case class Cons(head: BigInt, tail: List) extends List
case object Nil extends List
def size(l: List) : BigInt = (l match {
case Nil => BigInt(0)
case Cons(_, t) => 1 + size(t)
}) ensur... | epfl-lara/leon | testcases/web/synthesis/03_List_Union.scala | Scala | gpl-3.0 | 603 |
/*
* 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 ... | minixalpha/spark | sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/aggregate/ApproxCountDistinctForIntervalsSuite.scala | Scala | apache-2.0 | 9,538 |
/*
* Copyright 2021 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/amls-frontend | test/views/submission/bad_requestSpec.scala | Scala | apache-2.0 | 1,752 |
package org.clulab.dynet
import edu.cmu.dynet.{ExpressionVector, LookupParameter}
/**
* First layer that occurs in a sequence modeling architecture: goes from words to Expressions
*/
trait InitialLayer extends Saveable {
def forward(sentence: AnnotatedSentence,
constEmbeddings: ConstEmbeddingParamet... | sistanlp/processors | main/src/main/scala/org/clulab/dynet/InitialLayer.scala | Scala | apache-2.0 | 417 |
object Holder {
object ActorMaterializer {
def apply()(implicit context: ActorRefFactory): ActorMaterializer = ???
}
trait Materializer
abstract class ActorMaterializer extends Materializer
class ActorMaterializerSettings
trait ActorRefFactory
case class ActorSystem(s: String) extends ActorRefF... | loskutov/intellij-scala | testdata/typeInference/implicits/SCL9877.scala | Scala | apache-2.0 | 1,248 |
/**
* Copyright 2015 Yahoo Inc. Licensed under the Apache License, Version 2.0
* See accompanying LICENSE file.
*/
package kafka.manager
import java.util.Properties
import akka.actor.{ActorRef, ActorSystem, Kill, Props}
import akka.pattern._
import akka.util.Timeout
import akka.util.Timeout._
import com.typesafe.c... | Mogztter/kafka-manager | test/kafka/manager/TestKafkaStateActor.scala | Scala | apache-2.0 | 4,459 |
/*
* 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 ... | practice-vishnoi/dev-spark-1 | sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/jdbc/JDBCRDD.scala | Scala | apache-2.0 | 18,966 |
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.