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 org.hibernate.cache.rediscala.tests
import java.util.Properties
import com.zaxxer.hikari.{HikariConfig, HikariDataSource}
import org.hibernate.SessionFactory
import org.hibernate.cache.rediscala.SingletonRedisRegionFactory
import org.hibernate.cache.rediscala.tests.domain.Account
import org.hibernate.cfg.Avai... | debop/hibernate-rediscala | src/test/scala/org/hibernate/cache/rediscala/tests/HibernateRedisConfiguration.scala | Scala | apache-2.0 | 3,201 |
/**
* Created by Brent on 11/23/2016.
*/
import breeze.numerics.{atan, pow}
import scala.collection.mutable
import scala.collection.mutable.HashMap
import scala.io.Source
import scala.util.Try
object DataPipeline {
def indexColumnsAux(s: Array[String], i: Int): HashMap[Int, String] = {
if (i < s.length) {... | snakes-in-the-box/galapagos | src/main/scala/DataPipeline.scala | Scala | mit | 2,182 |
package models.actors.dataimport
import javax.inject.Inject
import akka.actor.{Actor, ActorRef}
import models.db.DataImportRepository
import models.entity.Task
import models.service.ProfileFileParser
import play.api.Logger
object DataImportActor {
trait Factory {
def apply(): Actor
}
case... | LeonardoZ/SAEB | app/models/actors/dataimport/DataImportActor.scala | Scala | mit | 1,499 |
/*
rule = Http4sFs2Linters
*/
package fix
import cats.effect._
import fs2._
object Fs2SyncCompilerTest {
def usesSyncInnocently[F[_]](implicit F: Sync[F]) = F.delay(println("hi"))
def usesSyncCompiler[F[_]](implicit F: Sync[F]) = Stream(1, 2, 3).covary[F].compile.drain // assert: Http4sFs2Linters.noFs2SyncCompil... | rossabaker/http4s | scalafix-internal/input/src/main/scala/fix/Fs2SyncCompilerTest.scala | Scala | apache-2.0 | 429 |
package lila.user
import org.joda.time.DateTime
import lila.db.BSON.BSONJodaDateTimeHandler
import reactivemongo.bson._
final class TrophyApi(coll: lila.db.Types.Coll) {
private implicit val trophyKindBSONHandler = new BSONHandler[BSONString, Trophy.Kind] {
def read(bsonString: BSONString): Trophy.Kind =
... | Happy0/lila | modules/user/src/main/TrophyApi.scala | Scala | mit | 985 |
package fi.pyppe.ircbot.slave
import org.joda.time.{Duration, DateTime}
import fi.pyppe.ircbot.event.Message
trait TimedChannelMaybeSayer extends MaybeSayer {
protected def onReact(m: Message): Option[String]
protected def silentPeriod: Duration
private final var lastReactions = Map[String, DateTime]()
fin... | Pyppe/akka-ircbot | slave/src/main/scala/fi/pyppe/ircbot/slave/TimedChannelMaybeSayer.scala | Scala | mit | 750 |
/*
* 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 ... | bavardage/spark | core/src/main/scala/spark/scheduler/DAGScheduler.scala | Scala | apache-2.0 | 32,950 |
/**
* Copyright 2017 RiskSense, Inc.
* This file is part of ipaddr library.
*
* Ipaddr is free software 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.apac... | risksense/ipaddr | src/main/scala/com/risksense/ipaddr/IpNetwork.scala | Scala | apache-2.0 | 13,920 |
package illustrations
import scala.scalajs.js.annotation.JSExportTopLevel
import scala.scalajs.js.annotation.JSExport
import scala.concurrent._
@JSExportTopLevel("Primes")
object Primes{
def recSieve(remaining: List[Int], accum: Vector[Int]) : Vector[Int] =
remaining match {
case Nil => accum... | siddhartha-gadgil/presentations | illustrations/src/Primes.scala | Scala | mit | 2,433 |
package eu.timepit.refined.macros
import scala.reflect.macros.blackbox
trait LiteralMatchers {
val c: blackbox.Context
import c.universe._
private[macros] object BigIntMatcher {
def unapply(expr: c.Tree): Option[BigInt] =
expr match {
case q"scala.`package`.BigInt.apply(${lit: Literal})" =>
... | fthomas/refined | modules/core/shared/src/main/scala-3.0-/eu/timepit/refined/macros/LiteralMatchers.scala | Scala | mit | 1,370 |
package ui.program
import org.scalajs.dom
import org.scalajs.dom.raw.{WebGLProgram, WebGLShader, WebGLUniformLocation}
import ui.scene.SceneItem
import ui.shader.Shader
import ui.GLContext
import ui.math.{Vec2, Vec3}
import scala.collection.mutable
import scala.scalajs.js
class Program(val gLContext: GLC... | gvatn/play-scalajs-webgl-spark | client/src/main/scala/ui/program/Program.scala | Scala | mit | 5,153 |
package io.reactors
package protocol
import io.reactors.common.SetSeq
import org.scalatest._
import org.scalatest.concurrent.AsyncTimeLimitedTests
import scala.collection._
import scala.concurrent.ExecutionContext
import scala.concurrent.Promise
import scala.concurrent.duration._
class RouterProtocolsSpec
extends... | storm-enroute/reactors | reactors-protocol/shared/src/test/scala/io/reactors/protocol/router-protocols-tests.scala | Scala | bsd-3-clause | 1,883 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | trueyao/spark-lever | core/src/test/scala/org/apache/spark/scheduler/TaskSetManagerSuite.scala | Scala | apache-2.0 | 31,064 |
package hercules.protocols
import hercules.entities.ProcessingUnit
import hercules.entities.notification.NotificationUnit
import spray.json._
/**
* Import this object to gain access to the messaging protocol of
* Hercules.
*
* All messages which are to be sent globally need to be defined in here!
*/
object Hercu... | johandahlberg/hercules | src/main/scala/hercules/protocols/HerculesMainProtocol.scala | Scala | mit | 8,460 |
package amora.backend.services
import java.io.File
import akka.actor.ActorSystem
import amora.backend.Logger
import amora.backend.indexer.ArtifactFetcher
import amora.converter.protocol.Artifact
import amora.converter.protocol.Project
class IndexArtifacts(val system: ActorSystem, override val logger: Logger) extends... | sschaef/tooling-research | backend/src/main/scala/amora/backend/services/IndexArtifacts.scala | Scala | mit | 1,277 |
package bgstats.model
import monix.reactive.Observable
trait ApplicationStore[M] extends AllCommands {
val state$: Observable[ApplicationState[M]]
}
| BardurArantsson/bg-stats | src/main/scala/bgstats/model/ApplicationStore.scala | Scala | apache-2.0 | 155 |
package com.karasiq.shadowcloud.metadata.imageio
import com.typesafe.config.Config
import com.karasiq.shadowcloud.metadata.{MetadataParser, MetadataProvider, MimeDetector}
class ImageIOMetadataProvider(rootConfig: Config) extends MetadataProvider {
protected object imageioConfig {
val config = rootConfig.getCo... | Karasiq/shadowcloud | metadata/imageio/src/main/scala/com/karasiq/shadowcloud/metadata/imageio/ImageIOMetadataProvider.scala | Scala | apache-2.0 | 570 |
/***********************************************************************
* 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 ... | MutahirKazmi/geomesa | geomesa-kafka/geomesa-kafka-datastore/geomesa-kafka-datastore-common/src/main/scala/org/locationtech/geomesa/kafka/GeoMessage.scala | Scala | apache-2.0 | 6,216 |
package org.zalando.jsonapi.json.circe
import io.circe._
import io.circe.generic.auto._
import io.circe.syntax._
import org.zalando.jsonapi.json.FieldNames
import org.zalando.jsonapi.model.JsonApiObject._
import org.zalando.jsonapi.model.Links.Link
import org.zalando.jsonapi.model.RootObject.{Data, ResourceObject, Res... | texvex/scala-jsonapi | src/main/scala/org/zalando/jsonapi/json/circe/CirceJsonapiEncoders.scala | Scala | mit | 6,626 |
package com.yetu.oauth2provider.oauth2.services
import com.yetu.oauth2provider.controllers.authentication.providers.EmailPasswordProvider
import com.yetu.oauth2provider.oauth2.models.{ ImplicitFlowException, ImplicitFlowSyntaxException, YetuUser }
import com.yetu.oauth2provider.services.data.interface.IPersonService
i... | yetu/oauth2-provider | app/com/yetu/oauth2provider/oauth2/services/ImplicitGrantFlowService.scala | Scala | mit | 1,377 |
/*
* TreeTable.scala
* (TreeTable)
*
* Copyright (c) 2013-2020 Hanns Holger Rutz. All rights reserved.
*
* This library 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 2.1 of t... | Sciss/TreeTable | scala/src/main/scala/de/sciss/treetable/TreeTable.scala | Scala | lgpl-3.0 | 20,488 |
/*
* Copyright 2019 ABSA Group Limited
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agr... | AbsaOSS/spline | commons/src/main/scala/za/co/absa/spline/common/webmvc/jackson/ObjectMapperBeanPostProcessor.scala | Scala | apache-2.0 | 1,478 |
package io.udash
package rest.openapi
import java.util.UUID
import com.avsystem.commons._
import com.avsystem.commons.misc.{ImplicitNotFound, NamedEnum, NamedEnumCompanion, Timestamp}
import io.udash.rest.raw._
import monix.eval.TaskLike
import scala.annotation.implicitNotFound
@implicitNotFound("RestSchema for ${T}... | UdashFramework/udash-core | rest/src/main/scala/io/udash/rest/openapi/RestSchema.scala | Scala | apache-2.0 | 19,116 |
package org.apache.spark.ml.ann
import breeze.linalg.{*, DenseMatrix => BDM, DenseVector => BDV, Vector => BV, axpy => Baxpy,
sum => Bsum}
import org.apache.spark.mllib.linalg.{Vectors, Vector}
import org.apache.spark.mllib.optimization.Updater
private[ann] class CNNUpdater(alpha: Double) extends Updater {
overrid... | hhbyyh/mCNN | src/communityInterface/CNNUpdater.scala | Scala | apache-2.0 | 689 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | u2009cf/spark-radar | sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetQuerySuite.scala | Scala | apache-2.0 | 26,926 |
object Solution {
def hasCommon(s: String, t: String): Boolean = {
(s.toSet & t.toSet).size >= 1
}
def main(args: Array[String]) {
for (_ <- 1 to readInt) {
val s = readLine
val t = readLine
if (hasCommon(s, t)) println("YES") else println("NO")
}
}
}
| advancedxy/hackerrank | algorithms/strings/TwoStrings.scala | Scala | mit | 292 |
package slick.backend
import scala.language.experimental.macros
import java.net.{URL, URI}
import scala.annotation.{StaticAnnotation, Annotation}
import scala.reflect.ClassTag
import scala.reflect.macros.Context
import scala.util.control.NonFatal
import slick.SlickException
import slick.profile.BasicProfile
import co... | adamkozuch/slick | slick/src/main/scala/slick/backend/DatabaseConfig.scala | Scala | bsd-2-clause | 5,810 |
package model
/**
* Created by ghseeli on 1/14/17.
*/
sealed trait Status {
def message: String
}
case class SquareAlreadyOccupied[B <: Coordinate](board: Board[B], player: Option[Player], coordinate: B) extends Status {
val message = "Entered square is already occupied!"
}
case class InvalidCoordinate[B <: Co... | ghseeli/four-dim-tic-tac-toe | src/main/scala/model/Status.scala | Scala | gpl-3.0 | 552 |
package utils.reflect
import java.lang.reflect.{Field,Method,Type,ParameterizedType,WildcardType,GenericArrayType,TypeVariable}
import scala.collection.mutable.Builder
import Reflect.findClass
trait AutoConvertData extends ConvertData {
def convert:String
}
/** A Binder ties an AccessibleObject (Field,... | Y-P-/data-processing-binding | Utils/src/utils/reflect/Binder.scala | Scala | gpl-3.0 | 10,957 |
/*
* 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... | yiheng/BigDL | spark/dl/src/test/scala/com/intel/analytics/bigdl/utils/tf/loaders/MinimumSpec.scala | Scala | apache-2.0 | 896 |
package org.squeryl.framework
import org.squeryl.{Session, Query}
import org.squeryl.test.PrimitiveTypeModeForTests._
import org.scalatest.matchers.should.Matchers
trait QueryTester extends Matchers {
var logQueries = false
var validateFirstAndExit = -1
var dumpAst = false
var doNotExecute =... | xuwei-k/Squeryl | src/test/scala/org/squeryl/framework/QueryTester.scala | Scala | apache-2.0 | 1,734 |
/*
Copyright (C) 2013-2019 Expedia Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in wri... | mikkokar/styx | system-tests/e2e-suite/src/test/scala/com/hotels/styx/client/TlsVersionSpec.scala | Scala | apache-2.0 | 5,998 |
import cats.effect.{ IO, IOApp, ExitCode }
import cats.implicits._
import io.circe.Json
import org.http4s.HttpRoutes
import org.http4s.circe._
import org.http4s.syntax._
import org.http4s.dsl.io._
import org.http4s.implicits._
import org.http4s.server.blaze._
object Main extends IOApp {
val helloWorldService = Http... | t-mochizuki/scala-study | http4s-example/src/main/scala/Main.scala | Scala | mit | 678 |
// goseumdochi: experiments with incarnation
// Copyright 2016 John V. Sichi
//
// 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
//
// Un... | lingeringsocket/goseumdochi | base/src/main/scala/org/goseumdochi/vision/VisionAnalyzer.scala | Scala | apache-2.0 | 2,242 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | mahak/spark | sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/json/JsonFiltersSuite.scala | Scala | apache-2.0 | 1,194 |
/**
* Copyright 2015 Yahoo Inc. Licensed under the Apache License, Version 2.0
* See accompanying LICENSE file.
*/
package controller.api
import controllers.KafkaManagerContext
import controllers.api.KafkaHealthCheck
import kafka.manager.utils.{CuratorAwareTest, KafkaServerInTest}
import kafka.test.SeededBroker
im... | sdgdsffdsfff/kafka-manager | test/controller/api/TestKafkaHealthCheck.scala | Scala | apache-2.0 | 4,134 |
package com.github.aselab.activerecord.io
import com.github.aselab.activerecord._
import reflections._
import java.util.{Date, UUID, TimeZone}
import java.sql.Timestamp
import com.github.nscala_time.time.Imports._
import org.joda.time.format.ISODateTimeFormat
trait Converter[A, B] {
def serialize(v: Any): B
def d... | xdougx/scala-activerecord | activerecord/src/main/scala/io/converters.scala | Scala | mit | 2,059 |
package com.rasterfoundry.backsplash.server
import com.rasterfoundry.backsplash.HistogramStore
import com.rasterfoundry.backsplash.HistogramStore.ToHistogramStoreOps
import com.rasterfoundry.database.LayerAttributeDao
import cats.effect.IO
import cats.implicits._
import com.typesafe.scalalogging.LazyLogging
import do... | azavea/raster-foundry | app-backend/backsplash-server/src/main/scala/com/rasterfoundry/backsplash/implicits/HistogramStoreImplicits.scala | Scala | apache-2.0 | 2,612 |
/**
* (c) Copyright 2013 WibiData, Inc.
*
* See the NOTICE file distributed with this work for additional
* information regarding copyright ownership.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of... | kijiproject/kiji-schema-shell | src/test/scala/org/kiji/schema/shell/ddl/TestUseJarCommand.scala | Scala | apache-2.0 | 2,525 |
/*
* Copyright (C) 2016-2019 Lightbend Inc. <https://www.lightbend.com>
*/
package com.lightbend.lagom.scaladsl.persistence.jdbc
import akka.actor.ActorSystem
import com.lightbend.lagom.internal.persistence.jdbc.SlickDbProvider
import com.lightbend.lagom.internal.persistence.jdbc.SlickOffsetStore
import com.lightbe... | rcavalcanti/lagom | persistence-jdbc/scaladsl/src/main/scala/com/lightbend/lagom/scaladsl/persistence/jdbc/JdbcPersistenceComponents.scala | Scala | apache-2.0 | 2,911 |
/*
* Copyright 2014 - 2015 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 a... | wemrysi/quasar | core/src/main/scala/slamdata/engine/physical/mongodb/workflowtask.scala | Scala | apache-2.0 | 6,502 |
package com.nefariouszhen.alert
import com.fasterxml.jackson.module.scala.DefaultScalaModule
import io.dropwizard.Bundle
import io.dropwizard.setup.{Environment, Bootstrap}
class ScalaBundle extends Bundle {
def initialize(bootstrap: Bootstrap[_]): Unit = {
bootstrap.getObjectMapper.registerModule(DefaultScalaM... | nbauernfeind/xmpp-alert | src/main/scala/com/nefariouszhen/alert/ScalaBundle.scala | Scala | apache-2.0 | 402 |
/*
* Copyright (C) 2013 Bernhard Berger
*
* Based on pegdown (C) 2010-2011 Mathias Doenitz and
* peg-markdown (C) 2008-2010 John MacFarlane.
*
* 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 Lice... | Hocdoc/pegdownScala | src/main/scala/info/hocdoc/markdown/FastEncoder.scala | Scala | apache-2.0 | 1,465 |
package chandu0101.scalajs.react.components
package materialui
import chandu0101.macros.tojs.JSMacro
import japgolly.scalajs.react._
import scala.scalajs.js
import scala.scalajs.js.`|`
/**
* This file is generated - submit issues instead of PR against it
*/
class Ampm_24hr(val value: String) extends AnyVal
ob... | elacin/scalajs-react-components | core/src/main/scala/chandu0101/scalajs/react/components/materialui/gen-types.scala | Scala | apache-2.0 | 2,718 |
package ru.primetalk.typed.expressions
import org.scalatest.FunSuite
import ru.primetalk.language.russian.RussianNumerals
import ru.primetalk.language.russian.morphology.LemmaGrammarCategory
/**
* @author zhizhelev, 21.10.14.
*/
class ParserTests extends FunSuite {
trait MyParsers extends Parsers {
override... | Primetalk/synapse-expressions | synapse-typed-expressions/src/test/scala/ru/primetalk/typed/expressions/ParserTests.scala | Scala | bsd-2-clause | 2,100 |
package x7c1.wheat.splicer.core
trait StringLike[A]{
def from(x: A): String
}
object StringLike {
implicit object str extends StringLike[String]{
override def from(x: String): String = x
}
}
| x7c1/Wheat | wheat-splicer/src/test/scala/x7c1/wheat/splicer/core/StringLike.scala | Scala | mit | 203 |
package coursier.cli.launch
import caseapp.{ExtraName => Short, HelpMessage => Help, ValueDescription => Value, _}
import coursier.cli.install.SharedChannelOptions
import coursier.cli.jvm.SharedJavaOptions
import coursier.cli.options.SharedLaunchOptions
import coursier.install.RawAppDescriptor
// format: off
@ArgsNam... | alexarchambault/coursier | modules/cli/src/main/scala/coursier/cli/launch/LaunchOptions.scala | Scala | apache-2.0 | 1,356 |
/**
* @author Yuuto
*/
package yuuto.enhancedinventories.client.renderer
import java.awt.Color
import net.minecraft.block.Block
import net.minecraft.client.model.ModelChest
import net.minecraft.client.model.ModelLargeChest
import net.minecraft.client.renderer.Tessellator
import net.minecraft.client.renderer.texture.... | AnimeniacYuuto/EnhancedInventories | src/main/scala/yuuto/enhancedinventories/client/renderer/TileImprovedChestRenderer.scala | Scala | gpl-2.0 | 7,548 |
package com.datastax.spark.connector.rdd
import com.datastax.spark.connector.cql._
import com.datastax.spark.connector.rdd.ClusteringOrder.{Ascending, Descending}
import com.datastax.spark.connector.rdd.reader._
import com.datastax.spark.connector.types.TypeConverter
import com.datastax.spark.connector.util.ConfigChec... | chbatey/spark-cassandra-connector | spark-cassandra-connector/src/main/scala/com/datastax/spark/connector/rdd/CassandraRDD.scala | Scala | apache-2.0 | 10,232 |
package com.github.aalbul.irc.domain
import java.util.UUID
import org.pircbotx.Channel
/**
* Created by nuru on 04.01.14.
*/
case class IrcChannel(id: UUID, name: String, mode: String, topic: String, topicTimestamp: Long, createdTimestamp: Long,
topicSetter: String, moderated: Boolean, noExter... | aalbul/reactive-irc | src/main/scala/com/github/aalbul/irc/domain/IrcChannel.scala | Scala | gpl-3.0 | 961 |
/*
* 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 ... | eric-haibin-lin/mxnet | scala-package/core/src/main/scala/org/apache/mxnet/util/OptionConversion.scala | Scala | apache-2.0 | 975 |
package controllers
import akka.pattern.ask
import model.command.ShortenUrl
import model.event._
import model.query._
import play.api.mvc._
import play.api.libs.json.Json
import play.api.Logger
import plugins.{ DomainAsker, Domain }
import scala.concurrent.Future
abstract class ShortUrl extends Controller with PlayLo... | jeantil/courtly | app/controllers/ShortUrl.scala | Scala | apache-2.0 | 2,070 |
/* Copyright 2017-19, 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_scala | modules/api/src/test/scala/org/platanios/tensorflow/api/ops/NNSpec.scala | Scala | apache-2.0 | 2,269 |
/**
* Copyright (C) 2009-2011 Scalable Solutions AB <http://scalablesolutions.se>
*/
package akka.dispatch
import akka.actor.{ Actor, ActorRef }
import akka.actor.newUuid
import akka.config.Config._
import akka.util.{ Duration, ReflectiveAccess }
import akka.config.Configuration
import java.util.concurrent.Time... | felixmulder/scala | test/disabled/presentation/akka/src/akka/dispatch/Dispatchers.scala | Scala | bsd-3-clause | 11,088 |
/*
* Copyright (c) 2014-2018 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... | Wogan/monix | monix-reactive/shared/src/test/scala/monix/reactive/internal/operators/DebounceRepeatedSuite.scala | Scala | apache-2.0 | 1,901 |
package scaldi.util
object JvmTestUtil {
// It is not pretty at all, but if you know better way to get JVM shutdown hook count, I would be happy to use it :)
def shutdownHookCount = {
val hooksField = Class.forName("java.lang.ApplicationShutdownHooks").getDeclaredField("hooks")
if (!hooksField.isAccessib... | Mironor/scaldi | src/test/scala/scaldi/util/JvmTestUtil.scala | Scala | apache-2.0 | 426 |
package cc.factorie.app.nlp.phrase
import cc.factorie.app.nlp._
import scala.util.parsing.combinator.{ImplicitConversions, Parsers}
import cc.factorie.app.nlp.pos.PennPosTag
import scala.util.parsing.input.{Reader, Position}
import java.util.GregorianCalendar
import scala.collection.mutable.ArrayBuffer
import cc.facto... | malcolmgreaves/factorie | src/main/scala/cc/factorie/app/nlp/phrase/DatePhraseFinder.scala | Scala | apache-2.0 | 10,667 |
//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
/** @author John Miller
* @version 1.2
* @date Sun Aug 23 15:42:06 EDT 2015
* @see LICENSE (MIT style license file).
*/
package scalation.linalgebra
import reflect.ClassTag
import scalation.math.{Complex, Rational, Real}... | mvnural/scalation | src/main/scala/scalation/linalgebra/Vec.scala | Scala | mit | 13,919 |
package argon.codegen.chiselgen
import argon.core._
import argon.nodes._
trait ChiselGenIfThenElse extends ChiselCodegen {
override protected def emitNode(lhs: Sym[_], rhs: Op[_]): Unit = rhs match {
case IfThenElse(cond, thenp, elsep) =>
open(src"val $lhs = {")
open(src"if ($cond) { ")
emitB... | stanford-ppl/spatial-lang | spatial/core/src/spatial/codegen/chiselgen/ChiselGenIfThenElse.scala | Scala | mit | 474 |
/*
* 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 ... | fogbeam/zeppelin_mirror | flink/flink-scala-2.12/src/main/scala/org/apache/zeppelin/flink/FlinkScala212Interpreter.scala | Scala | apache-2.0 | 2,146 |
package graycode
import org.scalacheck.Gen
import org.scalatest.prop.GeneratorDrivenPropertyChecks
import org.scalatest.{FlatSpec, Matchers}
import graycode.GrayCode._
class GrayCodeSpec extends FlatSpec with GeneratorDrivenPropertyChecks with Matchers {
behavior of "binary reflected Gray code"
val numbersLess... | HolyHaddock/scalacheck-example | src/test/scala/graycode/GrayCodeSpec.scala | Scala | mit | 454 |
/*******************************************************************************
* Copyright 2010 Maxime Lévesque
*
* 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... | ccap/Squeryl | src/main/scala/org/squeryl/internals/FieldMetaData.scala | Scala | apache-2.0 | 21,974 |
package fb
import scala.collection.mutable.HashMap
import scala.collection.mutable.ListBuffer
import Models._
object Data {
val users: HashMap[String, User] = new HashMap
val publicKeys: HashMap[String, String] = new HashMap
val pages: HashMap[String, Page] = new HashMap
val posts: HashMap[String, Post] = new... | BabakAp/ProjectFB | src/main/scala/fb/Data.scala | Scala | apache-2.0 | 396 |
package colossus.testkit
import akka.actor._
import akka.testkit.TestProbe
import colossus.core._
import scala.concurrent.duration._
trait MockConnection extends Connection with MockChannelActions {
/**
* Simulate event-loop iterations, calling readyForData until this buffer
* fills or everything is writt... | tumblr/colossus | colossus-testkit/src/main/scala/colossus.testkit/MockConnection.scala | Scala | apache-2.0 | 4,172 |
package nl.dekkr.feedfrenzy.backend.extractor.action
import java.time.format.{DateTimeFormatter, DateTimeFormatterBuilder, DateTimeParseException}
import java.time.{LocalDate, LocalTime, OffsetDateTime, ZoneOffset}
import java.util.Locale
import nl.dekkr.feedfrenzy.backend.model.DateParser
class ParseDateAction ext... | dekkr/feedfrenzy-backend | src/main/scala/nl/dekkr/feedfrenzy/backend/extractor/action/ParseDateAction.scala | Scala | mit | 1,885 |
/*
* 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 ... | akopich/spark | core/src/test/scala/org/apache/spark/SparkContextSchedulerCreationSuite.scala | Scala | apache-2.0 | 4,378 |
/*
* Copyright 2015 LinkedIn 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 w... | linkedin/play-parseq | sample/test/controllers/s/MultipleTasksSampleSpec.scala | Scala | apache-2.0 | 1,164 |
package extractors.exercises
object Exercise2 {
object At {
def unapply(s: String): Option[(String, String)] = sys.error("TODO")
}
}
| julienrf/scala-lessons | highlights/extractors/code/src/main/scala/extractors/exercises/Exercise2.scala | Scala | mit | 146 |
package io.skysail.api.osgi.bundlerepository.domain
import org.osgi.framework.Version
case class Resource(symbolicName: String, version: Version)
| evandor/skysail-server | skysail.api/src/io/skysail/api/osgi/bundlerepository/domain/Resource.scala | Scala | apache-2.0 | 148 |
package webpageparser
import model.estate.WebPage
import model.DomainLocalhost
import model.estate.Estate
import model.Url
class ParserTestLocalhost(webPage: WebPage[DomainLocalhost]) extends WebPageParser[DomainLocalhost] {
def parse(): Option[Estate[DomainLocalhost]] = {
None
}
def getEstateUrls: List... | tiborbotos/domino | domino-crawler/src/main/scala/webpageparser/ParserTestLocalhost.scala | Scala | lgpl-3.0 | 337 |
/* Copyright 2009-2016 EPFL, Lausanne */
package leon.integration.solvers
import leon.test._
import leon.test.helpers._
import leon.purescala.Common._
import leon.purescala.Definitions._
import leon.purescala.ExprOps._
import leon.purescala.Constructors._
import leon.purescala.Expressions._
import leon.purescala.Type... | regb/leon | src/test/scala/leon/integration/solvers/GlobalVariablesSuite.scala | Scala | gpl-3.0 | 1,939 |
package be.ellefant.cloudr
import roboguice.activity.RoboPreferenceActivity
import android.os.Bundle
class AccountPreferencesActivity extends RoboPreferenceActivity
with Base.CloudrActivity {
override def onCreate(savedInstance: Bundle) {
super.onCreate(savedInstance)
addPreferencesFromResource(R.xml.a... | sdb/cloudr | app/src/be/ellefant/cloudr/AccountPreferencesActivity.scala | Scala | gpl-3.0 | 355 |
/*
* 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 ... | dbtsai/spark | sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/V2ScanRelationPushDown.scala | Scala | apache-2.0 | 4,373 |
/*
* Copyright 2013-2016 the original author or 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 ap... | amuramatsu/Laika | core/src/test/scala/laika/parse/rst/ListParsersSpec.scala | Scala | apache-2.0 | 17,590 |
/**
* This file is part of the Uniscala Couch project.
* Copyright (C) 2012 Sustainable Software Pty Ltd.
* This is open source software, licensed under the Apache License
* version 2.0 license - please see the LICENSE file included in
* the distribution.
*
* Authors:
* Sam Stainsby (sam@sustainablesoftware.com... | stainsby/uniscala-couch | src/main/scala/net/uniscala/couch/CouchFailure.scala | Scala | apache-2.0 | 736 |
package com.sksamuel.elastic4s.fields
import com.sksamuel.elastic4s.analysis.LanguageAnalyzers
import com.sksamuel.elastic4s.requests.mappings.{MappingBuilderFn, MappingDefinition}
import org.scalatest.funsuite.AnyFunSuite
import org.scalatest.matchers.should.Matchers
class FieldMappingJsonTest extends AnyFunSuite wi... | stringbean/elastic4s | elastic4s-tests/src/test/scala/com/sksamuel/elastic4s/fields/FieldMappingJsonTest.scala | Scala | apache-2.0 | 2,062 |
import com.rabbitmq.client.ConnectionFactory
import com.rabbitmq.client.Connection
import com.rabbitmq.client.Channel
import com.rabbitmq.client.MessageProperties
val factory = new ConnectionFactory()
factory.setHost("hive.kaicode.com")
factory.setPort(5672)
factory.setUsername("order")
factory.setPassword("EisKisP1")... | sonwh98/helloPOS | src/sandbox/rabbitmq-tests.scala | Scala | gpl-2.0 | 840 |
/**
* SparklineData, Inc. -- http://www.sparklinedata.com/
*
* Scala based Audience Behavior APIs
*
* Copyright 2014-2015 SparklineData, 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 Lice... | cubefyre/audience-behavior-semantic-etl | etl/src/main/scala/org/sparkline/etl/MetricAnalysisException.scala | Scala | apache-2.0 | 1,500 |
/*
* Copyright (C) 2018 Joan Goyeau.
*
* 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, Ver... | sslavic/kafka | streams/streams-scala/src/test/scala/org/apache/kafka/streams/scala/kstream/MaterializedTest.scala | Scala | apache-2.0 | 4,196 |
package dsmoq.maintenance.data.user
import org.joda.time.DateTime
/**
* ユーザの検索結果を表すケースクラス
*/
case class SearchResultUser(
id: String,
name: String,
fullname: String,
mailAddress: String,
organization: String,
title: String,
description: String,
createdAt: DateTime,
updatedAt: DateTime,
disabled:... | nkawa/dsmoq | server/maintenance/src/main/scala/dsmoq/maintenance/data/user/SearchResultUser.scala | Scala | apache-2.0 | 365 |
package org.mdoc.common.model
import org.scalacheck.Prop._
import org.scalacheck.Properties
object FormatSpec extends Properties("Format") {
property("fromExtension . toExtension ~= id") = secure {
Format.values.forall { format =>
Format.fromExtension(format.toExtension).fold(false)(_ == format)
}
... | m-doc/common-model | shared/src/test/scala/org/mdoc/common/model/FormatSpec.scala | Scala | apache-2.0 | 324 |
/*
* Copyright 2014–2017 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... | drostron/quasar | couchbase/src/main/scala/quasar/physical/couchbase/planner/ShiftedReadFilePlanner.scala | Scala | apache-2.0 | 2,300 |
class A {
val x : { val self = this } = new { self => }
}
| AlexSikia/dotty | tests/untried/neg/t5361.scala | Scala | bsd-3-clause | 60 |
import org.specs2.mutable._
import org.specs2.runner._
import org.junit.runner._
import play.api.test._
import play.api.test.Helpers._
/**
* Add your spec here.
* You can mock out a whole application including requests, plugins etc.
* For more information, consult the wiki.
*/
@RunWith(classOf[JUnitRunner])
class... | Hofmaier/comstock | movierecommenderweb/test/ApplicationSpec.scala | Scala | mit | 824 |
package com.datastax.spark.connector.rdd.typeTests
import com.datastax.driver.core.{ProtocolVersion, Row}
import com.datastax.driver.core.ProtocolVersion._
import com.datastax.spark.connector._
import java.util.Date
class TimeTypeTest extends AbstractTypeTest[Long, java.lang.Long] {
override val minPV = ProtocolVe... | shashwat7/spark-cassandra-connector | spark-cassandra-connector/src/it/scala/com/datastax/spark/connector/rdd/typeTests/TimeTypeTest.scala | Scala | apache-2.0 | 1,655 |
/*
* 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 ... | gioenn/xSpark | mllib/src/main/scala/org/apache/spark/ml/feature/HashingTF.scala | Scala | apache-2.0 | 4,540 |
package ru.maizy.influxdbclient.data
/**
* Copyright (c) Nikita Kovaliov, maizy.ru, 2016-2017
* See LICENSE.txt for details.
*/
case class SeriesError(error: String)
| maizy/ambient7 | influxdb-client/src/main/scala/ru/maizy/influxdbclient/data/SeriesError.scala | Scala | apache-2.0 | 170 |
/*
* 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 ... | lhfei/spark-in-action | spark-3.x/src/main/scala/org/apache/spark/examples/streaming/DirectKerberizedKafkaWordCount.scala | Scala | apache-2.0 | 5,326 |
/*******************************************************************************
* Copyright (c) 2019. Carl Minden
*
* 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 ... | carlminden/anathema-roguelike | src/com/anathema_roguelike/main/display/animations/Blink.scala | Scala | gpl-3.0 | 1,591 |
package com.github.gigurra.serviceutils.twitter.service
import com.twitter.util.Future
import com.github.gigurra.serviceutils.twitter.logging.Logging
import com.github.gigurra.serviceutils.twitter.service.ServiceErrors.{AutoLoggingOff, AutoLoggingOn}
trait ServiceErrors extends Logging {
def autoLog: Boolean
de... | GiGurra/service-utils | src/main/scala/com/github/gigurra/serviceutils/twitter/service/ServiceErrors.scala | Scala | mit | 3,937 |
package core.node
/**
* This service allows to register a Node against a centralized lookup service for nodes across a network.
*
* @author Manuel Bernhardt <bernhardt.manuel@gmail.com>
*/
trait NodeRegistrationService {
/**
* Registers a new node. The organization doing the request will automatically become... | delving/culture-hub | web-core/app/core/node/NodeRegistrationService.scala | Scala | apache-2.0 | 1,230 |
/**
* Copyright (C) 2010 Orbeon, Inc.
*
* 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
* 2.1 of the License, or (at your option) any later version.
*
* This program i... | brunobuzzi/orbeon-forms | xforms/jvm/src/main/scala/org/orbeon/oxf/xforms/control/controls/XFormsRepeatControl.scala | Scala | lgpl-2.1 | 31,377 |
/* Copyright 2012 Christian Douven
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... | chridou/almhirt | almhirt-common/src/main/scala/almhirt/problem/ProblemInstances.scala | Scala | apache-2.0 | 1,102 |
package lib
import helpers.ServiceHelpers
import io.apibuilder.api.v0.models.{DiffBreaking, DiffNonBreaking}
import io.apibuilder.spec.v0.models.{Attribute, Deprecation, Interface}
import org.scalatestplus.play.PlaySpec
import org.scalatestplus.play.guice.GuiceOneAppPerSuite
import play.api.libs.json.Json
class Servi... | gheine/apidoc | api/test/lib/ServiceInterfaceDiffSpec.scala | Scala | mit | 4,128 |
package io.questions.model.questionnaire
import cats.data.NonEmptyList
import cats.syntax.eq._
import io.questions.model.questionnaire.Element.{ Derived, Enumerations, Info, Parent, Primitive }
import io.questions.model.questionnaire.nodekey.{ NodeKey, NodeKeyExtension }
object QuestionnaireNodeChildAppender {
def ... | channingwalton/qanda | questionnaire/src/main/scala/io/questions/model/questionnaire/QuestionnaireNodeChildAppender.scala | Scala | mit | 2,425 |
package com.twitter.finagle.service
import com.twitter.finagle.Service
import com.twitter.util.TimeConversions._
import com.twitter.util.{Await, Future, Time}
import org.mockito.Matchers
import org.specs.SpecificationWithJUnit
import org.specs.mock.Mockito
class RateLimitingFilterSpec extends SpecificationWithJUnit w... | firebase/finagle | finagle-core/src/test/scala/com/twitter/finagle/service/RateLimitingFilterSpec.scala | Scala | apache-2.0 | 1,633 |
package unfiltered.request
import java.io.{File => JFile}
trait MultiPartMatcher[T] {
def unapply(req: T): Option[T]
}
/** Multipart file upload utilities should extract data
* using this common format */
case class MultipartData[W](
params: String => Seq[String], files: String => W)
/** Describes an uploaded... | omarkilani/unfiltered | uploads/src/main/scala/request/uploads.scala | Scala | mit | 2,975 |
import scala.reflect.macros.blackbox.Context
object Impls {
def foo(c: Context) = {
import c.universe._
val body = Ident(TermName("IDoNotExist"))
c.Expr[Int](body)
}
}
object Macros {
def foo = macro Impls.foo
} | yusuke2255/dotty | tests/disabled/macro/run/macro-invalidret-nontypeable/Impls_Macros_1.scala | Scala | bsd-3-clause | 231 |
/*
* Copyright 2015 Webtrends (http://www.webtrends.com)
*
* See the LICENCE.txt file distributed with this work for additional
* information regarding copyright ownership.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* Yo... | mjwallin1/wookiee-spray | src/test/scala/com/webtrends/harness/component/spray/routes/BaseSprayRoutesSpecs.scala | Scala | apache-2.0 | 2,832 |
/*
* Copyright (c) 2015 Contributor. All rights reserved.
*/
package org.scalaide.debug.internal.expression
package context
import scala.annotation.tailrec
import scala.collection.JavaConverters._
import org.scalaide.debug.internal.expression.Names.Scala
import org.scalaide.debug.internal.expression.proxies.JdiProx... | scala-ide/scala-ide | org.scala-ide.sdt.debug.expression/src/org/scalaide/debug/internal/expression/context/InstanceOf.scala | Scala | bsd-3-clause | 3,325 |
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.