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 s_mach.similar
import breeze.linalg.DenseMatrix
import s_mach.similar.shingle.Shingler
class SimilarByShingles[A,Shingle](shingler: Shingler[A,Shingle])(implicit
s:Similar[Traversable[Shingle]]
) extends
SimilarByFeatures[A,Traversable[Shingle]](shingler) {
// TODO: implement these using algo here http... | S-Mach/s_mach.similar | src/main/scala/s_mach/similar/SimilarByShingles.scala | Scala | mit | 813 |
package org.sapia.mediafire.core.integration
import org.sapia.mediafire.core._
import java.util.Map
import java.io.File
import java.util.HashMap
object IntegrationTest {
def main(args:Array[String]) = {
val credentials = CredentialsFactory.loadCredentials()
val client = MfClientFactory.getDefaultClient("ht... | sapia-oss/mediafire_maven_plugin | core/src/main/scala/org/sapia/mediafire/core/integration/IntegrationTest.scala | Scala | apache-2.0 | 765 |
/*
* This file is part of Kiama.
*
* Copyright (C) 2008-2015 Anthony M Sloane, Macquarie University.
*
* Kiama 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 ... | solomono/kiama | core/src/org/kiama/attribution/AttributionCore.scala | Scala | gpl-3.0 | 21,009 |
package org.jetbrains.plugins.scala
package worksheet.actions
import java.awt.BorderLayout
import javax.swing.DefaultBoundedRangeModel
import com.intellij.icons.AllIcons
import com.intellij.lang.ASTNode
import com.intellij.openapi.actionSystem._
import com.intellij.openapi.application.ApplicationManager
import com.in... | LPTK/intellij-scala | src/org/jetbrains/plugins/scala/worksheet/actions/CleanWorksheetAction.scala | Scala | apache-2.0 | 4,761 |
package beyond
import akka.actor.Actor
import scala.concurrent.duration.FiniteDuration
object TickGenerator {
case object Tick
private[TickGenerator] trait PostStopCaller {
def postStop()
}
}
import TickGenerator._
trait TickGenerator extends PostStopCaller { this: Actor =>
protected val tickInterval: F... | SollmoStudio/beyond | core/app/beyond/TickGenerator.scala | Scala | apache-2.0 | 652 |
/*
* 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/iht-frontend | app/iht/utils/DeceasedInfoHelper.scala | Scala | apache-2.0 | 2,164 |
/*
* This file is part of Gwaihir
* Copyright (C) 2013, 2014 Alvaro Polo
*
* Gwaihir 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... | apoloval/gwaihir | src/main/scala/org/oac/gwaihir/aircraft/a320/system/elec/package.scala | Scala | gpl-2.0 | 1,934 |
import scala.quoted._
import scala.quoted.staging._
sealed abstract class VarRef[T] {
def update(expr: Expr[T])(using QuoteContext): Expr[Unit]
def expr(using QuoteContext): Expr[T]
}
object VarRef {
def apply[T: Type, U: Type](init: Expr[T])(body: VarRef[T] => Expr[U])(using QuoteContext): Expr[U] = '{
var... | som-snytt/dotty | tests/run-staging/i4044b.scala | Scala | apache-2.0 | 748 |
package blended.updater.config
import com.typesafe.config.{Config, ConfigFactory}
import scala.jdk.CollectionConverters._
import scala.util.Try
object FeatureConfigCompanion {
def apply(
repoUrl : String,
name : String,
bundles : List[BundleConfig] = List.empty,
features : List[FeatureRef] = List.e... | woq-blended/blended | blended.updater.config/jvm/src/main/scala/blended/updater/config/FeatureConfigCompanion.scala | Scala | apache-2.0 | 1,697 |
/***********************************************************************
* Copyright (c) 2013-2018 Commonwealth Computer Research, Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Apache License, Version 2.0
* which accompanies this distribution and... | jahhulbert-ccri/geomesa | geomesa-tools/src/test/scala/org/locationtech/geomesa/tools/convert/JPatternConverterTest.scala | Scala | apache-2.0 | 1,619 |
/*
* 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-execution/shared/src/main/scala/monix/execution/internal/collection/DropAllOnOverflowQueue.scala | Scala | apache-2.0 | 6,212 |
package ch.epfl.yinyang
package annotation
import org.scalatest.{ FlatSpec, ShouldMatchers }
class VirtualizeSpec extends FlatSpec with ShouldMatchers with EmbeddedControls {
def __ifThenElse[T](cs: List[Boolean], tb: => T, eb: => T): T = {
if (cs forall (_ == true)) tb else eb
}
def infix_==[T](x1: List[... | vjovanov/scala-yinyang | components/paradise/test/VirtualizeTest.scala | Scala | bsd-3-clause | 4,903 |
/******************************************************************
* See the NOTICE file distributed with this work for additional *
* information regarding Copyright ownership. The author/authors *
* license this file to you under the terms of the Apache License *
* Version 2.0 (the "License"); you may not use ... | reactivecodes/scala-time | src/main/scala/scalatime/impl/IntOps.scala | Scala | apache-2.0 | 2,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 ... | trueyao/spark-lever | core/src/main/scala/org/apache/spark/scheduler/DAGScheduler.scala | Scala | apache-2.0 | 57,687 |
package com.horstman.impatient
class Foo {
println(classOf[Foo])
// val l = new Inner() not possible
val l = new com.horstman.Inner()
}
| koenighotze/scalafortheimpatient | src/main/scala/chapter7/Foo.scala | Scala | apache-2.0 | 143 |
import com.google.protobuf.ByteString
import com.thesamet.proto.e2e.bytes_proto2.ByteMessage2
import org.scalatest.flatspec.AnyFlatSpec
import org.scalatest.matchers.must.Matchers
class BytesSpec extends AnyFlatSpec with Matchers {
"getField" should "work with proto2" in {
val b = ByteMessage2(s = Some(ByteStrin... | scalapb/ScalaPB | e2e/src/test/scala/BytesSpec.scala | Scala | apache-2.0 | 607 |
package codesniffer.deckard
/**
* Created by Bowen Cai on 4/25/2015.
*/
trait VecReader {
}
| xkommando/CodeSniffer | deckard/src/main/scala/codesniffer/deckard/VecReader.scala | Scala | lgpl-3.0 | 104 |
/*
* 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 ... | GJL/flink | flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/plan/utils/AggregateUtil.scala | Scala | apache-2.0 | 29,857 |
import sbt.Keys._
import sbt._
import sbt.io.Using
import scala.annotation.tailrec
import scala.collection.JavaConverters._
import scala.collection.mutable
import scala.collection.immutable.SortedSet
import scala.util.matching.Regex
import scala.xml.Elem
import scala.xml.transform.{RewriteRule, RuleTransformer}
final... | monixio/monix | project/MonixBuildUtils.scala | Scala | apache-2.0 | 4,040 |
package library
import eu.ace_design.island.arena.Teams
import eu.ace_design.island.bot.IExplorerRaid
trait SI3 extends Teams {
def all: Map[String, Class[_ <: IExplorerRaid]] = g1 ++ g2 ++ g3 ++ g4
def players = all
private lazy val g1: Map[String, Class[_ <: IExplorerRaid]] = Map(
"qaa" -> classOf[fr.... | mosser/QGL-15-16 | arena/src/main/scala/library/SI3.scala | Scala | lgpl-3.0 | 1,915 |
package mesosphere.marathon.util
import akka.actor.Scheduler
import scala.concurrent.duration.{ FiniteDuration, _ }
import scala.concurrent.{ ExecutionContext, Future, Promise, blocking => blockingCall }
import scala.util.control.NonFatal
import scala.util.{ Failure, Random, Success }
/**
* Functional transforms t... | yp-engineering/marathon | src/main/scala/mesosphere/marathon/util/Retry.scala | Scala | apache-2.0 | 3,712 |
/*
* Copyright (C) 2016 VSCT
*
* 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 writ... | voyages-sncf-technologies/maze | src/main/scala-2.11/fr/vsct/dt/maze/helpers/package.scala | Scala | apache-2.0 | 899 |
package notebook.server
import java.io.{File, InputStream}
import java.net.URL
import scala.collection.JavaConverters._
import scala.util.control.Exception.allCatch
import org.apache.commons.io.FileUtils
import com.typesafe.config._
import play.api._
import play.api.Logger
import play.api.libs.json._
case class ... | jayfans3/spark-notebook | app/notebook/NotebookConfig.scala | Scala | apache-2.0 | 3,796 |
/*
* 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/test/scala/org/apache/spark/util/DistributionSuite.scala | Scala | apache-2.0 | 1,402 |
/*******************************************************************************
* Copyright 2013 Vladimir Matveev
*
* 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.ap... | netvl/case-yaml | src/main/scala/cc/cu/tplex/caseyaml/Converter.scala | Scala | apache-2.0 | 5,926 |
package special.sigma
import special.collection._
import scalan.{RType, NeverInline}
class CSizeAnyValue(val tVal: RType[Any], val valueSize: Size[Any]) extends SizeAnyValue {
@NeverInline
override def dataSize: Long = valueSize.dataSize
}
class CSizeSigmaProp(val propBytes: Size[Coll[Byte]]) extends SizeSigmaPr... | ScorexFoundation/sigmastate-interpreter | sigma-impl/src/main/scala/special/sigma/SigmaDslCosted.scala | Scala | mit | 2,926 |
import sbt._
import sbt.Project._
import Keys._
import com.kalmanb.sbt.GitBuildPlugin._
object SbtJenkins extends Build {
val projectName = "sbt-git-modules"
val buildVersion = "0.1.0-SNAPSHOT"
val Org = "com.kalmanb"
lazy val root = Project(
id = projectName,
base = file("."),
settings = Seq(
... | kalmanb/sbt-git-modules | playground/project/Build.scala | Scala | apache-2.0 | 1,057 |
/*
* Scala.js (https://www.scala-js.org/)
*
* Copyright EPFL.
*
* Licensed under Apache License 2.0
* (https://www.apache.org/licenses/LICENSE-2.0).
*
* See the NOTICE file distributed with this work for
* additional information regarding copyright ownership.
*/
package java.nio.charset
import scala.annotat... | SebsLittleHelpers/scala-js | javalib/src/main/scala/java/nio/charset/UTF_8.scala | Scala | apache-2.0 | 17,077 |
package views.json.Tag
import org.specs2.matcher.JsonMatchers
import org.specs2.mutable.Specification
import com.overviewdocs.models.Tag
class updateSpec extends Specification with JsonMatchers {
"Json for update tag result" should {
"contain tag attributed" in {
val tag = Tag(id=34L, documentSetId=1L, n... | overview/overview-server | web/test/views/Tag/updateSpec.scala | Scala | agpl-3.0 | 539 |
package com.artclod.mathml
import com.artclod.mathml.scalar.apply._
import com.artclod.mathml.scalar.concept._
import scala.language.implicitConversions
package object scalar {
// Simple Constants
val `-1000` = Cn(-1000)
val `-12` = Cn(-12)
val `-11` = Cn(-11)
val `-10` = Cn(-10)
val `-9` = Cn(-9)
val `-8` = ... | kristiankime/web-education-games | app/com/artclod/mathml/scalar/package.scala | Scala | mit | 2,296 |
package build
import java.nio.charset.StandardCharsets
import java.nio.file.{Files, Path}
import scala.collection.JavaConverters._
import sbt._
import sbt.Keys._
import org.scalajs.linker._
import org.scalajs.linker.interface.{ModuleKind, _}
import org.scalajs.sbtplugin._
import org.scalajs.sbtplugin.ScalaJSPlugin... | scala-js/scala-js | sbt-plugin/src/sbt-test/linker/custom-linker/project/CustomScalaJSLinkerPlugin.scala | Scala | apache-2.0 | 3,314 |
package latis.units
import latis.dm.Variable
import latis.dm.Scalar
/**
* Return the value that was passed in.
*/
class NoOpUnitConverter(from: UnitOfMeasure, to: UnitOfMeasure) extends UnitConverter(from, to) {
//TODO: assert that from == to
override def convert(variable: Scalar): Scalar = variable
de... | dlindhol/LaTiS | src/main/scala/latis/units/NoOpUnitConverter.scala | Scala | epl-1.0 | 364 |
/*******************************************************************************
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/Tizen/TIZENNFCPeer.scala | Scala | bsd-3-clause | 6,848 |
package fpinscala.gettingstarted.exercises
/**
* Created by younggi on 4/17/17.
*/
object Exercise6 {
// Exercise 6: Implement the higher-order function that composes two functions.
// type의 변화에 따라 function 적용 순서
def compose[A,B,C](f: B => C, g: A => B): A => C = {
(a: A) => f(g(a))
}
def compose2[... | younggi/books | functional_programming_in_scala/funpro_scala/src/main/scala/fpinscala/gettingstarted/exercises/Exercise6.scala | Scala | mit | 872 |
/*
* Copyright 2015 Databricks 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 ... | levyx/spark-sql-perf | src/main/scala/com/databricks/spark/sql/perf/tpcds/TPCDS_1_4_Queries.scala | Scala | apache-2.0 | 206,322 |
import scala.tools.partest._
import java.io.{Console => _, _}
object Test extends DirectTest {
override def extraSettings: String = "-usejavacp -Xprint:uncurry -Ydelambdafy:method -Ystop-after:uncurry -d " + testOutput.path
override def code = """class Foo {
| def bar = {
... | yusuke2255/dotty | tests/pending/run/delambdafy_uncurry_method.scala | Scala | bsd-3-clause | 557 |
package play.boilerplate.api.client.dsl
import java.util.UUID
import org.joda.time.format.DateTimeFormat
import org.joda.time.{DateTime, LocalDate, LocalTime}
import org.scalatest.{FlatSpec, Matchers}
class QueryParameterTest extends FlatSpec with Matchers {
"QueryParameter" should "basic types support" in {
... | Romastyi/sbt-play-boilerplate | api-client/share/src/test/scala/play/boilerplate/api/client/dsl/QueryParameterTest.scala | Scala | apache-2.0 | 2,973 |
import scala.tools.partest._
import scala.tools.nsc._
object Test extends DirectTest {
override def extraSettings: String = "-usejavacp"
def code = """
case class C(x: Int, y: Int)
""".trim
def show() {
val global = newCompiler()
import global._
import analyzer._
val output = collection.... | lampepfl/dotty | tests/disabled/macro/run/macroPlugins-namerHooks.scala | Scala | apache-2.0 | 1,184 |
/**
* Vector impl. for metadata
*/
class Vector(var x: Double = 0.0, var y: Double = 0.0) {
def +(operand: Vector): Vector = {
return new Vector(x + operand.x, y + operand.y)
}
def -(operand: Vector): Vector = {
return new Vector(x - operand.x, y - operand.y)
}
def *(operand: Vector): V... | kamir/graphx-layouts | src/experimental/t2.scala | Scala | apache-2.0 | 1,100 |
/*
* tuProlog - Copyright (C) 2001-2002 aliCE team at deis.unibo.it
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any l... | zakski/project-soisceal | scala-core/src/main/scala/com/szadowsz/gospel/core/engine/state/RuleSelectionState.scala | Scala | lgpl-3.0 | 3,618 |
package com.github.rosmith.nlp.query
class OperandValue(_val: Any, iv: Boolean) extends Serializable {
assert(_val != null)
private var _value: Any = _val
private var _isVar: Boolean = iv
def value = _value
def isVar = _isVar
override def equals(obj: Any) = {
if (obj != null && obj.isIn... | rosmith/giet | src/main/scala/com/github/rosmith/nlp/query/OperandValue.scala | Scala | mit | 534 |
package org.tmoerman.plongeur.tda.cluster
import org.scalatest.{FlatSpec, Matchers}
import org.tmoerman.plongeur.tda.cluster.Scale.histogram
/**
* @author Thomas Moerman
*/
class ScaleSpec extends FlatSpec with Matchers {
behavior of "histogram(10) scale selection"
it should "yield 0 if the heights are empt... | tmoerman/plongeur | scala/plongeur-spark/src/test/scala/org/tmoerman/plongeur/tda/cluster/ScaleSpec.scala | Scala | mit | 1,509 |
/*
* 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 ... | Intel-bigdata/OAP | oap-data-source/arrow/standard/src/main/scala/com/intel/oap/spark/sql/execution/datasources/v2/arrow/ArrowPartitionReaderFactory.scala | Scala | apache-2.0 | 4,467 |
package com.googlecode.sarasvati.util.doc
import scala.io._;
import java.io._;
object GraphicDescaler
{
def main(args:Array[String])
{
val Graphic = """(.*<graphic.*?)(scalefit=".*" width=".*")(.*\\n)""".r
for ( arg <- args )
{
var file = new File( arg )
val newFile = new File( file.getPa... | plorenz/sarasvati | doc/reference/util/src/com/googlecode/sarasvati/util/doc/GraphicDescaler.scala | Scala | lgpl-3.0 | 715 |
/*
* 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 ... | jiangxb1987/spark | core/src/main/scala/org/apache/spark/MapOutputTracker.scala | Scala | apache-2.0 | 63,735 |
package utils.validators
import models.analysis.events.AnalysisResults.{AgeResult, AnalysisResult, GenericResult}
import no.uio.musit.models.ActorId
import no.uio.musit.test.matchers.DateTimeMatchers
import org.joda.time.DateTime
import org.scalatest.MustMatchers
trait AnalysisValidators extends DateTimeMatchers with... | MUSIT-Norway/musit | service_backend/test/utils/validators/AnalysisValidators.scala | Scala | gpl-2.0 | 1,648 |
import Origine._
import Titre._
class Demandeur(d:Int,n:String,a:Adresse,t:Titre,o:Origine) {
var numDem:Int = d
var nom:String = n
var adrr:Adresse = a
var titreDem:Titre = t
var origineDem:Origine = o
} | P1erreGaultier/workspace | Roomanager/src/modele/Demandeur.scala | Scala | unlicense | 216 |
/*
* #%L
* Core runtime for OOXOO
* %%
* Copyright (C) 2006 - 2017 Open Design Flow
* %%
* 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, o... | richnou/ooxoo-core | ooxoo-core/src/main/scala/com/idyria/osi/ooxoo/core/buffers/structural/VerticalBuffer.scala | Scala | agpl-3.0 | 20,009 |
/**
* 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... | stealthly/kafka | core/src/test/scala/unit/kafka/api/RequestResponseSerializationTest.scala | Scala | apache-2.0 | 11,924 |
/*
* Copyright 2011 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
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed ... | twitter/scrooge | scrooge-maven-plugin/src/main/scala/com/twitter/ScroogeRunner.scala | Scala | apache-2.0 | 1,673 |
/*
* Copyright 2012 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 t... | rocwzp/zipkin | zipkin-query/src/main/scala/com/twitter/zipkin/query/ZipkinQueryServer.scala | Scala | apache-2.0 | 3,912 |
/**
* Copyright (C) 2014 Orbeon, Inc.
*
* This program is free software; you can redistribute it and/or modify it under the terms of the
* GNU Lesser General Public License as published by the Free Software Foundation; either version
* 2.1 of the License, or (at your option) any later version.
*
* This program i... | brunobuzzi/orbeon-forms | src/test/scala/org/orbeon/oxf/util/URLFinderTest.scala | Scala | lgpl-2.1 | 5,046 |
package edu.gemini.model.p1.submit
import xml.{XML, NodeSeq}
import java.util.logging.{Level, Logger}
import java.text.{ParseException, SimpleDateFormat}
import java.util.TimeZone
import edu.gemini.model.p1.submit.SubmitResult.{ServiceError, Success, Failure}
object ResponseParser {
private val LOG = Logger.getLogg... | arturog8m/ocs | bundle/edu.gemini.model.p1.submit/src/main/scala/edu/gemini/model/p1/submit/ResponseParser.scala | Scala | bsd-3-clause | 2,865 |
package dundertext.data
final case class Span(text: String) {
assert(text.indexOf('\\n') == -1)
def split(splitpos: Int): (Span, Span) = {
val (l, r) = text.splitAt(splitpos)
(Span(l), Span(r))
}
}
| dundertext/dundertext | data/src/main/scala/dundertext/data/Span.scala | Scala | gpl-3.0 | 213 |
package org.dele.text.lapa.patterns
import org.dele.text.lapa.ErrorHandling.{MatcherGenErrorFailed, MatcherGenErrorUndefinedTemplate}
import DomainStructure.LangDomainManager
import org.dele.text.maen.ConfValueStringParser.Parsed
import org.dele.text.maen.matchers.MatcherTmpl.{DomainIdFinder, MatcherTmplLib}
import or... | new2scala/text-util | lapa/src/main/scala/org/dele/text/lapa/patterns/TMatcherGen.scala | Scala | apache-2.0 | 3,106 |
/*
* This file is part of pelam-scala-csv
*
* Copyright © Peter Lamberg 2015 (pelam-scala-csv@pelam.fi)
*
* 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/... | pelamfi/pelam-scala-csv | src/main/scala/fi/pelam/csv/table/Table.scala | Scala | apache-2.0 | 28,638 |
import scala.util.parsing.combinator._
import scala.util.parsing.json._
/*calc_import*/
object Parser extends JavaTokenParsers with OperatorPrecedenceParsers {
lazy val stringParser:PackratParser[List[Char]] =
ident ^^ { i => i.toList }
def listParser[T](innerParser:PackratParser[T]):PackratParser[List[T]] =
... | goodlyrottenapple/calculus-toolbox | template/Parser.scala | Scala | mit | 4,909 |
/*
* 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 ... | quasar-analytics/quasar | foundation/src/main/scala/quasar/contrib/fs2/compression.scala | Scala | apache-2.0 | 3,231 |
package me.apidoc.avro
import java.io.File
import lib.ServiceConfiguration
import org.scalatest.{FunSpec, Matchers}
class ParserSpec extends FunSpec with Matchers {
val dir = "avro/src/test/resources/me/apidoc/avro"
val config = ServiceConfiguration(
orgKey = "gilt",
orgNamespace = "com.bryzek",
vers... | Seanstoppable/apidoc | avro/src/test/scala/me/apidoc/avro/ParserSpec.scala | Scala | mit | 1,375 |
// See LICENSE for license details.
package sifive.blocks.devices.gpio
import Chisel.{defaultCompileOptions => _, _}
import freechips.rocketchip.util.CompileOptions.NotStrictInferReset
import chisel3.{withClockAndReset}
import sifive.blocks.devices.pinctrl.{Pin}
// While this is a bit pendantic, it keeps the GPIO
// ... | sifive/sifive-blocks | src/main/scala/devices/gpio/GPIOPins.scala | Scala | apache-2.0 | 1,353 |
package name.spanel.emdomo.accutank
import scala.util.control.Breaks._
abstract class Simulated[T <: Simulated[T]] {
this: T =>
def simulate(time: Float): T
def simulateLongTime(time: Float, deltaT: Float = 1): T = {
var ret = this
var timeLeft = time
breakable {
while (true) {
... | OndrejSpanel/emdomo | AccuTankSim/src/main/scala/name/spanel/emdomo/accutank/Tank.scala | Scala | gpl-3.0 | 3,429 |
package integration
import es.weso.shex.Schema
import es.weso.shex.ShExMatcher
import es.weso.rdf.jena.RDFAsJenaModel
import util._
import es.weso.rdf.nodes._
import es.weso.shex.Label._
import es.weso.rdf.validator._
import org.scalatest._
trait ValidTester extends FunSpec with Matchers {
def shouldBeValidAllNode... | labra/ShExcala | src/test/scala/integration/validTester.scala | Scala | mit | 1,986 |
package nexus.testbase.ops
import nexus._
import nexus.diff._
import nexus.diff.ops._
import nexus.prob._
import nexus.syntax._
import org.scalatest._
/**
* Tests (R, R) -> R functions.
* @author Tongfei Chen
*/
class OpSSSTests[R](gen: Stochastic[R])(implicit R: IsReal[R], RToFloat: CastToFloat[R]) extends FunSui... | ctongfei/nexus | test-base/src/main/scala/nexus/testbase/ops/OpSSSTests.scala | Scala | mit | 1,384 |
// code-examples/AdvOOP/shapes/shapes-case.scala
package shapes {
case class Point(x: Double, y: Double)
abstract class Shape() {
def draw(): Unit
}
case class Circle(center: Point, radius: Double) extends Shape() {
def draw() = println("Circle.draw: " + this)
}
case class Rectangle(lower... | XClouded/t4f-core | scala/src/tmp/AdvOOP/shapes/shapes-case.scala | Scala | apache-2.0 | 595 |
package github.events
import play.api.libs.json.JsValue
import github.GitHubEvent
case class IssueEvent(name: String, value: JsValue) extends GitHubEvent {
}
| shunjikonishi/github-hook | app/github/events/IssueEvent.scala | Scala | mit | 160 |
// Copyright: 2010 - 2017 https://github.com/ensime/ensime-server/graphs
// License: http://www.gnu.org/licenses/gpl-3.0.en.html
package org.ensime.intg
import scala.concurrent.duration._
import org.ensime.api
import org.ensime.api.{ BasicTypeInfo => _, EnsimeFile => _, _ }
import org.ensime.core._
import org.ensime.... | hzenginx/ensime-server | core/src/it/scala/org/ensime/intg/BasicWorkflow.scala | Scala | gpl-3.0 | 17,421 |
/*
* La Trobe University - Distributed Deep Learning System
* Copyright 2014 Matthias Langer (t3l@threelights.de)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apa... | bashimao/ltudl | blaze/src/main/scala/edu/latrobe/blaze/modules/AbsoluteErrorConstraint.scala | Scala | apache-2.0 | 6,621 |
package models
import models.PersistenceContext._
import net.fwbrasil.activate.migration.Migration
final class LoadData extends Migration {
def timestamp = System.currentTimeMillis + 100
def up = {
customScript {
val foo_1 = Foo("foo #1")
val foo_2 = Foo("foo #2")
val foo_3 = Foo("foo #3... | jeocentric/polyglot | app/models/LoadData.scala | Scala | lgpl-2.1 | 432 |
package maven2sbt.core
import maven2sbt.core.MavenProperty.findPropertyName
import scala.annotation.tailrec
import scala.util.matching.Regex
import cats.syntax.all._
/**
* @author Kevin Lee
* @since 2019-04-21
*/
sealed trait StringUtils {
/**
* @example
*
* ${whatever-is-here.blahBlah}
... | Kevin-Lee/maven2sbt | core/src/main/scala/maven2sbt/core/StringUtils.scala | Scala | mit | 3,643 |
/* Copyright 2009-2018 EPFL, Lausanne */
package inox
package solvers
package smtlib
import utils._
import _root_.smtlib.trees.Terms._
trait SMTLIBDebugger extends SMTLIBTarget {
import context._
import program._
protected def interpreterOpts: Seq[String]
implicit val debugSection: DebugSection
override... | romac/inox | src/main/scala/inox/solvers/smtlib/SMTLIBDebugger.scala | Scala | apache-2.0 | 1,376 |
/***********************************************************************
* Copyright (c) 2013-2019 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... | elahrvivaz/geomesa | geomesa-index-api/src/main/scala/org/locationtech/geomesa/index/utils/Explainer.scala | Scala | apache-2.0 | 2,277 |
package sbt
import Types.const
import java.io.File
/** Represents how settings from various sources are automatically merged into a Project's settings.
* This only configures per-project settings and not global or per-build settings. */
sealed abstract class AddSettings
object AddSettings
{
private[sbt] final cl... | harrah/xsbt | main/src/main/scala/sbt/AddSettings.scala | Scala | bsd-3-clause | 1,544 |
/**
* Copyright 2014 Dropbox, 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... | trafi/djinni | src/source/generator.scala | Scala | apache-2.0 | 16,423 |
import scala.reflect.macros.blackbox.Context
object Macros {
def foo = macro Impls.foo
object Impls {
def foo(c: Context) = c.universe.reify {
{ c.universe.reify(c.universe.reify("hello world")) }.splice.splice
}
}
}
| folone/dotty | tests/untried/neg/macro-reify-splice-splice/Macros_1.scala | Scala | bsd-3-clause | 239 |
/*
* Scala.js (https://www.scala-js.org/)
*
* Copyright EPFL.
*
* Licensed under Apache License 2.0
* (https://www.apache.org/licenses/LICENSE-2.0).
*
* See the NOTICE file distributed with this work for
* additional information regarding copyright ownership.
*/
package java.util.concurrent
import java.io.S... | scala-js/scala-js | javalib/src/main/scala/java/util/concurrent/ConcurrentHashMap.scala | Scala | apache-2.0 | 6,799 |
// /////////////////////////////////////////// //
// Fureteur - https://github.com/gip/fureteur //
// /////////////////////////////////////////// //
package fureteur.encoding
import java.io._
import org.apache.commons.codec.binary._
import org.apache.commons.codec.binary.Base64._
object Encoding {
def byteToZipp... | gip/fureteur | src/main/scala/encoding.scala | Scala | mit | 1,581 |
package com.outr.arango.api.model
import io.circe.Json
case class PostAPIViewIresearch(name: String,
properties: Option[PostAPIViewProps] = None,
`type`: Option[String] = None) | outr/arangodb-scala | api/src/main/scala/com/outr/arango/api/model/PostAPIViewIresearch.scala | Scala | mit | 243 |
package io.flow.lint
import io.apibuilder.spec.v0.models._
import org.scalatest.funspec.AnyFunSpec
import org.scalatest.matchers.should.Matchers
class ErrorModelsV2Spec extends AnyFunSpec with Matchers {
private[this] val linter = linters.ErrorModelsV2
private[this] val codeEnum = Services.buildEnum("checkout_e... | flowcommerce/api-lint | src/test/scala/io/flow/lint/ErrorModelsV2Spec.scala | Scala | mit | 2,559 |
package bad.robot.radiate.ui
import java.awt.Font.BOLD
import java.awt._
import javax.swing._
class TransparentTextArea extends JTextArea {
setOpaque(false)
setFont(UIManager.getFont("Button.font").deriveFont(BOLD, 11.0f))
setForeground(Color.white)
setBackground(Color.black)
setLineWrap(true)
setWrapStyl... | tobyweston/radiate | src/main/scala/bad/robot/radiate/ui/TransparentTextArea.scala | Scala | apache-2.0 | 354 |
package br.unb.cic.poo.gol
import Main.{height, width}
/* Parte do padrao Memento. Armazena as jogadas anteriores e permite desfazer as ultimas. */
object CareTaker {
private final val MEMENTO_SIZE = 10 // Define o maximo de jogadas que podem ser desfeitas
private var head = 0
private var tail = 0
private v... | PeterTowers/TP1-022017 | GoLScala/GoLScala_UN/src/br/unb/cic/poo/gol/CareTaker.scala | Scala | mit | 2,130 |
package org.aguo.civsim.controller
import org.aguo.civsim.model.World
import org.aguo.civsim.model.domain._
import org.aguo.civsim.view._
import scala.util.{ Failure, Success }
object JobsController {
val SetCommand = """(\\d+) (.*)""".r
val AddCommand = """\\+(\\d+) (.*)""".r
val SubtractCommand = """-(\\d+)... | aguo777/civ-sim | src/main/scala/org/aguo/civsim/controller/JobsController.scala | Scala | mit | 1,595 |
/*
* Copyright © 2014 TU Berlin (emma@dima.tu-berlin.de)
*
* 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 app... | aalexandrov/emma | emma-language/src/main/scala/org/emmalanguage/compiler/lang/core/Core.scala | Scala | apache-2.0 | 12,182 |
/*
* Ops.scala
* (ScalaCollider)
*
* Copyright (c) 2008-2021 Hanns Holger Rutz. All rights reserved.
*
* This software is published under the GNU Affero General Public License v3+
*
*
* For further information, please contact Hanns Holger Rutz at
* contact@sciss.de
*/
package de.sciss.synth
import de... | Sciss/ScalaCollider | shared/src/main/scala/de/sciss/synth/Ops.scala | Scala | lgpl-2.1 | 33,532 |
//: ----------------------------------------------------------------------------
//: Copyright (C) 2015 Verizon. 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 Licen... | runarorama/knobs | core/src/main/scala/knobs/AWS.scala | Scala | apache-2.0 | 3,706 |
/*
* 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/server/src/main/scala/es/tid/cosmos/infinity/server/actions/MovePath.scala | Scala | apache-2.0 | 1,371 |
package russoul.lib.common.math.geometry.simple
import russoul.lib.common.TypeClasses.{CanonicalEuclideanSpaceOverField, Field, Tensor1}
import russoul.lib.common._
import russoul.lib.common.math.geometry.simple.general.GeometricShape
import Implicits._
import shapeless.Nat
import shapeless.Nat._
import Abstraction._
... | Russoul/UniScalaLib | src/main/scala/russoul/lib/common/math/geometry/simple/Ray2Over.scala | Scala | mit | 1,032 |
package test
import java.io.{IOException, RandomAccessFile}
import java.nio.{ByteBuffer, ByteOrder}
import java.nio.channels.FileChannel
import unluac.parse.{BHeader, LFunction, LLocal, LObject}
object Compare {
/**
* Determines if two files of lua bytecode are the same
* (except possibly for line numbers)... | danielwegener/unluac-scala | jvm/src/test/scala/test/Compare.scala | Scala | mit | 2,975 |
package com.github.eklavya.thrust
import java.util.Date
/**
* Created by eklavya on 12/13/14.
*/
object RemoteArguments {
sealed abstract class RemoteArgument
case class Cookie(
//source url
source: String,
//the cookie name
n... | eklavya/scala-thrust | src/main/scala/com/github/eklavya/thrust/RemoteArguments.scala | Scala | apache-2.0 | 1,170 |
/***********************************************************************
* 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-accumulo/geomesa-accumulo-datastore/src/main/scala/org/locationtech/geomesa/accumulo/audit/ParamsAuditProvider.scala | Scala | apache-2.0 | 1,121 |
package gitbucket.core.util
import org.scalatest.funsuite.AnyFunSuite
import GitSpecUtil._
class EditorConfigUtilSpec extends AnyFunSuite {
val simpleConfig =
"""[*.txt]
|indent_style = tab
|indent_size = 4""".stripMargin
test("no EditorConfig file") {
withTestRepository { git =>
create... | imeszaros/gitbucket | src/test/scala/gitbucket/core/util/EditorConfigUtilSpec.scala | Scala | apache-2.0 | 1,609 |
package es.weso.shex
import org.scalatest._
import org.scalatest.prop.PropertyChecks
import org.scalatest.prop.Checkers
import es.weso.shex.Typing._
import Stream._
import es.weso.rdfgraph.nodes._
import es.weso.rdf._
import es.weso.rdfgraph.statements.RDFTriple
import es.weso.rdf.PrefixMap
import es.weso.shex.ShapeSy... | jorgeyp/ShExcala | src/test/scala/es/weso/shex/ContextSpec.scala | Scala | mit | 1,462 |
package scalagen.population
import org.scalatest.{ShouldMatchers, WordSpecLike}
import scalagen.message.Evaluated
import akka.testkit.{TestKit, TestActorRef}
import scalagen.actor.Phenotype
import utils.SampleActors.SampleGenome
import akka.actor.ActorSystem
class KillTheWorstsTest extends TestKit(ActorSystem("KillTh... | ppiotrow/scalagen | scalagen-core/src/test/scala/scalagen/population/KillTheWorstsTest.scala | Scala | apache-2.0 | 2,320 |
/*
* 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/amls-frontend | test/views/responsiblepeople/address/additional_extra_address_NonUKSpec.scala | Scala | apache-2.0 | 4,652 |
package org.jetbrains.plugins.scala
package codeInsight.intention.imports
import com.intellij.codeInsight.intention.PsiElementBaseIntentionAction
import com.intellij.openapi.editor.Editor
import com.intellij.openapi.project.Project
import com.intellij.psi._
import com.intellij.psi.search.LocalSearchScope
import com.in... | katejim/intellij-scala | src/org/jetbrains/plugins/scala/codeInsight/intention/imports/ImportStableMemberIntention.scala | Scala | apache-2.0 | 2,156 |
package go3d.server
import com.typesafe.scalalogging.Logger
import javax.servlet.http.HttpServletResponse
/**
Usage example for this endpoint:
To get an essentially random game ID waiting for a white player to connect:
$ curl -s http://$HOST/openGames | jq -r .ids[0]
To join a game without knowing the game I... | lene/go-3 | src/main/scala/server/OpenGamesServlet.scala | Scala | gpl-2.0 | 899 |
package com.softwaremill.bootzooka.infrastructure
import java.net.URI
import cats.effect.{IO, Resource}
import com.typesafe.scalalogging.StrictLogging
import doobie.hikari.HikariTransactor
import org.flywaydb.core.Flyway
import scala.concurrent.duration._
import Doobie._
import com.softwaremill.bootzooka.config.Sensi... | softwaremill/bootzooka | backend/src/main/scala/com/softwaremill/bootzooka/infrastructure/DB.scala | Scala | apache-2.0 | 2,814 |
package ui
import play.api.test.{PlaySpecification, WebDriverFactory}
import security.Users
import ui.mail.{FakeMailServer, WithMailServerAndBrowser}
import ui.model._
import utils.PortAllocator._
class SignUpSpec extends PlaySpecification with Users {
"Sign-up process" should {
"allow user sign-up" in new Wi... | timothygordon32/reactive-todolist | it/ui/SignUpSpec.scala | Scala | mit | 1,207 |
/*
* 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 ... | wzhfy/spark | sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/orc/OrcPartitionReaderFactory.scala | Scala | apache-2.0 | 7,514 |
/*
* This file is part of the regex project.
*
* 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 ... | ckaestne/regex | src/main/scala/edu/cmu/feature/vregex/VRegex.scala | Scala | apache-2.0 | 3,691 |
import java.io.File
import org.scalatest.{FlatSpec, Matchers}
import statla.Util
class SamplesDataSpec extends FlatSpec with Matchers {
implicit val ds = StRD
behavior of "A Sample"
it should "pass all the datasets" in {
import DatasetMatcher._
import Datasets.CertifiedValue
val testFolder = new ... | jvican/statla | src/test/scala/SamplesDataSpec.scala | Scala | mit | 1,208 |
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.