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 scalaz.stream
import scalaz.\\/
import scalaz.stream.Process.Halt
import Cause._
/**
* Defines termination cause for the process.
* Cause is always wrapped in `Halt` and controls process flow.
*/
sealed trait Cause {
/**
* Produces a cause that was caused by `cause`
* @param cause
* @return
*... | fthomas/scalaz-stream | src/main/scala/scalaz/stream/Cause.scala | Scala | mit | 3,417 |
/**
* Copyright 2015 Thomson Reuters
*
* Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or ag... | hochgi/CM-Well | server/cmwell-it/src/it/scala/cmwell/it/RDFTests.scala | Scala | apache-2.0 | 8,304 |
package sms.news.sentiment.analysis
import sms.news.model.SentimentScore
import sms.news.sentiment.SentimentDictionary
import sms.news.sentiment.analysis.test.Classifier
object SentimentAnalysis {
object default {
implicit object DefaultAnalyzer
extends SentimentAnalysis with HTMLArticleTextExtractor with... | kjanosz/stock-market-sherlock | news-parser/src/main/scala/sms/news/sentiment/analysis/SentimentAnalysis.scala | Scala | apache-2.0 | 953 |
package com.sksamuel.elastic4s.snapshots
import com.sksamuel.elastic4s.{Index, Indexes}
import com.sksamuel.exts.OptionImplicits._
case class RestoreSnapshotRequest(snapshotName: String,
repositoryName: String,
indices: Indexes = Indexes.Empty,
... | Tecsisa/elastic4s | elastic4s-core/src/main/scala/com/sksamuel/elastic4s/snapshots/RestoreSnapshotRequest.scala | Scala | apache-2.0 | 1,808 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | jkbradley/spark | sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/DataSourceV2Utils.scala | Scala | apache-2.0 | 2,421 |
package es.upm.oeg.epnoi.matching.metrics.domain.space
import es.upm.oeg.epnoi.matching.metrics.domain.entity.{ConceptualResource, Vocabulary}
import es.upm.oeg.epnoi.matching.metrics.feature.WordCounter
import es.upm.oeg.epnoi.matching.metrics.similarity.{ContentSimilarity, EuclideanSimilarity}
import org.apache.spar... | cbadenes/epnoi-matching-metrics | src/main/scala/es/upm/oeg/epnoi/matching/metrics/domain/space/ConceptsSpace.scala | Scala | apache-2.0 | 1,542 |
package views.html
import play.templates._
import play.templates.TemplateMagic._
import play.api.templates._
import play.api.templates.PlayMagic._
import models._
import controllers._
import java.lang._
import java.util._
import scala.collection.JavaConversions._
import scala.collection.JavaConverters._
import play.... | jiyus/ApacheCMDA_Frontend | target/scala-2.10/src_managed/main/views/html/flash_message.template.scala | Scala | apache-2.0 | 4,985 |
/*
* Copyright 2007-2011 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 applica... | lzpfmh/framework-2 | persistence/mapper/src/test/scala/net/liftweb/mapper/MapperSpec.scala | Scala | apache-2.0 | 13,984 |
/*
* 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 ... | bravo-zhang/spark | sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/continuous/WriteToContinuousDataSourceExec.scala | Scala | apache-2.0 | 3,373 |
/*
* Copyright (c) 2014-2020 by The Monix Project Developers.
* See the project homepage at: https://monix.io
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache... | alexandru/monifu | monix-execution/shared/src/main/scala/monix/execution/rstreams/package.scala | Scala | apache-2.0 | 1,242 |
package lila.api
import lila.common.Bus
final private[api] class Cli(
userRepo: lila.user.UserRepo,
security: lila.security.Env,
teamSearch: lila.teamSearch.Env,
forumSearch: lila.forumSearch.Env,
tournament: lila.tournament.Env,
explorer: lila.explorer.Env,
fishnet: lila.fishnet.Env,
... | luanlv/lila | modules/api/src/main/Cli.scala | Scala | mit | 2,846 |
package com.idyria.osi.ooxoo.db.store.mem
import com.idyria.osi.ooxoo.db.store.DocumentContainer
import com.idyria.osi.ooxoo.db.Document
import com.idyria.osi.ooxoo.core.buffers.structural.ElementBuffer
import scala.reflect.ClassTag
class MemContainer(var id : String) extends DocumentContainer {
var documentsMa... | richnou/ooxoo-db | src/main/scala/com/idyria/osi/ooxoo/db/store/mem/MemContainer.scala | Scala | lgpl-3.0 | 1,361 |
package mesosphere.marathon
import akka.actor.ActorSystem
import akka.event.EventStream
import akka.testkit.{ TestKit, TestProbe }
import com.codahale.metrics.MetricRegistry
import com.fasterxml.jackson.databind.ObjectMapper
import com.google.common.collect.Lists
import mesosphere.marathon.Protos.MarathonTask
import m... | EvanKrall/marathon | src/test/scala/mesosphere/marathon/MarathonSchedulerTest.scala | Scala | apache-2.0 | 3,968 |
object Test {
class A
implicit class Z(a: A) {
val ex = this
def unapply(x: A): Option[Int] = Some(1)
}
val a = new A
a match {
case a.ex(x) => /*start*/x/*end*/
}
}
//Int | ilinum/intellij-scala | testdata/typeInference/bugs5/ImplicitlyAddedExtractor.scala | Scala | apache-2.0 | 198 |
package com.sksamuel.elastic4s.search.queries
import com.sksamuel.elastic4s.testkit.ElasticSugar
import org.elasticsearch.action.support.WriteRequest.RefreshPolicy
import org.scalatest.{Matchers, WordSpec}
class RangeQueryTcpTest extends WordSpec with ElasticSugar with Matchers {
client.execute {
createIndex("... | aroundus-inc/elastic4s | elastic4s-tests/src/test/scala/com/sksamuel/elastic4s/search/queries/RangeQueryTcpTest.scala | Scala | apache-2.0 | 2,860 |
/* Copyright 2017-18, Emmanouil Antonios Platanios. 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 License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless ... | eaplatanios/tensorflow | tensorflow/scala/data/src/main/scala/org/platanios/tensorflow/data/Loader.scala | Scala | apache-2.0 | 2,247 |
/*
* 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/main/scala/org/apache/spark/deploy/ApplicationDescription.scala | Scala | apache-2.0 | 1,870 |
package slash_actions
import models._
trait SlashAction {
val admin = "conor"
def execute(
votingSession:Option[VotingSession],
username:String,
data:String):Option[String]
def noActiveSessionWarning:Option[String] = {
Some("No voting session is active right now.")
}
} | conor-pappas/chasm_bot | app/value_objects/slash_actions/SlashAction.scala | Scala | mit | 298 |
package com.datastax.spark.connector.rdd.reader
import com.datastax.driver.core.{ProtocolVersion, Row}
import com.datastax.spark.connector.AbstractGettableData
import com.datastax.spark.connector.types.TypeConverter
import scala.reflect.ClassTag
// The below fragment may look very repetitive and copy-pasted,
// howe... | brkyvz/spark-cassandra-connector | spark-cassandra-connector/src/main/scala/com/datastax/spark/connector/rdd/reader/FunctionBasedRowReader.scala | Scala | apache-2.0 | 11,385 |
class Bippo {
def length: Int = 123
class Tree
}
package object p1 {
class A
implicit class B(val s: String) { def bippy = s }
val c: Bippo = new Bippo
type D = String
}
package object p2 {
class A
implicit class B(val s: String) { def bippy = s }
val c: Bippo = new Bippo
type D = Int
}
trait NoWa... | dotty-staging/dotty | tests/untried/neg/warn-unused-imports.scala | Scala | apache-2.0 | 1,841 |
package is.hail.lir
import java.io.PrintWriter
import is.hail.HailContext
import scala.collection.mutable
import is.hail.asm4s._
import is.hail.utils._
import org.objectweb.asm.Opcodes._
// FIXME move typeinfo stuff lir
class Classx[C](val name: String, val superName: String, var sourceFile: Option[String]) {
va... | danking/hail | hail/src/main/scala/is/hail/lir/X.scala | Scala | mit | 20,625 |
package es.codemotion.akkaships.server
object ServerApp extends App {
val akkaShipsServer = new Server
akkaShipsServer.init(null)
akkaShipsServer.start()
while (true){
}
akkaShipsServer.stop()
akkaShipsServer.destroy()
}
| jjlopezm/Akkaships-Exercise | Server/src/main/scala/es/codemotion/akkaships/server/ServerApp.scala | Scala | apache-2.0 | 240 |
package chapter.seventeen
object ExerciseEight extends App {
}
| deekim/impatient-scala | src/main/scala/chapter/seventeen/ExerciseEight.scala | Scala | apache-2.0 | 66 |
/*
* Copyright University of Basel, Graphics and Vision Research Group
*
* 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 ... | unibas-gravis/scalismo-faces | src/main/scala/scalismo/faces/sampling/face/evaluators/LandmarkMapEvaluator.scala | Scala | apache-2.0 | 5,000 |
/*
* Copyright 2019 Spotify AB.
*
* 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 ... | spotify/scio | scio-core/src/main/scala/com/spotify/scio/util/CallSites.scala | Scala | apache-2.0 | 3,689 |
import scala.reflect.runtime.universe._
import scala.reflect.runtime.{currentMirror => cm}
import scala.tools.reflect._
object Test extends App {
val tb = cm.mkToolBox()
tb.parse("def x = {}")
try { tb.parse("def x = {") } catch { case _: Throwable => }
tb.parse("def x = {}")
}
| som-snytt/dotty | tests/disabled/reflect/run/t5942.scala | Scala | apache-2.0 | 288 |
// Copyright 2014 Jun Tsai. All rights reserved.
// site: http://www.ganshane.com
package shakey.services
import org.slf4j.LoggerFactory
/**
* logger support
*/
trait LoggerSupport {
protected val logger = LoggerFactory getLogger getClass
}
| zzwwws/shakey | shakey-client/src/main/scala/shakey/services/LoggerSupport.scala | Scala | apache-2.0 | 247 |
import org.objectweb.asm._, Opcodes._
import Database.FilterExpr
object CompiledQueryGen extends Opcodes {
val generatedClassName = "CompiledQuery"
def generate: Array[Byte] = {
val cw = new ClassWriter(ClassWriter.COMPUTE_FRAMES)
var mv: MethodVisitor = null
cw.visit(V1_8,
ACC_PUBLIC + ACC_S... | devth/devth.github.com | _code/compiled-query/src/main/scala/CompiledQueryGen.scala | Scala | mit | 8,475 |
package org.ensime.test
import org.scalatest.Spec
import org.scalatest.matchers.ShouldMatchers
import org.ensime.test.util.Helpers._
class SymbolCompletionSpec extends Spec with ShouldMatchers{
describe("Symbol Completion") {
it("should complete local variable name") {
withPresCompiler{ cc =>
val src =... | bbatsov/ensime | src/test/scala/org/ensime/test/SymbolCompletionSpec.scala | Scala | gpl-3.0 | 4,902 |
package com.twitter.finatra.thrift.internal
import com.twitter.finagle.{Filter, Service}
import com.twitter.finatra.thrift.ThriftFilter
import com.twitter.scrooge.ThriftMethod
import com.twitter.util.Future
class ThriftMethodService[Args, Result](
val method: ThriftMethod,
val svc: Service[Args, Result])
extend... | syamantm/finatra | thrift/src/main/scala/com/twitter/finatra/thrift/internal/ThriftMethodService.scala | Scala | apache-2.0 | 767 |
package com.twitter.hashing
import com.twitter.io.TempFile
import java.util.Base64
import org.junit.runner.RunWith
import org.scalatest.WordSpec
import org.scalatest.junit.JUnitRunner
import scala.collection.mutable.ListBuffer
import java.nio.charset.StandardCharsets.UTF_8
@RunWith(classOf[JUnitRunner])
class KeyHash... | BuoyantIO/twitter-util | util-hashing/src/test/scala/com/twitter/hashing/KeyHasherTest.scala | Scala | apache-2.0 | 1,558 |
package io.github.binaryfoo.lagotto
import java.io.PrintStream
import java.text.DecimalFormat
import org.joda.time.format.PeriodFormatterBuilder
import org.joda.time.{DateTimeUtils, Period}
trait ProgressMeter {
def startRun(fileCount: Int)
def startFile(name: String)
def progressInFile(records: Int, bytes: L... | binaryfoo/lagotto | src/main/scala/io/github/binaryfoo/lagotto/ProgressMeter.scala | Scala | mit | 4,769 |
/***********************************************************************
* Copyright (c) 2013-2020 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... | aheyne/geomesa | geomesa-fs/geomesa-fs-storage/geomesa-fs-storage-orc/src/test/scala/org/locationtech/geomesa/fs/storage/orc/OrcFileSystemWriterTest.scala | Scala | apache-2.0 | 2,779 |
package com.adlawson.json4s
import org.json4s.FieldSerializer
object TypeFieldSerializer extends FieldSerializer[AnyRef](
FieldSerializer.renameTo("typ", "type"),
FieldSerializer.renameFrom("type", "typ")
)
| adlawson/scala-json4s | src/main/scala/TypeFieldSerializer.scala | Scala | mit | 213 |
package org.jetbrains.plugins.scala
package annotator
import com.intellij.codeInsight.daemon.impl.AnnotationHolderImpl
import com.intellij.codeInsight.intention.IntentionAction
import com.intellij.codeInspection._
import com.intellij.lang.annotation._
import com.intellij.openapi.project.DumbAware
import com.intellij.o... | advancedxy/intellij-scala | src/org/jetbrains/plugins/scala/annotator/ScalaAnnotator.scala | Scala | apache-2.0 | 60,546 |
/***********************************************************************
* Copyright (c) 2013-2019 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... | elahrvivaz/geomesa | geomesa-lambda/geomesa-lambda-tools/src/main/scala/org/locationtech/geomesa/lambda/tools/stats/LambdaStatsBoundsCommand.scala | Scala | apache-2.0 | 1,426 |
package gsd.linux.tools
import com.typesafe.scalalogging.LazyLogging
import java.io.PrintStream
import gsd.linux.cnf.DimacsReader.{DimacsHeader, DimacsProblem}
import org.clapper.argot._
import gsd.linux.cnf.{DimacsReader, ImplBuilder, SATBuilder}
import java.util.Scanner
object ImplGraphMain extends ArgotUtil with... | matachi/linux-variability-analysis-tools.fm-translation | src/main/scala/gsd/linux/tools/ImplGraphMain.scala | Scala | gpl-3.0 | 2,997 |
package io.findify.sqsmock.model
import org.joda.time.DateTime
import scala.collection.mutable
/**
* Created by shutty on 3/30/16.
*/
class QueueCache(params:Queue) {
case class MessageLease(when:DateTime, msg:Message)
val queue = mutable.Queue[Message]()
val received = mutable.Map[String,MessageLease]()... | findify/sqsmock | src/main/scala/io/findify/sqsmock/model/QueueCache.scala | Scala | mit | 884 |
/*
* Copyright 2017 Datamountaineer.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to... | datamountaineer/stream-reactor | kafka-connect-mqtt/src/main/scala/com/datamountaineer/streamreactor/connect/mqtt/sink/MqttWriter.scala | Scala | apache-2.0 | 4,135 |
package io.taig.gandalf.syntax
import cats.data._
import io.taig.gandalf._
import io.taig.gandalf.syntax.raw._
import shapeless.HList
import scala.language.implicitConversions
trait cartesian {
implicit def validatedErrorToRawValidated[N <: String, O, A <: HList]( validated: Validated[Error[N, A], O] )(
... | Taig/BetterSafeThanSorry | core/src/main/scala/io/taig/gandalf/syntax/cartesian.scala | Scala | mit | 1,093 |
/*
* 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 ... | akmorrow13/spark-intervalrdd | src/test/scala/edu/berkeley/cs/amplab/spark/intervalrdd/IntervalPartitionSuite.scala | Scala | apache-2.0 | 6,214 |
package com.twitter.finagle.param
import com.twitter.finagle.service.TimeoutFilter
import com.twitter.finagle.{service, stats, tracing, Stack}
import com.twitter.util
/**
* A collection of methods for configuring common parameters (labels, stats receivers, etc)
* shared between Finagle clients and servers.
*
* @t... | adriancole/finagle | finagle-core/src/main/scala/com/twitter/finagle/param/CommonParams.scala | Scala | apache-2.0 | 4,572 |
package org.jetbrains.plugins.scala
package lang
package psi
package stubs
package elements
import api.expr.ScAnnotation
import impl.{ScAnnotationStubImpl, ScEarlyDefinitionsStubImpl}
import psi.impl.expr.ScAnnotationImpl
import api.toplevel.ScEarlyDefinitions
import com.intellij.psi.stubs.{IndexSink, StubInputStream... | consulo/consulo-scala | src/org/jetbrains/plugins/scala/lang/psi/stubs/elements/ScAnnotationElementType.scala | Scala | apache-2.0 | 2,286 |
package com.arcusys.valamis.persistence.impl.scorm.storage
import com.arcusys.valamis.lesson.scorm.model.tracking.{ActivityState, ObjectiveState}
import com.arcusys.valamis.lesson.scorm.storage.ActivityStorage
import com.arcusys.valamis.lesson.scorm.storage.tracking.{ActivityStateStorage, ObjectiveStateStorage}
import... | igor-borisov/valamis | valamis-slick-persistence/src/main/scala/com/arcusys/valamis/persistence/impl/scorm/storage/ActivityStateStorageImpl.scala | Scala | gpl-3.0 | 5,221 |
package org.squeryl.sharding.builder
import org.squeryl.sharding.{ShardedSessionFactory, ShardedSessionRepository}
/**
* Builder to create shard session
* User: takeshita
* Date: 11/09/07
* Time: 23:49
* To change this template use File | Settings | File Templates.
*/
trait ShardedSessionBuilder{
var name : ... | takezoux2/squeryl-experimental | src/main/scala/org/squeryl/sharding/builder/ShardedSessionBuilder.scala | Scala | apache-2.0 | 454 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | jkbradley/spark | sql/core/src/main/scala/org/apache/spark/sql/api/python/PythonSQLUtils.scala | Scala | apache-2.0 | 3,308 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | goldmedal/spark | sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/optimizer/FilterPushdownSuite.scala | Scala | apache-2.0 | 42,362 |
package blended.updater.config
import java.io.{File, FileReader}
import java.util.Properties
import scala.util.Try
class FilePropertyProvider(file : File) extends PropertyProvider {
private[this] val props : Properties = {
val props = new Properties()
Try { props.load(new FileReader(file)) }
// .... | woq-blended/blended | blended.updater.config/jvm/src/main/scala/blended/updater/config/FilePropertyProvider.scala | Scala | apache-2.0 | 546 |
package at.hazm.quebic
import java.io.{ByteArrayInputStream, ByteArrayOutputStream, InputStream, OutputStream}
import java.util.zip.{GZIPInputStream, GZIPOutputStream}
import scala.annotation.tailrec
sealed abstract class Codec(val id:Byte, val name:String) extends Type {
def encode(buffer:Array[Byte]):Array[Byte]... | torao/quebic | src/main/scala/at/hazm/quebic/Codec.scala | Scala | apache-2.0 | 1,471 |
package scala.db.openproject
import scala.concurrent._
import spray.http.{ HttpRequest, HttpResponse }
//import scala.db.openproject.OpenProject_HTTP_API._
import scala.db.openproject.JIRA_HTTP_API._
import akka.actor.{ ActorSystem, Actor, Props, ActorRef }
import akka.util.Timeout
import scala.concurrent.duration._
i... | cronacronis/scala-openproject-benchmark | src/main/scala/db/openproject/main.scala | Scala | lgpl-3.0 | 4,994 |
package mr.merc.unit
import SoldierState._
import mr.merc.unit.AttackAttribute._
// TODO remove defenders attack ?
// TODO make damage equal zero when success is false
case class AttackResult(isAttackerAttackingThisRound: Boolean, attacker: Soldier, defender: Soldier, attackersAttack: Attack, success: Boolean, damage... | RenualdMarch/merc | src/main/scala/mr/merc/unit/AttackResult.scala | Scala | gpl-3.0 | 774 |
package gremlin.scala
import org.apache.tinkerpop.gremlin.process.traversal.{P => JavaP}
import java.util.{Collection => JCollection}
import scala.collection.JavaConverters._
/** the scala version of tinkerpop's P, mostly to avoid unnecessarily complicated constructs
* like P.within(vertices.asJava: JCollection[Ver... | mpollmeier/gremlin-scala | gremlin-scala/src/main/scala/gremlin/scala/P.scala | Scala | apache-2.0 | 1,197 |
/**
* Copyright (c) 2015, Cloudera, Inc. All Rights Reserved.
*
* Cloudera, Inc. licenses this file to you 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/LIC... | cloudera/spark-timeseries | src/main/scala/com/cloudera/sparkts/models/TimeSeriesModel.scala | Scala | apache-2.0 | 1,687 |
package no.netcompany.testdatagen.aggreg
// Copyright (C) 2014 Lars Reed -- GNU GPL 2.0 -- see LICENSE.txt
import no.netcompany.testdatagen.generators.FromList
import no.netcompany.testdatagen.utils.Percentage
import org.junit.runner.RunWith
import org.scalatest.FlatSpec
import org.scalatest.junit.JUnitRunner
import... | lre-mesan/testdata | src/test/scala/no/netcompany/testdatagen/aggreg/TwoFromFunctionSpec.scala | Scala | gpl-2.0 | 1,420 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | jkbradley/spark | mllib/src/main/scala/org/apache/spark/ml/feature/VectorAssembler.scala | Scala | apache-2.0 | 12,635 |
package com.nulabinc.backlog.r2b.mapping
package object file {}
| nulab/BacklogMigration-Redmine | src/main/scala/com/nulabinc/backlog/r2b/mapping/file/package.scala | Scala | mit | 65 |
package chee.properties
import fastparse.core.Parsed
import org.scalatest._
import fastparse.core.Parsed.{ Success, Failure }
import LocalDateTime._
class LocalDateTimeParserTest extends FlatSpec with Matchers {
val now = LocalDateTime(2015,10,15,14,32,10)
val parserF = (atEnd: Boolean) => new LocalDateTimeParse... | eikek/chee | src/test/scala/chee/properties/LocalDateTimeParserTest.scala | Scala | gpl-3.0 | 3,737 |
package spray.oauth.authentication
/**
* Created with IntelliJ IDEA.
* User: hasan.ozgan
* Date: 6/12/14
* Time: 12:21 PM
* To change this template use File | Settings | File Templates.
*/
trait SessionAuthenticator {
}
| hasanozgan/spray-oauth | core/src/main/scala/spray/oauth/authentication/SessionAuthenticator.scala | Scala | apache-2.0 | 228 |
package streamz.akka.stream
import java.util.concurrent.{TimeUnit, CountDownLatch}
import scala.reflect._
import scala.util.Random
import scala.util.control.NoStackTrace
import scala.concurrent.{ExecutionContext, Future, Await}
import scala.concurrent.duration._
import org.scalatest.{BeforeAndAfterAll, Matchers, Wor... | ahjohannessen/streamz | streamz-akka-stream/src/test/scala/streamz/akka/stream/AkkaStreamSpec.scala | Scala | apache-2.0 | 8,525 |
/*
* 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 ... | pferrel/PredictionIO | examples/experimental/scala-local-movielens-filtering/src/main/scala/Filtering.scala | Scala | apache-2.0 | 1,591 |
/*
* Copyright (C) 2013 Alcatel-Lucent.
*
* See the NOTICE file distributed with this work for additional
* information regarding copyright ownership.
* Licensed to you 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 cop... | molecule-labs/molecule | molecule-core/src/main/scala/molecule/channel/IChan.scala | Scala | apache-2.0 | 10,347 |
package xitrum.validator
object Required extends Validator[String] {
def check(value: String) = !value.trim.isEmpty
def message(name: String, value: String) =
if (value.trim.isEmpty)
Some("%s must not be empty".format(name))
else
None
}
| georgeOsdDev/xitrum | src/main/scala/xitrum/validator/Required.scala | Scala | mit | 263 |
package io.callstats
import java.util.Date
import java.util.concurrent.Callable
import java.util.concurrent.ExecutorService
import java.util.concurrent.Executors
import java.util.concurrent.FutureTask
import java.util.concurrent.TimeUnit
import scala.beans.BeanProperty
import scala.collection.JavaConverters.asScalaSe... | callstats-io/hc_membership_probe | src/main/scala/io/callstats/HcProbe.scala | Scala | apache-2.0 | 6,111 |
/*
* spark-examples
* Copyright (C) 2015 Emmanuelle Raffenne
*
* 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.
*... | eraffenne/spark-streaming-examples | src/main/scala/com/example/spark/streaming/SimpleConsumer.scala | Scala | gpl-3.0 | 1,514 |
/*
* Copyright 2007-2011 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 applica... | wsaccaco/lift | framework/lift-base/lift-webkit/src/main/scala/net/liftweb/http/ResponseShortcutException.scala | Scala | apache-2.0 | 2,460 |
/**
* 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... | KevinLiLu/kafka | core/src/test/scala/unit/kafka/log/LogTest.scala | Scala | apache-2.0 | 176,276 |
/**
* 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... | KevinLiLu/kafka | core/src/main/scala/kafka/log/AbstractIndex.scala | Scala | apache-2.0 | 16,503 |
package net.fehmicansaglam.tepkin
import java.net.InetSocketAddress
import org.scalatest.{FlatSpec, Matchers}
class MongoClientUriSpec extends FlatSpec with Matchers {
"A MongoClientUri" should "parse database server running locally" in {
val expected = MongoClientUri(hosts = Set(new InetSocketAddress("localh... | cancobanoglu/tepkin | tepkin/src/test/scala/net/fehmicansaglam/tepkin/MongoClientUriSpec.scala | Scala | apache-2.0 | 2,710 |
package kornell.server.api
import javax.ws.rs.{GET, Path, Produces}
import javax.ws.rs.core.Response
import kornell.server.jdbc.SQL._
import scala.util.{Failure, Success, Try}
@Path("healthCheck")
class HealthCheckResource {
@GET
@Produces(Array("text/plain"))
def isHealthy: Response = checkDatabase match {
... | Craftware/Kornell | kornell-api/src/main/scala/kornell/server/api/HealthCheckResource.scala | Scala | apache-2.0 | 544 |
package org.http4s
package client
package middleware
import cats.effect._
import cats.implicits._
import org.http4s.Method._
import org.http4s.headers._
import org.http4s.util.CaseInsensitiveString
import _root_.io.chrisdavenport.vault._
/**
* Client middleware to follow redirect responses.
*
* A 301 or 302 res... | ChristopherDavenport/http4s | client/src/main/scala/org/http4s/client/middleware/FollowRedirect.scala | Scala | apache-2.0 | 5,700 |
package scalaandroid
import android.app.{ Activity => AActivity }
import android.view.{ Menu, MenuItem => AMenuItem }
import collection.mutable.ListBuffer
trait Activity {
self: AActivity =>
type OptionsMenuCallback = Menu => Unit
lazy val optionsMenuCallbacks = new ListBuffer[OptionsMenuCallback]
... | sdb/cloudr | sdroid/src/Activity.scala | Scala | gpl-3.0 | 938 |
/**
* Licensed to Big Data Genomics (BDG) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The BDG licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use ... | laserson/adam | adam-core/src/test/scala/org/bdgenomics/adam/rdd/contig/FlankReferenceFragmentsSuite.scala | Scala | apache-2.0 | 3,153 |
/***********************************************************************
* 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-utils/src/test/scala/org/locationtech/geomesa/utils/cache/SoftThreadLocalTest.scala | Scala | apache-2.0 | 2,474 |
package net.tomasherman.specus.server.net.session
import org.specs2.mutable.Specification
import org.specs2.specification.Scope
import org.specs2.mock.Mockito
import org.jboss.netty.channel.Channel
import net.tomasherman.specus.common.api.net.Packet
/**
* This file is part of Specus.
*
* Specus is free software: y... | tomasherman/specus | server/src/test/scala/net/tomasherman/specus/server/net/session/NettySessionSpec.scala | Scala | gpl-3.0 | 1,457 |
package scorex
import java.security.SecureRandom
import scala.annotation.tailrec
import scala.concurrent.duration._
import scala.reflect.runtime.universe
import scala.util._
package object utils {
@tailrec
final def untilTimeout[T](timeout: FiniteDuration,
delay: FiniteDuration = 100... | B83YPoj/Waves | src/main/scala/scorex/utils/utils.scala | Scala | apache-2.0 | 1,105 |
/*
* 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 ... | chenc10/Spark-PAF | core/src/main/scala/org/apache/spark/memory/MemoryManager.scala | Scala | apache-2.0 | 8,620 |
package coursier.cache.loggers
import java.io.Writer
import java.util.Locale
import java.util.concurrent.TimeUnit
import coursier.cache.internal.ConsoleDim
import scala.collection.compat._
import scala.concurrent.duration.{Duration, DurationInt}
class FileTypeRefreshDisplay(
/** Whether to keep details on screen ... | alexarchambault/coursier | modules/cache/jvm/src/main/scala/coursier/cache/loggers/FileTypeRefreshDisplay.scala | Scala | apache-2.0 | 5,105 |
/* *\\
** Squants **
** **
** Scala Quantities and Units of Measure Library and DSL **
** (c) 2013-2014, G... | non/squants | src/test/scala/squants/time/FrequencySpec.scala | Scala | apache-2.0 | 3,108 |
package text.search
/**
* @author ynupc
* Created on 2016/08/21
*/
object TurboBM extends Search {
override def indexOf[T](source: Array[T], target: Array[T]): Int = {
-1
}
override def indicesOf[T](source: Array[T], target: Array[T]): Array[Int] = {
Array()
}
}
| ynupc/scalastringcourseday6 | src/main/scala/text/search/TurboBM.scala | Scala | apache-2.0 | 295 |
/*
* 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/IteratorTest.scala | Scala | apache-2.0 | 1,817 |
package org.unisonweb.util
import Bytes.unsigned
import Critbyte._
sealed abstract class Critbyte[A] {
/** Returns the submap of this `Critbyte` whose keys all have `key` as a prefix. */
def prefixedBy(key: Bytes.Seq): Critbyte[A]
def lookup(key: Bytes.Seq): Option[A]
def insert(key: Bytes.Seq, value: A): ... | paulp/unison | runtime-jvm/main/src/main/scala/util/Critbyte.scala | Scala | mit | 12,016 |
/*
* Copyright (C) 2009 Lalit Pant <pant.lalit@gmail.com>
*
* The contents of this file are subject to the GNU General Public License
* Version 3 (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.gnu.org/copyleft/gpl.html
*
*... | dotta/kojo | KojoEnv/test/unit/src/net/kogics/kojo/turtle/TurtleTest.scala | Scala | gpl-3.0 | 8,335 |
/*
* Copyright (C) 2016-2017 Lightbend Inc. <https://www.lightbend.com>
*/
package com.lightbend.lagom.scaladsl.pubsub
import akka.remote.testkit.MultiNodeSpecCallbacks
import org.scalatest.BeforeAndAfterAll
import org.scalatest.Matchers
import org.scalatest.WordSpecLike
/**
* Hooks up MultiNodeSpec with ScalaTest... | edouardKaiser/lagom | pubsub/scaladsl/src/multi-jvm/scala/com/lightbend/lagom/scaladsl/pubsub/STMultiNodeSpec.scala | Scala | apache-2.0 | 622 |
/*******************************************************************************
* Copyright (c) 2014 Łukasz Szpakowski.
*
* 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/MP... | luckboy/Purfuncor | src/main/scala/pl/luckboy/purfuncor/backend/interp/Environmental.scala | Scala | mpl-2.0 | 667 |
package actors.persistent.arrivals
import drt.shared.{FeedSource, FeedSourceStatuses, FeedStatus, FeedStatuses}
trait FeedStateLike {
def feedSource: FeedSource
def maybeSourceStatuses: Option[FeedSourceStatuses]
def addStatus(newStatus: FeedStatus): FeedSourceStatuses = {
maybeSourceStatuses match {
... | UKHomeOffice/drt-scalajs-spa-exploration | server/src/main/scala/actors/persistent/arrivals/FeedStateLike.scala | Scala | apache-2.0 | 575 |
package examples.demo
import examples.demo.GModularClockCircle.Clock
import examples.demo.ui.{Circle, Point, Shape, ShapesPanel}
import rescala._
/**
* We now begin to introduce user interaction. Currently, the
* ball easily moves outside of the window and correcting its
* trajectory is very difficult. To simpl... | volkc/REScala | Examples/examples/src/main/scala/examples/demo/INumericResettableCircle.scala | Scala | apache-2.0 | 3,209 |
// Code generated by sbt-mavgen. Manual edits will be overwritten
package scavlink.message.enums
/**
* These flags encode the MAV mode.
*/
object MavModeFlag extends Enumeration with Flag {
val _UNKNOWN = Value(0)
/**
* 0b10000000 MAV safety set to armed. Motors are enabled / running / can start. Ready to fly... | nickolasrossi/scavlink | src/main/scala/scavlink/message/enums/MavModeFlag.scala | Scala | mit | 1,414 |
/*
* Copyright 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 ... | keshin/squbs | squbs-httpclient/src/main/scala/org/squbs/httpclient/endpoint/impl/SimpleServiceEndpointResolver.scala | Scala | apache-2.0 | 1,275 |
package org.jetbrains.plugins.scala.worksheet.runconfiguration
import com.intellij.openapi.components.ProjectComponent
import com.intellij.openapi.editor.{Editor, EditorFactory}
import com.intellij.openapi.editor.impl.EditorImpl
import com.intellij.openapi.project.Project
import com.intellij.util.containers.WeakHashMa... | ilinum/intellij-scala | src/org/jetbrains/plugins/scala/worksheet/runconfiguration/WorksheetCache.scala | Scala | apache-2.0 | 3,397 |
package mesosphere.marathon.state
import mesosphere.marathon.Protos
import mesosphere.marathon.event.UnhealthyTaskKillEvent
import mesosphere.marathon.state.PathId._
import mesosphere.mesos.protos.Implicits.slaveIDToProto
import mesosphere.mesos.protos.SlaveID
import org.apache.mesos.{ Protos => mesos }
case class Ta... | yp-engineering/marathon | src/main/scala/mesosphere/marathon/state/TaskFailure.scala | Scala | apache-2.0 | 3,654 |
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you ... | bwsw/t-streams | src/main/scala/com/bwsw/tstreams/agents/group/GroupParticipant.scala | Scala | apache-2.0 | 1,719 |
/*
* Sonar Scoverage Plugin
* Copyright (C) 2013 Rado Buransky
* dev@sonar.codehaus.org
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3 of the License, or (at... | scoverage/sonar-scoverage-plugin | plugin/src/main/scala/com/buransky/plugins/scoverage/sensor/ScoverageSensor.scala | Scala | lgpl-3.0 | 9,088 |
/**
* Copyright (c) 2012 Alexey Aksenov ezh@ezh.msk.ru
*
* 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... | ezh/android-DigiLib | src/main/scala/org/digimead/digi/ctrl/lib/util/ExceptionHandler.scala | Scala | apache-2.0 | 3,939 |
package com.ezoky.ezmodel.interaction.interpreter.eventsourcing
/**
* @author gweinbach on 07/03/2021
* @since 0.2.0
*/
trait Projecting {
trait Projector[StateType, -EventType] {
def project(state: StateType,
event: EventType): StateType
}
object Projector {
def identity[State... | ezoky/ezmodel | ezmodel-interaction/src/main/scala/com/ezoky/ezmodel/interaction/interpreter/eventsourcing/Projecting.scala | Scala | gpl-2.0 | 814 |
val x = play {
// RandSeed.ir(trig = 1, seed = 56789.0)
val bRF_0 = BRF.ar(670.28094, freq = -0.0029116, rq = -7.393255)
val inL = GbmanL.ar(freq = 746.1969, xi = 419.73846, yi = -2526.418)
val ramp = Ramp.ar(23.868387, dur = 695.37335)
val freeVerb2 = FreeVerb2.ar(inL = inL, in... | Sciss/Grenzwerte | individual_sounds/1630_462.scala | Scala | gpl-3.0 | 2,247 |
package com.github.com.diegopacheco.sandbox.scala.twoeleven.basic
object NestedFunctions extends App {
object math{
def count(l:List[Int]):Int= {
def reduce(l:List[Int]):Int = {
return l.reduce(_+_)
}
reduce(l)
}
}
println( math.count( List(1,2,3,4,5,6) ) )
} | diegopacheco/scala-playground | scala.211.playground/src/com/github/com/diegopacheco/sandbox/scala/twoeleven/basic/NestedFunctions.scala | Scala | unlicense | 320 |
/**
* 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... | geeag/kafka | core/src/test/scala/unit/kafka/utils/TestUtils.scala | Scala | apache-2.0 | 46,875 |
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you ... | DieBauer/flink | flink-libraries/flink-cep-scala/src/main/scala/org/apache/flink/cep/scala/CEP.scala | Scala | apache-2.0 | 1,717 |
package org.jetbrains.plugins.scala.lang.psi.impl.expr
import com.intellij.lang.ASTNode
import com.intellij.openapi.util.TextRange
import com.intellij.psi._
import com.intellij.psi.util.PsiTreeUtil
import org.jetbrains.plugins.scala.lang.psi.ScalaPsiElementImpl
import org.jetbrains.plugins.scala.lang.psi.api.ScalaElem... | gtache/intellij-lsp | intellij-lsp-dotty/src/org/jetbrains/plugins/scala/lang/psi/impl/expr/ScSelfInvocationImpl.scala | Scala | apache-2.0 | 4,876 |
package models.quiz
import com.artclod.collection.MustHandle
import models.quiz.answer.table._
import models.quiz.question.table._
import play.api.db.slick.Config.driver.simple._
package object table {
val quizzesTable = TableQuery[QuizzesTable]
val usersQuizzesTable = TableQuery[Users2QuizzesTable]
val deriv... | kristiankime/web-education-games | app/models/quiz/table/package.scala | Scala | mit | 4,405 |
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.