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 shapeless
import org.junit.Test
object CachedTestsDefinitions {
trait Intermediate {
def repr: String
}
object Intermediate {
def apply()(implicit intm: Intermediate): Intermediate = intm
implicit val default: Intermediate =
new Intermediate {
val repr = "default"
}
... | lambdista/shapeless | core/src/test/scala/shapeless/cached.scala | Scala | apache-2.0 | 1,714 |
/*
This file is part of Intake24.
Copyright 2015, 2016 Newcastle University.
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 appl... | digitalinteraction/intake24 | FoodDataXML/src/main/scala/uk/ac/ncl/openlab/intake24/foodxml/scripts/WriteFlatFoods.scala | Scala | apache-2.0 | 2,272 |
/*
* 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 ... | ZxlAaron/mypros | sql/hive/src/test/scala/org/apache/spark/sql/sources/CommitFailureTestSource.scala | Scala | apache-2.0 | 2,687 |
/*
* Copyright 2013 Bruno Bieth
*
* 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 ... | backuity/matchete | core/src/test/scala/org/backuity/matchete/TraversableMatchersTest.scala | Scala | apache-2.0 | 9,960 |
/*
* Scala.js (https://www.scala-js.org/)
*
* Copyright EPFL.
*
* Licensed under Apache License 2.0
* (https://www.apache.org/licenses/LICENSE-2.0).
*
* See the NOTICE file distributed with this work for
* additional information regarding copyright ownership.
*/
package org.scalajs.testsuite.javalib.util
im... | scala-js/scala-js | test-suite/shared/src/test/scala/org/scalajs/testsuite/javalib/util/ArrayDequeTest.scala | Scala | apache-2.0 | 4,529 |
package org.improving.fuse.test
import _root_.org.specs._
import jnajava.C._
import java.nio.{ CharBuffer, ByteBuffer }
object libcSpec extends Specification {
import com.sun.jna.{ Native, Memory }
import Libc.LIBC
import Libc.Conversions._
import Fcntl._
import jnajava.Stdio._
// def umask(cmask: Sh... | tonosaman/jna-fuse-scala | src/test/libcSpec.scala | Scala | isc | 4,979 |
/**
* Copyright 2015 Otto (GmbH & Co KG)
*
* 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... | utzwestermann/schedoscope | schedoscope-core/src/main/scala/org/schedoscope/dsl/transformations/Checksum.scala | Scala | apache-2.0 | 2,649 |
package bug1000656
import util.Box
import util.Full
/** Test that hyperlinking works for definitions defined in a dependent project. */
class Client {
def foo: Unit = {
val b: Box[Int] = null
val t: b.myInt/*^*/ = 10
val x = Full/*^*/("a")
}
}
| Kwestor/scala-ide | org.scala-ide.sdt.core.tests/test-workspace/hyperlinks/src/bug1000656/Client.scala | Scala | bsd-3-clause | 264 |
/***********************************************************************
* 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-fs/geomesa-fs-storage/geomesa-fs-storage-orc/src/main/scala/org/locationtech/geomesa/fs/storage/orc/OrcFileSystemStorageFactory.scala | Scala | apache-2.0 | 1,091 |
/* *\
** Squants **
** **
** Scala Quantities and Units of Measure Library and DSL **
** (c) 2013-2015, Ga... | underscorenico/squants | shared/src/test/scala/squants/motion/PressureSpec.scala | Scala | apache-2.0 | 3,691 |
package io.netflow.storage.cassandra
import java.net.{ InetAddress, InetSocketAddress }
import java.util.UUID
import com.datastax.driver.core.Row
import com.twitter.util.{ Future, Promise }
import com.websudos.phantom.CassandraTable
import com.websudos.phantom.Implicits._
import com.websudos.phantom.keys.{ Index, Par... | ayscb/netflow | netflow1/netflow-master/src/main/scala/io/netflow/storage/cassandra/NetFlowV9TemplateRecord.scala | Scala | apache-2.0 | 1,564 |
package controllers
import play.api._
import play.api.mvc._
import play.api.libs.concurrent.Akka
import language.postfixOps
import akka.actor.Actor
import akka.actor.ActorRef
import akka.actor.ActorSystem
import akka.actor.Props
import akka.actor.Terminated
import akka.pattern.ask
import akka.util.Timeout
import co... | luzhuomi/playakkahbase | scala/playAkka/app/controllers/Application.scala | Scala | gpl-2.0 | 906 |
package se.lu.nateko.cp.meta.services.sparql.magic
import scala.annotation.tailrec
import org.eclipse.rdf4j.query.algebra._
package object fusion{
def splitTriple(sp: StatementPattern) = (sp.getSubjectVar, sp.getPredicateVar, sp.getObjectVar)
def highestJoinOnlyAncestor(node: QueryModelNode): Option[Join] = {
d... | ICOS-Carbon-Portal/meta | src/main/scala/se/lu/nateko/cp/meta/services/sparql/magic/fusion/package.scala | Scala | gpl-3.0 | 2,738 |
package edu.arizona.sista.learning
import scala.collection.mutable.{ListBuffer, ArrayBuffer}
import edu.arizona.sista.struct.Counter
import edu.arizona.sista.struct.Lexicon
import scala.io.BufferedSource
import org.slf4j.LoggerFactory
import java.util.zip.GZIPInputStream
import java.io.{FileWriter, PrintWriter, FileIn... | michaelcapizzi/processors | src/main/scala/edu/arizona/sista/learning/RankingDataset.scala | Scala | apache-2.0 | 18,269 |
class Bar(i: Int):
inline def this() = this(0) // error
| dotty-staging/dotty | tests/neg/i12986a/Bar.scala | Scala | apache-2.0 | 58 |
/*
* 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 ... | ArvinDevel/onlineAggregationOnSparkV2 | core/src/test/scala/org/apache/spark/deploy/worker/ExecutorRunnerTest.scala | Scala | apache-2.0 | 1,851 |
/*
* Copyright (c) 2015-2022 "Neo Technology,"
* Network Engine for Objects in Lund AB [http://neotechnology.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.ap... | opencypher/openCypher | tools/tck-integrity-tests/src/test/scala/org/opencypher/tools/tck/ValidateSteps.scala | Scala | apache-2.0 | 7,024 |
package so.modernized.pathological
import java.nio.file._
import scala.collection.mutable
import java.nio.file.attribute.BasicFileAttributes
import so.modernized.pathological.util._
import java.nio.charset.Charset
import scala.reflect._
/**
* @author John Sullivan
*/
object Pathological {
private class GlobResol... | JackSullivan/pathological | src/main/scala/so/modernized/pathological/Pathological.scala | Scala | apache-2.0 | 3,995 |
package io.youi.server
import java.io.File
import io.youi.http.content.Content
import io.youi.http.{HttpConnection, HttpMethod, HttpStatus}
import io.youi.net.{ContentType, IP, Path, URLMatcher}
import io.youi.server.handler._
import io.youi.server.rest.Restful
import io.youi.server.validation.{ValidationResult, Vali... | outr/youi | server/src/main/scala/io/youi/server/dsl/package.scala | Scala | mit | 4,398 |
package io.bimble.pqgram
import java.util.UUID
import org.scalacheck.{Gen, Prop}
import org.scalatest.{Matchers, FlatSpec}
import scalax.collection.Graph
import scalax.collection.GraphPredef._
import scalax.collection.constrained.DAG
class PQGramRegressions extends FlatSpec with Matchers {
import Implicits._
... | hythloday/pqgram | src/test/scala/io/bimble/pqgram/PQGramRegressions.scala | Scala | apache-2.0 | 22,493 |
/*
* Copyright 2018 Satellite Applications Catapult 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
*
* ... | SatelliteApplicationsCatapult/tribble | tribble-core/src/test/scala/org/catapult/sa/tribble/mutators/TestMutators.scala | Scala | apache-2.0 | 3,945 |
package com.datawizards.dmg.dialects
import com.datawizards.dmg.generator.DatabaseGenerator
import com.datawizards.dmg.metadata._
object H2Dialect extends DatabaseGenerator with Dialect {
def getSupportedDialect(): Dialect = this
override def intType: String = "INT"
override def stringType: String = "VARCHAR"... | mateuszboryn/data-model-generator | src/main/scala/com/datawizards/dmg/dialects/H2Dialect.scala | Scala | apache-2.0 | 2,725 |
/**
* Copyright 2015 Mohiva Organisation (license at mohiva dot 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 req... | mohiva/play-silhouette | silhouette/app/com/mohiva/play/silhouette/api/repositories/AuthenticatorRepository.scala | Scala | apache-2.0 | 1,799 |
def main: Unit => IO[Unit] | hmemcpy/milewski-ctfp-pdf | src/content/3.5/code/scala/snippet32.scala | Scala | gpl-3.0 | 26 |
/**
* Copyright (C) 2016 Hurence (support@hurence.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 a... | Hurence/log-island | logisland-components/logisland-processors/logisland-processor-botsearch/src/main/scala/com/hurence/botsearch/analytics/TracesIndexer.scala | Scala | apache-2.0 | 2,645 |
/**
* 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... | confluentinc/kafka-deprecated-fork | core/src/test/scala/unit/kafka/log/LogTest.scala | Scala | apache-2.0 | 33,523 |
package cromwell.engine.backend.io.filesystem.gcs
import java.nio.file.attribute.{BasicFileAttributes, FileTime}
import com.google.api.services.storage.Storage
import com.google.api.services.storage.model.StorageObject
import wdl4s.values._
class GcsFileAttributes(path: NioGcsPath, storageClient: Storage) extends Ba... | cowmoo/cromwell | engine/src/main/scala/cromwell/engine/backend/io/filesystem/gcs/GcsFileAttributes.scala | Scala | bsd-3-clause | 1,245 |
/*
* 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/AtomicNumberAny.scala | Scala | apache-2.0 | 3,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 ... | hhbyyh/spark | core/src/test/scala/org/apache/spark/scheduler/EventLoggingListenerSuite.scala | Scala | apache-2.0 | 23,189 |
/***********************************************************************
* 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-utils/src/main/scala/org/locationtech/geomesa/utils/iterators/ExceptionalIterator.scala | Scala | apache-2.0 | 1,777 |
package akkit
import akka.actor._
import akka.routing.RouterConfig
import scala.language.implicitConversions
import scala.reflect.ClassTag
case class SafeProps[T <: Actor](props: Props) extends AnyVal {
def withDispatcher(dispatcher: String) = map { _ withDispatcher dispatcher }
def withDeploy(deploy: Deploy) =... | ataraxer/akkit | akkit-core/src/main/scala/SafeRef.scala | Scala | mit | 921 |
/*
* 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/core/src/main/scala/org/apache/spark/sql/execution/datasources/PruneFileSourcePartitions.scala | Scala | apache-2.0 | 3,414 |
/*
* 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 ... | sgururajshetty/carbondata | integration/spark2/src/test/scala/org/apache/carbondata/spark/testsuite/partition/TestAlterPartitionTable.scala | Scala | apache-2.0 | 51,366 |
package coursier.cli.publish
import java.io.{File, PrintStream}
import java.net.URI
import java.nio.file.Paths
import java.time.Instant
import java.util.concurrent.ScheduledExecutorService
import caseapp._
import coursier.cache.internal.ThreadUtil
import coursier.publish.checksum.{ChecksumType, Checksums}
import cour... | coursier/coursier | modules/cli/src/main/scala/coursier/cli/publish/Publish.scala | Scala | apache-2.0 | 9,751 |
/***********************************************************************
* Copyright (c) 2013-2016 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 is ... | mdzimmerman/geomesa | geomesa-kafka/geomesa-kafka-datastore/src/test/scala/org/locationtech/geomesa/kafka/ReplayKafkaDataStoreTest.scala | Scala | apache-2.0 | 7,373 |
///////////////////////////////////////////////////////////////////////////////
// GeolocateRoughRanker.scala
//
// Copyright (C) 2014 Ben Wing, The University of Texas at Austin
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.... | utcompling/textgrounder | src/main/scala/opennlp/textgrounder/geolocate/GeolocateRoughRanker.scala | Scala | apache-2.0 | 1,501 |
/*
* Copyright 2014–2018 SlamData 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 agr... | slamdata/slamengine | impl/src/main/scala/quasar/impl/storage/IndexedStore.scala | Scala | apache-2.0 | 4,318 |
/**
* 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... | iheartradio/kafka | core/src/main/scala/kafka/tools/ProducerPerformance.scala | Scala | apache-2.0 | 13,000 |
/*
* 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/core/src/test/scala/org/apache/spark/sql/execution/WholeStageCodegenSuite.scala | Scala | apache-2.0 | 36,315 |
/*
* Copyright ASCII Soup (Nils Luxton) (c) 2016.
*
* GNU GPL v3 - See LICENSE.txt for details
*/
package com.asciisoup.advent.DayOne
case class CircularList[T](list: List[T], startAt: T) {
private var index: Int = list.indexOf(startAt)
def next: T = {
if (index + 1 == list.length) {
index = -1
... | ascii-soup/AdventOfCode2016 | src/main/scala/com/asciisoup/advent/DayOne/CircularList.scala | Scala | gpl-3.0 | 475 |
package cromwell
import akka.testkit.EventFilter
import cromwell.util.SampleWdl
import wdl4s._
import wdl4s.values.WdlFloat
class FileSizeWorkflowSpec extends CromwellTestkitSpec {
object FileSize extends SampleWdl {
override def wdlSource(runtime: String = "") =
"""task file_size {
| File input... | cowmoo/cromwell | engine/src/test/scala/cromwell/FileSizeWorkflowSpec.scala | Scala | bsd-3-clause | 3,691 |
package com.twitter.finagle
import com.twitter.util.{Activity, Var}
import java.net.InetSocketAddress
import org.junit.runner.RunWith
import org.scalatest.junit.{AssertionsForJUnit, JUnitRunner}
import org.scalatest.FunSuite
import scala.language.implicitConversions
@RunWith(classOf[JUnitRunner])
class ServersetNamer... | adriancole/finagle | finagle-serversets/src/test/scala/com/twitter/finagle/ServersetNamerTest.scala | Scala | apache-2.0 | 2,060 |
package aims.http
import java.io.File
import aims.core.Restlet
import aims.model.Event
import aims.routing.PatternMatcher
import aims.routing.PatternMatcher._
import akka.http.model.HttpMethod
import akka.http.model.HttpMethods._
/**
* Component:
* Description:
* Date: 15/3/10
* @author Andy Ai
*/
trait Attachm... | aiyanbo/aims | aims-core/src/main/scala/aims/http/AttachmentsDownloadRestlet.scala | Scala | mit | 642 |
package org.ai4fm.proofprocess.ui.actions
import org.eclipse.core.commands.IStateListener
import org.eclipse.core.commands.State
/** A command [[org.eclipse.core.commands.State]] that initialises value from preferences
* and updates the preferences when the command state changes. Used for ''toggle'' commands
* an... | andriusvelykis/proofprocess | org.ai4fm.proofprocess.ui/src/org/ai4fm/proofprocess/ui/actions/CustomToggleState.scala | Scala | epl-1.0 | 924 |
package sbt.mavenint
import java.util.Properties
import java.util.regex.Pattern
import org.apache.ivy.core.module.descriptor.DependencyDescriptor
import org.apache.ivy.core.module.id.ModuleRevisionId
import org.apache.ivy.util.extendable.ExtendableItem
/**
* This class contains all the logic for dealing with the ex... | corespring/sbt | ivy/src/main/scala/sbt/mavenint/PomExtraDependencyAttributes.scala | Scala | bsd-3-clause | 4,633 |
/*
* Copyright (c) 2014 Contributor. All rights reserved.
*/
package org.scalaide.ui.internal.repl
import org.scalaide.ui.ScalaImages
import org.scalaide.core.IScalaPlugin
import org.scalaide.core.IScalaProject
import org.scalaide.ui.syntax.ScalariformToSyntaxClass
import scala.tools.nsc.Settings
import org.eclipse.... | Kwestor/scala-ide | org.scala-ide.sdt.core/src/org/scalaide/ui/internal/repl/ReplConsoleView.scala | Scala | bsd-3-clause | 13,839 |
/*
* Copyright (C) 2017 LREN CHUV for Human Brain Project
*
* 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... | HBPSP8Repo/workflow | src/it/scala/ch/chuv/lren/woken/dao/FeaturesRepositoryDAOSpec.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 ... | pgandhi999/spark | external/kafka-0-10-sql/src/test/scala/org/apache/spark/sql/kafka010/KafkaTestUtils.scala | Scala | apache-2.0 | 23,337 |
package org.jetbrains.plugins.scala.testingSupport.scalatest.scala2_11.scalatest3_0_1
import org.jetbrains.plugins.scala.testingSupport.scalatest.finders.FindersApiTest
/**
* @author Roman.Shein
* @since 10.03.2017
*/
class Scalatest2_11_3_0_1_FindersApiTest extends Scalatest2_11_3_0_1_Base with FindersApiTest {
... | ilinum/intellij-scala | test/org/jetbrains/plugins/scala/testingSupport/scalatest/scala2_11/scalatest3_0_1/Scalatest2_11_3_0_1_FindersApiTest.scala | Scala | apache-2.0 | 322 |
/*
* 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 ... | GJL/flink | flink-table/flink-table-planner/src/test/scala/org/apache/flink/table/api/stream/table/OverWindowTest.scala | Scala | apache-2.0 | 17,774 |
/**
* 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... | dchenbecker/kafka-sbt | core/src/main/scala/kafka/javaapi/TopicMetadataRequest.scala | Scala | apache-2.0 | 1,631 |
/*
* Copyright 2010 LinkedIn
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in... | tcrayford/hafka | kafka/core/src/test/scala/unit/kafka/javaapi/producer/SyncProducerTest.scala | Scala | bsd-3-clause | 6,323 |
package akka.ainterface.remote.epmd
package publisher
import akka.actor.{ActorRef, FSM, LoggingFSM, Props}
import akka.ainterface.local.LocalNode
import akka.ainterface.remote.epmd.publisher.EpmdPublisher._
import akka.ainterface.remote.epmd.publisher.EpmdPublisherProtocol.Publish
import akka.ainterface.remote.transpo... | ainterface/ainterface | ainterface/src/main/scala/akka/ainterface/remote/epmd/publisher/EpmdPublisher.scala | Scala | apache-2.0 | 3,614 |
/*******************************************************************************
Copyright (c) 2013-2014, S-Core, KAIST.
All rights reserved.
Use is subject to license terms.
This distribution may include materials developed by third parties.
*********************************************************... | darkrsw/safe | src/main/scala/kr/ac/kaist/jsaf/analysis/typing/models/DOMCore/DOMDocument.scala | Scala | bsd-3-clause | 67,138 |
package io.finch.iteratee
import cats.effect.IO
import com.twitter.io.Buf
import io.finch._
import io.iteratee.Enumerator
import org.scalatestplus.scalacheck.ScalaCheckDrivenPropertyChecks
class IterateeStreamingSpec extends FinchSpec with ScalaCheckDrivenPropertyChecks {
checkAll("Iteratee.streamBody", StreamingL... | ImLiar/finch | iteratee/src/test/scala/io/finch/iteratee/IterateeStreamingSpec.scala | Scala | apache-2.0 | 457 |
/*
* 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/TensorflowLoaderSpec.scala | Scala | apache-2.0 | 26,873 |
package gv
package isi.scalaz
import concurrent.{ Future, ExecutionContext }
import scalaz.{ Monad }
trait FutureInstances {
final class Instances(implicit ec: ExecutionContext) extends Monad[Future] {
override def point[A](a: ⇒ A): Future[A] = Future successful a
override def bind[A, B](fa: Future[A])(... | mouchtaris/jleon | src/main/scala-2.12/gv/isi/scalaz/FutureInstances.scala | Scala | mit | 471 |
import scala.annotation.StaticAnnotation
class identity extends StaticAnnotation {
inline def apply(defn: Any): Any = meta {
defn
}
}
| scalameta/paradise | tests/meta/src/main/scala/identity.scala | Scala | bsd-3-clause | 143 |
package io.arabesque.computation
import io.arabesque.aggregation.{AggregationStorage, AggregationStorageMetadata}
import io.arabesque.cache.LZ4ObjectCache
import io.arabesque.conf.SparkConfiguration
import io.arabesque.embedding._
import io.arabesque.utils.SerializableConfiguration
import org.apache.hadoop.fs.{FileSys... | dccspeed/Arabesque | src/main/scala/io/arabesque/computation/SparkEmbeddingMasterEngine.scala | Scala | apache-2.0 | 9,662 |
package pl.bka.shapegenweb
import akka.actor.{ActorSystem, Props}
import akka.io.IO
import spray.can.Http
import akka.pattern.ask
import akka.util.Timeout
import scala.concurrent.duration._
object Boot extends App {
// we need an ActorSystem to host our application in
implicit val system = ActorSystem("on-spray-... | bartekkalinka/shapegenweb | scala/src/main/scala/pl/bka/shapegenweb/Boot.scala | Scala | unlicense | 639 |
package unfiltered.request
object Path {
def unapply[T](req: HttpRequest[T]) = Some(req.uri.split('?')(0))
def apply[T](req: HttpRequest[T]) = req.uri.split('?')(0)
}
object QueryString {
def unapply[T](req: HttpRequest[T]) = req.uri.split('?') match {
case Array(path) => None
case Array(path, query) =>... | beni55/unfiltered | library/src/main/scala/request/paths.scala | Scala | mit | 526 |
/*
* Copyright 2014 IBM Corp.
*
* 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... | codeaudit/spark-kernel | protocol/src/test/scala/com/ibm/spark/kernel/protocol/v5/content/InspectReplyOkSpec.scala | Scala | apache-2.0 | 2,292 |
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2015-2021 Andre White.
*
* 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
*
* https://www.apache.org/licenses/LICENSE... | adarro/ddo-calc | subprojects/common/ddo-core/src/main/scala/io/truthencode/ddo/model/feats/MasterOfArtifice.scala | Scala | apache-2.0 | 1,009 |
class Foo(x: Foo)
case object Bar extends Foo(null)
case object Voop extends Foo(Voop)
| yusuke2255/dotty | tests/untried/neg/t473.scala | Scala | bsd-3-clause | 87 |
package fi.kapsi.kosmik.sfti
object Chapter14 {
/**
* Using pattern matching, write a function swap that receives a pair of integers
* and returns the pair with the components swapped.
*/
object Ex02 {
def swap(pair: (Int, Int)): (Int, Int) =
pair match {
case (a, b) => (b, a)
... | suniala/sfti-exercises | src/main/scala/fi/kapsi/kosmik/sfti/Chapter14.scala | Scala | apache-2.0 | 5,842 |
//
// Copyright 2013, Martin Pokorny <martin@truffulatree.org>
//
// This Source Code Form is subject to the terms of the Mozilla Public License,
// v. 2.0. If a copy of the MPL was not distributed with this file, You can
// obtain one at http://mozilla.org/MPL/2.0/.
//
package org.truffulatree.scampi3
trait Enumerati... | mpokorny/scampi | src/main/scala/org/truffulatree/scampi3/Enumerations.scala | Scala | mpl-2.0 | 4,553 |
/*
* Copyright 2015 Rik van der Kleij
*
* 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... | ericssmith/intellij-haskell | src/com/powertuple/intellij/haskell/psi/HaskellNamedElement.scala | Scala | apache-2.0 | 921 |
package com.github.grimcoder.producemarketrestscalatra.model
//import com.github.nscala_time.time.Imports._
import java.util.Date
import com.novus.salat.annotations._
/**
* Created by taraskovtun on 9/6/15.
*/
case class Price (@Key("_id") Id: Option[String], Price: Double, ItemName: String)
case class Sale (@Key... | grimcoder/ProduceMarketRESTScalatra | src/main/scala/com/github/grimcoder/producemarketrestscalatra/model/Price.scala | Scala | mit | 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 ... | apache/kylin | kylin-spark-project/kylin-spark-engine/src/test/scala/org/apache/kylin/cluster/parser/TestCapacitySchedulerParser.scala | Scala | apache-2.0 | 1,845 |
package com.vorlov.util
import java.io.{Reader, StringReader}
import org.apache.lucene.analysis.Analyzer.TokenStreamComponents
import org.apache.lucene.analysis.TokenStream
import org.apache.lucene.analysis.core.{StopAnalyzer, StopFilter}
import org.apache.lucene.analysis.miscellaneous.LengthFilter
import org.apache.... | VolodymyrOrlov/tweets-opinion-mining | src/main/scala/com/vorlov/util/Tokenizer.scala | Scala | apache-2.0 | 1,572 |
/**
* Copyright (c) 2014 Rafael Brandão <rafa.bra@gmail.com>
*
* This is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 3 of the License, or (at
* your option) any later version.
*
... | rafael-brandao/ecurrencies | gateway/pagseguro/provider/src/main/scala/ecurrencies/pagseguro/provider/protocol/xml/ScalaXMLReaderProtocol.scala | Scala | lgpl-3.0 | 9,026 |
package org.jetbrains.plugins.scala.lang.parameterInfo.typeParameterInfo
class TypeParameterInfoSimpleTestsTest extends TypeParameterInfoTestBase {
override def getTestDataPath: String =
s"${super.getTestDataPath}SimpleTests/"
def testApplyMethodA() = doTest()
// TODO
// def testApplyMethodB = doTest
... | ilinum/intellij-scala | test/org/jetbrains/plugins/scala/lang/parameterInfo/typeParameterInfo/TypeParameterInfoSimpleTestsTest.scala | Scala | apache-2.0 | 714 |
package com.tuplejump.cobalt.calliope
import org.apache.hadoop.mapreduce.Job
import org.apache.cassandra.hadoop.{ConfigHelper, ColumnFamilyInputFormat}
import org.apache.cassandra.thrift.{IndexExpression, SliceRange, SlicePredicate}
import scala.collection.JavaConversions._
/**
* Created with IntelliJ IDEA.
* User:... | tuplejump/calliope-old | src/main/scala/com/tuplejump/calliope/ConfBuilder.scala | Scala | apache-2.0 | 2,024 |
import scala.reflect.runtime.universe._
import scala.tools.reflect.Eval
object Test extends dotty.runtime.LegacyApp {
{
val x = 42
def foo() = reify(reify(reify(x)));
{
val x = 2
val code1 = foo()
val code2 = code1.eval
val code3 = code2.eval
println(code3.eval)
}
}
}
| yusuke2255/dotty | tests/disabled/macro/run/reify_newimpl_37.scala | Scala | bsd-3-clause | 320 |
package io.getquill.codegen.util
import java.io.Closeable
import io.getquill.codegen.integration.CodegenTestCases
import io.getquill.context.jdbc.JdbcContext
import javax.sql.DataSource
trait WithContext[Prefix <: ConfigPrefix, CTest <: CodegenTestCases] extends SchemaMaker {
type QuillContext <: JdbcContext[_, _]
... | getquill/quill | quill-codegen-tests/src/test/scala/io/getquill/codegen/util/WithContext.scala | Scala | apache-2.0 | 1,278 |
// Generated by the Scala Plugin for the Protocol Buffer Compiler.
// Do not edit!
//
// Protofile syntax: PROTO2
package com.google.protobuf.descriptor
import _root_.scalapb.internal.compat.JavaConverters._
/** Encapsulates information about the original source file from which a
* FileDescriptorProto was generated... | scalapb/ScalaPB | scalapb-runtime/src/main/scalajvm/com/google/protobuf/descriptor/SourceCodeInfo.scala | Scala | apache-2.0 | 30,891 |
package colossus.controller
import colossus.core.{DataOutBuffer, DisconnectCause, DisconnectError, MoreDataResult}
import colossus.streaming.{BufferedPipe, PipeCircuitBreaker, PipeStateException, PullResult}
abstract class StaticOutState(val canPush: Boolean) {
def disconnecting = !canPush
}
object StaticOutState {... | tumblr/colossus | colossus/src/main/scala/colossus/controller/OutputController.scala | Scala | apache-2.0 | 3,392 |
package controllers
object Components extends AssetsBuilder | adrobisch/silent-disco-scala | app/controllers/Components.scala | Scala | mit | 60 |
package com.gravity.goose.images
import org.apache.http.client.HttpClient
import com.gravity.goose.{Configuration, Article}
import org.jsoup.nodes.{Element, Document}
import java.util.regex.{Pattern, Matcher}
import com.gravity.goose.text.string
import java.net.{MalformedURLException, URL}
import org.jsoup.select.Elem... | njosephef/extractor | src/main/scala/com/gravity/goose/images/UpgradedImageIExtractor.scala | Scala | apache-2.0 | 17,163 |
package safe.strings
import org.scalatest.WordSpec
import shapeless.test.illTyped
class SafeSpec extends WordSpec {
"ss\\"$value\\"" should {
"not compile when passed an unsafe type" in {
val value = new UnsafeType
illTyped { """ ss"$value" """}
}
"print a single item using the implicit S... | jeffmay/secure-string-context | src/test/scala/safe/strings/SafeSpec.scala | Scala | apache-2.0 | 1,487 |
package org.openmole.plugin.method.evolution
import org.openmole.core.exception.UserBadDataError
import cats._
import cats.implicits._
import mgo.evolution._
import mgo.evolution.algorithm._
import mgo.evolution.breeding._
import mgo.evolution.elitism._
import mgo.evolution.niche._
import monocle.macros.GenLens
import... | openmole/openmole | openmole/plugins/org.openmole.plugin.method.evolution/src/main/scala/org/openmole/plugin/method/evolution/NichedNSGA2.scala | Scala | agpl-3.0 | 25,051 |
/*
* Copyright (C) 2016-2019 Lightbend Inc. <https://www.lightbend.com>
*/
package com.example.shoppingcart.api
import java.time.Instant
import akka.{Done, NotUsed}
import com.lightbend.lagom.scaladsl.api.transport.Method
import com.lightbend.lagom.scaladsl.api.{Service, ServiceCall}
import play.api.libs.json.{For... | ignasi35/lagom | dev/sbt-plugin/src/sbt-test/sbt-plugin/akka-persistence-typed-migration-scala/shopping-cart-api/src/main/scala/com/example/shoppingcart/api/ShoppingCartService.scala | Scala | apache-2.0 | 1,245 |
/*
* 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 | external/kafka/src/test/scala/org/apache/spark/streaming/kafka/KafkaStreamSuite.scala | Scala | apache-2.0 | 2,881 |
package sclasner
import java.io.File
import java.net.{URL, URLClassLoader, URLDecoder}
import java.util.StringTokenizer
import scala.collection.mutable.{HashSet => MHashSet}
// See the source code of https://github.com/ngocdaothanh/annovention
object Discoverer {
// Use lazy to avoid Null Pointer Exception
/** ... | xitrum-framework/sclasner | src/main/scala/sclasner/Discoverer.scala | Scala | mit | 1,852 |
package org.jetbrains.plugins.scala
package lang
package psi
package impl
package statements
package params
import com.intellij.lang.ASTNode
import org.jetbrains.plugins.scala.lang.psi.api.base.types._
import org.jetbrains.plugins.scala.lang.psi.api.statements.params._
/**
* @author Alexander Podkhalyuzin
* Date: 2... | JetBrains/intellij-scala | scala/scala-impl/src/org/jetbrains/plugins/scala/lang/psi/impl/statements/params/ScParameterTypeImpl.scala | Scala | apache-2.0 | 571 |
/*
* Copyright (c) 2011-2015 EPFL DATA Laboratory
* Copyright (c) 2014-2015 The Squall Collaboration (see NOTICE)
*
* All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the... | epfldata/squall | squall-functional/src/main/scala/ch/epfl/data/squall/api/scala/SquallType.scala | Scala | apache-2.0 | 3,203 |
package controllers
import javax.inject._
import play.api._
import play.api.mvc._
import play.api.data.Form
import play.api.data.Forms._
import play.api.data._
import models.Contact
import play.api.i18n.Messages
import play.api.i18n.I18nSupport
import play.api.i18n.MessagesApi
import services.ContactService
import ser... | diegopacheco/scala-playground | play-2.5-scala-app-sandbox/app/controllers/ContactController.scala | Scala | unlicense | 2,384 |
package tut
trait Zed {
trait Monad[M[_]] {
def point[A](a: A): M[A]
def map[A, B](ma: M[A])(f: A => B): M[B]
def flatMap[A, B](ma: M[A])(f: A => M[B]): M[B]
}
implicit class MonadOps[M[_], A](ma: M[A])(implicit M: Monad[M]) {
def map[B](f: A => B): M[B] = M.map(ma)(f)
def flatMap[B](f: A =... | non/tut | core/src/main/scala/tut/Zed.scala | Scala | mit | 3,909 |
package wdltool.graph
import cats.data.Validated.{Invalid, Valid}
import wdl4s.wdl.types.WdlIntegerType
import wdl4s.wom.expression.PlaceholderWomExpression
import wdl4s.wom.graph.{ExpressionBasedGraphOutputNode, Graph, PortBasedGraphOutputNode, RequiredGraphInputNode}
class ExpressionBasedGraphOutputNodeSpec extends... | broadinstitute/wdltool | src/test/scala/wdltool/graph/ExpressionBasedGraphOutputNodeSpec.scala | Scala | bsd-3-clause | 2,622 |
package com.nekogata.backlogger.domain.setting
trait SettingRepository {
def store(s: Setting): Unit
def get(): Setting
}
| Shinpeim/BackLogger | scala/src/main/scala/com/nekogata/backlogger/domain/setting/SettingRepository.scala | Scala | mit | 127 |
package pl.touk.nussknacker.defaultmodel.migrations
import pl.touk.nussknacker.engine.api.MetaData
import pl.touk.nussknacker.engine.graph.node.{CustomNode, NodeData}
import pl.touk.nussknacker.engine.migration.NodeMigration
case class ProcessSplitterMigration(migratedNodeType: String = "split") extends NodeMigratio... | TouK/nussknacker | defaultModel/src/main/scala/pl/touk/nussknacker/defaultmodel/migrations/ProcessSplitterMigration.scala | Scala | apache-2.0 | 955 |
package org.jetbrains.plugins.scala
package lang
package psi
package types
import com.intellij.openapi.progress.ProgressManager
import com.intellij.openapi.util.Computable
import com.intellij.psi._
import org.jetbrains.plugins.scala.extensions._
import org.jetbrains.plugins.scala.lang.psi.ScalaPsiUtil._
import org.jet... | triplequote/intellij-scala | scala/scala-impl/src/org/jetbrains/plugins/scala/lang/psi/types/ScalaConformance.scala | Scala | apache-2.0 | 66,779 |
package lila.db
import scala.util.Success
import org.joda.time.DateTime
import reactivemongo.bson._
abstract class BSON[T]
extends BSONHandler[BSONDocument, T]
with BSONDocumentReader[T]
with BSONDocumentWriter[T] {
import BSON._
def reads(reader: Reader): T
def writes(writer: Writer, obj: T): BS... | Happy0/lila | modules/db/src/main/BSON.scala | Scala | mit | 6,708 |
package filodb.memory.format.vectors
import debox.Buffer
import filodb.memory.format._
//noinspection ScalaStyle
class UTF8VectorTest extends NativeVectorTest {
import filodb.memory.format.Encodings._
describe("UTF8AppendableVector") {
it("should be able to append all NAs") {
val utf8vect = UTF8Vector... | velvia/FiloDB | memory/src/test/scala/filodb.memory/format/vectors/UTF8VectorTest.scala | Scala | apache-2.0 | 7,324 |
/*
import stainless.annotation._
import stainless.collection._
import stainless.lang._
import stainless.lang.Option._
import stainless.lang.StaticChecks._
import stainless.proof.check
object TreeImmutSumExample {
case class Cell[T](var value: T) extends AnyHeapRef
def treeOptToSet(t: Option[Tree]): Set[AnyHeapRef... | epfl-lara/stainless | frontends/benchmarks/full-imperative/valid/TreeImmutSum.scala | Scala | apache-2.0 | 4,718 |
package cpup.lib.module
import com.typesafe.config.ConfigFactory
object RootModule extends TRootModule with TModule[TRootModule] {
ModuleLoader.modulesByInst(this) = this
override final val inst = this
override lazy val spec = new ModuleSpec[TRootModule](ModuleLoader.moduleType[TRootModule](classOf[TRootModule]), ... | CoderPuppy/cpup-lib | src/main/scala/cpup/lib/module/RootModule.scala | Scala | mit | 493 |
package one.lockstep.multilock.protocol
import one.lockstep.util.protocol.Protocol
import scodec.Codec
case class HandshakeRequest(servers: Seq[Server])
object HandshakeRequest {
implicit lazy val codec: Codec[HandshakeRequest] = ???
implicit lazy val protocol: Protocol[HandshakeRequest] = ???
} | lockstep-one/vault | vault-common/src/main/scala/one/lockstep/multilock/protocol/HandshakeRequest.scala | Scala | agpl-3.0 | 304 |
package recfun
import common._
import scala.annotation.tailrec
object Main {
def main(args: Array[String]) {
println("Pascal's Triangle")
for (row <- 0 to 10) {
for (col <- 0 to row)
print(pascal(col, row) + " ")
println()
}
}
/**
* Exercise 1
*/
def pascal(c: Int, r: In... | edvorg/scala-progfun | recfun/src/main/scala/recfun/Main.scala | Scala | gpl-3.0 | 1,067 |
/*
* Wire
* Copyright (C) 2016 Wire Swiss GmbH
*
* 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 License, or
* (at your option) any later version.
*
* This progr... | wireapp/wire-android-sync-engine | zmessaging/src/main/scala/com/waz/service/assets/MetaDataService.scala | Scala | gpl-3.0 | 5,740 |
package jp.t2v.lab.play2.auth.social.core
import scala.concurrent.{ ExecutionContext, Future }
trait OAuthProviderUserSupport {
self: OAuthController =>
type ProviderUser
def retrieveProviderUser(accessToken: AccessToken)(implicit ctx: ExecutionContext): Future[ProviderUser]
}
| kuenzaa/play2-auth | social/src/main/scala/jp/t2v/lab/play2/auth/social/core/OAuthProviderUserSupport.scala | Scala | apache-2.0 | 291 |
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.