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 hylien
import eu.unicredit.web.Models.{DomNode, Location, Size}
import eu.unicredit.web.hylien.Distances
import org.specs2.mutable.Specification
import org.specs2.specification.Scope
import scala.collection.mutable
/**
* Created by fabiana on 7/4/16.
*/
class TreeEditDistanceSpecs extends Specification ... | fabiofumarola/HyLiEn | src/test/scala/hylien/TreeEditDistanceSpecs.scala | Scala | apache-2.0 | 6,914 |
package org.velvia.filo.codecs
import scala.language.postfixOps
import scalaxy.loops._
import org.velvia.filo.{FiloVector, FastBufferReader}
import org.velvia.filo.vector._
object DictStringWrapper {
// Used to represent no string value or NA. Better than using null.
val NoString = ""
}
abstract class DictStri... | velvia/filo | filo-scala/src/main/scala/org.velvia.filo/codecs/DictEncodingWrappers.scala | Scala | apache-2.0 | 1,341 |
package org.jetbrains.plugins.scala
package codeInspection.collections
import org.jetbrains.plugins.scala.codeInspection.InspectionBundle
import org.jetbrains.plugins.scala.lang.psi.api.expr._
/**
* Nikolay.Tropin
* 2014-05-05
*/
class SortFilterInspection extends OperationOnCollectionInspection {
override def p... | triggerNZ/intellij-scala | src/org/jetbrains/plugins/scala/codeInspection/collections/SortFilterInspection.scala | Scala | apache-2.0 | 2,207 |
package com.twitter.finagle.thriftmux
import com.twitter.conversions.DurationOps._
import com.twitter.finagle.{Address, Name, Service, ThriftMux}
import com.twitter.finagle.context.Contexts
import com.twitter.finagle.thriftmux.thriftscala.TestService
import com.twitter.finagle.thriftmux.thriftscala.TestService.{Inquir... | twitter/finagle | finagle-thriftmux/src/test/scala/com/twitter/finagle/thriftmux/ContextAmplificationTest.scala | Scala | apache-2.0 | 3,646 |
package com.stulsoft.serialization
/**
* @author Yuriy Stul.
*/
trait MessageTrait {
}
| ysden123/poc | pserialization/src/main/scala/com/stulsoft/serialization/MessageTrait.scala | Scala | mit | 93 |
package com.github.agourlay.cornichon.experimental.examples
import com.github.agourlay.cornichon.experimental.CornichonFeature
class DummyExamplesFour extends CornichonFeature {
def feature = Feature("Dummy four feature") {
Scenario("single scenario pending").pending
}
}
| OlegIlyenko/cornichon | cornichon-experimental/src/test/scala/com/github/agourlay/cornichon/experimental/examples/DummyExamplesFour.scala | Scala | apache-2.0 | 285 |
/*
* 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 ... | mike0sv/spark | core/src/main/scala/org/apache/spark/ui/jobs/StagePage.scala | Scala | apache-2.0 | 55,150 |
/*
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 to in writing, software
distr... | twitter/scalding | scalding-core/src/main/scala/com/twitter/scalding/typed/cascading_backend/HashJoiner.scala | Scala | apache-2.0 | 2,716 |
package gapt.formats.dimacs
import gapt.expr._
import gapt.expr.formula.Atom
import gapt.models.PropositionalModel
import gapt.proofs.rup.RupProof
import gapt.proofs.{ Clause, HOLClause }
import scala.collection.mutable
object DIMACS {
type Atom = Int
type Literal = Int
type Clause = Seq[Literal]
type CNF = ... | gapt/gapt | core/src/main/scala/gapt/formats/dimacs/dimacs.scala | Scala | gpl-3.0 | 4,147 |
// Generated by the Scala Plugin for the Protocol Buffer Compiler.
// Do not edit!
//
// Protofile syntax: PROTO3
package com.google.protobuf.struct
import _root_.scalapb.internal.compat.JavaConverters._
/** `ListValue` is a wrapper around a repeated field of values.
*
* The JSON representation for `ListValue` is... | dotty-staging/ScalaPB | scalapb-runtime/jvm/src/main/scala/com/google/protobuf/struct/ListValue.scala | Scala | apache-2.0 | 6,992 |
package com.ruimo.scoins
case class Percent(value: Double) extends AnyVal with Ordered[Percent] {
def of(that: Double) = value * that / 100
def +(that: Percent) = Percent(value + that.value)
def -(that: Percent) = Percent(value - that.value)
override def compare(that: Percent): Int =
if (value < that.valu... | ruimo/scoins | src/main/scala/com/ruimo/scoins/Percent.scala | Scala | apache-2.0 | 623 |
package com.alzindiq.cluster
import com.alzindiq.Plumber
import Plumber
import scala.collection.mutable
object PenaltyCalculator {
def calculatePenalty(bucket : String, plumbers : Set[Plumber], neighbouSimSumMap : Map[Plumber, Double], precalcCohe : Double, similarities : Map[Plumber,Map[Plumber,Double]]) : Doub... | alzindiq/plumb | src/main/scala/com/alzindiq/cluster/PenaltyCalculator.scala | Scala | apache-2.0 | 1,447 |
/*
* Copyright (c) 2011-16 Miles Sabin
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agr... | liff/shapeless | core/src/main/scala/shapeless/typeable.scala | Scala | apache-2.0 | 16,162 |
/***********************************************************************
* 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-filter/src/main/scala/org/locationtech/geomesa/filter/FilterHelper.scala | Scala | apache-2.0 | 25,609 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | akrabat/openwhisk | core/invoker/src/main/scala/org/apache/openwhisk/core/containerpool/ContainerPool.scala | Scala | apache-2.0 | 32,543 |
/**
* Copyright 2013-2014 Jorge Aliss (jaliss at gmail dot com) - twitter: @jaliss
*
* 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
*... | matthewchartier/securesocial | module-code/app/securesocial/core/services/HttpService.scala | Scala | apache-2.0 | 1,153 |
package com.greencatsoft.angularjs.core
import scala.concurrent.Future
import scala.language.implicitConversions
import scala.scalajs.js
import scala.scalajs.js.Any.{ fromFunction1, fromFunction5 }
import scala.scalajs.js.UndefOr
import scala.scalajs.js.UndefOr.undefOr2ops
import scala.scalajs.js.annotation.JSExportAl... | easel/scalajs-angular | src/main/scala/com/greencatsoft/angularjs/core/Http.scala | Scala | apache-2.0 | 8,222 |
/**
* Copyright (C) 2010-2012 LShift Ltd.
*
* 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... | 0x6e6562/diffa | client-support/src/main/scala/net/lshift/diffa/client/ValidatingScanResultParser.scala | Scala | apache-2.0 | 2,136 |
package org.jetbrains.plugins.scala.macroAnnotations
import com.intellij.psi.util.PsiModificationTracker
import org.junit.Assert
/**
* Author: Svyatoslav Ilinskiy
* Date: 9/25/15.
*/
class CachedInsidePsiElementTest extends CachedWithRecursionGuardTestBase {
def testSimple(): Unit = {
object Foo extends Cac... | LPTK/intellij-scala | test/org/jetbrains/plugins/scala/macroAnnotations/CachedInsidePsiElementTest.scala | Scala | apache-2.0 | 607 |
/* *\\
** \\ \\ / _) \\ \\ / \\ | **
** \\ \\ / | __ \\ _ \\ __| \\ \\ / |\\/ | **
** \\ \\ / | | | __/ | \\ \\ / | | **
** \\_/ _| .__/ \\___| _| \\_/ _| _| **
** _| ... | hsyl20/Scala_ViperVM | src/main/scala/org/vipervm/runtime/mm/DefaultDataManager.scala | Scala | gpl-3.0 | 6,617 |
/* Copyright 2009-2016 EPFL, Lausanne */
package leon
import leon.utils._
object Main {
lazy val allPhases: List[LeonPhase[_, _]] = {
List(
frontends.scalac.ExtractionPhase,
frontends.scalac.ClassgenPhase,
utils.TypingPhase,
utils.FileOutputPhase,
purescala.RestoreMethods,
... | regb/leon | src/main/scala/leon/Main.scala | Scala | gpl-3.0 | 12,227 |
package org.lolhens.minechanics.client.util
/**
* Created by LolHens on 22.09.2014.
*/
class Vertex(val vec: Vec3f, val norm: Vec3f) {
}
| LolHens/Minechanics | src/main/scala/org/lolhens/minechanics/client/util/Vertex.scala | Scala | gpl-2.0 | 140 |
/*
* 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 ... | bowenli86/flink | flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/codegen/agg/batch/HashWindowCodeGenerator.scala | Scala | apache-2.0 | 31,573 |
// scalac: -Xfatal-warnings
//
import scala.language.reflectiveCalls
trait A {
trait Concrete { def conco: Int = 1 }
type Foo <: { def bippy: Int }
type Bar <: { def barry: Int }
implicit def barTag: scala.reflect.ClassTag[Bar]
def f1(x: Any) = x match {
case x: Foo with Concrete => x.bippy + x.conco
... | scala/scala | test/files/neg/t7721.scala | Scala | apache-2.0 | 4,142 |
/*******************************************************************************
Copyright (c) 2013, S-Core, KAIST.
All rights reserved.
Use is subject to license terms.
This distribution may include materials developed by third parties.
**************************************************************... | daejunpark/jsaf | src/kr/ac/kaist/jsaf/analysis/typing/models/DOMCore/DOMStringList.scala | Scala | bsd-3-clause | 6,692 |
package org.elinker.core.api.service
import spray.routing.HttpService
import spray.routing.authentication._
import scala.concurrent.ExecutionContext.Implicits.global
/**
* Created by nilesh on 9/12/14.
*/
trait TokenService extends HttpService with UserAuthentication {
val tokenRoute =
path("token") {
... | nilesh-c/elinker | src/main/scala/org/elinker/core/api/service/TokenService.scala | Scala | apache-2.0 | 473 |
package controllers.util
import akka.actor.ActorSelection
import javax.inject.Inject
import com.overviewdocs.messages.DocumentSetCommands
import modules.RemoteActorSystemModule
class JobQueueSender @Inject() (remoteActorSystemModule: RemoteActorSystemModule) {
protected def messageBroker: ActorSelection = remoteAc... | overview/overview-server | web/app/controllers/util/JobQueueSender.scala | Scala | agpl-3.0 | 444 |
package com.arcusys.valamis.course.model
import com.arcusys.learn.liferay.services.GroupLocalServiceHelper
import scala.util.{Failure, Success, Try}
/**
* Created By:
* User: zsoltberki
* Date: 29.4.2016
*/
object CourseMembershipType extends Enumeration {
type CourseMembershipType = Value
val OPEN = Val... | arcusys/Valamis | valamis-course/src/main/scala/com/arcusys/valamis/course/model/CourseMembershipType.scala | Scala | gpl-3.0 | 630 |
package com.softwaremill.bootzooka.http
import cats.effect.IO
import cats.implicits._
import com.softwaremill.bootzooka._
import com.softwaremill.bootzooka.infrastructure.Json._
import com.softwaremill.bootzooka.util.Id
import com.softwaremill.tagging._
import com.typesafe.scalalogging.StrictLogging
import io.circe.Pr... | softwaremill/bootzooka | backend/src/main/scala/com/softwaremill/bootzooka/http/Http.scala | Scala | apache-2.0 | 3,839 |
package uk.org.nbn.nbnv.importer.validation
import uk.org.nbn.nbnv.importer.records.NbnRecord
import uk.org.nbn.nbnv.importer.fidelity.{Result, ResultLevel}
//validate SiteKey length
class Nbnv79Validator {
def validate(record: NbnRecord) = {
val validator = new LengthValidator
validator.validate... | JNCC-dev-team/nbn-importer | importer/src/main/scala/uk/org/nbn/nbnv/importer/validation/Nbnv79Validator.scala | Scala | apache-2.0 | 397 |
/*
* Copyright (c) 2011, Daniel Spiewak
* 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 cond... | djspiewak/anti-xml | src/test/scala/com/codecommit/antixml/performance/JavaNodeSeqWithIndexedSeq.scala | Scala | bsd-3-clause | 3,222 |
/*
* Copyright (c) 2015
*
* 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... | remstef/flinkfun | src/main/scala/de/tudarmstadt/lt/flinkdt/pipes/RerankDT.scala | Scala | apache-2.0 | 2,243 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | dbtsai/spark | sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/FileScan.scala | Scala | apache-2.0 | 7,425 |
package com.twitter.finagle.mysql
import org.scalatest.junit.JUnitRunner
import org.scalatest.mock.MockitoSugar
import org.scalatest.{MustMatchers, FunSuite}
import org.junit.runner.RunWith
import org.mockito.Mockito._
import org.mockito.Matchers._
import com.twitter.util.{Await, Time}
/**
* Tests the transaction fu... | adriancole/finagle | finagle-mysql/src/test/scala/com/twitter/finagle/mysql/unit/TransactionTest.scala | Scala | apache-2.0 | 1,895 |
trait Cap
trait Toolbox {
type Tree
val tpd: TypedTrees
trait TypedTrees {
type Tree
}
val Apply: ApplyImpl
trait ApplyImpl {
def unapply(tree: Tree): Option[(Tree, Seq[Tree])]
def unapply(tree: tpd.Tree)(implicit c: Cap): Option[(tpd.Tree, Seq[tpd.Tree])]
}
}
class Test(val tb: Toolbox) ... | som-snytt/dotty | tests/neg/i2378.scala | Scala | apache-2.0 | 628 |
package com.sksamuel.avro4s.kafka
import java.io.ByteArrayOutputStream
import com.sksamuel.avro4s.{Decoder, Encoder}
import com.sksamuel.avro4s.{AvroInputStream, AvroOutputStream, AvroSchema, SchemaFor}
import org.apache.avro.Schema
import org.apache.kafka.common.serialization.{Deserializer, Serde, Serializer}
class... | 51zero/avro4s | avro4s-kafka/src/main/scala/com/sksamuel/avro4s/kafka/GenericSerde.scala | Scala | mit | 1,182 |
/** Case class for converting RDD to DataFrame */
// Define the schema using a case class.
// Note: Case classes in Scala 2.10 can support only up to 22 fields. To work around this limit,
// you can use custom classes that implement the Product interface.
case class Record(starttime: String)
| faganpe/KafkaStreamingPOC | src/main/scala/Record.scala | Scala | apache-2.0 | 293 |
package lampetia.cg.extensions
/**
* @author Hossam Karim
*/
object Scalate {
def seperate[A](iterable: Seq[A], seperator: String = ",")(f: A => String) =
iterable.map(f).mkString(seperator)
}
| rosama86/lampetia | lampetia-code-gen/src/main/scala/lampetia/cg/extensions/Scalate.scala | Scala | mit | 205 |
/* Copyright 2017-19, Emmanouil Antonios Platanios. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless ... | eaplatanios/tensorflow_scala | modules/api/src/main/scala/org/platanios/tensorflow/api/learn/hooks/TensorBoardHook.scala | Scala | apache-2.0 | 2,450 |
/*
* 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 ... | hequn8128/flink | flink-table/flink-table-planner-blink/src/test/scala/org/apache/flink/table/planner/plan/rules/logical/FlinkJoinPushExpressionsRuleTest.scala | Scala | apache-2.0 | 2,883 |
package com.joypeg.scamandrill.client
import akka.actor.ActorSystem
import akka.http.scaladsl._
import akka.http.scaladsl.model._
import akka.stream.ActorMaterializer
import akka.stream.scaladsl.{Sink, Source}
import com.joypeg.scamandrill.utils.SimpleLogger
import scala.concurrent.duration._
import scala.concurrent.... | AdAgility/scamandrill | src/main/scala/com/joypeg/scamandrill/client/ScamandrillSendReceive.scala | Scala | apache-2.0 | 3,140 |
package io.udash.core
/**
* Creates view with [[io.udash.core.EmptyPresenter]]. Used for static views.
*
* By default, instances of this class are compared by class name to prevent rerendering of static views.
* This behaviour can be opted out of by overriding equals/hashCode.
**/
abstract class StaticViewFactory... | UdashFramework/udash-core | core/.js/src/main/scala/io/udash/core/Defaults.scala | Scala | apache-2.0 | 782 |
class Meter(val x: Double) extends AnyVal
trait A {
def apply(x: Double) = x.toString
}
trait B {
def apply(x: Meter) = x.toString
}
object Test extends A with B // error: double definition
| som-snytt/dotty | tests/neg/valueclasses-doubledefs2.scala | Scala | apache-2.0 | 196 |
package com.github.vonnagy.service.container.http
import java.net.InetAddress
import akka.http.scaladsl.model.headers.`Remote-Address`
import akka.http.scaladsl.model.{RemoteAddress, StatusCodes}
import akka.http.scaladsl.server.Directives
import com.github.vonnagy.service.container.Specs2RouteTest
import com.github.... | vonnagy/service-container | service-container/src/test/scala/com/github/vonnagy/service/container/http/BaseEndpointsSpec.scala | Scala | apache-2.0 | 1,366 |
/*
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 to in writing, software
distr... | lucamilanesio/scalding | scalding-core/src/test/scala/com/twitter/scalding/mathematics/SizeHintTest.scala | Scala | apache-2.0 | 3,792 |
package ru.st.training.domain
object CellState extends Enumeration {
type CellState = Value
val AllWallBuilt, TopWallRuin, RightWallRuin, BottomWallRuin, LeftWallRuin,
AllWallBuiltWithExit = Value
}
| mrzo0m/RobotInMaze | src/main/scala/ru/st/training/domain/CellState.scala | Scala | mit | 215 |
/*
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 to in writing, software
distr... | twitter/scalding | scalding-commons/src/main/scala/com/twitter/scalding/commons/source/LzoCodecSource.scala | Scala | apache-2.0 | 1,086 |
/*
* Copyright 2016 The BigDL Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agr... | jenniew/BigDL | spark/dl/src/main/scala/com/intel/analytics/bigdl/python/api/PythonBigDL.scala | Scala | apache-2.0 | 73,037 |
/***********************************************************************
* Copyright (c) 2013-2018 Commonwealth Computer Research, Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Apache License, Version 2.0
* which accompanies this distribution and... | ddseapy/geomesa | geomesa-convert/geomesa-convert-xml/src/test/scala/org/locationtech/geomesa/convert/xml/XmlConverterTest.scala | Scala | apache-2.0 | 27,958 |
package com.dataintuitive.luciusapi
// Functions implementation and common code
import com.dataintuitive.luciusapi.functions.HistogramFunctions._
import Common.ParamHandlers._
// LuciusCore
import com.dataintuitive.luciuscore.Model.DbRow
import com.dataintuitive.luciuscore.genes._
// Jobserver
import spark.jobserver... | data-intuitive/LuciusAPI | src/main/scala/com/dataintuitive/luciusapi/histogram.scala | Scala | apache-2.0 | 2,201 |
/*
* (c) Copyright 2016 Hewlett Packard Enterprise Development LP
*
* 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 b... | hpe-cct/cct-tutorial | src/main/scala/tutorial/libcog/actuators/ActuatorExample.scala | Scala | apache-2.0 | 1,461 |
import org.scalatestplus.play._
import play.api.test._
import play.api.test.Helpers._
import LongestPath._
/**
* Add your spec here.
* You can mock out a whole application including requests, plugins etc.
* For more information, consult the wiki.
*/
class ApplicationSpec extends PlaySpec with OneAppPerTest {
"R... | Strateger/LongestPath | test/ApplicationSpec.scala | Scala | mit | 2,221 |
package euler
package til60
object Euler51 extends EulerProblem {
/**
* primePermutations(123, 2) returns all prime permutations of 123xx with xx == 00,11,..,99
*/
def primePermutations(n: Int, addedDigitCnt: Int) = {
val digits = toDigits(n) ++ List.fill(addedDigitCnt)(-1)
digits.permutations.map { ... | TrustNoOne/Euler | scala/src/main/scala/euler/til60/Euler51.scala | Scala | mit | 636 |
package io.circe.yaml
import io.circe.Json
import io.circe.Json.eqJson
import io.circe.testing.instances._
import org.scalatest.funsuite.AnyFunSuite
import org.scalatestplus.scalacheck.Checkers
import org.typelevel.discipline.Laws
class SnakeYamlSymmetricSerializationTests extends AnyFunSuite with Checkers with Symme... | circe/circe-yaml | src/test/scala/io/circe/yaml/SnakeYamlSymmetricSerializationTests.scala | Scala | apache-2.0 | 674 |
package akka.guice.annotation
import scala.annotation.{StaticAnnotation, compileTimeOnly}
import scala.language.experimental.macros
import scala.reflect.macros.whitebox
object injectableActor {
def impl(c: whitebox.Context)(annottees: c.Expr[Any]*): c.Expr[Any] =
new InjectableActorHelper[c.type](c).impl(annott... | Equiem/akka-guice | macros/src/main/scala/akka/guice/annotation/injectableActor.scala | Scala | mit | 1,119 |
package org.jetbrains.plugins.scala
package lang
package psi
package api
package base
package types
import org.jetbrains.plugins.scala.lang.psi.types.result.TypeResult
/**
* @author Alexander Podkhalyuzin
* Date: 07.03.2008
*/
trait ScAnnotTypeElement extends ScTypeElement {
override protected val typeName = "Typ... | JetBrains/intellij-scala | scala/scala-impl/src/org/jetbrains/plugins/scala/lang/psi/api/base/types/ScAnnotTypeElement.scala | Scala | apache-2.0 | 474 |
package edu.gemini.pot.sp
import edu.gemini.spModel.rich.pot.sp._
import org.scalacheck.Gen
import scala.collection.JavaConverters._
import scala.util.Random
object DuplicateSpec extends ProgramTestSupport {
val genTestProg: Gen[ISPFactory => ISPProgram] =
ProgramGen.genProg
def randomInstance[A](as: Vecto... | spakzad/ocs | bundle/edu.gemini.pot/src/test/scala/edu/gemini/pot/sp/DuplicateSpec.scala | Scala | bsd-3-clause | 4,843 |
package me.gregd.cineworld.domain.service
import java.time.format.DateTimeFormatter
import java.time.{LocalDate, LocalTime}
import me.gregd.cineworld.domain.model.{Cinema, Coordinates, Film, Performance}
import me.gregd.cineworld.integration.vue.{ImageUrl, VueIntegrationService}
import me.gregd.cineworld.integration.... | Grogs/cinema-service | domain/src/main/scala/me/gregd/cineworld/domain/service/VueService.scala | Scala | gpl-3.0 | 2,207 |
// GENERATED CODE: DO NOT EDIT
package org.usagram.clarify
case class Validity15[+V1, +V2, +V3, +V4, +V5, +V6, +V7, +V8, +V9, +V10, +V11, +V12, +V13, +V14, +V15](_1: Definite[V1], _2: Definite[V2], _3: Definite[V3], _4: Definite[V4], _5: Definite[V5], _6: Definite[V6], _7: Definite[V7], _8: Definite[V8], _9: Definite... | takkkun/clarify | core/src/main/scala/org/usagram/clarify/Validity15.scala | Scala | mit | 1,157 |
package demo.pi
import org.apache.spark.{SparkConf, SparkContext}
import scala.math.random
/**
* モンテカルロ法で円周率を計算します
*/
object PiSample {
def main(args: Array[String]): Unit = {
// 実行前準備
val conf = new SparkConf().setAppName(getClass.getSimpleName)
val spark = new SparkContext(conf)
// 引数からサンプル数を... | h-mochizuki/rts-sample | spark-sample/src/main/scala/demo/pi/PiSample.scala | Scala | apache-2.0 | 1,148 |
import stainless.annotation._
import stainless.io._
import stainless.math.BitVectors._
object FixedArray {
val CONSTANT1: UInt16 = 2
val CONSTANT2: UInt16 = 3
val CONSTANT3: UInt16 = CONSTANT1 + CONSTANT2
@cCode.`export`
case class W(x: Int, a: Array[Int], y: Int) {
require(
a.length == CONSTANT3... | epfl-lara/stainless | frontends/benchmarks/genc/valid/FixedArray.scala | Scala | apache-2.0 | 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 ... | brandon-edwards/incubator-spot | spot-ml/src/test/scala/org/apache/spot/lda/SpotLDAWrapperTest.scala | Scala | apache-2.0 | 14,725 |
import scala.reflect.ClassTag
object Test {
def main(args: Array[String]): Unit = {
def testArray[T: ClassTag](n: Int, elem: Int => T): Unit = {
val t: Int *: Tuple = 0 *: Tuple.fromArray(Array.tabulate(n)(elem))
println(t.tail)
}
for (i <- 0 to 25)
testArray(i, j => j)
println(T... | som-snytt/dotty | tests/run-deep-subtype/Tuple-tail.scala | Scala | apache-2.0 | 4,242 |
package org.scalatest.examples
// Type-constructor polymorphism
import org.scalactic.TypeCheckedTripleEquals
import org.scalactic.anyvals.PosZDouble
import org.scalatest.examples.Demo._
import org.scalatest.prop.PropertyChecks
import org.scalatest.{LogicFunSpec, Matchers}
// (Demo 12 PosInt.ensuringValid in the REPL... | bvenners/scalaX2016Demos | src/test/scala/org/scalatest/examples/Demo13Spec.scala | Scala | apache-2.0 | 1,043 |
package net.virtualvoid.bytecode
package backend
import java.lang.{ String => jString }
/** This trait contains the methods which form the contract between Mnemonic's
* instructions and the backend implementations. Each backend has to implement
* its own frame type which gets called by the instruction implementat... | jrudolph/bytecode | src/main/scala/net/virtualvoid/bytecode/backend/BackendSupport.scala | Scala | bsd-2-clause | 2,486 |
/*
* 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 ... | style95/openwhisk | tests/src/test/scala/org/apache/openwhisk/core/database/azblob/AzureBlobAttachmentStoreBehaviorBase.scala | Scala | apache-2.0 | 2,161 |
import sbt._
class StatsdProject(info: ProjectInfo) extends DefaultProject(info)
with rsync.RsyncPublishing
with ruby.GemBuilding
with assembly.AssemblyBuilder {
val codaRepo = "Coda Hale's Repository... | jamesgolick/statsd.scala | project/build/StatsdProject.scala | Scala | mit | 1,642 |
import java.net.URL
import rescala._
object Main extends App {
val urlCheck = new UrlChecker("http://www.faz.net/aktuell/rhein-main/?rssview=1")
System.out.println(urlCheck.UrlValid.now)
System.out.println(urlCheck.ErrorMessage.now)
val url1 = new URL("http://www.faz.net/aktuell/rhein-main/?rssview=1")
v... | volkc/REScala | Examples/RSSReader/SimpleRssReader/src/main/scala/Main.scala | Scala | apache-2.0 | 472 |
/**
* 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... | PSPDFKit-labs/djinni | src/source/generator.scala | Scala | apache-2.0 | 15,768 |
package filodb.query.exec.rangefn
import java.util.regex.{Pattern, PatternSyntaxException}
import monix.reactive.Observable
import filodb.core.query.{CustomRangeVectorKey, IteratorBackedRangeVector, RangeVector, RangeVectorKey}
import filodb.memory.format.ZeroCopyUTF8String
trait MiscellaneousFunction {
def execu... | velvia/FiloDB | query/src/main/scala/filodb/query/exec/rangefn/MiscellaneousFunction.scala | Scala | apache-2.0 | 4,524 |
package com.lynbrookrobotics.potassium.frc
import com.ctre.phoenix.ErrorCode
import com.ctre.phoenix.motorcontrol.ControlMode
import com.ctre.phoenix.motorcontrol.can.TalonSRX
import com.lynbrookrobotics.potassium.control.offload.EscConfig.{NativePositionGains, NativeVelocityGains}
import com.lynbrookrobotics.potassiu... | Team846/potassium | frc/jvm/src/test/scala/com/lynbrookrobotics/potassium/frc/LazyTalonTest.scala | Scala | mit | 10,553 |
/**
* Copyright 2015 Lorand Szakacs
*
* 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... | lorandszakacs/sbt-common-build | src/main/scala/com/lorandszakacs/sbt/commonbuild/core/CommonBuildCoreDependencies.scala | Scala | apache-2.0 | 3,483 |
package providers
import com.feth.play.module.pa.providers.password.UsernamePasswordAuthUser
import com.feth.play.module.pa.user.NameIdentity
import views.form.Signup
/**
* Use the default constructor for password reset only - do not use this to signup a user!
* @param password
* @param email
*/
class MySignu... | bravegag/play-authenticate-usage-scala | app/providers/MySignupAuthUser.scala | Scala | apache-2.0 | 1,086 |
package ingraph.ire.nodes.unary
import akka.actor.{ActorSystem, Props, actorRef2Scala}
import akka.testkit.{ImplicitSender, TestActors, TestKit}
import ingraph.ire.datatypes.Tuple
import ingraph.ire.messages.ChangeSet
import org.scalatest.{BeforeAndAfterAll, Matchers, WordSpecLike}
class UnwindNodeTest(_system: Actor... | FTSRG/ingraph | ire/src/test/scala/ingraph/ire/nodes/unary/UnwindNodeTest.scala | Scala | epl-1.0 | 2,266 |
package scalax.collection.constrained
package generic
import scala.language.{higherKinds, postfixOps}
import scala.annotation.unchecked.uncheckedVariance
import scala.collection.Iterable
import scala.collection.mutable.{Builder, ListBuffer}
import scala.collection.generic.CanBuildFrom
import scala.reflect.runt... | Calavoow/scala-graph | constrained/src/main/scala/scalax/collection/constrained/generic/Graph.scala | Scala | bsd-3-clause | 2,932 |
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you ... | bwsw/t-streams | src/main/scala/com/bwsw/tstreams/agents/producer/ProducerTransactionData.scala | Scala | apache-2.0 | 1,924 |
/*
* 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 ... | practice-vishnoi/dev-spark-1 | external/flume/src/main/scala/org/apache/spark/streaming/flume/PollingFlumeTestUtils.scala | Scala | apache-2.0 | 6,621 |
package com.github.tkqubo.akka_open_graph_fetcher
import akka.http.scaladsl.model.StatusCodes
import akka.http.scaladsl.model.StatusCodes.ClientError
import org.specs2.mutable.Specification
import spray.json.DefaultJsonProtocol._
import spray.json._
import scala.concurrent.TimeoutException
/**
* Test class for [[E... | tkqubo/akka-open-graph-fetcher | src/test/scala/com/github/tkqubo/akka_open_graph_fetcher/ErrorTest.scala | Scala | mit | 2,068 |
/**
* 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... | flange/drift-dev | kafka/00-kafka_2.11-0.10.1.0/libs/tmp/kafka/producer/Partitioner.scala | Scala | apache-2.0 | 1,658 |
package toguru.toggles
import javax.inject.{Inject, Named}
import akka.actor.ActorRef
import akka.pattern.ask
import akka.util.Timeout
import com.codahale.metrics.Counter
import com.kenshoo.play.metrics.Metrics
import play.api.http.MimeTypes
import play.api.libs.json.{JsPath, Json, Writes}
import play.api.libs.functi... | andreas-schroeder/toguru | app/toguru/toggles/ToggleStateController.scala | Scala | mit | 3,931 |
package mesosphere.marathon.core.launcher.impl
import com.google.inject.Inject
import mesosphere.marathon.MarathonConf
import mesosphere.marathon.core.base.Clock
import mesosphere.marathon.core.launcher.{ TaskOp, TaskOpFactory }
import mesosphere.marathon.core.task.{ Task, TaskStateOp }
import mesosphere.marathon.stat... | vivekjuneja/marathon | src/main/scala/mesosphere/marathon/core/launcher/impl/TaskOpFactoryImpl.scala | Scala | apache-2.0 | 6,563 |
type ~>[Args <: Tuple, Return] = Args match {
case (arg1, arg2) => ((arg1, arg2) => Return)
}
trait Builder[Args <: NonEmptyTuple] {
def apply(f: Args ~> String): String
}
class BuilderImpl[Args <: NonEmptyTuple] extends Builder[Args] {
override def apply(f: Args ~> String): String = ???
}
val builder = Builde... | dotty-staging/dotty | tests/pos/i13526.scala | Scala | apache-2.0 | 480 |
/***********************************************************************
* Copyright (c) 2013-2020 Commonwealth Computer Research, Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Apache License, Version 2.0
* which accompanies this distribution and... | aheyne/geomesa | geomesa-utils/src/main/scala/org/locationtech/geomesa/utils/index/ByteArrays.scala | Scala | apache-2.0 | 17,840 |
package se.gigurra.aichallenge.host
import akka.actor.ActorSystem
import org.slf4j.LoggerFactory
import se.culvertsoft.mgen.javapack.serialization.{CommandLineArgHelp, CommandLineArgParser}
import se.gigurra.aichallenge.{ClassRegistry, CmdLineArgs}
import se.gigurra.aichallenge.ClassRegistry
object Main {
protecte... | GiGurra/gigurra-game-challenge | src/main/scala/se/gigurra/aichallenge/host/Main.scala | Scala | gpl-2.0 | 1,278 |
/*
* The MIT License (MIT)
*
* Copyright (c) 2016 Algolia
* http://www.algolia.com/
*
* 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... | algolia/algoliasearch-client-scala | src/test/scala/algolia/integration/IndexSettingsIntegrationTest.scala | Scala | mit | 2,640 |
/*
* Copyright (c) 2021 Couchbase, 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... | couchbaselabs/couchbase-spark-connector | src/main/scala/com/couchbase/spark/Keyspace.scala | Scala | apache-2.0 | 1,336 |
/**
* Copyright (C) 2015 Stratio (http://stratio.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by ap... | pmadrigal/spark-mongodb | spark-mongodb/src/main/scala/com/stratio/datasource/mongodb/partitioner/MongodbPartitioner.scala | Scala | apache-2.0 | 7,372 |
package org.lolhens.minechanics.core.storageaccess
import scala.language.dynamics
trait StorageAccess extends Dynamic {
final def selectDynamic(name: String): StorageAccess = {
if (name.matches("_\\d+"))
apply(name.substring(1).toInt)
else
apply(name)
}
def apply(i: Int): StorageAccess = ap... | LolHens/Minechanics | src/main/scala/org/lolhens/minechanics/core/storageaccess/StorageAccess.scala | Scala | gpl-2.0 | 1,819 |
package controllers.alertwatcherxr
import javax.inject._
import play.api._
import play.api.mvc._
import play.api.data.Form
import play.api.data.Forms._
import play.api.data._
import models.alertwatcherxr.Alert
import play.api.i18n.Messages
import play.api.i18n.I18nSupport
import play.api.i18n.MessagesApi
import servic... | tnddn/iv-web | portal/rest-portal/app/controllers/alertwatcherxr/AlertWatcherXRController.scala | Scala | apache-2.0 | 4,487 |
/*
* 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 ... | style95/openwhisk | tests/src/test/scala/org/apache/openwhisk/core/database/mongodb/MongoDBArtifactStoreTests.scala | Scala | apache-2.0 | 1,175 |
/*
* 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... | MobinRanjbar/hue | apps/spark/java/livy-spark/src/main/scala/com/cloudera/hue/livy/spark/SparkProcessBuilderFactory.scala | Scala | apache-2.0 | 1,120 |
package dispatch.oauth
import dispatch._
import scala.concurrent.{Future,ExecutionContext}
import com.ning.http.client.oauth._
trait SomeHttp {
def http: HttpExecutor
}
trait SomeConsumer {
def consumer: ConsumerKey
}
trait SomeEndpoints {
def requestToken: String
def accessToken: String
def authorize: S... | kkirsche/reboot | core/src/main/scala/oauth/exchange.scala | Scala | lgpl-3.0 | 2,448 |
package org.openmole.gui.plugin.task.systemexec.client
/*
* Copyright (C) 19/10/2014 // mathieu.leclaire@openmole.org
*
* 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 versio... | ISCPIF/PSEExperiments | openmole-src/openmole/gui/plugins/org.openmole.gui.plugin.task.systemexec.client/src/main/scala/org/openmole/gui/plugin/task/systemexec/client/SystemExecTaskFactoryUI.scala | Scala | agpl-3.0 | 1,168 |
package stainless
package verification
import CoqEncoder._
import CoqExpression._
object optAdmitAll extends inox.FlagOptionDef("admit-all", false)
trait CoqEncoder {
given givenDebugSection: DebugSectionCoq.type = DebugSectionCoq
val p: StainlessProgram
val ctx: inox.Context
val st: stainless.trees.type = ... | epfl-lara/stainless | core/src/main/scala/stainless/verification/CoqEncoder.scala | Scala | apache-2.0 | 30,729 |
/* __ *\\
** ________ ___ / / ___ Scala API **
** / __/ __// _ | / / / _ | (c) 2003-2010, LAMP/EPFL **
** __\\ \\/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\\___/_/... | cran/rkafkajars | java/scala/xml/parsing/XhtmlEntities.scala | Scala | apache-2.0 | 4,929 |
/*
* Copyright (C) 2015 Stratio (http://stratio.com)
*
* 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... | diegohurtado/sparta | serving-core/src/main/scala/com/stratio/sparta/serving/core/marathon/MarathonService.scala | Scala | apache-2.0 | 12,380 |
/*
* 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 ... | ddna1021/spark | sql/core/src/main/scala/org/apache/spark/sql/execution/ExpandExec.scala | Scala | apache-2.0 | 7,131 |
//############################################################################
// Programmation IV - 2002 - Week 01
//############################################################################
object M0 {
//##########################################################################
Console.println(87 + 145);
... | folone/dotty | tests/run/Course-2002-01.scala | Scala | bsd-3-clause | 6,019 |
import leon.Utils._
/* VSTTE 2008 - Dafny paper */
/*
Add the loop invariants so that Leon can verify this function.
*/
object Mult {
def mult(x : BigInt, y : BigInt): BigInt = ({
var r = 0
if(y < 0) {
var n = y
(while(n != 0) {
r = r - x
n = n + 1
}) //invariant(...)
... | epfl-lara/leon | testcases/graveyard/tutorials/07_Ex6_Mult.scala | Scala | gpl-3.0 | 474 |
package controllers.api
import play.api.mvc._
import play.api.libs.json._
import play.api.mvc.BodyParsers.parse
import utils._
import utils.auth._
import utils.JsonLogging
import levar._
import levar.json._
import levar.Format
import db._
object ExperimentController extends Controller with JsonLogging {
private va... | peoplepattern/LeVar | levar-web/app/controllers/api/ExperimentController.scala | Scala | apache-2.0 | 6,063 |
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.