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 |
|---|---|---|---|---|---|
import scala.quoted._
import scala.quoted.autolift
import scala.language.implicitConversions
case class Xml(parts: String, args: List[Any])
object XmlQuote {
implicit object SCOps {
inline def (inline ctx: StringContext) xml (args: => Any*): Xml =
${XmlQuote.impl('ctx, 'args)}
}
def impl(receiver: ... | som-snytt/dotty | tests/run-macros/xml-interpolation-3/XmlQuote_1.scala | Scala | apache-2.0 | 505 |
package co.blocke.scalajack
package json.parameters
import TestUtil._
import munit._
import munit.internal.console
import co.blocke.scalajack.json.JSON
import co.blocke.scala_reflection._
class TraitParams() extends FunSuite:
val sj = co.blocke.scalajack.ScalaJack()
test("Simple parameters - Foo[A](x:A) where... | gzoller/ScalaJack | core/src/test/scala/co.blocke.scalajack/json/parameters/TraitParams.scala | Scala | mit | 6,151 |
/**
* Licensed to Big Data Genomics (BDG) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The BDG licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use ... | erictu/adam | adam-core/src/test/scala/org/bdgenomics/adam/converters/FragmentConverterSuite.scala | Scala | apache-2.0 | 6,715 |
import sbt._
import Keys._
object ApplicationBuild extends Build {
val main = Project("basic", file(".")).settings(
scalaVersion := "2.11.4",
resolvers += Resolver.bintrayRepo("boldradiussolutions", "maven"),
libraryDependencies ++= Seq("com.boldradius" %% "total-map" % "0.2.3-SNAPSHOT"),
scalacOptions ++= S... | boldradius/total-map | examples/basic/project/Build.scala | Scala | apache-2.0 | 354 |
package gitbucket.core.controller
import gitbucket.core.dashboard.html
import gitbucket.core.model.Account
import gitbucket.core.service._
import gitbucket.core.util.{Keys, UsersAuthenticator}
import gitbucket.core.util.Implicits._
import gitbucket.core.service.IssuesService._
class DashboardController
extends Da... | xuwei-k/gitbucket | src/main/scala/gitbucket/core/controller/DashboardController.scala | Scala | apache-2.0 | 5,735 |
package com.github.tminglei.slickpg
package str
import slick.ast.Library.{SqlFunction, SqlOperator}
import slick.ast.TypedType
import slick.jdbc.{JdbcTypesComponent, PostgresProfile}
import slick.lifted.ExtensionMethods
/**
* Created by minglei on 12/12/16.
*/
trait PgStringExtensions extends JdbcTypesComponent {... | TimothyKlim/slick-pg | core/src/main/scala/com/github/tminglei/slickpg/str/PgStringExtensions.scala | Scala | bsd-2-clause | 1,987 |
/*
* 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-elastic/src/main/scala/com/datamountaineer/streamreactor/connect/elastic/indexname/CreateIndex.scala | Scala | apache-2.0 | 1,654 |
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you ... | hongyuhong/flink | flink-libraries/flink-table/src/main/scala/org/apache/flink/table/plan/rules/datastream/DataStreamSortRule.scala | Scala | apache-2.0 | 3,225 |
package org.yotchang4s.pixiv.auth
import java.io.IOException
import java.util.regex._
import org.yotchang4s.pixiv._
import org.yotchang4s.pixiv.auth._
import org.yotchang4s.pixiv.http._
import scala.collection.convert.WrapAsScala._
import org.yotchang4s.scala.Loan
import org.yotchang4s.scala.Loan._
object FormAuth {
... | yotchang4s/yapix | src/org/yotchang4s/pixiv/auth/FormAuth.scala | Scala | bsd-3-clause | 1,888 |
/*
* Copyright (C) 2009-2015 Typesafe Inc. <http://www.typesafe.com>
*/
package play.api.libs.json
import scala.language.higherKinds
import scala.reflect.macros.Context
import language.experimental.macros
object JsMacroImpl {
def formatImpl[A: c.WeakTypeTag](c: Context): c.Expr[Format[A]] =
macroImpl[A, Form... | jeantil/play-json-extra | play-json-extra/js/src/main/scala/play/api/libs/json/JsMacroImpl.scala | Scala | apache-2.0 | 11,329 |
/*
* Copyright (C) Lightbend Inc. <https://www.lightbend.com>
*/
package com.lightbend.lagom.scaladsl.it.routers
import com.lightbend.lagom.scaladsl.api.Service.named
import com.lightbend.lagom.scaladsl.api.Descriptor
import com.lightbend.lagom.scaladsl.api.Service
trait AdditionalRoutersService extends Service {
... | lagom/lagom | service/scaladsl/integration-tests/src/test/scala/com/lightbend/lagom/scaladsl/it/routers/AdditionalRoutersService.scala | Scala | apache-2.0 | 390 |
package org.infinispan.spark.test
import java.util.Properties
import org.infinispan.client.hotrod.RemoteCache
import org.scalatest.{DoNotDiscover, BeforeAndAfterAll, Suite}
/**
* Trait to be mixed-in by tests that require a reference to a RemoteCache
*
* @author gustavonalle
*/
sealed trait RemoteTest {
def g... | rnowling/infinispan-spark | src/test/scala/org/infinispan/spark/test/RemoteTest.scala | Scala | apache-2.0 | 1,532 |
package com.whitepages.cloudmanager.action
import com.whitepages.cloudmanager.ManagerException
import com.whitepages.cloudmanager.client.{SolrCloudVersion, SolrRequestHelpers}
import org.apache.solr.client.solrj.impl.CloudSolrServer
import org.apache.solr.common.params.ModifiableSolrParams
import org.apache.solr.commo... | randomstatistic/solrcloud_manager | src/main/scala/com/whitepages/cloudmanager/action/AddReplica.scala | Scala | apache-2.0 | 2,298 |
/*******************************************************************************
Copyright (c) 2013-2014, S-Core, KAIST.
All rights reserved.
Use is subject to license terms.
This distribution may include materials developed by third parties.
*********************************************************... | darkrsw/safe | src/main/scala/kr/ac/kaist/jsaf/analysis/typing/models/jquery/JQueryEvent.scala | Scala | bsd-3-clause | 15,730 |
/*
* 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 ... | hengyicai/OnlineAggregationUCAS | sql/hive/src/test/scala/org/apache/spark/sql/hive/ErrorPositionSuite.scala | Scala | apache-2.0 | 4,754 |
/*
* Copyright (c) 2015-6 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 agre... | milessabin/macro-compat | test/src/main/scala/testmacro/testmacro.scala | Scala | apache-2.0 | 8,081 |
package monocle
import scalaz.std.anyVal._
import scalaz.std.list._
import scalaz.std.option._
import scalaz.syntax.std.boolean._
import scalaz.syntax.std.option._
import scalaz.syntax.tag._
import scalaz.{Choice, Foldable, Maybe, Monoid, \\/}
/**
* A [[Fold]] can be seen as a [[Getter]] with many targets or
* a we... | CapeSepias/Monocle | core/src/main/scala/monocle/Fold.scala | Scala | mit | 5,255 |
package cc.factorie.app.nlp
import org.scalatest.FlatSpec
import org.scalatest._
import cc.factorie.app.nlp.pos.{PennPosTag, PennPosDomain}
import cc.factorie.app.nlp.parse._
/** Test serialization of Document to BSON.
@author John Sullivan, Andrew McCallum
*/
class TestDocumentStore extends FlatSpec with Matche... | iesl/fuse_ttl | src/factorie-factorie_2.11-1.1/src/test/scala/cc/factorie/app/nlp/TestDocumentStore.scala | Scala | apache-2.0 | 1,395 |
package quickcheck
import common._
import org.scalacheck._
import Arbitrary._
import Gen._
import Prop._
abstract class QuickCheckHeap extends Properties("Heap") with IntHeap {
property("min1") = forAll { a: Int =>
val h = insert(a, empty)
findMin(h) == a
}
//If you insert an element into an empty h... | albertpastrana/reactive | quickcheck/src/main/scala/quickcheck/QuickCheck.scala | Scala | mit | 3,319 |
package com.itszuvalex.itszulib.logistics
import java.util
import com.itszuvalex.itszulib.api.core.Loc4
/**
* Created by Christopher on 4/5/2015.
*/
trait INetwork[C <: INetworkNode[N], N <: INetwork[C, N]] {
/**
*
* @return Network Identifier. This should be unique.
*/
def ID: Int
/**
*
*... | BlockWorker/ItszuLib | src/main/scala/com/itszuvalex/itszulib/logistics/INetwork.scala | Scala | gpl-2.0 | 3,826 |
import scala.tools.nsc.interactive.tests._
import scala.reflect.internal.util._
object Test extends InteractiveTest {
import compiler._, definitions._
override def runDefaultTests() {
def resolveTypeTagHyperlink() {
val sym = compiler.askForResponse(() => compiler.currentRun.runDefinitions.TypeTagClass... | felixmulder/scala | test/files/presentation/t7678/Runner.scala | Scala | bsd-3-clause | 2,328 |
package com.artclod.mathml.scalar.apply.trig
import com.artclod.mathml.scalar._
import com.artclod.mathml.scalar.concept._
import scala.util._
case class ApplySin(value: MathMLElem) extends UnaryFunction(value, Sin) {
override def eval(b: Map[String, Double]) = Try(Trigonometry.sin(v.eval(b).get))
override def c... | kristiankime/web-education-games | app/com/artclod/mathml/scalar/apply/trig/ApplySin.scala | Scala | mit | 580 |
/* Copyright 2014 Nest Labs
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... | mighdoll/sparkle | store/src/main/scala/nest/sparkle/loader/StreamLoader.scala | Scala | apache-2.0 | 793 |
package newts
import cats.kernel.laws.discipline.{MonoidTests, EqTests}
class AllTest extends NewtsSuite {
checkAll("All", MonoidTests[All].monoid)
checkAll("All", EqTests[All].eqv)
test("combine"){
true.asAll |+| true.asAll shouldEqual true.asAll
All(true) |+| All(false) shouldEqual All(false)... | julien-truffaut/newts | test/shared/src/test/scala/newts/AllTest.scala | Scala | apache-2.0 | 547 |
package org.randi3.simulation.utility
import org.randi3.schema.{DatabaseSchema, LiquibaseUtil}
import org.randi3.utility.TestingEnvironment
import org.randi3.model.criterion.constraint.{Constraint, DoubleConstraint}
import org.randi3.model.criterion.{Criterion, IntegerCriterion, DoubleCriterion, OrdinalCriterion}
impo... | dschrimpf/randi3-simulation | src/test/scala/org/randi3/simulation/utility/TestingEnvironmentSimulation.scala | Scala | gpl-3.0 | 734 |
/*
* 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 ... | zouzias/spark-lucenerdd | src/main/scala/org/zouzias/spark/lucenerdd/response/LuceneRDDResponse.scala | Scala | apache-2.0 | 3,183 |
/*
* 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 ... | kiszk/spark | mllib/src/main/scala/org/apache/spark/ml/clustering/GaussianMixture.scala | Scala | apache-2.0 | 26,480 |
/*
* 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 ... | dotunolafunmiloye/spark | core/src/main/scala/org/apache/spark/rdd/ZippedPartitionsRDD.scala | Scala | apache-2.0 | 5,132 |
package io.getquill.quotation
import scala.reflect.macros.whitebox.Context
import io.getquill.ast._
import io.getquill.dsl.CoreDsl
trait Liftables {
val c: Context
import c.universe.{ Ident => _, Constant => _, Function => _, If => _, Block => _, _ }
private val pack = q"io.getquill.ast"
implicit val astLi... | jcranky/quill | quill-core/src/main/scala/io/getquill/quotation/Liftables.scala | Scala | apache-2.0 | 7,217 |
package sbtdocker
import org.apache.commons.lang3.StringEscapeUtils
import sbtdocker.staging.SourceFile
sealed trait Instruction
/**
* A real dockerfile instruction. Contains a instruction name and arguments.
*/
trait DockerfileInstruction extends Instruction {
def arguments: String
def instructionName: Strin... | kurtkopchik/sbt-docker | src/main/scala/sbtdocker/Instructions.scala | Scala | mit | 10,493 |
package edu.gemini.ags.impl
import edu.gemini.ags.api.{AgsAnalysis, AgsGuideQuality, AgsStrategy}
import edu.gemini.ags.api.AgsStrategy.Estimate
import edu.gemini.ags.conf.ProbeLimitsTable
import edu.gemini.ags.gems.{GemsCatalogSearchCriterion, GemsCatalogSearchKey, CatalogSearchCriterion}
import edu.gemini.catalog.ap... | spakzad/ocs | bundle/edu.gemini.ags/src/test/scala/edu/gemini/ags/impl/GemsStrategySpec.scala | Scala | bsd-3-clause | 40,423 |
/*
* Copyright 2021 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/simple-reactivemongo | src/main/scala/uk/gov/hmrc/mongo/json/ReactiveMongoFormats.scala | Scala | apache-2.0 | 3,243 |
package sttp.client3.impl.fs2
import cats.effect.IO
import cats.instances.string._
import fs2.{Chunk, Stream}
import sttp.capabilities.fs2.Fs2Streams
import sttp.client3.impl.cats.CatsTestBase
import sttp.model.sse.ServerSentEvent
import sttp.client3.testing.streaming.StreamingTest
trait Fs2StreamingTest extends Stre... | softwaremill/sttp | effects/fs2-ce2/src/test/scala/sttp/client3/impl/fs2/Fs2StreamingTest.scala | Scala | apache-2.0 | 899 |
/*
* Copyright 2014-2022 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... | Netflix/atlas | atlas-core/src/main/scala/com/netflix/atlas/core/algorithm/OnlineTrend.scala | Scala | apache-2.0 | 2,105 |
class A { def m() { return x } }
object Main { def main(args: Array[String]) { } }
| tobast/compil-petitscala | tests/typing/bad/testfile-context_return-1.scala | Scala | gpl-3.0 | 83 |
/*
* 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 ... | sjtu-iiot/graphx-algorithm | src/main/scala/org/apache/spark/graphx/GraphXUtils.scala | Scala | gpl-2.0 | 1,721 |
package controllers
import java.util.concurrent.TimeUnit
import play.api.libs.json._
import play.api.test.Helpers._
import play.api.test._
import utils.MongoDBTestUtils.withUserInDb
import scala.concurrent._
import scala.concurrent.duration._
/**
* You can mock out a whole application including requests, plugins ... | meip/bettermeeting | test/controllers/MeetingIT.scala | Scala | apache-2.0 | 4,810 |
package com.example
import com.google.inject.Stage
import com.twitter.finatra.thrift.EmbeddedThriftServer
import com.twitter.inject.server.FeatureTest
import com.swissguard.SwissGuardThriftServer
class ExampleServerStartupTest extends FeatureTest {
val server = new EmbeddedThriftServer(
twitterServer = new Swi... | divanvisagie/swiss-guard | authentication/src/test/scala/com/example/ExampleServerStartupTest.scala | Scala | apache-2.0 | 451 |
/**
* 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... | Parth-Brahmbhatt/kafka | core/src/main/scala/kafka/network/SocketServer.scala | Scala | apache-2.0 | 19,447 |
package scredis.protocol
import akka.util.ByteString
import org.scalacheck.Gen
import org.scalatest._
import org.scalatestplus.scalacheck.ScalaCheckDrivenPropertyChecks
import org.scalatest.matchers.should.Matchers
import org.scalatest.wordspec.AnyWordSpec
class ProtocolSpec extends AnyWordSpec with ScalaCheckDriven... | scredis/scredis | src/test/scala/scredis/protocol/ProtocolSpec.scala | Scala | apache-2.0 | 5,334 |
package im.actor.server.dialog.group
import akka.actor.{ ActorRef, ActorSystem, Props }
import akka.contrib.pattern.{ ClusterSharding, ShardRegion }
import im.actor.server.dialog.DialogCommand
import im.actor.server.dialog.DialogIdExtractors.getGroupDialogId
object GroupDialogRegion {
private def idExtractor: Shar... | lzpfmh/actor-platform | actor-server/actor-core/src/main/scala/im/actor/server/dialog/group/GroupDialogRegion.scala | Scala | mit | 1,108 |
// scalac: -Xfatal-warnings
//
sealed abstract class X
sealed case class A(x: Int) extends X
// test reachability on mixed sealed / non-sealed matches
object Test extends App {
val B: X = A(0)
val C: X = A(1)
// all cases are reachable and the match is exhaustive
(C: X) match {
case B =>
case C =>
... | scala/scala | test/files/neg/virtpatmat_reach_sealed_unsealed.scala | Scala | apache-2.0 | 827 |
/*
Copyright (c) 2017 KAPSARC
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
dist... | EconomicSL/auctions | src/main/scala/org/economicsl/auctions/actors/schedules/PoissonProcess.scala | Scala | apache-2.0 | 1,447 |
/*
* Copyright (c) 2012-2014 Snowplow Analytics Ltd. All rights reserved.
*
* This program is licensed to you under the Apache License Version 2.0,
* and you may not use this file except in compliance with the Apache License Version 2.0.
* You may obtain a copy of the Apache License Version 2.0 at http://www.apach... | janeefting/snowplow | 3-enrich/scala-hadoop-enrich/src/test/scala/com.snowplowanalytics.snowplow.enrich.hadoop/JobSpecHelpers.scala | Scala | apache-2.0 | 11,572 |
package dao
import io.strongtyped.active.slick._
trait RepoFor[M, I] extends EntityActions with PostgresProfileProvider {
type Entity = M
type Id = I
}
| thomastoye/speelsysteem | app/dao/RepoFor.scala | Scala | gpl-2.0 | 158 |
/*
* This file is part of openisetl
*
* Copyright (c) Arnaud Le Blanc
*/
package openisetl.compiler.analysis.dataholder
trait AnDataHolderClient {
def getAnData[T](h:AnDataHolder, k:Any) : Option[T] = {
h.getAnData(this) match {
case Some(d) => d.get(k) match {
case Some(v) => Some(v.asInstanc... | arnaud-lb/OpenISETL | src/main/scala/openisetl/compiler/analysis/dataholder/AnDataHolderClient.scala | Scala | mit | 595 |
/*
* 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/parameters/FP16SplitsParameterSpec.scala | Scala | apache-2.0 | 5,008 |
package mesosphere.marathon.event
import mesosphere.marathon.health.HealthCheck
import mesosphere.marathon.upgrade.{ DeploymentPlan, DeploymentStep }
import org.rogach.scallop.ScallopConf
import com.google.inject.{ Inject, Singleton, Provides, AbstractModule }
import akka.event.EventStream
import javax.inject.Named
im... | EvanKrall/marathon | src/main/scala/mesosphere/marathon/event/Events.scala | Scala | apache-2.0 | 4,859 |
package org.sarrufat.sudoku.latinsqr
class LatinSquare( size: Integer) {
override def toString() = {
normalized.toString
}
def normalized = {
def normalizedRow(idx: Integer) = for { i <- 0 until size } yield { (i + idx) % size }
for { r <- 0 until size } yield normalizedRow(r)
}
}
... | sarrufat/ScalaSudoku | src/main/scala/org/sarrufat/sudoku/latinsqr/LatinSquare.scala | Scala | gpl-3.0 | 386 |
package com.wavesplatform.transaction
import com.wavesplatform.protobuf.transaction.PBTransactions
trait LegacyPBSwitch { self: Transaction with VersionedTransaction =>
def protobufVersion: TxVersion
final def isProtobufVersion: Boolean = self.version >= protobufVersion
override def bytesSize: Int =
if (is... | wavesplatform/Waves | node/src/main/scala/com/wavesplatform/transaction/LegacyPBSwitch.scala | Scala | mit | 724 |
/* __ *\
** ________ ___ / / ___ Scala API **
** / __/ __// _ | / / / _ | (c) 2006-2013, LAMP/EPFL **
** __\ \/ /__/ __ |/ /__/ __ | http://www.scala-lang.org/ **
** /____/\___/_/ |_/... | jmnarloch/scala-js | scalalib/overrides-2.10/scala/collection/JavaConversions.scala | Scala | bsd-3-clause | 9,530 |
package org.jetbrains.plugins.scala
package lang
package psi
package impl
package expr
import com.intellij.lang.ASTNode
import com.intellij.psi.PsiElementVisitor
import org.jetbrains.plugins.scala.extensions._
import org.jetbrains.plugins.scala.lang.psi.api.ScalaElementVisitor
import org.jetbrains.plugins.scala.lang.p... | ilinum/intellij-scala | src/org/jetbrains/plugins/scala/lang/psi/impl/expr/ScInfixExprImpl.scala | Scala | apache-2.0 | 1,956 |
package net.liftweb.paypal
/*
* Copyright 2007-2008 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 requ... | andreum/liftweb | lift-paypal/src/main/scala/net/liftweb/paypal/Paypal.scala | Scala | apache-2.0 | 17,984 |
package is.hail.types.physical.stypes.primitives
import is.hail.annotations.{CodeOrdering, Region}
import is.hail.asm4s.{Code, DoubleInfo, Settable, SettableBuilder, TypeInfo, Value}
import is.hail.expr.ir.{EmitCodeBuilder, EmitMethodBuilder, SortOrder}
import is.hail.types.physical.stypes.{SCode, SType}
import is.hai... | danking/hail | hail/src/main/scala/is/hail/types/physical/stypes/primitives/SFloat64.scala | Scala | mit | 3,124 |
package org.functionalkoans.forscala.support
import org.scalatest.{ Args, FailedStatus, Status, Suite }
trait KoanSuite extends Suite with KoanMatchers {
def meditate = pending
abstract override def runTest(testName: String, args: Args): Status = {
if (!args.stopper.stopRequested) {
super.runTest(test... | pharmpress/codingdojo | scala-koans/src/test/scala/org/functionalkoans/forscala/support/KoanSuite.scala | Scala | apache-2.0 | 376 |
package de.htwg.zeta.parser.shape.parsetree
import de.htwg.zeta.parser.shape.parsetree.GeoModelAttributes.Align
import de.htwg.zeta.parser.shape.parsetree.GeoModelAttributes.Curve
import de.htwg.zeta.parser.shape.parsetree.GeoModelAttributes.Editable
import de.htwg.zeta.parser.shape.parsetree.GeoModelAttributes.For
im... | Zeta-Project/zeta | api/parser/src/main/scala/de/htwg/zeta/parser/shape/parsetree/GeoModelParseTrees.scala | Scala | bsd-2-clause | 5,611 |
package deburnat.transade.core.conc
import collection.mutable.Map
import xml.Elem
import actors.Actor
import deburnat.transade.core.admins.{CoreAdmin, TransadeScalaAdmin}
import CoreAdmin.{br, tab1, proc, bug}
import deburnat.transade.core.readers.Reader.read
/**
* Project name: transade
* @author Patrick Meppe (ta... | deburnatshazem/transade | core/src/main/scala/deburnat/transade/core/conc/TransadeScalaActor.scala | Scala | apache-2.0 | 1,893 |
package controllers.user
import models.user.User
import play.api.libs.json.Json._
import play.api.mvc.{Controller, Action}
import javax.inject.Singleton
@Singleton
class UserRest extends Controller {
import models.user.Serializers._
def get(username: String) = Action {
Ok(toJson(User(username, "example")))
... | jeffmay/angular-play-multimodule-seed | api/app/controllers/user/UserRest.scala | Scala | apache-2.0 | 326 |
/**
* Copyright 2015 Thomson Reuters
*
* Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or ag... | hochgi/CM-Well | server/cmwell-formats/src/main/scala/cmwell/formats/FormatExtractor.scala | Scala | apache-2.0 | 4,227 |
trait A {
type D >: Null <: C
def foo(d: D)(d2: d.type): Unit
trait C {
def bar: Unit = foo(null)(null)
}
}
object B extends A {
class D extends C
def foo(d: D)(d2: d.type): Unit = () // Bridge method required here!
}
object Test extends dotty.runtime.LegacyApp {
new B.D().bar
}
| yusuke2255/dotty | tests/pending/run/t6443b.scala | Scala | bsd-3-clause | 300 |
/*
* Copyright (C) 2020 MapRoulette contributors (see CONTRIBUTORS.md).
* Licensed under the Apache License, Version 2.0 (see LICENSE).
*/
package org.maproulette.framework.service
import java.util.UUID
import java.util.concurrent.TimeUnit
import scala.concurrent.duration.FiniteDuration
import org.maproulette.ses... | mgcuthbert/maproulette2 | test/org/maproulette/framework/service/TaskReviewMetricsServiceSpec.scala | Scala | apache-2.0 | 5,921 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | shaneknapp/spark | sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/util/DateTimeUtilsSuite.scala | Scala | apache-2.0 | 45,791 |
package com.onion.mongo
import com.onion.model.{Gender, User}
import org.scalatest.FunSuite
import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.Await
import scala.concurrent.duration._
/**
* Created by famo on 1/28/15.
*/
class UserDaoTest extends FunSuite {
val user = User("id",
"... | jasoncao/onion-ring | src/test/scala/com/onion/mongo/UserDaoTest.scala | Scala | apache-2.0 | 813 |
package sgl
package util
/** An abstract provider for the Random object.
*
* Random is designed to be both simple to start using, by providing
* a global Random object with a preset seed (randomly) ready to be used
* out of the box. After mixing RandomProvider, one can simply start
* calling Random.nextInt()... | regb/scala-game-library | core/src/main/scala/sgl/util/RandomProvider.scala | Scala | mit | 4,267 |
import one.gzero.db.{GraphSONEdge, GremlinResultJsonProtocol, GraphSONVertex}
import org.scalatest._
import spray.json._
import spray.httpx.SprayJsonSupport
import SprayJsonSupport._
class GremlinTests extends FlatSpec with Matchers {
case class NameProperty(name:String)
import GremlinResultJsonProtocol._
"A... | gzeroone/gzero | src/test/scala/GremlinTests.scala | Scala | apache-2.0 | 1,325 |
package com.shocktrade.server.trading
import java.util.Date
import com.ldaniels528.commons.helpers.OptionHelper._
import com.ldaniels528.tabular.Tabular
import com.ldaniels528.tabular.formatters.FormatHandler
import com.shocktrade.models.contest.OrderTerms.OrderTerm
import com.shocktrade.models.contest.PriceTypes.Pri... | ldaniels528/shocktrade-server | app-server/app/com/shocktrade/server/trading/OrderProcessor.scala | Scala | apache-2.0 | 17,283 |
/*
* 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 writin... | paypal/squbs | squbs-testkit/src/main/scala/org/squbs/testkit/TestRoute.scala | Scala | apache-2.0 | 2,868 |
/*
* 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 ... | narahari92/spark | core/src/main/scala/org/apache/spark/deploy/history/FsHistoryProvider.scala | Scala | apache-2.0 | 31,260 |
package scala.meta.internal.parsers
/** Utility for tracking a context, like whether we are inside a pattern or a quote. */
private[parsers] trait NestedContext {
private var nested = 0
def within[T](body: => T): T = {
nested += 1
try {
body
} finally {
nested -= 1
}
}
def isInside(... | scalameta/scalameta | scalameta/parsers/shared/src/main/scala/scala/meta/internal/parsers/NestedContext.scala | Scala | bsd-3-clause | 472 |
/*
* Copyright (c) 2014-2019 Israel Herraiz <isra@herraiz.org>
*
* 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 use, c... | iht/fpinscala | src/main/scala/chap03/ex13.scala | Scala | mit | 1,519 |
package services.graphstages
import akka.stream._
import akka.stream.stage.{GraphStage, GraphStageLogic, InHandler, OutHandler}
import drt.shared.Terminals.{InvalidTerminal, Terminal}
import drt.shared._
import drt.shared.api.Arrival
import org.slf4j.{Logger, LoggerFactory}
import services.SDate
import services.arriva... | UKHomeOffice/drt-scalajs-spa-exploration | server/src/main/scala/services/graphstages/ArrivalsGraphStage.scala | Scala | apache-2.0 | 18,215 |
package com.pastebin.Pj9d8jt5
import java.awt.image.BufferedImage
import java.net.URL
import javax.imageio.ImageIO
import org.scalatest._
import org.scalatest.Matchers._
import scala.concurrent.duration._
import scala.concurrent.{Await, Future}
import walfie.gbf.raidfinder.util.BlockingIO
class ImagePHashSpec extends... | xheres/api-gbfraidfinder | server/src/it/scala/com/pastebin/Pj9d8jt5/ImagePHashSpec.scala | Scala | mit | 15,106 |
/*
* 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 ... | ibm-cds-labs/spark.samples | streaming-twitter/src/main/scala/com/ibm/cds/spark/samples/StatusSerializer.scala | Scala | apache-2.0 | 1,400 |
package io.github.interestinglab.waterdrop.output.structuredstreaming
import java.util.Properties
import com.alibaba.fastjson.JSONObject
import io.github.interestinglab.waterdrop.config.{Config, ConfigFactory}
import io.github.interestinglab.waterdrop.UserRuntimeException
import io.github.interestinglab.waterdrop.api... | InterestingLab/waterdrop | waterdrop-core/src/main/scala/io/github/interestinglab/waterdrop/output/structuredstreaming/Kafka.scala | Scala | apache-2.0 | 4,460 |
package com.gopivotal.sutils
import scala.util.control.NonFatal
import scalaz.{-\\/, \\/, \\/-}
package object io extends IOFunctions with IOInstances {
// added in 7.1, so use that when update is possible. Can't update cause it breaks jackson...
private[io] def fromTryCatchNonFatal[A](a: => A): Throwable \\/ A ... | pivotalsoftware/sutils | sutils-core/src/main/scala/com/gopivotal/sutils/io/package.scala | Scala | apache-2.0 | 384 |
package com.atomist.rug.kind.pom
import com.atomist.project.edit.SuccessfulModification
import com.atomist.rug.kind.java.JavaTypeUsageTest
import com.typesafe.scalalogging.LazyLogging
import org.scalatest.{FlatSpec, Matchers}
class PomUsageTest extends FlatSpec with Matchers with LazyLogging {
import com.atomist.r... | atomist/rug | src/test/scala/com/atomist/rug/kind/pom/PomUsageTest.scala | Scala | gpl-3.0 | 819 |
/***********************************************************************
* Copyright (c) 2013-2017 Commonwealth Computer Research, Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Apache License, Version 2.0
* which accompanies this distribution and... | ronq/geomesa | geomesa-fs/geomesa-fs-spark/src/main/scala/org/locationtech/geomesa/fs/spark/ParquetFileSystemRDD.scala | Scala | apache-2.0 | 4,951 |
/*
* 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 ... | tzulitai/flink | flink-table/flink-table-planner/src/test/scala/org/apache/flink/table/plan/TimeIndicatorConversionTest.scala | Scala | apache-2.0 | 18,020 |
/*
* 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 ... | yanboliang/spark | external/kinesis-asl/src/test/scala/org/apache/spark/streaming/kinesis/KinesisStreamSuite.scala | Scala | apache-2.0 | 18,226 |
package ch.octo.cffpoc.gtfs.raw
import java.io.File
import ch.octo.cffpoc.gtfs.{ RawCalendarDate, ServiceId }
import com.github.tototoshi.csv.CSVReader
import org.joda.time.LocalDate
import org.joda.time.format.DateTimeFormat
/**
* Created by alex on 29/04/16.
*/
object RawCalendarDateReader extends RawDataCollec... | alexmasselot/gtfs-simulation-play | src/main/scala/ch/octo/cffpoc/gtfs/raw/RawCalendarDateReader.scala | Scala | apache-2.0 | 748 |
/*
* 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/nn/SequentialSpec.scala | Scala | apache-2.0 | 2,144 |
/***********************************************************************
* Copyright (c) 2013-2022 Commonwealth Computer Research, Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Apache License, Version 2.0
* which accompanies this distribution and... | locationtech/geomesa | geomesa-z3/src/main/scala/org/locationtech/geomesa/curve/LegacyZ3SFC.scala | Scala | apache-2.0 | 2,159 |
/*
*************************************************************************************
* Copyright 2013 Normation SAS
*************************************************************************************
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero Ge... | Kegeruneku/rudder | rudder-web/src/main/scala/com/normation/rudder/web/rest/directive/DirectiveAPIService2.scala | Scala | agpl-3.0 | 16,958 |
package noiselib.util
/**
* PRNG that returns the same thing for any call with the same seed and position
* Passes most dieharder tests
*/
class PositionalRandom(seed: Int = 0) {
import scala.util.hashing.MurmurHash3._
def get(x: Int, y: Int): Int = {
var h = seed
h = mix(h, x)
h = mixLast(h, y)
finaliz... | flaviut/noiselib | src/main/scala/noiselib/util/PositionalRandom.scala | Scala | mit | 10,857 |
package net.particlez
import org.junit.Assert._
import org.junit.Test
class StaticParticleTest {
@Test
def testTransform() {
case object p extends StaticParticle[Pos]("p")
//val p = new StaticParticle[Pos]("p")
val q = p.transform(_ => new StaticParticle[Pos]("q"))
assertEquals("q", q.name())... | bbiletskyy/particlez | src/test/scala/net/particlez/StaticParticleTest.scala | Scala | apache-2.0 | 965 |
package im.actor.server.api.rpc.service.messaging
import akka.actor._
import akka.contrib.pattern.DistributedPubSubMediator
import akka.util.Timeout
import im.actor.server.group.GroupProcessorRegion
import im.actor.server.user.{ UserViewRegion, UserProcessorRegion }
import slick.driver.PostgresDriver.api._
import scal... | v2tmobile/actor-platform | actor-server/actor-rpc-api/src/main/scala/im/actor/server/api/rpc/service/messaging/MessagingServiceImpl.scala | Scala | mit | 3,359 |
package org.jetbrains.plugins.scala.lang.refactoring.introduceVariable
import com.intellij.openapi.command.CommandProcessor
import com.intellij.openapi.command.undo.UndoManager
import com.intellij.openapi.editor.{Editor, ScrollType}
import com.intellij.psi._
import com.intellij.refactoring.RefactoringActionHandler
imp... | JetBrains/intellij-scala | scala/scala-impl/src/org/jetbrains/plugins/scala/lang/refactoring/introduceVariable/ScalaInplaceTypeAliasIntroducer.scala | Scala | apache-2.0 | 3,587 |
package scalariform.formatter
import scalariform.parser._
import scalariform.formatter.preferences._
// format: OFF
class IndentWithTabsTest extends AbstractFormatterTest {
implicit val formattingPreferences: FormattingPreferences =
FormattingPreferences.setPreference(IndentWithTabs, true)
"""class A {
... | mdr/scalariform | scalariform/src/test/scala/scalariform/formatter/IndentWithTabsTest.scala | Scala | mit | 3,939 |
package org.oseraf.bullseye.service.DataService
import com.tinkerpop.blueprints.impls.tg.TinkerGraph
import org.oseraf.bullseye.store.impl.blueprints.BlueprintsGraphStore
import org.oseraf.bullseye.store.{Entity, EntityStore, IdentifiedEntity, SplicePlugin}
trait SimpleAddingSplitter {
val store: EntityStore with ... | OSERAF/MASTERImpl | service/src/main/scala/org/oseraf/bullseye/service/DataService/SimpleAddingSplitter.scala | Scala | apache-2.0 | 2,316 |
package sgl
import util.Loader
trait GraphicsProvider extends GraphicsHelpersComponent {
this: SystemProvider =>
trait Graphics extends GraphicsExtension {
def loadImage(path: ResourcePath): Loader[Bitmap]
abstract class AbstractBitmap {
def height: Int
def width: Int
/** Release the... | regb/scala-game-library | core/src/main/scala/sgl/GraphicsProvider.scala | Scala | mit | 17,244 |
package org.openmole.gui.ext.dataui
import org.scalajs.dom.raw.HTMLElement
import scalatags.JsDom.TypedTag
import scalatags.JsDom.all._
/*
* Copyright (C) 26/11/14 // mathieu.leclaire@openmole.org
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero Gene... | ISCPIF/PSEExperiments | openmole-src/openmole/gui/ext/org.openmole.gui.ext.dataui/src/main/scala/org/openmole/gui/ext/dataui/PanelUI.scala | Scala | agpl-3.0 | 1,028 |
package org.jetbrains.plugins.scala.lang.completion
import javax.swing.Icon
import com.intellij.codeInsight.lookup.{Lookup, LookupActionProvider, LookupElement, LookupElementAction}
import com.intellij.psi.PsiClass
import com.intellij.util.ui.EmptyIcon
import com.intellij.util.{Consumer, PlatformIcons}
import org.jet... | ilinum/intellij-scala | src/org/jetbrains/plugins/scala/lang/completion/ScalaImportStaticLookupActionProvider.scala | Scala | apache-2.0 | 1,321 |
// Copyright 2018 EPFL DATA Lab (data.epfl.ch)
//
// 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... | epfldata/squid | core/src/test/scala/squid/statics/CompileTimeTests.scala | Scala | apache-2.0 | 3,346 |
// Project: slogging
// Module:
// Description:
package slogging
import scala.scalanative.native._
object SyslogLoggerFactory extends UnderlyingLoggerFactory {
override def getUnderlyingLogger(name: String) = {
SyslogLogger
}
object SyslogLogger extends LoggerTemplate {
override def logMessa... | jokade/slogging | syslog/src/main/scala-native-0.3/slogging/SyslogLoggerFactory.scala | Scala | mit | 1,980 |
/*
* Copyright 2012 Eike Kettner
*
* 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... | eikek/publet | web/src/test/scala/org/eknet/publet/web/PartitionTypeMountTest.scala | Scala | apache-2.0 | 1,139 |
package org.infinispan.spark.suites
import org.infinispan.client.hotrod.RemoteCache
import org.infinispan.spark._
import org.infinispan.spark.domain.Runner
import org.infinispan.spark.test.TestingUtil._
import org.infinispan.spark.test._
import org.scalatest._
import scala.concurrent.ExecutionContext.Implicits.global... | galderz/infinispan-spark | src/test/scala/org/infinispan/spark/suites/RDDFailOverSuite.scala | Scala | apache-2.0 | 2,052 |
package uk.gov.homeoffice.akka.cluster
import com.typesafe.config.{Config, ConfigFactory}
import grizzled.slf4j.Logging
/**
* For a module to be clustered, seed-nodes have to be configured, and one of the entries in seed-nodes will be the module that wishes to be part of the cluster.
* The number of nodes in the ... | UKHomeOffice/rtp-akka-lib | src/main/scala/uk/gov/homeoffice/akka/cluster/Clustering.scala | Scala | mit | 3,054 |
/*
* Copyright (c) 2012, TU Berlin
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions... | mzuber/simple-language | src/main/scala/modules/EnrichedLambdaCalculus.scala | Scala | bsd-3-clause | 12,955 |
package ru.pavkin.todoist.api.core.model
import org.scalacheck.Arbitrary._
import org.scalacheck.Gen
import org.scalatest.prop.GeneratorDrivenPropertyChecks
import org.scalatest.{FunSuite, Matchers}
class LabelColorSpec extends FunSuite with Matchers with GeneratorDrivenPropertyChecks {
test("LabelColor.unsafeBy r... | vpavkin/scalist | tests/src/test/scala/ru/pavkin/todoist/api/core/model/LabelColorSpec.scala | Scala | mit | 707 |
package com.twitter.zipkin.storage.redis
import java.io.Closeable
import java.nio.ByteBuffer
import com.google.common.base.Charsets.UTF_8
import com.twitter.finagle.redis.Client
import com.twitter.util.{Duration, Future}
import com.twitter.zipkin.Constants
import com.twitter.zipkin.common.{AnnotationType, BinaryAnnot... | jfeltesse-mdsol/zipkin | zipkin-redis/src/main/scala/com/twitter/zipkin/storage/redis/RedisIndex.scala | Scala | apache-2.0 | 4,297 |
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.