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 dotty.tools.dotc.config
enum ScalaRelease(val majorVersion: Int, val minorVersion: Int) extends Ordered[ScalaRelease]:
case Release3_0 extends ScalaRelease(3, 0)
case Release3_1 extends ScalaRelease(3, 1)
def show = s"$majorVersion.$minorVersion"
def compare(that: ScalaRelease) =
val ord = summon... | dotty-staging/dotty | compiler/src/dotty/tools/dotc/config/ScalaRelease.scala | Scala | apache-2.0 | 606 |
/* Copyright 2009-2016 EPFL, Lausanne */
package leon
package synthesis
package rules
case object BottomUpETE extends BottomUpETELike("BU Example-guided Term Exploration") {
def getParams(sctx: SynthesisContext, p: Problem) = {
ETEParams(
grammar = grammars.default(sctx, p),
maxExpands = 4
)
}... | regb/leon | src/main/scala/leon/synthesis/rules/BottomUpETE.scala | Scala | gpl-3.0 | 323 |
package com.twitter.diffy.lifter
import com.fasterxml.jackson.databind.JsonNode
import com.google.common.net.MediaType
import com.twitter.diffy.ParentSpec
import com.twitter.diffy.lifter.HttpLifter.MalformedJsonContentException
import com.twitter.io.Charsets
import com.twitter.util.{Await, Throw, Try}
import org.jboss... | mgifos/diffy | src/test/scala/com/twitter/diffy/lifter/HttpLifterSpec.scala | Scala | apache-2.0 | 7,870 |
/* Copyright 2017 EPFL, Lausanne */
package inox
package parsing
case class MatchPosition(id: Int) | romac/inox | src/main/scala/inox/parsing/MatchPosition.scala | Scala | apache-2.0 | 100 |
/*
* Copyright University of Basel, Graphics and Vision Research Group
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless ... | unibas-gravis/scalismo-faces | src/main/scala/scalismo/faces/mesh/MeshSurfaceSampling.scala | Scala | apache-2.0 | 1,918 |
// #1435
object t1435 {
implicit def a(s:String):String = sys.error("")
implicit def a(i:Int):String = sys.error("")
implicit def b(i:Int):String = sys.error("")
}
class C1435 {
val v:String = {
import t1435.a
2
}
}
// #1492
class C1492 {
class X
def foo(x: X => X): Unit = {}
foo ( implicit... | yusuke2255/dotty | tests/pending/pos/implicits-old.scala | Scala | bsd-3-clause | 1,538 |
/*
* Copyright 2020 Precog Data
*
* 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 ... | djspiewak/quasar | frontend/src/test/scala/quasar/ScalarStageSpec.scala | Scala | apache-2.0 | 95,570 |
package org.jetbrains.plugins.scala
package lang.rearranger
import com.intellij.openapi.editor.Document
import com.intellij.openapi.util.TextRange
import com.intellij.openapi.util.text.StringUtil
import com.intellij.psi._
import com.intellij.psi.codeStyle.arrangement.ArrangementUtil
import com.intellij.psi.codeStyle.a... | JetBrains/intellij-scala | scala/scala-impl/src/org/jetbrains/plugins/scala/lang/rearranger/ScalaArrangementVisitor.scala | Scala | apache-2.0 | 18,035 |
/*
* Copyright 2001-2013 Artima, 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 agre... | scalatest/scalatest | jvm/scalatest-test/src/test/scala/org/scalatest/InOrderContainMatcherDeciderSpec.scala | Scala | apache-2.0 | 11,933 |
/*
* 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/execution/streaming/StreamExecution.scala | Scala | apache-2.0 | 26,324 |
/*
* 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... | yuyongyang800/SparkDistributedMatrix | src/main/scala/org/apache/spark/sql/matfast/matrix/BLAS.scala | Scala | apache-2.0 | 20,671 |
/***********************************************************************
* 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-arrow/geomesa-arrow-tools/src/main/scala/org/locationtech/geomesa/arrow/tools/ArrowRunner.scala | Scala | apache-2.0 | 1,297 |
package controllers
import views._
import com.p44.broadcast.FishStoreBroadcaster
import akka.pattern.ask
import akka.util.Timeout
import play.api.Play.current
import play.api.mvc.{ Action, Controller }
import scala.concurrent.duration._
import scala.concurrent.Future
import scala.concurrent.ExecutionContext.Implicits... | p44/FishStore | app/controllers/FishStoreTwoController.scala | Scala | apache-2.0 | 3,970 |
/*
Copyright (c) 2017, Qvantel
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 and the following di... | Doikor/jsonapi-scala | core/src/test/scala/com/qvantel/jsonapi/MacrosSpec.scala | Scala | bsd-3-clause | 10,473 |
/***********************************************************************
* Copyright (c) 2013-2015 Commonwealth Computer Research, Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Apache License, Version 2.0 which
* accompanies this distribution and is ... | drackaer/geomesa | geomesa-tools/src/main/scala/org/locationtech/geomesa/tools/commands/AccumuloParams.scala | Scala | apache-2.0 | 4,150 |
package org.jetbrains.plugins.scala.extensions
import com.intellij.psi.PsiElement
object PrevSiblingNotWhitespaceComment {
def unapply(e: PsiElement): Option[PsiElement] = Option(e.getPrevSiblingNotWhitespaceComment)
}
| JetBrains/intellij-scala | scala/scala-impl/src/org/jetbrains/plugins/scala/extensions/PrevSiblingNotWhitespaceComment.scala | Scala | apache-2.0 | 223 |
package com.twitter.finagle.mux
import com.twitter.concurrent.AsyncQueue
import com.twitter.conversions.time._
import com.twitter.finagle.context.Contexts
import com.twitter.finagle.mux.lease.exp.Lessor
import com.twitter.finagle.mux.transport.Message
import com.twitter.finagle.stats.NullStatsReceiver
import com.twitt... | spockz/finagle | finagle-mux/src/test/scala/com/twitter/finagle/mux/ClientServerTest.scala | Scala | apache-2.0 | 10,234 |
package org.jetbrains.plugins.scala.editor.importOptimizer
import com.intellij.psi.{PsiAnchor, PsiWhiteSpace}
import org.jetbrains.plugins.scala.lang.psi.api.toplevel.imports.ScImportStmt
//TODO: rename to "ImportRangeInfo" or "ImportRangeInfo"
final case class RangeInfo(
firstPsi: PsiAnchor,
lastPsi: PsiAnchor,
... | JetBrains/intellij-scala | scala/scala-impl/src/org/jetbrains/plugins/scala/editor/importOptimizer/RangeInfo.scala | Scala | apache-2.0 | 1,239 |
package sc2d
import java.awt.Paint
import java.awt.Shape
import java.awt.Stroke
import java.awt.BasicStroke
import java.awt.Graphics2D
import java.awt.geom.Point2D
import java.awt.geom.Rectangle2D
final case class StrokeShape(shape:Shape, paint:Paint, stroke:Stroke) extends Figure {
private lazy val strokedShape =
... | ritschwumm/sc2d | src/main/scala/sc2d/StrokeShape.scala | Scala | bsd-2-clause | 1,272 |
// Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
// Licensed under the Apache License, Version 2.0 (see LICENSE).
package org.pantsbuild.testproject.publish
// A simple jvm binary to test the jvm_run task on. Try, e.g.,
// ./pants -ldebug run --jvm-run-jvm-options='-Dfoo=bar' --jvm-run-jvm-program-... | tdyas/pants | testprojects/src/scala/org/pantsbuild/testproject/publish/JvmRunExample.scala | Scala | apache-2.0 | 565 |
package org.randi3.schema
import scala.slick.lifted.{TypeMapperDelegate, BaseTypeMapper}
import scala.slick.driver.BasicProfile
import scala.slick.session.{PositionedResult, PositionedParameters}
import java.sql.SQLException
object PostgresByteArrayTypeMapper extends
BaseTypeMapper[Array[Byte]] with TypeMapperDelega... | dschrimpf/randi3-core | src/main/scala/org/randi3/schema/PostgresTypeMapper.scala | Scala | gpl-3.0 | 1,012 |
package com.identityblitz.jwt
import com.identityblitz.json._
import com.identityblitz.json.JSuccess
import org.joda.time.DateTime
/**
* This class represents IntDate type of JSON Web Token. The type contain the number of seconds from 1970-01-01T0:0:OZ UTC
* until the specified UTC date/time.
*/
sealed case class ... | brainysmith/json-lib | src/main/scala/com/identityblitz/jwt/IntDate.scala | Scala | mit | 1,042 |
/*
* 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/main/scala/uk/gov/hmrc/ct/accounts/frs102/calculations/TotalCreditorsWithinOneYearCalculator.scala | Scala | apache-2.0 | 1,276 |
package services
import javax.inject.Singleton
import play.api.Logger
import scala.collection.mutable
/**
* Store for conversion log messages.
*/
trait LogStore {
def add(id: String, log: Seq[String]): Unit
def get(id: String): Option[Seq[String]]
}
/**
* Memory backed log store.
*/
@Singleton
class Si... | kuhnuri/kuhnuri-queue | app/services/LogStore.scala | Scala | apache-2.0 | 733 |
import p.C
import scala.tools.asm.Opcodes
import scala.tools.partest.BytecodeTest
import scala.tools.partest.ASMConverters._
object Test extends BytecodeTest {
def foo(c: C, x: Int) = c.f(x)
def goo(c: C, x: Int) = c.g(x)
def has(i: Instruction, c: String, m: String) = {
val cls = loadClassNode(c)
val ... | felixmulder/scala | test/files/run/t9403/Test_2.scala | Scala | bsd-3-clause | 725 |
import org.apache.spark.{SparkContext, SparkConf}
/**
* Created by ma on 15-1-27.
*/
class QueryT18 extends BaseQuery{
System.setProperty("spark.cores.max",String.valueOf(ParamSet.cores))
val conf = new SparkConf()
conf.setAppName("TPCH-Q18")
val sc = new SparkContext(conf)
val sqlContext = new org.ap... | f7753/spark-SQL-tpch-test-tool | QueryT18.scala | Scala | apache-2.0 | 2,471 |
package scala.slick.jdbc
trait ResultSetMutator[T] {
/**
* Get the current row's value.
*/
def row: T
/**
* Update the current row.
*/
def row_=(value: T)
/**
* Insert a new row.
*/
def insert(value: T)
/**
* Delete the current row.
*/
def delete(): Unit
}
| szeiger/scala-query | src/main/scala/scala/slick/jdbc/ResultSetMutator.scala | Scala | bsd-2-clause | 302 |
/*
* Licensed to Cloudera, Inc. under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. Cloudera, Inc. licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use thi... | vmanoria/bluemix-hue-filebrowser | hue-3.8.1-bluemix/apps/spark/java/livy-core/src/main/scala/com/cloudera/hue/livy/LineBufferedStream.scala | Scala | gpl-2.0 | 2,444 |
package foo
trait ArgumentExprs1 {
def f(foo: Int, bar: String)(implicit ev0: Ev0, ev1: Ev1) = 1
f(
23,
"bar",
)(
Ev0,
Ev1,
)
// test arg exprs in the presence of varargs
def g(x: Int, y: Int*) = 1
g(1,2,
)
g(1,List(2, 3): _*,
)
}
trait ArgumentExprs2 {
class C(foo: Int, bar: St... | lrytz/scala | test/files/pos/trailing-commas.scala | Scala | apache-2.0 | 2,149 |
/** Copyright 2015 TappingStone, 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 ... | alex9311/PredictionIO | data/src/main/scala/org/apache/predictionio/data/webhooks/mailchimp/MailChimpConnector.scala | Scala | apache-2.0 | 9,315 |
// Databricks notebook source exported at Sat, 18 Jun 2016 07:08:06 UTC
// MAGIC %md
// MAGIC
// MAGIC # [Scalable Data Science](http://www.math.canterbury.ac.nz/~r.sainudiin/courses/ScalableDataScience/)
// MAGIC
// MAGIC
// MAGIC ### prepared by [Raazesh Sainudiin](https://nz.linkedin.com/in/raazesh-sainudiin-4595... | raazesh-sainudiin/scalable-data-science | db/xtraResources/ProgGuides1_6/sqlProgrammingGuide/003_dataSources_sqlProgGuide.scala | Scala | unlicense | 33,097 |
package sri.web.vdom
import org.scalajs.dom
import sri.core._
import scalajsplus.macros.{FunctionObjectMacro, exclude}
import scalajsplus.{OptDefault => NoValue, OptionalParam => U}
import sri.universal.MergeJSObjects
import scala.scalajs.js
import scala.scalajs.js.Dynamic.{literal => json}
import scala.scalajs.js.J... | scalajs-react-interface/vdom | src/main/scala/sri/web/vdom/Tags.scala | Scala | apache-2.0 | 129,267 |
/*
* 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/main/scala/org/beangle/commons/codec/binary/Base64.scala | Scala | lgpl-3.0 | 3,439 |
package shared
import app.{RouterBuilderUtils, WsClientMacro}
import org.scalatest.{FlatSpec, Matchers}
class WsMacrosTest extends FlatSpec with Matchers {
trait Api {
def updateTopic(id: Long, data: String): List[String]
def updateParagraph(id: Long): Either[String, Int]
}
"WsClient.post" should "do c... | Igorocky/lesn | macroses/src/test/scala/shared/WsMacrosTest.scala | Scala | mit | 2,849 |
/*
* 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 ... | nchammas/spark | sql/core/src/test/scala/org/apache/spark/sql/DataFrameWindowFunctionsSuite.scala | Scala | apache-2.0 | 41,837 |
package net.rrm.ehour.reminder
import net.rrm.ehour.AbstractSpec
import net.rrm.ehour.config.EhourConfigStub
import net.rrm.ehour.domain.UserObjectMother
import net.rrm.ehour.mail.service.MailMan
import net.rrm.ehour.persistence.mail.dao.MailLogDao
import org.mockito.ArgumentCaptor
import org.mockito.Matchers._
import... | momogentoo/ehour | eHour-service/src/test/scala/net/rrm/ehour/reminder/ReminderServiceSpec.scala | Scala | gpl-2.0 | 1,786 |
package org.bitcoins.rpc.marshallers.wallet
import org.bitcoins.core.crypto.DoubleSha256Digest
import org.bitcoins.core.currency.{Bitcoins, CurrencyUnit}
import org.bitcoins.core.protocol.transaction.Transaction
import org.bitcoins.core.util.BitcoinSLogger
import org.bitcoins.rpc.bitcoincore.wallet.{UTXO, WalletTransa... | bitcoin-s/bitcoin-s-rpc-client | src/main/scala/org/bitcoins/rpc/marshallers/wallet/WalletTransactionMarshaller.scala | Scala | mit | 4,132 |
package se.gigurra.leavu3.datamodel
import com.github.gigurra.heisenberg.MapData._
import com.github.gigurra.heisenberg.{Schema, Parsed}
case class NavIndicators(source: SourceData = Map.empty) extends SafeParsed[NavIndicators.type] {
val requirements = parse(schema.requirements)
val acs = parse(schema.a... | GiGurra/leavu3 | src/main/scala/se/gigurra/leavu3/datamodel/NavIndicators.scala | Scala | mit | 658 |
import scala.reflect.runtime.universe._
import scala.tools.reflect.Eval
object Test extends App {
reify {
/** A mutable property whose getter and setter may be customized. */
case class Property[T](init: T) {
private var value: T = init
/** The getter function, defaults to identity. */
pri... | som-snytt/dotty | tests/disabled/macro/run/reify_properties.scala | Scala | apache-2.0 | 1,742 |
package sttp.client3
import org.scalatest.flatspec.AnyFlatSpec
import org.scalatest.matchers.should.Matchers
import java.nio.charset.StandardCharsets
class ToRfc2616ConverterTest extends AnyFlatSpec with Matchers {
private val localhost = uri"http://localhost"
it should "convert base request" in {
val req ... | softwaremill/sttp | core/src/test/scala/sttp/client3/ToRfc2616ConverterTest.scala | Scala | apache-2.0 | 4,053 |
package test_data
import scala.xml.Elem
case class SectionAboutEmployment(xml: Elem) {
val rootPathJobDetails = xml \\\\ "DWPCATransaction" \\\\ "DWPCAClaim" \\\\ "Employment" \\\\ "JobDetails"
val areYouEmployedQuestion = xml \\\\ "DWPCATransaction" \\\\ "DWPCAClaim" \\\\ "Employed" \\\\ "QuestionLabel"
va... | Department-for-Work-and-Pensions/RenderingService | test/test_data/SectionAboutEmployment.scala | Scala | mit | 3,472 |
// Copyright 2014 Foursquare Labs Inc. All Rights Reserved.
package io.fsq.rogue.lift
import com.mongodb.DBObject
import io.fsq.field.Field
import io.fsq.rogue.{AbstractListModifyField, AbstractListQueryField, SelectableDummyField}
class CaseClassQueryField[V, M](val field: Field[V, M]) {
def unsafeField[F](name: ... | foursquare/fsqio | src/jvm/io/fsq/rogue/lift/LiftQueryField.scala | Scala | apache-2.0 | 981 |
package com.github.diegopacheco.sandbox.scripts.scala.colletions
object ListCollectionsFun extends App {
val teams = List("Grêmio FC","São Paulo FC","Palmeiras FC","Inter FC")
println(teams.head)
println(teams(1))
val moreTeams = "Curitiba" :: teams
println(moreTeams.head)
println(moreTeams)
val brasilei... | diegopacheco/scala-playground | scala-playground/src/com/github/diegopacheco/sandbox/scripts/scala/colletions/ListCollectionsFun.scala | Scala | unlicense | 842 |
/*
* Copyright 2014–2018 SlamData Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agr... | jedesah/Quasar | mongodb/src/main/scala/quasar/physical/mongodb/collection.scala | Scala | apache-2.0 | 6,839 |
package org.functionalkoans.forscala
import org.functionalkoans.forscala.support.KoanFunSuite
import org.scalatest.Matchers
import org.scalatest.Matchers
class AboutLiteralBooleans extends KoanFunSuite with Matchers {
koan("""Boolean literals are either true or false, using the true or false keyword""") {
val ... | pharmpress/codingdojo | scala-koans/src/test/scala/org/functionalkoans/forscala/AboutLiteralBooleans.scala | Scala | apache-2.0 | 548 |
package com.twitter.finagle.thriftmux
import com.twitter.conversions.time._
import com.twitter.finagle._
import com.twitter.finagle.builder.{ServerBuilder, ClientBuilder}
import com.twitter.finagle.client.StackClient
import com.twitter.finagle.dispatch.PipeliningDispatcher
import com.twitter.finagle.param.{Label, Stat... | kristofa/finagle | finagle-thriftmux/src/test/scala/com/twitter/finagle/thriftmux/EndToEndTest.scala | Scala | apache-2.0 | 19,247 |
package org.scalajs.testsuite.javalib.time.chrono
import java.time.{DateTimeException, LocalTime, LocalDate}
import java.time.chrono.ChronoLocalDate
import org.scalajs.testsuite.javalib.time.temporal.TemporalTest
object ChronoLocalDateTest extends TemporalTest {
import ChronoLocalDate._
describe("java.time.chro... | jasonchaffee/scala-js | test-suite/js/src/test/require-jdk8/org/scalajs/testsuite/javalib/time/chrono/ChronoLocalDateTest.scala | Scala | bsd-3-clause | 911 |
/**
* Copyright 2010 James Strachan
*
* 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 ... | jstrachan/webbytest | src/main/scala/webbytest/HtmlTestsProject.scala | Scala | apache-2.0 | 1,155 |
package edu.cmu.lti.nlp.amr.GraphDecoder
import edu.cmu.lti.nlp.amr._
import edu.cmu.lti.nlp.amr.FastFeatureVector._
import java.io.File
import java.io.FileOutputStream
import java.io.PrintStream
import java.io.BufferedOutputStream
import java.io.OutputStreamWriter
import java.lang.Math.abs
import java.lang.Math.log
i... | jflanigan/jamr | src/GraphDecoder/Alg1.scala | Scala | bsd-2-clause | 6,964 |
/*
* Copyright (C) Lightbend Inc. <https://www.lightbend.com>
*/
package play.libs.ws
import akka.actor.ActorSystem
import akka.stream.Materializer
import play.api.mvc.Results._
import play.api.mvc._
import play.api.test._
import play.core.server.Server
import play.libs.ws.ahc.AhcWSClient
import play.shaded.ahc.org... | benmccann/playframework | transport/client/play-ahc-ws/src/test/scala/play/libs/ws/WSSpec.scala | Scala | apache-2.0 | 1,499 |
/*
* Copyright (C) 2009-2018 Lightbend Inc. <https://www.lightbend.com>
*/
package scalaguide.json
import javax.inject.Inject
import org.junit.runner.RunWith
import org.specs2.runner.JUnitRunner
import play.api.mvc._
import play.api.test._
import scala.concurrent.Future
@RunWith(classOf[JUnitRunner])
class ScalaJ... | Shenker93/playframework | documentation/manual/working/scalaGuide/main/json/code/ScalaJsonHttpSpec.scala | Scala | apache-2.0 | 7,909 |
/*
* Copyright (c) 2013-2022 Erik van Oosten
*
* 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 ... | erikvanoosten/metrics-scala | metrics-scala-hdr/src/main/scala/nl/grons/metrics4/scala/HdrMetricBuilder.scala | Scala | apache-2.0 | 2,557 |
/*
* 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 | infinity/common/src/test/scala/es/tid/cosmos/infinity/common/json/formats/Rfc822DateFormatTest.scala | Scala | apache-2.0 | 1,294 |
/*
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 use this f... | transcendent-ai-labs/DynaML | dynaml-core/src/main/scala/io/github/mandar2812/dynaml/models/neuralnets/CommitteeNetwork.scala | Scala | apache-2.0 | 4,583 |
package com.github.sstone.amqp
import akka.testkit.{ImplicitSender, TestKit}
import akka.actor.{ActorRef, Props, ActorSystem}
import akka.util.Timeout
import akka.pattern.{ask, gracefulStop}
import org.scalatest.{BeforeAndAfter, WordSpecLike}
import org.scalatest.matchers.ShouldMatchers
import java.util.concur... | sstone/amqp-client | src/test/scala/com/github/sstone/amqp/ChannelSpec.scala | Scala | mit | 1,577 |
import org.scalawebtest.core.gauge.HtmlGauge
import org.scalawebtest.core.{IntegrationFlatSpec, IntegrationFreeSpec}
abstract class BaseSpec extends IntegrationFlatSpec with HtmlGauge {
config.useBaseUri("http://localhost:9000")
} | unic/ScalaWebTest | examples/play-scala-starter-example/it/BaseSpec.scala | Scala | apache-2.0 | 233 |
package com.github.mdr.mash.evaluator
class ClassesTest extends AbstractEvaluatorTest {
"class Point x y; Point.new 3 4 | [.x, .y]" ==> "[3, 4]"
"class Point x y; Point 3 4 | [.x, .y]" ==> "[3, 4]"
"class Point x y { def sum = x + y }; Point 3 4 | .sum" ==> 7
"class Point x y { def sum = this.x + this.y }; Po... | mdr/mash | src/test/scala/com/github/mdr/mash/evaluator/ClassesTest.scala | Scala | mit | 1,521 |
package BootstrapResampling
import org.scalatest.FunSuite
import org.scalatest.BeforeAndAfter
class BootstrapResamplingTest extends FunSuite with BeforeAndAfter {
def mean(x: Vector[Double]) = {
x.foldLeft(0.0)((a, b) => a + b) / x.length
}
def variance(x: Vector[Double]) = {
val mu = mean(x)
x.... | rdtaylor/BootstrapResampling | src/test/scala/BootstrapResampling/BootstrapResamplingTest.scala | Scala | mit | 3,307 |
package streams
import common._
/**
* This component implements a parser to define terrains from a
* graphical ASCII representation.
*
* When mixing in that component, a level can be defined by
* defining the field `level` in the following form:
*
* val level =
* """------
* |--ST--
* |-... | mmcc007/scala-principles | streams/src/main/scala/streams/StringParserTerrain.scala | Scala | gpl-3.0 | 2,712 |
/*
* Copyright (c) 2014-2015 by its authors. Some rights reserved.
* See the project homepage at: http://www.monifu.org
*
* 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://... | virtualirfan/monifu | monifu/jvm/src/test/scala/monifu/reactive/observers/BufferUnboundedConcurrencySuite.scala | Scala | apache-2.0 | 7,931 |
package software.betamax.specs2
import org.apache.commons.io.IOUtils
import org.apache.http.client.HttpClient
import org.apache.http.client.methods.HttpGet
import org.apache.http.impl.client.HttpClientBuilder
import org.junit.runner.RunWith
import org.specs2.mutable.Specification
import org.specs2.runner.JUnitRunner
... | betamaxteam/betamax | betamax-specs2_2.11/src/test/scala/software/betamax/specs2/RecordedInteractionTest.scala | Scala | apache-2.0 | 1,419 |
package skinny.micro.response
import java.io.{ OutputStream, PrintWriter }
import javax.servlet.http.{ Cookie => ServletCookie, HttpServletResponse }
import skinny.micro.ServletConcurrencyException
import skinny.micro.cookie.Cookie
import skinny.micro.implicits.RicherStringImplicits
import scala.collection.JavaConve... | xerial/skinny-micro | micro/src/main/scala/skinny/micro/response/RichResponse.scala | Scala | bsd-2-clause | 2,750 |
/*
* 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 reflect
... | martijnhoekstra/scala | src/reflect/scala/reflect/api/Names.scala | Scala | apache-2.0 | 4,801 |
package beer.features
import org.scalatest.{FlatSpec, ShouldMatchers}
/**
* @author milos
*/
class LengthDisbalanceTest extends FlatSpec with ShouldMatchers {
"disbalance" should "work" in {
val exponential = false
val f = new LengthDisbalance(exponential, List(1.0))
val sys = "Hello I am".split(" ... | qingsongma/blend | tools/beer_2.0/src/beer/features/LengthDisbalanceTest.scala | Scala | gpl-3.0 | 837 |
package renesca.graph
import renesca.NonBacktickName
import renesca.parameter.{PropertyKey, PropertyMap}
import scala.collection.mutable
object Label {
implicit def StringToLabel(name: String): Label = Label(name)
}
case class Label(name: String) extends NonBacktickName
object Node {
private[renesca] def apply... | renesca/renesca | shared/src/main/scala/renesca/graph/Node.scala | Scala | apache-2.0 | 2,555 |
package org.denigma.threejs.extras
import org.denigma.threejs.{ Vector3, Vector2, Camera }
import org.scalajs.dom
import scala.scalajs.js
import scala.scalajs.js.annotation.JSName
@js.native
@JSName("THREE.TrackballControls")
class TrackBallControls(camera: Camera) extends js.Object {
def getMouseOnSc... | antonkulaga/threejs-facade | facade/src/main/scala/org/denigma/threejs/extras/TrackBallControls.scala | Scala | mpl-2.0 | 929 |
package org.jetbrains.bsp.protocol
import java.io.File
import ch.epfl.scala.bsp4j.BspConnectionDetails
import com.google.gson.Gson
import com.intellij.openapi.util.SystemInfo
import com.intellij.openapi.util.text.StringUtil.defaultIfEmpty
import com.intellij.util.SystemProperties
import org.jetbrains.bsp.{BspBundle, ... | JetBrains/intellij-scala | bsp/src/org/jetbrains/bsp/protocol/BspConnectionConfig.scala | Scala | apache-2.0 | 3,681 |
package org.ai4fm.proofprocess.zeves.core.parse
import scala.collection.JavaConverters._
import scala.language.existentials
import org.ai4fm.proofprocess.{Intent, Loc, ProofElem, ProofEntry, ProofProcessFactory, Term, Trace}
import org.ai4fm.proofprocess.core.graph.PProcessGraph._
import org.ai4fm.proofprocess.core.u... | andriusvelykis/proofprocess | org.ai4fm.proofprocess.zeves.core/src/org/ai4fm/proofprocess/zeves/core/parse/ProofEntryReader.scala | Scala | epl-1.0 | 6,672 |
package pl.tk.scalaconstructs
trait FunctorObject[A,F[_]] {
def map[B <: A](mapper : A => B) : F[B]
}
trait FunctorStandalone[F[_]] {
def map[A,B](value : F[A])(f : A =>B) : F[B]
}
object FunctorStandalone {
implicit def listFunctor = new FunctorStandalone[List] {
def map[A,B](value : List[A])(f:A=>B) = v... | almendar/scala-constructs-learn | src/main/scala/pl/tk/scalaconstructs/MonadicEither.scala | Scala | apache-2.0 | 2,725 |
/*
* Copyright (c) 2002-2018 "Neo Technology,"
* Network Engine for Objects in Lund AB [http://neotechnology.com]
*
* This file is part of Neo4j.
*
* Neo4j 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 Foundatio... | HuangLS/neo4j | community/cypher/compatibility-suite/src/test/scala/cypher/cucumber/reporter/JsonResult.scala | Scala | apache-2.0 | 1,531 |
package com.twitter.server
import com.twitter.app.{App, Flag}
import com.twitter.finagle.client.ClientRegistry
import com.twitter.finagle.filter.ServerAdmissionControl
import com.twitter.finagle.http.{HttpMuxer, Method, Request, Response, Route => HttpRoute}
import com.twitter.finagle.server.ServerRegistry
import com.... | twitter/twitter-server | server/src/main/scala/com/twitter/server/AdminHttpServer.scala | Scala | apache-2.0 | 11,475 |
package controllers
import play.api.libs.json.Json
import play.api.libs.ws.WS
import play.api.mvc._
import securesocial.core._
/**
* A controller for authenticating REST api clients.
* Based on http://eng.kifi.com/mobile-auth-with-play-and-securesocial/
*/
object ApiAuth extends Controller {
private implicit va... | epidataio/epidata-community | play/app/controllers/ApiAuth.scala | Scala | apache-2.0 | 1,364 |
package net.sansa_stack.query.tests
import java.io.File
import java.net.{URI, URL}
import java.nio.file.{Path, Paths}
import scala.collection.JavaConverters._
import org.apache.jena.riot.RDFParserBuilder
import org.apache.jena.ext.com.google.common.reflect.ClassPath
import org.apache.jena.iri.{IRIFactory, ViolationC... | SANSA-Stack/SANSA-RDF | sansa-query/sansa-query-tests/src/main/scala/net/sansa_stack/query/tests/W3cConformanceSPARQLQueryEvaluationTestSuite.scala | Scala | apache-2.0 | 6,236 |
/*
* MnoClassifier learns MSISDN-Operator combinations to afterwards predict Operators.
* Copyright (C) 2013 MACH Connectivity 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... | mkroli/mnoclassifier | src/main/scala/com/github/mkroli/mnoclassifier/service/ShutdownServiceComponent.scala | Scala | gpl-2.0 | 2,470 |
/*
* Copyright (c) 2002-2018 "Neo Technology,"
* Network Engine for Objects in Lund AB [http://neotechnology.com]
*
* This file is part of Neo4j.
*
* Neo4j 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 Foundatio... | HuangLS/neo4j | community/cypher/cypher-compiler-2.3/src/main/scala/org/neo4j/cypher/internal/compiler/v2_3/commands/expressions/InequalitySeekRangeExpression.scala | Scala | apache-2.0 | 1,737 |
package glint.model
/**
* Root trait for glinting objects (nodes and )
* Created by CAB on 01.03.2015.
*/
trait Glint {
val version:Long = -1
val glintID:Long = -1}
| AlexCAB/Glint | src/main/scala/glint/model/Glint.scala | Scala | mit | 175 |
package org.jetbrains.plugins.scala
package lang
package parser
package parsing
package types
import org.jetbrains.plugins.scala.lang.lexer.ScalaTokenTypes
import org.jetbrains.plugins.scala.lang.parser.parsing.builder.ScalaPsiBuilder
/**
* @author Alexander Podkhalyuzin
* Date: 08.02.2008
*/
/*
* SelfType ::= id [... | ilinum/intellij-scala | src/org/jetbrains/plugins/scala/lang/parser/parsing/types/SelfType.scala | Scala | apache-2.0 | 3,062 |
package modules
import java.io._
import java.net.URISyntaxException
import java.util.Scanner
import irc.info.{Info, Rank}
import irc.message.{Message, MessageCommands}
import irc.server.ServerResponder
import ircbot.{BotCommand, BotModule, ModuleFiles}
import org.json.JSONArray
class Administration extends BotModule... | wiiaam/taylorswift | src/main/scala/modules/Administration.scala | Scala | agpl-3.0 | 13,434 |
package tracing
import monix.eval.tracing.{TaskEvent, TaskTrace}
import monix.eval.{BaseTestSuite, Task}
/**
* All Credits to https://github.com/typelevel/cats-effect and https://github.com/RaasAhsan
*/
object FullStackTracingSuite extends BaseTestSuite {
def traced[A](io: Task[A]): Task[TaskTrace] =
io.fl... | monix/monix | tracingTests/src/fulltracing/scala/tracing/FullStackTracingSuite.scala | Scala | apache-2.0 | 4,306 |
/*
* 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 ... | minixalpha/spark | sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/PartitioningUtils.scala | Scala | apache-2.0 | 19,064 |
package com.twitter.finagle.memcached.integration
import java.net.{InetAddress, InetSocketAddress}
import com.twitter.common.io.FileUtils._
import com.twitter.common.quantity.{Time, Amount}
import com.twitter.common.zookeeper.{ZooKeeperUtils, ServerSets, ZooKeeperClient}
import com.twitter.conversions.time._
import c... | kristofa/finagle | finagle-memcached/src/test/scala/com/twitter/finagle/memcached/integration/MigrationClientTest.scala | Scala | apache-2.0 | 10,077 |
package lila.memo
import com.typesafe.config.Config
import lila.db.Types._
final class Env(config: Config, db: lila.db.Env) {
private val CollectionCache = config getString "collection.cache"
lazy val mongoCache: MongoCache.Builder = MongoCache(db(CollectionCache))
}
object Env {
lazy val current = "[boot] ... | Happy0/lila | modules/memo/src/main/Env.scala | Scala | mit | 415 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | jkbradley/spark | core/src/test/scala/org/apache/spark/deploy/history/EventLogFileReadersSuite.scala | Scala | apache-2.0 | 13,567 |
package slamdata.engine.physical.mongodb
import slamdata.engine._
import scalaz._
import Scalaz._
import collection.immutable.ListMap
import org.specs2.mutable._
class FindQuerySpec extends Specification {
implicit def toBson(x: Int) = Bson.Int32(x)
implicit def toField(name: String) = BsonField.Name(name)
... | mossprescott/quasar | src/test/scala/slamdata/engine/physical/mongodb/findquery.scala | Scala | agpl-3.0 | 1,962 |
package com.github.j5ik2o.chatwork.infrastructure.api.my
import com.github.j5ik2o.chatwork.infrastructure.api.ClientFactory
import com.github.j5ik2o.chatwork.infrastructure.api.me.MeApiService
import org.specs2.mutable.Specification
import scala.concurrent.Await
import scala.concurrent.ExecutionContext.Implicits.globa... | j5ik2o/chatwork-client | src/test/scala/com/github/j5ik2o/chatwork/infrastructure/api/my/TaskApiServiceImplSpec.scala | Scala | apache-2.0 | 799 |
package at.forsyte.apalache.tla.bmcmt.rewriter
/**
* Configuration options for SymbStateRewriter, see tuning.md.
*
* @author Igor Konnov
*/
class RewriterConfig {
/**
* If true, translate 'or' and 'and' into 'if-then-else'.
*/
var shortCircuit = true
/**
* If true, for A /\ B, check satisfiab... | konnov/dach | tla-bmcmt/src/main/scala/at/forsyte/apalache/tla/bmcmt/rewriter/RewriterConfig.scala | Scala | apache-2.0 | 896 |
/*
* Copyright 2014 Commonwealth Computer Research, 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... | drmathochist/geomesa | geomesa-core/src/main/scala/org/locationtech/geomesa/core/data/GeoMesaMetadata.scala | Scala | apache-2.0 | 7,666 |
package scorex.settings
import java.net.{InetAddress, InetSocketAddress}
import play.api.libs.json.{JsObject, Json}
import scorex.crypto.Base58
import scorex.utils.ScorexLogging
import scala.util.Try
/**
* Changeable settings here
*/
trait Settings extends ScorexLogging {
lazy val Port = 9084
val filename:... | beni55/Scorex-Lagonaki | scorex-basics/src/main/scala/scorex/settings/Settings.scala | Scala | cc0-1.0 | 2,559 |
package net.tomasherman.specus.server.api.net
import org.specs2.mutable.Specification
import org.jboss.netty.buffer.ChannelBuffers.dynamicBuffer
import org.jboss.netty.buffer.ChannelBuffers.buffer
import net.tomasherman.specus.server.api.net.DecodingUtils._
import org.jboss.netty.util.CharsetUtil
import java.nio.chars... | tomasherman/specus | server_api/src/test/scala/net/tomasherman/specus/server/api/net/DecodingUtilsSpec.scala | Scala | gpl-3.0 | 4,850 |
/*
*
* 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
* distri... | flaminem/flamy | src/test/scala/com/flaminem/flamy/parsing/hive/AnnotationParser$Test.scala | Scala | apache-2.0 | 2,069 |
package scife
package enumeration
package iterable
package testcase
import scife.{ enumeration => e }
import e.iterable._
import e.dependent._
import scife.util.logging._
import scife.util._
import org.scalatest._
import org.scalatest.prop._
import org.scalacheck.Gen
import scala.language.postfixOps
class BinarySe... | kaptoxic/SciFe | src/test/scala/scife/enumeration/iterable/testcase/BinarySearchTreeEnum.scala | Scala | gpl-2.0 | 1,119 |
/*
* 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 ... | aokolnychyi/spark | sql/hive/src/test/scala/org/apache/spark/sql/hive/HiveExternalSessionCatalogSuite.scala | Scala | apache-2.0 | 1,686 |
package com.daxin
/**
* address 主构造器中参数不写var或者val的话默认是private[this] val 型 , val 和var 隐式的指定了权限
* 所以address是private[this]
* class Dog(var name: String, var age: Int, address: String) 主构造器
*
*
*/
class Dog(var name: String, var age: Int, address: String) {
/**
* 从构造器,在重构造器中必须调用主构造器初始化
*
* 使用this关键字... | Dax1n/Scala | ConstructorDemo/src/com/daxin/Dog.scala | Scala | apache-2.0 | 988 |
/*
* Copyright 2020 Lenses.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.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to i... | datamountaineer/stream-reactor | kafka-connect-aws-s3/src/test/scala/io/lenses/streamreactor/connect/aws/s3/formats/TextFormatWriterTest.scala | Scala | apache-2.0 | 2,167 |
package lettergenerator
package mediator
import formatter.{DocxMakerFormatter,Template,Details}
import generators._
import org.docx4j.openpackaging.io.SaveToZipFile
import org.docx4j.openpackaging.packages.WordprocessingMLPackage
import java.util.{HashMap => JHashMap}
class DocxMediator(gui: renderer.Wizard, templa... | claudiusbr/LetterGenerator | src/main/scala/lettergenerator/mediator/DocxMediator.scala | Scala | mit | 1,394 |
/*
* 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/config/FiltersSpec.scala | Scala | apache-2.0 | 3,341 |
package spatial.codegen.chiselgen
import argon.codegen.chiselgen.ChiselCodegen
import argon.core._
import spatial.aliases._
import spatial.nodes._
trait ChiselGenHostTransfer extends ChiselCodegen {
// Does not belong in chisel
// override protected def emitNode(lhs: Sym[_], rhs: Op[_]): Unit = rhs match {
//... | stanford-ppl/spatial-lang | spatial/core/src/spatial/codegen/chiselgen/ChiselGenHostTransfer.scala | Scala | mit | 368 |
import leon.lang._
import leon.annotation._
import leon.lang.synthesis._
import leon.collection._
import scala.reflect.runtime.universe._
import scala.reflect.api.{TypeCreator, Universe, Mirror}
import scala.collection.immutable.{List => ScalaList, Nil => ScalaNil}
object Editor {
abstract class Mode
case object... | epfl-lara/leon | testcases/extern/EditorSimple.scala | Scala | gpl-3.0 | 4,500 |
/*
*
* 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
* distri... | flaminem/flamy | src/main/scala/com/flaminem/flamy/parsing/hive/ast/DefaultTransformer.scala | Scala | apache-2.0 | 1,029 |
//-----------------------------------------------------------------------
// FILE : CertificateWriter.scala
// SUBJECT : An object that writes certificates.
// AUTHOR : (C) Copyright 2011 by Peter C. Chapin <PChapin@vtc.vsc.edu>
//
//-----------------------------------------------------------------------
package ed... | pchapin/sprocket | src/edu/uvm/sprocket/CertificateWriter.scala | Scala | bsd-3-clause | 1,324 |
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.