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 test
import org.scalatest._
import scala.concurrent._
import scala.concurrent.duration._
import scala.concurrent.ExecutionContext.Implicits.global
import transport.tyrus._
import transport._
class TestClient extends FlatSpec with Matchers {
"WebSocketClient" should "speak with echo server" in {
val... | OlivierBlanvillain/scalajs-transport | transport/test/src/test/scala/TestClient.scala | Scala | mit | 756 |
package com.michalplachta.shoesorter.api
import akka.actor.{Props, ActorSystem}
import akka.cluster.sharding.{ClusterSharding, ClusterShardingSettings}
import com.michalplachta.shoesorter.SortingDecider
import com.typesafe.config.ConfigFactory
object ShardedApp extends App {
val config = ConfigFactory.load("sharded... | miciek/akka-sharding-example | src/main/scala/com/michalplachta/shoesorter/api/ShardedApp.scala | Scala | mit | 841 |
package zzb.domain.directive
import akka.actor.{ActorSystem, Props}
import akka.util.Timeout
import org.scalatest.{BeforeAndAfterAll, MustMatchers, WordSpec}
import spray.util._
import zzb.rest._
import scala.concurrent.duration._
/**
* Created by Simon on 2014/3/25
*/
class AuthorizeDirectivesTest extends WordSpe... | stepover/zzb | zzb-domain/src/test/scala/zzb/domain/directive/AuthorizeDirectivesTest.scala | Scala | mit | 1,516 |
package com.versal.fireotter
object `package` {
def resource(name: String): String = getClass.getClassLoader.getResource(name).getPath
def csv(path: String): Traversable[Seq[String]] = new Traversable[Seq[String]] {
import java.io.{BufferedReader, InputStreamReader, FileInputStream}
override def fore... | Versal/fireotter | src/main/scala/fireotter.scala | Scala | bsd-2-clause | 1,645 |
package monocle
import monocle.macros.{GenLens, Lenses, PLenses}
import shapeless.test.illTyped
class LensMonoExample extends MonocleSuite {
// @Lenses generate Lens automatically in the companion object
@Lenses case class Address(streetNumber: Int, streetName: String)
@Lenses case class Person(name: String, ag... | julien-truffaut/Monocle | example/src/test/scala/monocle/LensExample.scala | Scala | mit | 4,322 |
package com.mesosphere.universe.v2.model
case class Assets(
uris: Option[Map[String, String]], // GitHub issue #58
container: Option[Container]
)
| movicha/cosmos | cosmos-model/src/main/scala/com/mesosphere/universe/v2/model/Assets.scala | Scala | apache-2.0 | 151 |
package com.shekhargulati.medium
import com.shekhargulati.medium.domainObjects.PostRequest
import okhttp3.mockwebserver.{MockResponse, MockWebServer}
import org.scalatest.{BeforeAndAfterEach, FunSpec, Matchers}
class MediumClientSpec extends FunSpec with Matchers with BeforeAndAfterEach {
var server: MockWebServe... | shekhargulati/medium-scala-sdk | src/test/scala/com/shekhargulati/medium/MediumClientSpec.scala | Scala | apache-2.0 | 14,052 |
/*
* 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 ... | rednaxelafx/apache-spark | sql/core/src/test/scala/org/apache/spark/sql/streaming/FileStreamSourceSuite.scala | Scala | apache-2.0 | 83,050 |
/*
* 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-reactive/shared/src/test/scala/monix/reactive/internal/operators/SwitchIfEmptySuite.scala | Scala | apache-2.0 | 1,859 |
/*
* 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 ... | ashigeru/asakusafw-spark | extensions/iterativebatch/compiler/core/src/main/scala/com/asakusafw/spark/extensions/iterativebatch/compiler/graph/AggregateCompiler.scala | Scala | apache-2.0 | 3,548 |
package utils
/**
*
*/
package object stats {
def mean[T](item:Traversable[T])(implicit n:Numeric[T]) = {
n.toDouble(item.sum) / item.size.toDouble
}
def variance[T](items:Traversable[T])(implicit n:Numeric[T]) : Double = {
val itemMean = mean(items)
val count = items.size
val sumOfSquares = i... | Connexity/hannibal | app/utils/stats/package.scala | Scala | apache-2.0 | 1,341 |
/*
* Copyright (C) 2010 Romain Reuillon
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This progra... | openmole/openmole | openmole/plugins/org.openmole.plugin.environment.egi/src/main/scala/org/openmole/plugin/environment/egi/EGIEnvironment.scala | Scala | agpl-3.0 | 17,293 |
/**
* Copyright © 2016-2020 Lightbend, 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 ... | lightbend-training/course-management-tools | course-templates/scala3-cmt-template-no-common/project/CompileOptions.scala | Scala | apache-2.0 | 856 |
package controllers
import play.api.mvc._
import play.api.libs.json._
import play.api.libs.json.Json._
import play.api.data._
import play.api.data.Forms._
import play.api.data.validation.Constraints._
import common._
import dao._
import model._
import JsonFormatHelpers._
import authentication.{SecureSocialSecurity, A... | mikegirkin/papersheet | src/app/controllers/EntryController.scala | Scala | mit | 2,066 |
/*
* 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 ... | techaddict/spark | core/src/main/scala/org/apache/spark/deploy/master/ApplicationInfo.scala | Scala | apache-2.0 | 4,340 |
/*
* Copyright (c) 2011-18 Miles Sabin
*
* 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... | milessabin/shapeless | core/src/main/scala/shapeless/typeable.scala | Scala | apache-2.0 | 17,569 |
/*
* 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 ... | ajbozarth/incubator-livy | server/src/test/scala/org/apache/livy/server/ApiVersioningSupportSpec.scala | Scala | apache-2.0 | 4,767 |
package com.example
case class Context(app: String, args: Array[String])
| reid-spencer/twirl-import | src/main/scala/com/example/Context.scala | Scala | unlicense | 74 |
package com.sk.app.proxmock
/**
* Created by Szymon on 17.05.2016.
*/
package object console {
type UnaryOperation = (String, Array[String]) => Unit
type Operation = (Array[String]) => Unit
}
| szymonkudzia/proxmock | sources/src/main/scala/com/sk/app/proxmock/console/package.scala | Scala | mit | 199 |
/*
* Copyright (c) 2015, Nightfall Group
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of conditions a... | Nightfall/Instrumentality | core/src/main/scala/moe/nightfall/instrumentality/editor/gui/PoseEditParamsElement.scala | Scala | bsd-2-clause | 3,258 |
/**
* 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... | asteris-llc/kafka | src/scala/ly/stealth/mesos/kafka/Cluster.scala | Scala | apache-2.0 | 3,839 |
/**
* This file is part of mycollab-services.
*
* mycollab-services 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.
*
* mycolla... | uniteddiversity/mycollab | mycollab-services/src/main/scala/com/esofthead/mycollab/eventmanager/ApplicationEvent.scala | Scala | agpl-3.0 | 1,173 |
package sbt
package plugins
import Def.Setting
import Keys._
import librarymanagement._
/**
* An experimental plugin that adds the ability for Giter8 templates to be resolved
*/
object Giter8TemplatePlugin extends AutoPlugin {
override def requires = CorePlugin
override def trigger = allRequirements
override... | Duhemm/sbt | main/src/main/scala/sbt/plugins/Giter8ResolverPlugin.scala | Scala | bsd-3-clause | 620 |
package breeze.math
import org.scalacheck.{Arbitrary, Prop}
import org.scalatest.FunSuite
import org.scalatest.prop.Checkers
/**
*
* @author dlwh
*/
trait MutableModuleTestBase[V, S] extends FunSuite with Checkers {
implicit val space: MutableModule[V, S]
import space._
implicit def genTriple: Arbitrary[... | wstcpyt/breeze | math/src/test/scala/breeze/math/MutableModuleTestBase.scala | Scala | apache-2.0 | 4,573 |
package com.aerospike.spark
import org.scalatest.FlatSpec
import org.scalatest.Matchers
import com.aerospike.client.AerospikeClient
import com.aerospike.client.Bin
import com.aerospike.client.Key
import com.aerospike.client.policy.WritePolicy
import com.aerospike.spark.sql.AerospikeConnection
class AeroSparkDatasetF... | xiaotiejiang888/scalamongoas | src/test/scala/com/aerospike/spark/AeroSparkDatasetFunctionsSpec.scala | Scala | apache-2.0 | 5,289 |
class t8583 {
case class A( value: Double ) {
def *( o: A ) = A( value * o.value )
}
implicit def doubleToA( d: Double ) = A( d )
implicit def listToA( in: List[A] ): A = in.head
val result: A = List( A( 1 ) ) map { 2.0 * _ } //this line causes the compiler to crash
}
| martijnhoekstra/scala | test/files/pos/t8583.scala | Scala | apache-2.0 | 286 |
package org.scalaide.debug.internal
import org.eclipse.debug.core.sourcelookup.AbstractSourceLookupParticipant
import org.scalaide.debug.internal.model.ScalaStackFrame
import org.scalaide.debug.internal.async.AsyncStackFrame
/**
* SourceLookupParticipant providing a source names when using the
* Scala debugger
*/
... | dragos/scala-ide | org.scala-ide.sdt.debug/src/org/scalaide/debug/internal/ScalaSourceLookupParticipant.scala | Scala | bsd-3-clause | 636 |
package com.programmaticallyspeaking.ncd.nashorn
import com.programmaticallyspeaking.ncd.testing.UnitTest
import org.scalatest.prop.TableDrivenPropertyChecks
class VMVersionTest extends UnitTest with TableDrivenPropertyChecks {
"VMVersion" - {
"parse" - {
val cases = Table(
("desc", "input", "ex... | provegard/ncdbg | src/test/scala/com/programmaticallyspeaking/ncd/nashorn/VMVersionTest.scala | Scala | bsd-3-clause | 2,081 |
package lila.simul
import chess.variant.Variant
import lila.game.PerfPicker
import lila.rating.Perf
import lila.user.{ User, Perfs }
private[simul] case class SimulPlayer(
user: String,
variant: Variant,
rating: Int,
provisional: Option[Boolean]) {
def is(userId: String): Boolean = user == userId
... | clarkerubber/lila | modules/simul/src/main/SimulPlayer.scala | Scala | agpl-3.0 | 949 |
/*
* =========================================================================================
* Copyright © 2015 the khronus project <https://github.com/hotels-tech/khronus>
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You m... | despegar/khronus | khronus-core/src/main/scala/com/searchlight/khronus/model/Version.scala | Scala | apache-2.0 | 916 |
trait T extends Any {
def foo = 1
type X
}
class C1(val a: Any) extends AnyVal with T {
override def foo = super[T].foo // error
}
class C2(val a: Int) extends AnyVal with T {
override def foo = super.foo + a // okay
}
class C3(val a: Int) extends AnyVal with T {
override def foo = C3.super.foo + a // okay... | felixmulder/scala | test/files/neg/t6483.scala | Scala | bsd-3-clause | 538 |
/*
* The MIT License (MIT)
*
* Copyright (c) 2015 Iat Chong Chan
*
* 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... | ET-Chan/th4j | src/main/scala/th4j/func/TensorCopyFunc.scala | Scala | mit | 1,943 |
package controllers.authentication
import javax.inject.Inject
import com.mohiva.play.silhouette.api.{ Environment, LogoutEvent, Silhouette }
import com.mohiva.play.silhouette.impl.authenticators.JWTAuthenticator
import com.mohiva.play.silhouette.impl.providers.SocialProviderRegistry
import models.tenant.AuthCrewUser
... | thomastoye/speelsysteem | app/controllers/authentication/JWTCredentialsTestController.scala | Scala | gpl-2.0 | 1,059 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | BryanCutler/spark | sql/core/src/main/scala/org/apache/spark/sql/Dataset.scala | Scala | apache-2.0 | 135,668 |
package models
case class Child(id: Option[Long], firstName: String, lastName: String, birthDate: Long, educationLevel: Option[EducationLevel])
case class Profile(user: SecureUser, person: Option[Person], roles: List[Role])
| silbermm/proximal | app/models/JsonModels.scala | Scala | apache-2.0 | 227 |
/**
* Copyright (c) 2013, The National Archives <digitalpreservation@nationalarchives.gov.uk>
* http://www.nationalarchives.gov.uk
*
* 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://mozi... | digital-preservation/dali | src/main/scala/uk/gov/tna/dri/preingest/loader/auth/RememberMeStrategy.scala | Scala | mpl-2.0 | 2,072 |
package net.hearthstats.ui.deckoverlay
import java.awt.{ BorderLayout, Dimension }
import javax.swing.{ JFrame, JLabel, WindowConstants }
import javax.swing.Box.createVerticalBox
import net.hearthstats.config.{ Environment, RectangleConfig }
import net.hearthstats.config.UserConfig.configToValue
import net.hearthstat... | HearthStats/HearthStats.net-Uploader | companion/src/main/scala/net/hearthstats/ui/deckoverlay/DeckOverlaySwing.scala | Scala | bsd-3-clause | 3,930 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | sgururajshetty/carbondata | integration/spark2/src/main/scala/org/apache/spark/sql/execution/strategy/CarbonLateDecodeStrategy.scala | Scala | apache-2.0 | 30,774 |
package io.mpjsons
import io.mpjsons.impl.deserializer.BeanDeserializer
import io.mpjsons.impl.serializer.BeanSerializer
import io.mpjsons.impl.util.{Context, TypesUtil}
import io.mpjsons.impl.{DeserializerFactory, SerializerFactory, StringIterator}
import org.scalatest.{FlatSpec, MustMatchers}
import scala.reflect.r... | marpiec/mpjsons | src/test/scala/io/mpjsons/CustomConverterSupportSpec.scala | Scala | apache-2.0 | 3,327 |
package net.bmjames.opts.types
import net.bmjames.opts.helpdoc.Chunk
import scalaz.Functor
import scalaz.syntax.functor._
/** A single option of a parser.
*/
final case class Opt[A](main: OptReader[A], props: OptProperties)
/** Specification for an individual parser option.
*/
final case class OptProperties(vis... | bmjames/scala-optparse-applicative | src/main/scala/net/bmjames/opts/types/Opt.scala | Scala | bsd-3-clause | 1,397 |
package java.nio.file
import java.net.URI
// obtained interface by experimentation on the JDK.
trait Path {
def isAbsolute: Boolean
def getRoot: Path
def getFileName: Path
def getParent: Path
def getNameCount: Int
def getName(index: Int): Path
def subpath(beginIndex: Int, endIndex: Int): Path
def star... | MasseGuillaume/scalameta | scalameta/io/js/src/main/scala/java/nio/file/Path.scala | Scala | bsd-3-clause | 749 |
/*
* 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 ... | aosagie/spark | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/encoders/RowEncoder.scala | Scala | apache-2.0 | 12,484 |
package scala.meta
import scala.tools.nsc.{Global => ScalaGlobal}
import scala.meta.semantic.{Context => ScalametaSemanticContext}
import scala.meta.internal.hosts.scalac.contexts.{SemanticContext => ScalahostSemanticContext}
import scala.reflect.macros.contexts.{Context => ScalareflectMacroContext}
import scala.meta.... | mdemarne/scalahost | interface/src/main/scala/scala/meta/Scalahost.scala | Scala | bsd-3-clause | 1,490 |
/* NSC -- new Scala compiler
* Copyright 2005-2013 LAMP/EPFL
* @author Paul Phillips
*/
package scala.tools.nsc
package interpreter
import scala.language.implicitConversions
/** Files having to do with the state of a repl session:
* lines of text entered, types and terms defined, etc.
*/
package object session ... | felixmulder/scala | src/repl/scala/tools/nsc/interpreter/session/package.scala | Scala | bsd-3-clause | 519 |
package com.jgibbons.romannumerals
import org.scalatest.FlatSpec
import scala.collection.immutable.HashMap
class RomanNumeralsSpec extends FlatSpec {
behavior of "RomanNumerals"
it should "Convert Properly" in {
val mapped = HashMap[Int, String](
1 -> "I", 2 -> "II", 3 -> "III", 4 -> "IV", ... | PendaRed/roman-numerals | src/test/scala/com/jgibbons/romannumerals/RomanNumeralsSpec.scala | Scala | mit | 2,074 |
/*
* 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... | brharrington/atlas | atlas-akka/src/test/scala/com/netflix/atlas/akka/ConnectionContextFactorySuite.scala | Scala | apache-2.0 | 2,418 |
/*
* Copyright (c) 2013
*/
package com.github.kompot.play2sec.authentication.providers
import com.github.kompot.play2sec.authentication.providers.password.DefaultUsernamePasswordAuthUser
class MyLoginUsernamePasswordAuthUser(clearPassword: String, email: String,
expiration: Long) extends DefaultUsernamePasswor... | kompot/play2sec | test/com/github/kompot/play2sec/authentication/providers/MyLoginUsernamePasswordAuthUser.scala | Scala | apache-2.0 | 526 |
/*
* 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/main/scala/org/apache/spark/sql/store/StoreHashFunction.scala | Scala | apache-2.0 | 8,498 |
package com.twitter.concurrent
import com.twitter.conversions.DurationOps._
import com.twitter.util.{Await, Future, MockTimer, Promise, Return, Time}
import org.mockito.Mockito._
import org.scalatestplus.mockito.MockitoSugar
import org.scalatest.wordspec.AnyWordSpec
import scala.collection.compat.immutable.LazyList
im... | twitter/util | util-core/src/test/scala/com/twitter/concurrent/OfferTest.scala | Scala | apache-2.0 | 11,250 |
package uk.ac.surrey.xw.chooser
import java.awt.BorderLayout.CENTER
import java.awt.event.ItemEvent.SELECTED
import org.nlogo.api.LogoList
import org.nlogo.api.LogoList.toIterator
import org.nlogo.api.Nobody
import org.nlogo.window.GUIWorkspace
import javax.swing.JComboBox
import uk.ac.surrey.xw.api.LabeledPanelWidg... | qiemem/eXtraWidgets | xw/widgets/ChooserWidget/src/main/scala/uk/ac/surrey/xw/chooser/Chooser.scala | Scala | mit | 1,907 |
package p1tt187.doc2text.extractor
/**
* @author fabian
* on 07.11.15.
*/
trait TExtractor {
def getText:String
def close:Unit
}
| P1tt187/doc2txt | src/main/scala/p1tt187/doc2text/extractor/TExtractor.scala | Scala | apache-2.0 | 152 |
/*
* Copyright 2021 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/JsonPath.scala | Scala | apache-2.0 | 3,007 |
package com.wavesplatform.transaction.validation.impl
import cats.data.ValidatedNel
import com.wavesplatform.lang.ValidationError
import com.wavesplatform.transaction.TxValidationError.{GenericError, OrderValidationError}
import com.wavesplatform.transaction.TxVersion
import com.wavesplatform.transaction.assets.exchan... | wavesplatform/Waves | node/src/main/scala/com/wavesplatform/transaction/validation/impl/ExchangeTxValidator.scala | Scala | mit | 2,346 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | ueshin/apache-spark | sql/core/src/main/scala/org/apache/spark/sql/execution/adaptive/OptimizeSkewInRebalancePartitions.scala | Scala | apache-2.0 | 4,271 |
/* _____ _
* | ___| __ __ _ _ __ ___ (_) __ _ _ __
* | |_ | '__/ _` | '_ ` _ \\| |/ _` | '_ \\
* | _|| | | (_| | | | | | | | (_| | | | |
* |_| |_| \\__,_|_| |_| |_|_|\\__,_|_| |_|
*
* Copyright 2014 Pellucid Analytics
*
* Licensed under the Apache License, Version 2.0 (the "License");
*... | codeaudit/framian | framian/src/main/scala/framian/ColumnTyper.scala | Scala | apache-2.0 | 2,887 |
package com.github.agourlay.cornichon.matchers
import com.github.agourlay.cornichon.core.CornichonError
import com.github.agourlay.cornichon.matchers.MatcherParser._
import org.parboiled2._
import scala.util.{ Failure, Success }
class MatcherParser(val input: ParserInput) extends Parser {
def matchersRule = rule ... | agourlay/cornichon | cornichon-core/src/main/scala/com/github/agourlay/cornichon/matchers/MatcherParser.scala | Scala | apache-2.0 | 1,873 |
package com.github.skozlov.turing
object CellState extends Enumeration {
type CellState = Value
val `0` = Value("0")
val `1` = Value("1")
val Zero = `0`
val One = `1`
} | skozlov/turing | base/src/main/scala/com/github/skozlov/turing/CellState.scala | Scala | apache-2.0 | 176 |
package org.apache.spark.metrics
import com.codahale.metrics
import org.apache.spark.SparkEnv
import org.apache.spark.metrics.source.Source
/** This class is a Source implementation for Cassandra Connector related Codahale metrics. It is
* automatically instantiated and registered by Spark metrics system if this so... | nvoron23/spark-cassandra-connector | spark-cassandra-connector/src/main/scala/org/apache/spark/metrics/CassandraConnectorSource.scala | Scala | apache-2.0 | 4,786 |
package scala.collection.immutable
import org.junit.Assert.assertEquals
import org.junit.Test
import scala.tools.testkit.AllocationTest
import scala.util.hashing.MurmurHash3
class MapHashcodeTest extends AllocationTest {
@Test def nonAllocatingMapN(): Unit = {
val t0 = Map.empty
val t1 = new Map.Map1(1, ... | scala/scala | test/junit/scala/collection/immutable/MapHashcodeTest.scala | Scala | apache-2.0 | 5,876 |
package com.sksamuel.scapegoat
import java.io.{File, FileNotFoundException}
import java.net.URL
import java.nio.charset.StandardCharsets
import java.nio.file.Files
import scala.tools.nsc.Settings
import scala.tools.nsc.reporters.ConsoleReporter
/**
* @author
* Stephen Samuel
*/
trait PluginRunner {
val scala... | sksamuel/scapegoat | src/test/scala/com/sksamuel/scapegoat/PluginRunner.scala | Scala | apache-2.0 | 3,417 |
/*
* Copyright 2017 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... | liquidarmour/ct-calculations | src/test/scala/uk/gov/hmrc/ct/computations/CP286Spec.scala | Scala | apache-2.0 | 4,843 |
/***********************************************************************
* 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-tools/src/main/scala/org/locationtech/geomesa/fs/tools/compact/PartitionInputFormat.scala | Scala | apache-2.0 | 6,724 |
/*
* 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 ... | davidzchen/samza | samza-core/src/test/scala/org/apache/samza/metrics/TestJmxServer.scala | Scala | apache-2.0 | 1,945 |
/*
* Copyright (C) 2014 LAMP/EPFL
* Copyright (C) 2014 Typesafe Inc. <http://www.typesafe.com>
*/
package selfassembly.examples.pickling
package object shareEverything {
implicit object ShareEverything extends refs.ShareEverything
}
package object shareNothing {
implicit object ShareNothing extends refs.ShareN... | phaller/selfassembly | src/main/scala/selfassembly/examples/pickling/refs/package.scala | Scala | bsd-3-clause | 610 |
/*
* 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... | CodeSmell/stream-reactor | kafka-connect-mqtt/src/main/scala/com/datamountaineer/streamreactor/connect/mqtt/sink/MqttSinkConnector.scala | Scala | apache-2.0 | 2,204 |
/*
* 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 ... | cin/spark | sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetQuerySuite.scala | Scala | apache-2.0 | 32,522 |
package scalydomain.core
import scala.collection._
import scala.util.Random
import scala.util.control.Breaks._
import java.io.File
import java.security.MessageDigest
import java.util.concurrent.atomic._
import org.msgpack.annotation.{Message, Ignore}
import org.msgpack.ScalaMessagePack
import org.iq80.leveldb.{Opti... | anelson/scalydomain | core/src/main/scala/ModelDb.scala | Scala | apache-2.0 | 932 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | zzcclp/carbondata | integration/spark/src/test/scala/org/apache/carbondata/spark/testsuite/badrecordloger/BadRecordLoggerTest.scala | Scala | apache-2.0 | 12,736 |
/*
Copyright 2014 Twitter, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distr... | sriramkrishnan/scalding | scalding-core/src/main/scala/com/twitter/scalding/typed/NoStackAndThen.scala | Scala | apache-2.0 | 4,153 |
package com.mlh.clustering
import akka.cluster.Cluster
import akka.cluster.ClusterEvent._
import akka.actor.ActorLogging
import akka.actor.Actor
class ClusterListener extends Actor with ActorLogging {
// subscribe to cluster changes, re-subscribe when restart
override def preStart(): Unit = {
log.debug("start... | eikon-paku-ca/akka-cluster-docker-sample | src/main/scala/ClusterListener.scala | Scala | mit | 931 |
package com.github.apuex.akka.gen.util
import com.github.apuex.akka.gen.ModelLoader
import org.scalatest.{FlatSpec, Matchers}
import scala.xml.Text
class TextNodeSpec extends FlatSpec with Matchers {
"A TextNode" should "extract text attribute from xml node" in {
val xml = ModelLoader("src/test/resources/com/g... | apuex/akka-model-gen | src/test/scala/com/github/apuex/akka/gen/util/TextNodeSpec.scala | Scala | gpl-3.0 | 614 |
package enums
import common.CommonTest
import enums.api.SkillFile
import de.ust.skill.common.scala.api.Read
import de.ust.skill.common.scala.api.ReadOnly
import de.ust.skill.common.scala.api.Write
/**
* Tests the file reading capabilities.
*/
class BasicTest extends CommonTest {
test("enums - create") {
val ... | skill-lang/skillScalaTestSuite | src/test/scala/enums/BasicTest.scala | Scala | bsd-3-clause | 1,080 |
package com.geishatokyo.diffsql.parser
import com.geishatokyo.diffsql.ast.ColumnOption
import com.geishatokyo.diffsql.ast.Column
/**
* Created by takeshita on 14/02/14.
*/
trait ColumnParsers { self : SQLParser with DataTypeParsers =>
object ColumnOptionDef{
val Null = "NULL" ^^^ { ColumnOption.Null}
va... | geishatokyo/diff-sql-table | parser/src/main/scala/com/geishatokyo/diffsql/parser/ColumnParsers.scala | Scala | mit | 1,583 |
package controllers
import javax.inject.Inject
import services.email.EmailService
import services.{ AuthTokenService, UserService }
import com.mohiva.play.silhouette.api._
import com.mohiva.play.silhouette.impl.providers.CredentialsProvider
import forms.ForgotPasswordForm
import models.User
import play.api.Configurat... | vetafi/vetafi-web | app/controllers/ForgotPasswordController.scala | Scala | apache-2.0 | 3,541 |
package impulsestorm.stargame.model
import impulsestorm.stargame.lib._
import scala.util.Random
import org.bson.types.ObjectId
case class Player( id: Int, openid: Option[String], alias: String,
traits: Set[Trait],
homeStarId: Int,
exploredStarIds: Set[Int],
... | tommycli/stargame | src/main/scala/impulsestorm/stargame/model/Player.scala | Scala | agpl-3.0 | 3,868 |
package org.helgoboss.scala_osgi_metatype.builders
import org.helgoboss.scala_osgi_metatype.interfaces.{ValidationResult, ListAttributeDefinition}
import reflect.ClassTag
import reflect.classTag
/**
* Convenient builder for list attribute definitions without advanced validation (type validation is done).
*
* == Ex... | helgoboss/scala-osgi-metatype | src/main/scala/org/helgoboss/scala_osgi_metatype/builders/ListAttribute.scala | Scala | mit | 2,130 |
def =>=[W[_], A, B, C]: (W[A] => B) => (W[B] => C) => (W[A] => C) =
f => g => g compose extend(f) | hmemcpy/milewski-ctfp-pdf | src/content/3.7/code/scala/snippet13.scala | Scala | gpl-3.0 | 99 |
object A {
def x: Int = 3
} | jamesward/xsbt | sbt/src/sbt-test/source-dependencies/struct/A.scala | Scala | bsd-3-clause | 28 |
package bandit
import model.Arm
import org.scalatest._
import Matchers._
/**
* Class to test the Lin UCB Bandit algorithm
*/
class LinUCBBanditSpec extends WordSpec {
val arm1 = Arm(
id = 1L,
message = "hey babe",
pullCount = 0,
requestCount = 0,
value = 0.0
)
val arm2 = Arm(
id = 2L... | evancasey/tinder-bandits | src/test/scala/bandit/LinUCBBanditSpec.scala | Scala | mit | 855 |
package edu.gemini.qv.plugin.ui
import edu.gemini.qv.plugin.ui.QvGui._
import edu.gemini.shared.gui.RotatedButtonUI
import javax.swing.BorderFactory
import scala.swing.GridBagPanel.Fill._
import scala.swing.ScrollPane.BarPolicy
import scala.swing._
import scala.swing.event.ButtonClicked
/**
*/
class SideBarPanel(lab... | arturog8m/ocs | bundle/edu.gemini.qv.plugin/src/main/scala/edu/gemini/qv/plugin/ui/SideBar.scala | Scala | bsd-3-clause | 2,710 |
package io.swarm.tsdb.metadata
import java.util.UUID
import io.swarm.domain.{IDEntity, ResourceRef}
import scala.concurrent._
/**
* Created by Anil Chalil on 12/18/13.
*/
object SeriesType extends Enumeration {
type SeriesType = Value
val Long, Float = Value
}
case class Series(id: UUID, key: String, name: Opt... | Turkcell/swarm | tsdb/src/main/scala/io/swarm/tsdb/metadata/entities.scala | Scala | apache-2.0 | 1,297 |
package model
import skinny.orm._, feature._
import scalikejdbc._
import org.joda.time._
case class SchoolFollow(
id: Long,
schoolId: Long,
accountId: Long,
createdAt: Option[DateTime] = None
)
object SchoolFollow extends SkinnyCRUDMapper[SchoolFollow] {
override lazy val tableName = "school_follow"
over... | yoshitakes/skinny-task-example | src/main/scala/model/SchoolFollow.scala | Scala | mit | 493 |
/*
* 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 ... | SteamShon/incubator-s2graph | s2core/src/main/scala/org/apache/s2graph/core/storage/Serializable.scala | Scala | apache-2.0 | 1,006 |
package latis.ops.filter
import latis.dm.Function
import latis.ops.OperationFactory
import latis.dm.Sample
import latis.metadata.Metadata
import latis.dm.WrappedFunction
import latis.util.iterator.MappingIterator
import latis.util.LatisServiceException
/**
* Keep only the first 'limit' samples of any outer Function ... | dlindhol/LaTiS | src/main/scala/latis/ops/filter/LimitFilter.scala | Scala | epl-1.0 | 1,577 |
package org.apache.spark.ml.parity.feature
import org.apache.spark.ml.parity.SparkParityBase
import org.apache.spark.ml.Transformer
import org.apache.spark.ml.feature.Tokenizer
import org.apache.spark.sql.DataFrame
/**
* Created by hollinwilkins on 10/30/16.
*/
class TokenizerParitySpec extends SparkParityBase {
... | combust/mleap | mleap-spark/src/test/scala/org/apache/spark/ml/parity/feature/TokenizerParitySpec.scala | Scala | apache-2.0 | 524 |
import akka.{LoginPlayerExecutor, CreatePlayerExecutor, PlayerActor}
import akka.actor.{ActorSystem, AddressFromURIString, RootActorPath}
import akka.contrib.pattern.ClusterClient
import akka.japi.Util.immutableSeq
import com.typesafe.config.ConfigFactory
object StartPlayerWorker {
def main(args: Array[String]): U... | djoudjou/Quiz | app/StartPlayerWorker.scala | Scala | cc0-1.0 | 1,059 |
/*
* 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
* distribut... | copygrinder/copygrinder_server | src/main/scala/org/copygrinder/pure/copybean/persistence/PredefinedCopybeanTypes.scala | Scala | apache-2.0 | 2,451 |
package basic.implicits
import scala.reflect.macros.whitebox.Context
/**
* 以下の內容そのままを動かすことができます。
*
* http://docs.scala-lang.org/ja/overviews/macros/basic.implicits.html
*/
object ImplicitMacroSample01 {
def show[T](x: T)(implicit s: Showable[T]) = s.show(x)
}
trait Showable[T] {
def show(x: T): String
}
... | thachi/scala-macro-sample | macro/src/main/scala/basic/implicits/ImplicitMacroSample01.scala | Scala | apache-2.0 | 964 |
/***********************************************************************
* 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-hbase/geomesa-hbase-tools/src/main/scala/org/locationtech/geomesa/hbase/tools/ingest/HBaseIngestCommand.scala | Scala | apache-2.0 | 1,413 |
/*
* Copyright 2017 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 ... | Harikiranvuyyuru/squbs | samples/pubsub/pubsubsvc/src/test/scala/org/squbs/samples/pubsub/actors/UnsignedHexUtilSpec.scala | Scala | apache-2.0 | 3,702 |
/**
* (C) Copyright IBM Corp. 2015 - 2017
*
* 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 applicabl... | SparkTC/spark-bench | cli/src/test/scala/com/ibm/sparktc/sparkbench/Capturing.scala | Scala | apache-2.0 | 2,150 |
/**
* 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... | kavink92/kafka-0.8.0-beta1-src | core/src/main/scala/kafka/tools/MirrorMaker.scala | Scala | apache-2.0 | 6,931 |
@main def Test: Unit =
val tup1 = 1 *: EmptyTuple
val tup2 = 1 *: 2 *: EmptyTuple
val tup3 = 1 *: 2 *: 3 *: EmptyTuple
val tup4 = 1 *: 2 *: 3 *: 4 *: EmptyTuple
val tup5 = 1 *: 2 *: 3 *: 4 *: 5 *: EmptyTuple
val tup22 = 1 *: 2 *: 3 *: 4 *: 5 *: 6 *: 7 *: 8 *: 9 *: 10 *: 11 *: 12 *: 13 *: 14 *: 15 *: 16 *: ... | dotty-staging/dotty | tests/run/genericTupleMembers.scala | Scala | apache-2.0 | 739 |
/***
* Copyright 2014 Rackspace US, 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 applica... | wdschei/api-checker | core/src/main/scala/com/rackspace/com/papi/components/checker/handler/SaveDotHandler.scala | Scala | apache-2.0 | 1,600 |
package com.elsevier.soda
import com.elsevier.soda.messages._
import com.google.gson.Gson
import com.softwaremill.sttp._
final case class SodaClientException(private val message: String = "",
private val cause: Throwable = None.orNull)
extends Exception(message, cause)
class... | elsevierlabs-os/soda | src/main/scala/com/elsevier/soda/SodaClient.scala | Scala | apache-2.0 | 5,087 |
package scalafortheimpatient.chapter04
/**
* Map and Tuple.
*
* @author Wei Xing
*/
/**
*
*/
object Section01 {
def main(args: Array[String]) {
// "Alice" -> 10 gen tuple, and Map apply tuple array.
val v1 = Map("Alice" -> 10, "Bob" -> 3, "Cindy" -> 8) // return immutable HashMap
// mutable... | weixing-org/scala-lang-project | scala-impatient/src/main/scala/scalafortheimpatient/chapter04/_.scala | Scala | apache-2.0 | 2,130 |
/*
* Copyright 2016 The BigDL Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agr... | intel-analytics/BigDL | scala/dllib/src/test/scala/com/intel/analytics/bigdl/dllib/integration/torch/BatchNormalizationSpec.scala | Scala | apache-2.0 | 14,379 |
/**
* For copyright information see the LICENSE document.
*/
package entice.server.controllers
import entice.server._, Net._
import entice.server.test._
import entice.server.utils._
import entice.server.database._
import entice.protocol._
import akka.actor._
import akka.testkit._
import com.typesafe.config.ConfigF... | entice/old-server | src/test/scala/entice/server/controllers/CharDeleteSpec.scala | Scala | bsd-3-clause | 2,246 |
package net.white_azalea.models.exporter
import java.io.File
import org.fusesource.scalate.{ TemplateEngine, TemplateSource }
/**
* Template render.
*/
class Template(templateFile: Option[File]) {
/**
* Template engine.
*
* mode as mustache.
* http://scalate.github.io/scalate/documentation/mustache.... | Sunao-Yoshii/JUnitDocMarge | src/main/scala/net/white_azalea/models/exporter/Template.scala | Scala | apache-2.0 | 899 |
/**
* Copyright 2014-2020 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 ... | lift/framework | persistence/mongodb/src/main/scala/net/liftweb/mongodb/JsonExtractors.scala | Scala | apache-2.0 | 3,150 |
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.