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 |
|---|---|---|---|---|---|
/*
* Copyright (C) 2011-2013 org.bayswater
*
* 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... | newlandsvalley/musicrest | src/main/scala/org/bayswater/musicrest/model/Comment.scala | Scala | apache-2.0 | 2,281 |
package dbpedia.dataparsers.util
import java.net._
object UriUtils
{
private val knownSchemes = Set("http", "https", "ftp")
private val knownPrefixes = knownSchemes.map(_ + "://")
def hasKnownScheme(uri: String) : Boolean = knownPrefixes.exists(uri.startsWith(_))
/**
* TODO: comment
*/
... | FnOio/dbpedia-parsing-functions-scala | src/main/scala/dbpedia/dataparsers/util/UriUtils.scala | Scala | gpl-2.0 | 974 |
package controllers.beans
case class User (email: String, password: String, fullname: String) | leleueri/easygift | easygift-play/app/controllers/beans/User.scala | Scala | apache-2.0 | 94 |
package marg.token
class Token private(string: String, kind: TokenKind) {
require(string != null)
override def toString = string + " : " + kind.toString
def isEOF = kind eq TokenKind.EOF
def String = string
def Kind = kind
}
object Token {
def apply(string: String, kind: TokenKind) = new Token(string, ki... | 193s/marg | src/main/scala/marg/token/Token.scala | Scala | gpl-2.0 | 439 |
import org.scalatest.FunSuite
import com.ssjskipp.misc._
class DecisionTreeSpec extends FunSuite {
test("Trivial DecisionTree should give expected results") {
val leftDecide = ClassifyLeaf(
(x: Seq[Double]) => if (x(1) > 0) "Positive" else "Negative or Zero"
)
val rightDecide = ClassifyLeaf(
(x: Se... | ssjskipp/thought | src/test/scala/DecisionTree.spec.scala | Scala | mit | 1,103 |
package formation.warp10
import java.time.LocalDateTime
import scala.util.{Failure, Success}
import akka.actor.ActorSystem
import akka.stream.ActorMaterializer
import akka.stream.scaladsl.{Sink, Source}
import kneelnrise.warp10scala.model._
import kneelnrise.warp10scala.services.Warp10Client
class Warp10Api(configur... | kneelnrise/formation-warp10 | src/main/scala/formation/warp10/Warp10Api.scala | Scala | mit | 1,500 |
/* Copyright (C) 2008-2014 University of Massachusetts Amherst.
This file is part of "FACTORIE" (Factor graphs, Imperative, Extensible)
http://factorie.cs.umass.edu, http://github.com/factorie
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with... | iesl/fuse_ttl | src/factorie-factorie_2.11-1.1/src/main/scala/cc/factorie/app/nlp/Sentence.scala | Scala | apache-2.0 | 4,555 |
/*
* Copyright (c) 2016 SnappyData, Inc. 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 required by ap... | vjr/snappydata | core/src/test/scala/io/snappydata/app/ExternalTableTestData.scala | Scala | apache-2.0 | 944 |
/*
* 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/main/scala/com/intel/analytics/bigdl/nn/mkldnn/ReorderMemory.scala | Scala | apache-2.0 | 3,868 |
package lila.forum
import play.api.libs.json.Json
import lila.db.api._
import lila.db.Implicits._
import tube.categTube
object CategRepo {
def bySlug(slug: String) = $find byId slug
def withTeams(teams: List[String]): Fu[List[Categ]] =
$find($query($or(Seq(
Json.obj("team" -> $exists(false)),
... | danilovsergey/i-bur | modules/forum/src/main/CategRepo.scala | Scala | mit | 624 |
package org.scalawiki.wlx
import org.scalawiki.cache.CachedBot
import org.scalawiki.dto.Site
import org.scalawiki.wlx.dto.Contest
import org.scalawiki.wlx.query.MonumentQuery
import org.specs2.mutable.Specification
class WlmUaListsSpec extends Specification {
sys.props.put("jna.nosys", "true")
sequential
val ... | intracer/scalawiki | scalawiki-wlx/src/test/scala/org/scalawiki/wlx/WlmUaListsSpec.scala | Scala | apache-2.0 | 1,826 |
/*
* 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/featran | core/src/main/scala/com/spotify/featran/transformers/Indicator.scala | Scala | apache-2.0 | 1,572 |
/**
* Copyright 2015 Yahoo Inc. Licensed under the Apache License, Version 2.0
* See accompanying LICENSE file.
*/
package kafka.manager
import java.util.Properties
import akka.actor.{ActorRef, ActorSystem, Kill, Props}
import akka.pattern._
import akka.util.Timeout
import com.typesafe.config.{Config, ConfigFactor... | vvutharkar/kafka-manager | test/kafka/manager/TestBrokerViewCacheActor.scala | Scala | apache-2.0 | 2,532 |
// TODO(low): proper generated API sources caching: doesn't detect output directory change
import sbt._
import Keys._
import Project.Initialize
import Util._
import Common._
import Licensed._
import Scope.ThisScope
import LaunchProguard.{ proguard, Proguard }
object Sbt extends Build {
override lazy val settings = ... | xeno-by/old-scalameta-sbt | project/Sbt.scala | Scala | bsd-3-clause | 19,487 |
package org.mdoc.rendering.service
import com.typesafe.scalalogging.StrictLogging
import scala.util.Try
object Main extends App with StrictLogging {
Try(Blaze.server.run.awaitShutdown()).recover {
case throwable =>
logger.error("awaitShutdown()", throwable)
sys.exit(1)
}
}
| m-doc/rendering-service | src/main/scala/org/mdoc/rendering/service/Main.scala | Scala | apache-2.0 | 296 |
package io.apicollective.play
import akka.stream.Materializer
import play.api.{Logger, Logging}
import play.api.mvc._
import scala.concurrent.{ExecutionContext, Future}
import play.api.http.HttpFilters
/**
* Add this to your base.conf:
* play.http.filters=io.apicollective.play.LoggingFilter
**/
class Loggin... | gheine/apidoc | api/app/play/LoggingFilter.scala | Scala | mit | 1,255 |
/*
* Copyright (C) 2014 GRNET S.A.
*
* 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 program is distrib... | grnet/snf-vmcatcher | src/test/scala/gr/grnet/egi/vmcatcher/ImageListConfigTest.scala | Scala | gpl-3.0 | 3,313 |
package spark
import akka.actor.ActorSystem
import spark.broadcast.BroadcastManager
import spark.debugger.ActorBasedEventReporter
import spark.debugger.EventReporter
import spark.debugger.NullEventReporter
import spark.network.ConnectionManager
import spark.storage.BlockManager
import spark.storage.BlockManagerMaster... | ankurdave/arthur | core/src/main/scala/spark/SparkEnv.scala | Scala | bsd-3-clause | 4,500 |
/*
* Copyright (C) 2016-2017 Lightbend Inc. <https://www.lightbend.com>
*/
package com.lightbend.lagom.internal.javadsl.broker.kafka
import com.google.inject.AbstractModule
class KafkaBrokerModule extends AbstractModule {
override def configure(): Unit = {
bind(classOf[JavadslRegisterTopicProducers]).asEager... | edouardKaiser/lagom | service/javadsl/kafka/server/src/main/scala/com/lightbend/lagom/internal/javadsl/broker/kafka/KafkaBrokerModule.scala | Scala | apache-2.0 | 339 |
/*
* 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 ... | akrabat/openwhisk | tests/src/test/scala/org/apache/openwhisk/core/database/azblob/AzureBlobAttachmentStoreITTests.scala | Scala | apache-2.0 | 1,211 |
package org.jetbrains.plugins.scala.failed.annotator
import org.jetbrains.plugins.scala.base.ScalaLightCodeInsightFixtureTestAdapter
/**
* @author Nikolay.Tropin
*/
class DefaultArgWithTypeArgsTest extends ScalaLightCodeInsightFixtureTestAdapter {
override def shouldPass: Boolean = false
def testSCL8688(): ... | JetBrains/intellij-scala | scala/scala-impl/test/org/jetbrains/plugins/scala/failed/annotator/DefaultArgWithTypeArgsTest.scala | Scala | apache-2.0 | 824 |
/*
* 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 not u... | sachintyagi22/spark | sql/core/src/main/scala/org/apache/spark/sql/Column.scala | Scala | apache-2.0 | 36,191 |
package fpinscala.monoids
import fpinscala.parallelism.Nonblocking._
import fpinscala.parallelism.Nonblocking.Par.toParOps // infix syntax for `Par.map`, `Par.flatMap`, etc
trait Monoid[A] {
def op(a1: A, a2: A): A
def zero: A
}
sealed trait WC
case class Stub(chars: String) extends WC
case class Part(lStub: Str... | enpassant/fpinscala | exercises/src/main/scala/fpinscala/monoids/Monoid.scala | Scala | mit | 6,760 |
package ee.cone.c4actor
import com.typesafe.scalalogging.LazyLogging
import ee.cone.c4actor.ConnProtocol.D_Node
import ee.cone.c4actor.Types.SrcId
import ee.cone.c4assemble.Types.{Each, Outs, Values}
import ee.cone.c4assemble._
import ee.cone.c4di.c4
import ee.cone.c4proto.{Id, protocol}
@protocol("ConnTestApp") obje... | conecenter/c4proto | base_examples/src/main/scala/ee/cone/c4actor/AssemblerConnectTest.scala | Scala | apache-2.0 | 3,411 |
/*
* 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 ... | graphframes/graphframes | src/main/scala/org/graphframes/lib/ParallelPersonalizedPageRank.scala | Scala | apache-2.0 | 4,664 |
package forcomp
object Anagrams {
/** A word is simply a `String`. */
type Word = String
/** A sentence is a `List` of words. */
type Sentence = List[Word]
/** `Occurrences` is a `List` of pairs of characters and positive integers saying
* how often the character appears.
* This list is sorted al... | relyah/CourseraFunctionalProgramming | resource/progfun-master/forcomp/src/main/scala/forcomp/Anagrams.scala | Scala | gpl-2.0 | 8,996 |
package pokestats
import com.github.racc.tscg.TypesafeConfigModule
import play.api.ApplicationLoader.Context
import play.api.inject.guice.{GuiceApplicationBuilder, GuiceApplicationLoader}
class CustomApplicationLoader extends GuiceApplicationLoader {
override protected def builder(context: Context): GuiceApp... | guilgaly/pokemon-stats | server/src/main/scala/pokestats/CustomApplicationLoader.scala | Scala | apache-2.0 | 548 |
/*
* Copyright 2012-2016 Steve Chaloner
*
* 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... | schaloner/deadbolt-2-scala | code/app/be/objectify/deadbolt/scala/filters/DeadboltFilterComponents.scala | Scala | apache-2.0 | 1,508 |
/**
* Copyright (C) 2013 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 prog... | brunobuzzi/orbeon-forms | xforms/jvm/src/test/scala/org/orbeon/oxf/client/fr/ClientCurrencyTest.scala | Scala | lgpl-2.1 | 1,576 |
package mesosphere.marathon.api.v2
import javax.inject.Inject
import javax.servlet.http.{ HttpServletRequest, HttpServletResponse }
import javax.ws.rs._
import javax.ws.rs.core.{ Context, MediaType, Response }
import com.codahale.metrics.annotation.Timed
import mesosphere.marathon.Protos.MarathonTask
import mesospher... | Kosta-Github/marathon | src/main/scala/mesosphere/marathon/api/v2/AppTasksResource.scala | Scala | apache-2.0 | 5,332 |
package dotty1.collections
package immutable
import annotation.unchecked.uncheckedVariance
// Like Iter2, but with non-variant types only.
object Iter2 {
trait Iterator[A] extends IterableOnce[A] {
def hasNext: Boolean
def next: A
def iterator = this
def foreach(f: A => Unit): Unit = ???
def ma... | VladimirNik/dotty | tests/pos/Iter3.scala | Scala | bsd-3-clause | 6,362 |
import java.io.File
import play.api._
import play.api.mvc.Results._
import com.typesafe.config.ConfigFactory
import mvc.{Result, RequestHeader}
object Global extends GlobalSettings {
override def onLoadConfig(config: Configuration, path: File, classloader: ClassLoader, mode: Mode.Mode): Configuration = {
val mod... | MoonGene/Analytics | src/moon/app/Global.scala | Scala | gpl-3.0 | 627 |
/*
* 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/catalyst/src/test/scala/org/apache/spark/sql/catalyst/statsEstimation/BasicStatsEstimationSuite.scala | Scala | apache-2.0 | 6,466 |
package fuel
import fuel.util.TRandom
import scala.annotation.tailrec
object Preamble {
/** Draws uniformly a single element from the sequence */
implicit class RndApply[T](s: Seq[T]) {
assert(s.nonEmpty)
def apply(rnd: TRandom) = s(rnd.nextInt(s.size))
// Note: with replacement!
def apply(rnd: TR... | iwob/fuel | src/main/scala/fuel/Preamble.scala | Scala | mit | 2,607 |
package models
import formats.CommonJsonFormats
import play.api.libs.json.Json
import scala.io
import scala.language.postfixOps
case class Shortlist(id: String, category: String)
object Shortlist extends CommonJsonFormats {
val shortlistJsonFile = "/shortlist/shortlist.json"
lazy val shortlists = {
val sho... | siz-io/siz-api | app/models/Shortlist.scala | Scala | isc | 623 |
/*
* 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 ... | jasonpet/openwhisk | tests/src/test/scala/org/apache/openwhisk/core/entity/test/ExecTests.scala | Scala | apache-2.0 | 11,278 |
/*
* Copyright 2016 HM Revenue & Customs
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or a... | ahudspith-equalexperts/ct-calculations | src/main/scala/uk/gov/hmrc/ct/ct600/v2/B64.scala | Scala | apache-2.0 | 941 |
/*
* Copyright 2016 The BigDL Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agr... | JerryYanWan/BigDL | spark/dl/src/test/scala/com/intel/analytics/bigdl/torch/TemporalConvolutionSpec.scala | Scala | apache-2.0 | 4,913 |
/* 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/data/FilterDatasetSuite.scala | Scala | apache-2.0 | 2,033 |
package eu.pepot.eu.spark.inputsplitter
import java.util.concurrent.{Executors, TimeUnit}
import eu.pepot.eu.spark.inputsplitter.common.config.Config
import eu.pepot.eu.spark.inputsplitter.common.file._
import eu.pepot.eu.spark.inputsplitter.common.file.matcher.FilesMatcher
import eu.pepot.eu.spark.inputsplitter.comm... | mauriciojost/spark-input-splitter | src/main/scala/eu/pepot/eu/spark/inputsplitter/SplitWriter.scala | Scala | apache-2.0 | 3,265 |
package hulk.http
import akka.http.scaladsl.model._
import akka.stream.ActorMaterializer
import akka.util.ByteString
import hulk.http.response.{ResponseFormat, HttpResponseBodyWriter, HttpResponseBody}
import scala.collection.immutable.Seq
import scala.concurrent.Future
import scala.concurrent.duration._
import scal... | reneweb/hulk | framework/src/main/scala/hulk/http/HulkHttpResponse.scala | Scala | apache-2.0 | 11,402 |
/*
* Copyright (c) 2013-2014 Telefónica Investigación y Desarrollo S.A.U.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unles... | telefonicaid/fiware-cosmos-platform | cosmos-api/app/es/tid/cosmos/api/auth/oauth2/AbstractOAuthProvider.scala | Scala | apache-2.0 | 2,808 |
package net.sansa_stack.query.spark.graph.jena.expression
import net.sansa_stack.query.spark.graph.jena.util.Result
import org.apache.jena.graph.Node
import org.apache.jena.sparql.expr._
/**
* Class that evaluate solution based on expression. Support expression with FILTER operators.
* @param e Expression of the fi... | SANSA-Stack/SANSA-RDF | sansa-query/sansa-query-spark/src/main/scala/net/sansa_stack/query/spark/graph/jena/expression/Compare.scala | Scala | apache-2.0 | 3,183 |
/*
Copyright 2013 Lance Gatlin
Author: [email protected]
This file is part of org.s_mach library.
org.s_mach library 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... | lancegatlin/s_mach.fsm | src/main/scala/org/s_mach/Transformer/package.scala | Scala | gpl-3.0 | 5,275 |
package sampler.cluster.abc.algorithm
import org.mockito.Matchers.anyObject
import org.mockito.Mockito.when
import org.scalatest.FreeSpec
import org.scalatest.Matchers
import org.scalatest.mock.MockitoSugar
import akka.event.LoggingAdapter
import sampler.cluster.abc.Scored
import sampler.cluster.abc.Weighted
import sa... | tsaratoon/Sampler | sampler-cluster/src/test/scala/sampler/cluster/abc/algorithm/AlgorithmComponentTest.scala | Scala | apache-2.0 | 9,225 |
package org.jetbrains.plugins.scala
package lang.types.existentialSimplification
import java.io.File
import com.intellij.openapi.util.io.FileUtil
import com.intellij.openapi.util.text.StringUtil
import com.intellij.openapi.vfs.{CharsetToolkit, LocalFileSystem}
import com.intellij.psi.util.PsiTreeUtil
import org.jetbr... | ilinum/intellij-scala | test/org/jetbrains/plugins/scala/lang/types/existentialSimplification/ExistentialSimplificationTestBase.scala | Scala | apache-2.0 | 3,316 |
package scala.build
import sbt._, Keys._
/** This object defines keys that should be visible with an unqualified name in all .sbt files and the command line */
object BuildSettings extends AutoPlugin {
override def trigger = allRequirements
object autoImport {
lazy val baseVersion = settingKey[String]("The b... | lrytz/scala | project/BuildSettings.scala | Scala | apache-2.0 | 819 |
/*
* Copyright (C) Lightbend Inc. <https://www.lightbend.com>
*/
package play.api.inject.guice
import akka.actor.ActorSystem
import akka.actor.ClassicActorSystemProvider
import com.google.inject.AbstractModule
import com.typesafe.config.Config
import org.specs2.mutable.Specification
import play.api.ApplicationLoade... | wegtam/playframework | core/play-guice/src/test/scala/play/api/inject/guice/GuiceApplicationLoaderSpec.scala | Scala | apache-2.0 | 4,763 |
package mesosphere.marathon
import akka.actor.ActorSystem
import akka.testkit.{ TestKit, TestProbe }
import mesosphere.marathon.Protos.MarathonTask
import mesosphere.marathon.health.HealthCheckManager
import mesosphere.marathon.state._
import mesosphere.marathon.tasks.{ OfferReviver, TaskQueue, TaskTracker }
import or... | spacejam/marathon | src/test/scala/mesosphere/marathon/SchedulerActionsTest.scala | Scala | apache-2.0 | 4,525 |
package org.apache.spark.ml.parity.feature
import org.apache.spark.ml.parity.SparkParityBase
import org.apache.spark.ml.feature.{MinMaxScaler, VectorAssembler}
import org.apache.spark.ml.{Pipeline, Transformer}
import org.apache.spark.sql.DataFrame
/**
* Created by hollinwilkins on 10/30/16.
*/
class MinMaxScaler... | combust-ml/mleap | mleap-spark/src/test/scala/org/apache/spark/ml/parity/feature/MinMaxScalerParitySpec.scala | Scala | apache-2.0 | 722 |
/**
* 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"); yo... | zzwlstarby/mykafka | core/src/main/scala/kafka/server/checkpoints/OffsetCheckpointFile.scala | Scala | apache-2.0 | 2,303 |
package com.rklaehn.interval
import org.scalacheck.Properties
import spire.implicits._
import spire.laws.LogicLaws
object IntervalSeqLogicLawsCheck extends Properties("IntervalSeq") with AddProperties {
val algebra = IntervalSeqAlgebra.booleanAlgebra[Long]
val arb = IntervalSeqArbitrary.arbitrary
addProperti... | non/intervalset | src/test/scala/com/rklaehn/interval/IntervalSeqLogicLawsCheck.scala | Scala | apache-2.0 | 377 |
package com.github.dronegator.nlp.utils
import scala.concurrent.duration.Duration
import scala.concurrent.{Await, Future, duration}, duration.Duration.Inf
object concurrent {
implicit class Zukunft[A](future: Future[A]) {
def await =
Await.result(future, Inf)
def await(atMost: Duration) =
... | dronegator/nlp | utils/src/main/scala/com/github/dronegator/nlp/concurrent.scala | Scala | apache-2.0 | 355 |
package com.example
import org.scalatest.FlatSpec
import spray.testkit.ScalatestRouteTest
import org.scalatest.matchers.ShouldMatchers
import spray.http.StatusCodes
class InlineHtmlTest extends FlatSpec with ScalatestRouteTest with ShouldMatchers with InlineHtml {
def actorRefFactory = system
behavior of "Inline... | shenbaise/mltoy | src/test/scala/com/example/InlineHtmlTest.scala | Scala | apache-2.0 | 560 |
/**
* Copyright (c) 2007-2011 Eric Torreborre <[email protected]>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation
* the rights to us... | stuhood/specs | src/main/scala/org/specs/form/SeqForm.scala | Scala | mit | 4,063 |
package lemastero.algorithms.trie
/**
* Ternary Search Trie implementation.
*
* Store characters and values in nodes.
* Each node has 3 children:
* smaller (lfet),
* equal (middle),
* larger (right)
*/
class TernarySearchTrie[Value] extends StringSymbolTable[Value] {
private val root = new Ter... | lemastero/algorithms | src/main/scala/lemastero/algorithms/trie/TernarySearchTrie.scala | Scala | mit | 2,148 |
package io.github.takayuky.fluent
package object refined
extends FluentEncoderRefinedInstances
| takayuky/TypesafeFluentLogger | refined/src/main/scala/io/github/takayuky/fluent/refined/package.scala | Scala | mit | 98 |
/*
* Copyright 2014-2021 Netflix, 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... | copperlight/atlas | atlas-jmh/src/main/scala/com/netflix/atlas/core/util/TimeWaveCalc.scala | Scala | apache-2.0 | 2,413 |
package org.scaladebugger.api.lowlevel.requests.properties.processors
import com.sun.jdi.request._
import org.scalamock.scalatest.MockFactory
import org.scalatest.{FunSpec, Matchers, ParallelTestExecution}
import org.scaladebugger.api.lowlevel.requests.properties.CustomProperty
import org.scaladebugger.test.helpers.Pa... | chipsenkbeil/scala-debugger | scala-debugger-api/src/test/scala/org/scaladebugger/api/lowlevel/requests/properties/processors/CustomPropertyProcessorSpec.scala | Scala | apache-2.0 | 992 |
/*
* 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... | jenniew/BigDL | spark/dl/src/test/scala/com/intel/analytics/bigdl/utils/tf/loaders/InvSpec.scala | Scala | apache-2.0 | 1,184 |
package com.bob.scala.webapi
import java.time.LocalDateTime
import com.bob.java.webapi.handler.MdcPropagatingOnScheduleAction
import com.bob.scala.webapi.controller.User
import com.bob.scala.webapi.utils.CodeInvoke
import com.fasterxml.jackson.databind.ObjectMapper
import org.springframework.beans.factory.annotation.... | sevenz/springboot-scala-withswagger | webapi/src/main/scala/com/bob/scala/webapi/ScalaApplication.scala | Scala | apache-2.0 | 2,683 |
package ch.uzh.ifi.pdeboer.pplib.hcomp.ballot.dao
import java.util.UUID
import ch.uzh.ifi.pdeboer.pplib.hcomp.ballot.persistence.{Answer, Permutation, Question}
import org.joda.time.DateTime
import scalikejdbc._
/**
* Created by mattia on 06.07.15.
*/
class BallotDAO extends DAO {
override def countAllAnswers()... | manuelroesch/PaperValidator | app/helper/questiongenerator/dao/BallotDAO.scala | Scala | mit | 10,073 |
package me.frmr.kafka.detective.matchfinder
import me.frmr.kafka.detective.api._
import org.scalatest._
class KeyEqualsFinderSpec extends FlatSpec with Matchers {
"KeyEqualsFinder" should "locate string matches in reference window" in new StringContext {
val result = new KeyEqualsFinder().find(testMessage, refe... | farmdawgnation/kafka-detective | api/src/test/scala/me/frmr/kafka/detective/matchfinder/KeyEqualsFinderSpec.scala | Scala | apache-2.0 | 2,933 |
/* __ *\\
** ________ ___ / / ___ __ ____ Scala.js Benchmarks **
** / __/ __// _ | / / / _ | __ / // __/ Adam Burmister **
** __\\ \\/ /__/ __ |/ /__/ __ |/_// /_\\ \\ 2012, Google, Inc **
** /____/\\___/... | cedricviaccoz/scala-native | benchmarks/src/main/scala/tracer/Shapes.scala | Scala | bsd-3-clause | 3,217 |
package com.sksamuel.elastic4s
import java.util
import com.sksamuel.elastic4s.ElasticDsl._
import com.sksamuel.elastic4s.mappings.FieldType._
import org.scalatest.{ WordSpec, Matchers }
import org.scalatest.mock.MockitoSugar
/** @author Stephen Samuel */
class MappingTest extends WordSpec with MockitoSugar with Elas... | alexander-svendsen/elastic4s | elastic4s-core/src/test/scala/com/sksamuel/elastic4s/MappingTest.scala | Scala | apache-2.0 | 3,122 |
package org.deepdive.extraction
import akka.actor._
import akka.routing._
import akka.pattern.{ask, pipe}
import akka.util.Timeout
import org.deepdive.settings._
import org.deepdive.Context
import org.deepdive.extraction._
import org.deepdive.extraction.ExtractorRunner._
import org.deepdive.extraction.datastore._
impo... | dennybritz/deepdive | src/main/scala/org/deepdive/extraction/ExtractorRunner.scala | Scala | apache-2.0 | 8,756 |
package com.github.mdr.mash.repl.browser.handler
import com.github.mdr.mash.input.InputAction
import com.github.mdr.mash.repl._
import com.github.mdr.mash.repl.browser.ObjectBrowserActions.{ PreviousPage, _ }
import com.github.mdr.mash.repl.browser.TextLinesBrowserState
trait TextLinesBrowserActionHandler {
self: O... | mdr/mash | src/main/scala/com/github/mdr/mash/repl/browser/handler/TextLinesBrowserActionHandler.scala | Scala | mit | 1,234 |
package binconcifartests
import chisel3._
import chisel3.iotesters.{PeekPokeTester, Driver, ChiselFlatSpec}
import scala.util.Random
import binconcifar.SSILayer
import scala.collection.mutable.ArrayBuffer
class SSILayerTests[T <: Bits]( c : SSILayer[T] ) extends PeekPokeTester( c ) {
val myRand = new Random
val t... | da-steve101/binary_connect_cifar | src/test/scala/SSILayerSuite.scala | Scala | gpl-3.0 | 2,342 |
package me.yingrui.segment.filter.disambiguation
import me.yingrui.segment.core.SegmentResult
import me.yingrui.segment.core.disambiguation.DisambiguationToSerialLabels._
import me.yingrui.segment.crf.CRFClassifier
import me.yingrui.segment.dict.POSUtil._
import me.yingrui.segment.tools.CorpusLoader._
import org.mocki... | yingrui/mahjong | lib-segment/src/test/scala/me/yingrui/segment/filter/disambiguation/CRFDisambiguationFilterTest.scala | Scala | gpl-3.0 | 3,358 |
/*
* Copyright 2018 Vladimir Konstantinov
*
* 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 ... | yet-another-cafebabe/korro | src/main/scala/com/github/illfaku/korro/internal/client/HttpChannelHandler.scala | Scala | lgpl-3.0 | 2,579 |
/*
* 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 ... | witgo/spark | core/src/main/scala/org/apache/spark/TestUtils.scala | Scala | apache-2.0 | 16,931 |
/*
* Copyright 2011-2019 Asakusa Framework Team.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable ... | ueshin/asakusafw-spark | compiler/src/main/scala/com/asakusafw/spark/compiler/util/NumPartitions.scala | Scala | apache-2.0 | 3,473 |
/*
* Copyright 2022 HM Revenue & Customs
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or a... | hmrc/help-to-save-frontend | test/uk/gov/hmrc/helptosavefrontend/controllers/AuthSupport.scala | Scala | apache-2.0 | 6,530 |
/*
* Copyright 2013 Stephan Rehfeld
*
* 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 ... | stephan-rehfeld/scaladelray | src/main/scala/scaladelray/ui/model/RegularSamplingPatternProvider.scala | Scala | apache-2.0 | 1,998 |
/*
* Copyright (c) 2014 - 2015 Contributor. All rights reserved.
*/
package org.scalaide.debug.internal.expression
package proxies.primitives
import org.scalaide.debug.internal.expression.Names.Java
import org.scalaide.debug.internal.expression.Names.Scala
import org.scalaide.debug.internal.expression.context.JdiCon... | Kwestor/scala-ide | org.scala-ide.sdt.debug.expression/src/org/scalaide/debug/internal/expression/proxies/primitives/DoubleJdiProxy.scala | Scala | bsd-3-clause | 895 |
/*
*************************************************************************************
* Copyright 2011 Normation SAS
*************************************************************************************
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero Ge... | fanf/cf-clerk | src/test/scala/com/normation/cfclerk/services/DummyPolicyTranslator.scala | Scala | agpl-3.0 | 2,453 |
/*
* 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 ... | zimmermatt/flink | flink-mesos/src/main/scala/org/apache/flink/mesos/runtime/clusterframework/MesosTaskManager.scala | Scala | apache-2.0 | 2,408 |
package com.aidan.chapter4
import org.scalatest.FunSuite
import org.junit.runner.RunWith
import org.scalatest.junit.JUnitRunner
@RunWith(classOf[JUnitRunner])
class Chapter4Test extends FunSuite {
import com.aidan.chapter4.Chapter4._
test("get discount") {
val gizmos = Map("GPS" -> 10.00, "Dinghy" -> 10000.... | aidanwhiteley/scala_impatient | src/test/scala/com/aidan/chapter4/Chapter4Test.scala | Scala | apache-2.0 | 2,664 |
package org.dsa.core.prepare
/**
* Created by xubo on 2016/12/27.
*/
object FindByLength {
def main(args: Array[String]) {
val result=FindLocal.findSequnceByLength(args(0),args(1).toInt)
println("result")
println(result)
}
}
| xubo245/CloudSW | src/main/scala/org/dsa/core/prepare/FindByLength.scala | Scala | gpl-2.0 | 247 |
/**
* Created by rzeznik on 14.11.15.
*/
object Ranks extends Enumeration(2) {
type Rank = Value
val `2` = Value("2")
val `3` = Value("3")
val `4` = Value("4")
val `5` = Value("5")
val `6` = Value("6")
val `7` = Value("7")
val `8` = Value("8")
val `9` = Value("9")
val `10` = Value("10")
val Ja... | marcin-rzeznicki/Wonderland-Scala-Katas | CardGameWar/src/main/scala/Ranks.scala | Scala | epl-1.0 | 451 |
/*
* 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/test/scala/com/waz/service/UserSearchServiceSpec.scala | Scala | gpl-3.0 | 25,069 |
/*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distribute... | wvlet/airframe | airframe-http-codegen/src/main/scala/wvlet/airframe/http/codegen/RouteScanner.scala | Scala | apache-2.0 | 3,282 |
package pep_095
import common.LongOps
import scala.collection.mutable
object Wip {
val MAX = 1000000
object Attempt1 {
def solve(): String = {
// val a: Seq[(ChainLength, Long)] = (1 to MAX).map(a => (aaa(a), a * -1))
// val b: (ChainLength, Long) = a.max
// val c: Long = b.... | filippovitale/pe | pe-solution/src/main/scala/pep_095/Wip.scala | Scala | mit | 2,179 |
package com.airbnb.aerosolve.training
import com.airbnb.aerosolve.core.{FeatureVector, Example, FunctionForm}
import com.airbnb.aerosolve.core.models.MlpModel
import com.airbnb.aerosolve.core.util.FloatVector
import com.airbnb.aerosolve.core.util.Util
import com.typesafe.config.Config
import org.slf4j.{LoggerFactory,... | ralic/aerosolve | training/src/main/scala/com/airbnb/aerosolve/training/MlpModelTrainer.scala | Scala | apache-2.0 | 19,172 |
package org.jetbrains.sbt
package project.module
import java.awt.event.ActionEvent
import java.util.Collections
import com.intellij.openapi.project.Project
import com.intellij.openapi.roots.ui.configuration.{ModuleConfigurationState, ModuleElementsEditor}
import com.intellij.ui.CollectionListModel
import com.intellij... | JetBrains/intellij-scala | scala/scala-impl/src/org/jetbrains/sbt/project/module/SbtModuleSettingsEditor.scala | Scala | apache-2.0 | 4,576 |
/*
* Copyright (C) 2005, The Beangle Software.
*
* 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 your option) any later version.
*
* This... | beangle/commons | core/src/test/scala/org/beangle/commons/bean/PropertiesTest.scala | Scala | lgpl-3.0 | 3,433 |
package org.shapelogic.sc.polygon
/**
*
* @author Sami Badawi
*
*/
object PolygonFactory {
def createSameType(poygon: Polygon): Polygon = {
if (poygon.isInstanceOf[MultiLinePolygon]) {
new MultiLinePolygon(null)
} else if (poygon.isInstanceOf[Polygon]) {
new Polygon(null)
} else
nu... | sami-badawi/shapelogic-scala | src/test/scala/org/shapelogic/sc/polygon/PolygonFactory.scala | Scala | mit | 329 |
/*
* Copyright 2022 HM Revenue & Customs
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or a... | hmrc/self-assessment-api | test/mocks/config/MockAppConfig.scala | Scala | apache-2.0 | 2,498 |
package controllers
import play.api._
import play.api.mvc._
import java.util.Date._
import play.api.i18n._
import play.api.data.Form
import play.api.data.Forms._
import play.api.data.validation.Constraints._
import play.api.libs.json.Json
import java.util.Date
import scala.concurrent.{ ExecutionContext, Future }
impo... | gavinbaumanis/scribble | app/controllers/Application.scala | Scala | apache-2.0 | 2,353 |
package org.intracer.wmua.cmd
import org.intracer.wmua.{ContestJury, Image, JuryTestHelpers}
import org.scalawiki.dto.{Namespace, Page}
import org.scalawiki.query.SinglePageQuery
import org.specs2.concurrent.ExecutionEnv
import org.specs2.mock.Mockito
import org.specs2.mutable.Specification
import scala.concurrent.Fu... | intracer/wlxjury | test/org/intracer/wmua/cmd/FetchImageInfoSpec.scala | Scala | apache-2.0 | 2,628 |
package com.twitter.finagle.memcached.integration
import com.twitter.finagle.Service
import com.twitter.finagle.builder.ClientBuilder
import com.twitter.finagle.memcached.protocol._
import com.twitter.finagle.memcached.protocol.text.Memcached
import com.twitter.finagle.memcached.util.ChannelBufferUtils._
import com.tw... | lukiano/finagle | finagle-memcached/src/test/scala/com/twitter/finagle/memcached/integration/InterpreterServiceTest.scala | Scala | apache-2.0 | 1,612 |
/**
* 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... | orbeon/orbeon-forms | xforms-runtime/shared/src/main/scala/org/orbeon/oxf/xforms/event/events/XFormsUIEvent.scala | Scala | lgpl-2.1 | 3,125 |
/***********************************************************************
* Copyright (c) 2013-2018 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... | ddseapy/geomesa | geomesa-kudu/geomesa-kudu-spark-runtime/src/main/scala/org/locationtech/geomesa/ScalaDocs.scala | Scala | apache-2.0 | 624 |
package org.jetbrains.sbt
package project.data
import com.intellij.openapi.externalSystem.model.{ProjectKeys, Key, ProjectSystemId}
import com.intellij.openapi.externalSystem.model.project.AbstractExternalEntityData
/**
* @author Pavel Fatin
*/
class ScalaFacetData(val owner: ProjectSystemId,
v... | consulo/consulo-scala | SBT/src/main/scala/org/jetbrains/sbt/project/data/ScalaFacetData.scala | Scala | apache-2.0 | 702 |
package com.github.gdefacci.briscola.web
package modules
import org.obl.raz.Api._
import org.obl.raz.UriTemplate
import com.github.gdefacci.briscola.player.PlayerId
import com.github.gdefacci.briscola.game.GameId
import com.github.gdefacci.briscola.competition.CompetitionId
import javax.inject.Singleton
import com.gi... | gdefacci/briscola | ddd-briscola-web/src/main/scala/com/github/gdefacci/briscola/web/modules/RoutesModule.scala | Scala | bsd-3-clause | 2,325 |
package au.id.cxd.math.probability.discrete
import au.id.cxd.math.count.Choose
/**
* ##import MathJax
*
* Created by cd on 7/09/2014.
*
* Hyper geometric
*
*
* The Hypergeometric (class name HyperGeometric) distribution represents the probability of choosing $y$ number of events of the same kind
* f... | cxd/scala-au.id.cxd.math | math/src/main/scala/au/id/cxd/math/probability/discrete/HyperGeometric.scala | Scala | mit | 1,766 |
/*
* Copyright (C) 2009-2017 Lightbend Inc. <https://www.lightbend.com>
*/
package play.api
import java.io._
import java.util.Properties
import java.util.concurrent.TimeUnit
import com.typesafe.config._
import com.typesafe.config.impl.ConfigImpl
import play.utils.PlayIO
import scala.collection.JavaConverters._
imp... | Shruti9520/playframework | framework/src/play/src/main/scala/play/api/Configuration.scala | Scala | apache-2.0 | 39,028 |
/*
* Scala (https://www.scala-lang.org)
*
* Copyright EPFL and Lightbend, Inc.
*
* Licensed under Apache License 2.0
* (http://www.apache.org/licenses/LICENSE-2.0).
*
* See the NOTICE file distributed with this work for
* additional information regarding copyright ownership.
*/
package scala
package collecti... | lrytz/scala | src/library/scala/collection/immutable/TreeMap.scala | Scala | apache-2.0 | 13,808 |
import com.typesafe.sbt.osgi.OsgiKeys._
import sbt.Keys._
import sbt._
import blended.sbt.Dependencies
object BlendedSecurityLoginImpl extends ProjectFactory {
private[this] val helper = new ProjectSettings(
projectName = "blended.security.login.impl",
description = "Implementation of the Login backend.",
... | lefou/blended | project/BlendedSecurityLoginImpl.scala | Scala | apache-2.0 | 1,253 |
package com.github.tarao
package slickjdbc
package helper
trait TraitSingletonBehavior { self: UnitSpec =>
import scala.reflect.Manifest
import java.lang.Class
def signatures[T](clazz: Class[T]): Set[String] =
clazz.getDeclaredMethods.map { x =>
x.getReturnType.toString + " " + x.getName +
"("... | tarao/slick-jdbc-extension-scala | src/test/scala/com/github/tarao/slickjdbc/helper/TraitSingletonBehavior.scala | Scala | mit | 921 |
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.