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 org.jetbrains.plugins.scala
package format
import com.intellij.psi.PsiElement
import org.jetbrains.plugins.scala.extensions.PsiElementExt
import org.jetbrains.plugins.scala.lang.lexer.ScalaTokenTypes
import org.jetbrains.plugins.scala.lang.psi.api.base.ScInterpolatedStringLiteral
import org.jetbrains.plugins.s... | JetBrains/intellij-scala | scala/scala-impl/src/org/jetbrains/plugins/scala/format/InterpolatedStringParser.scala | Scala | apache-2.0 | 4,870 |
package com.catinthedark.yoba.entity
import com.catinthedark.yoba.Shared
import com.catinthedark.yoba.common.Const
object Creatures {
def create(shared: Shared, x: Float, z: Float): Creature = {
new Mammy(x, z, Const.Difficulty.mammySpeed(shared.lvl), Const.Physics.mammyWidth, Const.Physics.mammyDepth)
}
d... | cat-in-the-dark/old48_33_game | src/main/scala/com/catinthedark/yoba/entity/Creatures.scala | Scala | mit | 2,448 |
package mesosphere.marathon
package integration
import mesosphere.AkkaIntegrationTest
import mesosphere.marathon.core.task.Task
import mesosphere.marathon.integration.facades.MarathonFacade._
import mesosphere.marathon.integration.setup.EmbeddedMarathonTest
import mesosphere.marathon.state.AbsolutePathId
class TaskKi... | mesosphere/marathon | tests/integration/src/test/scala/mesosphere/marathon/integration/TaskKillingIntegrationTest.scala | Scala | apache-2.0 | 4,158 |
/*
* Copyright 2017 PayPal
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in ... | SarathChandran/squbs | squbs-unicomplex/src/main/scala/org/squbs/unicomplex/UnicomplexBoot.scala | Scala | apache-2.0 | 28,350 |
package scutil
package object lang {
type Identity[T] = T
type Predicate[-T] = T=>Boolean
type Thunk[+T] = ()=>T
type Effect[-T] = T=>Unit
//------------------------------------------------------------------------------
def constant[S,T](value: =>T):(S=>T) = _ => value
def ignorant[S,T](thunk:Thunk[T]... | ritschwumm/scutil | modules/core/src/main/scala/scutil/lang/package.scala | Scala | bsd-2-clause | 776 |
/*
* 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/ShouldFileBePropertyMatcherSpec.scala | Scala | apache-2.0 | 1,660 |
import scala.language.higherKinds
object Bug {
class Tag[W[M1[X1]]]
def ofType[W[M2[X2]]]: Tag[W] = ???
type InSeq [M3[X3]] = Some[M3[Any]]
// fail
val x = ofType[InSeq]
// okay
val y: Any = ofType[InSeq]
object T {
val z = ofType[InSeq]
}
}
| yusuke2255/dotty | tests/pending/pos/t7902.scala | Scala | bsd-3-clause | 269 |
package es.weso.shacl
import org.apache.jena.riot.RDFLanguages._
import scala.collection.JavaConversions._
object DataFormats {
lazy val formats = List("TURTLE", "RDF/XML", "N-TRIPLES", "RDF/JSON", "TRIG")
def available(format: String): Boolean = {
formats.contains(format.toUpperCase)
}
def default = "... | jorgeyp/ShExcala | src/main/scala/es/weso/shacl/DataFormats.scala | Scala | mit | 440 |
package monocle.macros
import monocle._
import monocle.macros.internal.MacroImpl
class GenLens[A] {
/** generate a [[Lens]] between a case class `S` and one of its field */
def apply[B](field: A => B): Lens[A, B] = macro MacroImpl.genLens_impl[A, B]
}
object GenLens {
def apply[A] = new GenLens[A]
} | malcolmgreaves/Monocle | macro/src/main/scala/monocle/macros/GenLens.scala | Scala | mit | 310 |
package com.typesafe.slick.testkit.tests
import org.junit.Assert._
import scala.slick.ast._
import scala.slick.ast.Util._
import com.typesafe.slick.testkit.util.{TestkitTest, TestDB}
class MapperTest(val tdb: TestDB) extends TestkitTest {
import tdb.profile.simple._
override val reuseInstance = true
def testM... | zefonseca/slick-1.0.0-scala.2.11.1 | slick-testkit/src/main/scala/com/typesafe/slick/testkit/tests/MapperTest.scala | Scala | bsd-2-clause | 7,023 |
package com.socrata.http.server
import scala.collection.JavaConverters._
import javax.servlet.DispatcherType
import java.util.{EventListener, EnumSet}
import org.eclipse.jetty.server.Handler
import org.eclipse.jetty.servlet.ServletContextHandler
import scala.concurrent.duration.{FiniteDuration, Duration}
class Socra... | socrata-platform/socrata-http | socrata-http-jetty/src/main/scala/com/socrata/http/server/SocrataServerJettyServlet.scala | Scala | apache-2.0 | 4,147 |
package sri.universal.apis
import sri.core.{ComponentConstructor, ReactElement}
import scala.scalajs.js
import scala.scalajs.js.annotation.{JSImport, JSName}
@js.native
trait AppRegistry extends js.Object {
def registerConfig(config: js.Array[js.Object]): Unit = js.native
def registerComponent(
appKey: S... | scalajs-react-interface/universal | src/main/scala/sri/universal/apis/AppRegistry.scala | Scala | apache-2.0 | 1,042 |
package mesosphere.marathon.api.v2
import javax.servlet.http.HttpServletRequest
import javax.ws.rs.core.{ Context, Response }
import javax.ws.rs.{ DELETE, GET, Path, Produces }
import com.google.inject.Inject
import mesosphere.chaos.http.HttpConf
import mesosphere.marathon.MarathonConf
import mesosphere.marathon.api.... | timcharper/marathon | src/main/scala/mesosphere/marathon/api/v2/LeaderResource.scala | Scala | apache-2.0 | 1,604 |
package com.github.dronegator.nlp.utils
/**
* Created by cray on 9/20/16.
*/
import akka.actor._
import scala.reflect.ClassTag
package object typeactor {
implicit class ActorRefFactoryExt[A](system: ActorRefFactory)(implicit tag: ClassTag[A]) {
def actorOf(props: TypeProps[A]) =
TypeActorRef[A](syste... | dronegator/nlp | akka-utils/src/main/scala/com/github/dronegator/nlp/utils/typeactor/package.scala | Scala | apache-2.0 | 661 |
package scapi.ahe
import java.math.BigInteger
import edu.biu.scapi.midLayer.asymmetricCrypto.encryption.{DJKeyGenParameterSpec, ScDamgardJurikEnc}
import edu.biu.scapi.midLayer.asymmetricCrypto.keys.{DamgardJurikPrivateKey, DamgardJurikPublicKey}
import edu.biu.scapi.midLayer.ciphertext.BigIntegerCiphertext
import ed... | kushti/scala-scapi | src/main/scala/scapi/ahe/DamgardJurikExperiment.scala | Scala | cc0-1.0 | 1,094 |
/*
* 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 ... | ZxlAaron/mypros | sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/encoders/ExpressionEncoderSuite.scala | Scala | apache-2.0 | 15,682 |
package storage
import models.ForumCategory
/**
* DAO for forum categories
*/
trait ForumCategoryDAO extends GenericDAO[ForumCategory] | metaxmx/FridayNightBeer | modules/datamodel/src/main/scala/storage/ForumCategoryDAO.scala | Scala | apache-2.0 | 147 |
package net.xylophones.planetoid.game.logic
import net.xylophones.planetoid.game.maths.Vector2D
import net.xylophones.planetoid.game.model._
import net.xylophones.planetoid.game.logic.ModelTestObjectMother._
import org.junit.runner.RunWith
import org.scalatest.junit.JUnitRunner
import org.scalatest.{FunSuite, Matchers... | wjsrobertson/planetoid | game/src/test/scala/net/xylophones/planetoid/game/logic/GameCollisionUpdaterTest.scala | Scala | apache-2.0 | 4,887 |
package me.elrod.tryidrisapp
import android.app.{ Activity, AlertDialog, Fragment }
import android.content.{ Context, Intent }
import android.graphics.Color
import android.os.Bundle
import android.text.{ Spanned, Spannable, SpannableString }
import android.text.style.ForegroundColorSpan
import android.util.Log
import ... | relrod/tryidris-android | src/main/scala/activity/MainActivity.scala | Scala | bsd-3-clause | 4,979 |
/*
* Copyright 2011 TomTom International BV
*
* 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 o... | ebowman/splitter | src/test/scala/tomtom/splitter/layer7/CommandableServer.scala | Scala | apache-2.0 | 2,866 |
package varys.framework
private[varys] object DataType extends Enumeration {
type DataType = Value
val FAKE, INMEMORY, ONDISK = Value
}
private[varys] case class DataIdentifier(
dataId: String,
coflowId: String)
private[varys] class FlowDescription(
val id: String, // Expected to be unique within ... | mosharaf/varys | core/src/main/scala/varys/framework/DataDescription.scala | Scala | apache-2.0 | 2,168 |
package com.angos.slicknspray
object MathHelper {
val R = 6371.0 /* km */
def haversine(xLat: Double, xLong: Double, yLat: Double, yLong: Double): Double = {
val latDistance = (yLat - xLat) / 2.0
val lonDistance = (yLong - xLong) / 2.0
val a = Math.sin(latDistance) * Math.sin(latDistance) +
Ma... | jdkendall/angos-slicknspray | src/main/scala/com/angos/slicknspray/MathHelper.scala | Scala | mit | 521 |
import com.typesafe.config.{ConfigException, Key, Path}
import uconfig.parser.HoconParser
package object uconfig {
type PathSeq = List[Path]
object PathSeq {
def apply(segments: Key*): PathSeq = List(segments:_*)
def fromString(path: String): PathSeq = HoconParser.parse(HoconParser.pathSeq,path) match {
... | jokade/sconfig | shared/src/main/scala/uconfig/package.scala | Scala | mit | 661 |
package com.gilt.opm.query
import com.gilt.opm.utils.MongoHelper
import com.mongodb.casbah.commons.MongoDBObject
import MongoHelper.toMongo
/**
* Case class representing the logic to filter a property that is less than the given value.
*
* @param valueTranslator: see [[com.gilt.opm.query.OpmSearcher]]
*/
case cla... | gilt/opm | src/main/scala/com/gilt/opm/query/OpmPropertyLessThan.scala | Scala | mit | 917 |
package no.digipost.labs.users
import no.digipost.labs.Settings.Proxy
import org.scalatest.Assertions
import org.json4s._
import org.json4s.jackson.JsonMethods.parse
import org.json4s.jackson.Serialization.write
import no.digipost.labs.oauth._
import scala.concurrent.Future
import com.ning.http.util.Base64
import no.d... | digipost/labs | backend/src/test/scala/no/digipost/labs/users/SessionHelper.scala | Scala | apache-2.0 | 3,618 |
/*
* Copyright (C) 2009-2018 Lightbend Inc. <https://www.lightbend.com>
*/
package play.filters
import play.api.mvc.EssentialFilter
import play.filters.csp.CSPComponents
import play.filters.csrf.CSRFComponents
import play.filters.headers.SecurityHeadersComponents
import play.filters.hosts.AllowedHostsComponents
/*... | Shenker93/playframework | framework/src/play-filters-helpers/src/main/scala/play/filters/HttpFiltersComponents.scala | Scala | apache-2.0 | 775 |
/**
* 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
* distributed ... | Chasego/kafka | core/src/test/scala/integration/kafka/api/BaseQuotaTest.scala | Scala | apache-2.0 | 19,352 |
/* sbt -- Simple Build Tool
* Copyright 2011 Mark Harrah
*/
package sbt
import java.io.File
import java.net.URI
import Def.{ ScopedKey, Setting }
import Project._
import Types.Endo
import compiler.Eval
import SessionSettings._
final case class SessionSettings(currentBuild: URI, currentProject: Map[URI, String], or... | xeno-by/old-scalameta-sbt | main/src/main/scala/sbt/SessionSettings.scala | Scala | bsd-3-clause | 10,252 |
package Dataset
import dispatch._, Defaults._
import ij.{ImagePlus, IJ}
import ij.process.ImageProcessor
import org.netbeans.api.keyring.Keyring
import imagepipeline._, Defs._
import scala.collection._
class Dataset {
def run(): Unit = {
}
}
case class RoiDataset(image: String, roi: String, convertImgPath: Str... | hirokai/ImagePipelineNew | src/main/scala/Dataset.scala | Scala | mit | 3,625 |
package fpgatidbits.ocm
import Chisel._
// A module for inferring true dual-pPort BRAMs on FPGAs
// Since (Xilinx) FPGA synthesis tools do not infer TDP BRAMs from
// Chisel-generated Verilog (both ports in the same "always" block),
// we use a BlackBox with a premade Verilog BRAM template.
class DualPortBRAMIO(add... | maltanar/fpga-tidbits | src/main/scala/fpgatidbits/ocm/DualPortBRAM.scala | Scala | bsd-2-clause | 4,178 |
/*
* Copyright 2015 the original author or 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 applicab... | arkadius/reliable-http-client | rhttpc-akka-http/src/main/scala/rhttpc/akkahttp/proxy/SuccessHttpResponseRecognizer.scala | Scala | apache-2.0 | 933 |
package domain
import play.api.libs.json.Json
case class User(id: Long, email: String)
object User {
implicit val format = Json.format[User]
} | vadim-shb/english-vocabulator | server/app/domain/User.scala | Scala | apache-2.0 | 147 |
package scadla.utils
import scadla._
import squants.space.Length
import scala.language.postfixOps
import squants.space.LengthConversions._
object RoundedCube {
def apply(x: Length, y: Length, z: Length, r: Length) = {
if (r.value > 0) {
val d = 2*r
assert(d < x && d < y && d < z, "RoundedCube, radi... | dzufferey/scadla | src/main/scala/scadla/utils/RoundedCube.scala | Scala | apache-2.0 | 858 |
package com.webtrends.harness.component.zookeeper
import java.util
import java.util.UUID
import org.apache.curator.x.discovery.{UriSpec, ServiceInstance}
import org.apache.curator.x.discovery.details.InstanceProvider
import org.specs2.mutable.SpecificationWithJUnit
import org.specs2.time.NoTimeConversions
import coll... | mjwallin1/wookiee-zookeeper | src/test/scala/com/webtrends/harness/component/zookeeper/WookieeWeightedStrategySpec.scala | Scala | apache-2.0 | 2,745 |
/*
* BrowserClientImpl.scala
* (ScalaOSC)
*
* Copyright (c) 2008-2021 Hanns Holger Rutz. All rights reserved.
*
* This software is published under the GNU Lesser General Public License v2.1+
*
*
* For further information, please contact Hanns Holger Rutz at
* [email protected]
*/
package de.sciss.osc
package... | Sciss/ScalaOSC | js/src/main/scala/de/sciss/osc/impl/BrowserClientImpl.scala | Scala | lgpl-2.1 | 786 |
/*
* Copyright (c) 2013 Scott Abernethy.
*
* 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 version 3 of the License, or
* (at your option) any later version.
*
* This program is d... | scott-abernethy/opener-of-the-way | test/ApplicationSpec.scala | Scala | gpl-3.0 | 1,484 |
/*
* Copyright (c) 2015 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 agreed... | malcolmgreaves/shapeless | examples/src/main/scala/shapeless/examples/caseclassmerge.scala | Scala | apache-2.0 | 1,673 |
/**
* Copyright 2015, deepsense.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 ... | deepsense-io/seahorse-workflow-executor | deeplang/src/main/scala/io/deepsense/deeplang/catalogs/doperable/TraitNode.scala | Scala | apache-2.0 | 1,518 |
package com.holdenkarau.spark.testing
import org.apache.spark.ml.linalg.SQLDataTypes.{MatrixType, VectorType}
import org.apache.spark.sql.SQLContext
import org.apache.spark.sql.types.{StructField, StructType}
import org.scalacheck.Prop.forAll
import org.scalatest.FunSuite
import org.scalatest.prop.Checkers
class MLSc... | snithish/spark-testing-base | src/test/2.0/scala/com/holdenkarau/spark/testing/MLScalaCheckTest.scala | Scala | apache-2.0 | 1,207 |
package sbt.inc
import sbt.IO
import java.io.File
import collection.mutable
/**
* During an incremental compilation run, a ClassfileManager deletes class files and is notified of generated class files.
* A ClassfileManager can be used only once.
*/
trait ClassfileManager {
/**
* Called once per compilation st... | pdalpra/sbt | compile/inc/src/main/scala/sbt/inc/ClassfileManager.scala | Scala | bsd-3-clause | 3,445 |
/**
* 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... | yonglehou/kafka-1 | src/scala/ly/stealth/mesos/kafka/Cli.scala | Scala | apache-2.0 | 34,750 |
package sigmastate.eval
import org.ergoplatform._
import sigmastate._
import sigmastate.Values._
import sigmastate.helpers.ContextEnrichingTestProvingInterpreter
import sigmastate.lang.LangTests
import sigmastate.utxo._
import scalan.BaseCtxTests
import scalan.util.BenchmarkUtil._
import special.sigma._
class Compile... | ScorexFoundation/sigmastate-interpreter | sigmastate/src/test/scala/sigmastate/eval/CompilerItTest.scala | Scala | mit | 8,426 |
/**
* This code is generated using [[https://www.scala-sbt.org/contraband/ sbt-contraband]].
*/
// DO NOT EDIT MANUALLY
package sbt.internal.bsp.codec
import _root_.sjsonnew.{ Unbuilder, Builder, JsonFormat, deserializationError }
trait TestResultFormats { self: sjsonnew.BasicJsonProtocol =>
implicit lazy val TestRe... | xuwei-k/xsbt | protocol/src/main/contraband-scala/sbt/internal/bsp/codec/TestResultFormats.scala | Scala | apache-2.0 | 1,152 |
package parsers.base
trait TableParser {
def parse: Array[Array[String]]
}
| maxmouchet/vamk-timetables | parsers/src/main/scala/parsers/base/TableParser.scala | Scala | mit | 80 |
/*
* Copyright 2015 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... | scottcutts/ct-calculations | src/main/scala/uk/gov/hmrc/ct/computations/LEC11.scala | Scala | apache-2.0 | 1,323 |
// Copyright 2016 Yahoo Inc.
// Licensed under the terms of the Apache 2.0 license.
// Please see LICENSE file in the project root for terms.
package com.yahoo.ml.caffe
import org.apache.spark.{Partition, SparkContext}
import org.apache.spark.rdd.{RDD, UnionRDD}
import scala.reflect.ClassTag
private[caffe] class Uni... | yahoo/CaffeOnSpark | caffe-grid/src/main/scala/com/yahoo/ml/caffe/UnionRDDWLocsSpecified.scala | Scala | apache-2.0 | 545 |
/*
* Copyright 2016 The BigDL Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agr... | intel-analytics/BigDL | scala/dllib/src/test/scala/com/intel/analytics/bigdl/dllib/nn/ops/MaxSpec.scala | Scala | apache-2.0 | 2,920 |
package lila.tournament
import akka.actor._
import akka.pattern.{ ask, pipe }
import scala.concurrent.duration._
import actorApi._
import lila.hub.actorApi.map.Ask
import makeTimeout.short
private[tournament] final class StartedOrganizer(
api: TournamentApi,
reminder: ActorRef,
isOnline: String => Boolea... | clarkerubber/lila | modules/tournament/src/main/StartedOrganizer.scala | Scala | agpl-3.0 | 2,323 |
/***********************************************************************
* Copyright (c) 2013-2017 Commonwealth Computer Research, Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Apache License, Version 2.0
* which accompanies this distribution and... | ronq/geomesa | geomesa-features/geomesa-feature-avro/src/main/scala/org/locationtech/geomesa/features/avro/AvroSimpleFeature.scala | Scala | apache-2.0 | 5,485 |
package org.jetbrains.plugins.scala.lang.completion
import com.intellij.codeInsight.completion._
import com.intellij.codeInsight.lookup._
import com.intellij.openapi.application.ApplicationManager
import com.intellij.patterns.PsiElementPattern.Capture
import com.intellij.patterns.{ElementPattern, PlatformPatterns, Sta... | triggerNZ/intellij-scala | src/org/jetbrains/plugins/scala/lang/completion/ScalaSmartCompletionContributor.scala | Scala | apache-2.0 | 32,866 |
package org.orbeon.oxf.xforms.action.actions
import org.orbeon.dom.Element
import org.orbeon.oxf.util.IndentedLogger
import org.orbeon.oxf.xforms.model.XFormsModel
import org.orbeon.oxf.xforms.XFormsServerSharedInstancesCache
import org.orbeon.oxf.xforms.action.{DynamicActionContext, XFormsAction, XFormsActionInterpre... | orbeon/orbeon-forms | xforms-runtime/shared/src/main/scala/org/orbeon/oxf/xforms/action/actions/XXFormsInvalidateInstanceAction.scala | Scala | lgpl-2.1 | 1,940 |
package org.jetbrains.plugins.scala
package annotator
package quickfix
import com.intellij.codeInsight.FileModificationService
import com.intellij.codeInsight.intention.IntentionAction
import com.intellij.openapi.command.undo.UndoUtil
import com.intellij.openapi.editor.Editor
import com.intellij.openapi.project.Projec... | JetBrains/intellij-scala | scala/scala-impl/src/org/jetbrains/plugins/scala/annotator/quickfix/ChangeTypeFix.scala | Scala | apache-2.0 | 2,103 |
/*
* Copyright (C) 2009-2013 Typesafe Inc. <http://www.typesafe.com>
*/
package scalaguide.tests.scalatest
import org.scalatest._
import org.scalatestplus.play._
import play.api.libs.ws._
import play.api.mvc._
import play.api.test._
import play.api.{GlobalSettings, Application}
import play.api.test.Helpers._
impo... | jyotikamboj/container | pf-documentation/manual/working/scalaGuide/main/tests/code-scalatestplus-play/ScalaFunctionalTestSpec.scala | Scala | mit | 4,557 |
package me.reminisce.gameboard.questions
import java.util.concurrent.TimeUnit
import akka.testkit.{TestActorRef, TestProbe}
import me.reminisce.database.MongoCollections
import me.reminisce.database.MongoDBEntities.FBPage
import me.reminisce.database.MongoDBFormats._
import me.reminisce.gameboard.board.GameboardEntit... | reminisceme/game-creator | src/test/scala/me/reminisce/gameboard/questions/OrderByPageLikesSpec.scala | Scala | apache-2.0 | 2,722 |
/*
* 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 ... | dmlc/mxnet | scala-package/examples/src/main/scala/org/apache/mxnetexamples/multitask/Data.scala | Scala | apache-2.0 | 1,816 |
package fr.eurecom.dsg.treelib.evaluation
import org.apache.spark.rdd._
abstract class BaseEvaluation {
/**
* Evaluate the accuracy of a prediction
*
* @param predictedResult the predicted values
* @param actualResult the actual result
*/
def Evaluate(predictedResult: RDD[String], a... | bigfootproject/treelib | src/main/scala/fr/eurecom/dsg/treelib/evaluation/BaseEvaluation.scala | Scala | apache-2.0 | 353 |
package scala.tools.nsc
package object symtab {
val Flags = scala.reflect.internal.Flags
}
| felixmulder/scala | src/compiler/scala/tools/nsc/symtab/package.scala | Scala | bsd-3-clause | 96 |
package org.raisercostin.jedi
import org.raisercostin.jedi.Locations._
import org.scalatest._
import org.junit.runner.RunWith
import org.junit.Assert._
import org.scalatest.junit.JUnitRunner
import scala.util.Try
import java.util.regex.Pattern.Loop
import Locations._
import org.scalatest.Matchers._
@RunWith(classOf... | raisercostin/jedi-io | src/test/scala/org/raisercostin/jedi/CachedLocationTest.scala | Scala | apache-2.0 | 2,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 ... | gyfora/flink | flink-table/flink-table-planner-blink/src/test/scala/org/apache/flink/table/api/TableEnvironmentTest.scala | Scala | apache-2.0 | 4,045 |
package org.jetbrains.plugins.scala
package lang
package refactoring
package util
import com.intellij.openapi.application.ApplicationManager
import com.intellij.psi._
import org.jetbrains.plugins.scala.extensions._
import org.jetbrains.plugins.scala.lang.lexer.{ScalaLexer, ScalaTokenTypes}
import org.jetbrains.plugins... | triggerNZ/intellij-scala | src/org/jetbrains/plugins/scala/lang/refactoring/util/ScalaNamesUtil.scala | Scala | apache-2.0 | 3,191 |
package io.reactors.protocol.instrument
import io.reactors._
/** Service used to record custom channel and reactor behavior.
*
* Together with the `ScriptedTransport`, this service is used to simulate
* faulty behavior and unreliable network, or otherwise any kind of special behavior.
*/
class Scripted(val ... | storm-enroute/reactive-collections | reactors-protocol/shared/src/main/scala/io/reactors/protocol/instrument/Scripted.scala | Scala | bsd-3-clause | 1,775 |
package dotty.tools.dotc.core
import Contexts._
/** Periods are the central "clock" of the compiler.
* A period consists of a run id and a phase id.
* run ids represent compiler runs
* phase ids represent compiler phases
*/
abstract class Periods { thisCtx: Context =>
import Periods._
/** The current phas... | som-snytt/dotty | compiler/src/dotty/tools/dotc/core/Periods.scala | Scala | apache-2.0 | 5,742 |
package com.github.agourlay.cornichon.dsl
import com.github.agourlay.cornichon.core.CornichonError
import org.parboiled2._
import scala.util.{ Failure, Success }
import scala.collection.breakOut
object DataTableParser {
val WhiteSpace = CharPredicate("\u0009\u0020")
val delimeter = CharPredicate('|')
val del... | OlegIlyenko/cornichon | cornichon-core/src/main/scala/com/github/agourlay/cornichon/dsl/DataTable.scala | Scala | apache-2.0 | 3,172 |
/**
* 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"); yo... | richhaase/kafka | core/src/test/scala/unit/kafka/server/AbstractFetcherThreadTest.scala | Scala | apache-2.0 | 9,191 |
package techex.data
import org.joda.time.Instant
import techex.cases.playerSignup.CreatePlayerData
import techex.domain._
import scalaz.stream.async
import scalaz.stream.async.mutable.Topic
object eventstreams {
lazy val events: Topic[InputMessage] =
scalaz.stream.async.topic()
val factUdpates: Topic[Fact... | kantega/tech-ex-2015 | backend/src/main/scala/techex/data/eventstreams.scala | Scala | mit | 1,241 |
package org.scalajs.jsenv.test
import org.scalajs.jsenv.nodejs.NodeJSEnv
import org.junit.Test
import org.junit.Assert._
class NodeJSTest extends TimeoutComTests {
protected def newJSEnv: NodeJSEnv = new NodeJSEnv
/** Node.js strips double percentage signs - #500 */
@Test
def percentageTest: Unit = {
v... | mdedetrich/scala-js | js-envs/src/test/scala/org/scalajs/jsenv/test/NodeJSTest.scala | Scala | bsd-3-clause | 1,567 |
package com.cpuheater.bot
import akka.actor.ActorSystem
import akka.event.Logging
import akka.http.scaladsl.Http
import akka.http.scaladsl.server.directives.DebuggingDirectives
import akka.util.Timeout
import akka.http.scaladsl.server.Directives._
import akka.stream.{ActorMaterializer, ActorMaterializerSettings, Super... | cpuheater/scala-messenger-bot | src/main/scala/com/cpuheater/bot/BotApp.scala | Scala | apache-2.0 | 1,265 |
//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
/** @author Arash Fard, Usman Nisar, Ayushi Jain, Aravind Kalimurthy, John Miller
* @version 1.2
* @date Thu Nov 25 11:28:31 EDT 2013
* @see LICENSE (MIT style license file).
*/
package scalation.graphalytics
import scala.c... | NBKlepp/fda | scalation_1.2/src/main/scala/scalation/graphalytics/StrictSim.scala | Scala | mit | 14,810 |
package mesosphere.marathon
package integration
import java.util.concurrent.atomic.AtomicInteger
import mesosphere.AkkaIntegrationTest
import mesosphere.marathon.integration.setup.{ EmbeddedMarathonTest, IntegrationHealthCheck }
import mesosphere.marathon.raml.{ App, GroupUpdate, UpgradeStrategy }
import mesosphere.m... | janisz/marathon | src/test/scala/mesosphere/marathon/integration/GroupDeployIntegrationTest.scala | Scala | apache-2.0 | 16,289 |
/**
* BuildDocTreeSpec.scala
*
* Unit tests for tree generation: find connected components, build thresholded tree
*
* Overview, created August 2012
* @author Jonathan Stray
*
*/
package com.overviewdocs.clustering
import com.overviewdocs.nlp.UnigramDocumentVectorGenerator
import org.specs2.mutable.Specificat... | overview/overview-server | worker/src/test/scala/com/overviewdocs/clustering/BuildDocTreeSpec.scala | Scala | agpl-3.0 | 1,194 |
package com.metl.data
import java.time.ZoneId
import com.metl.utils._
import com.metl.model._
import scala.xml._
import net.liftweb.common._
import net.liftweb.util.Helpers._
import Privacy._
import com.metl.external.ForeignRelationship
trait XmlUtils {
def getPrivacyByName(content:NodeSeq,name:String):Privacy = ... | StackableRegiments/analyticalmetlx | src/main/scala/com/metl/data/GenericXmlSerializer.scala | Scala | apache-2.0 | 46,330 |
/*
* Copyright (C) 2016 Vincibean <Andre Bessi>
*
* 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 version 3 of the License, or
* (at your option) any later version.
*
* This... | Vincibean/ScalaForTheImpatient-Solutions | src/main/scala/org/vincibean/scala/impatient/chapter6/exercise7/package.scala | Scala | gpl-3.0 | 1,160 |
package collins.controllers.actions.asset
import scala.concurrent.Future
import play.api.data.Form
import play.api.data.Forms.of
import play.api.data.Forms.optional
import play.api.data.Forms.text
import play.api.data.Forms.tuple
import play.api.libs.concurrent.Execution.Implicits.defaultContext
import play.api.mvc.R... | funzoneq/collins | app/collins/controllers/actions/asset/ProvisionUtil.scala | Scala | apache-2.0 | 12,285 |
/*
* Copyright (C) 2016-2019 Lightbend Inc. <https://www.lightbend.com>
*/
package com.lightbend.lagom.scaladsl.server.testkit
import java.net.URI
import akka.NotUsed
import play.api.libs.typedmap.TypedMap
import play.api.mvc.request.RemoteConnection
import play.api.mvc.request.RequestTarget
import play.api.mvc.He... | rcavalcanti/lagom | service/scaladsl/server/src/test/scala/com/lightbend/lagom/scaladsl/server/testkit/FakeRequest.scala | Scala | apache-2.0 | 1,432 |
import akka.actor.ActorSystem
import colossus.core.IOSystem
import colossus.protocols.http.HttpMethod._
import colossus.protocols.http.UrlParsing._
import colossus.protocols.http.{HttpServer, Initializer, RequestHandler}
import colossus.protocols.http.{ContentType, Http, HttpCodes, HttpHeader, HttpHeaders}
import colos... | tumblr/colossus | colossus-docs/src/main/scala/HttpService2.scala | Scala | apache-2.0 | 2,062 |
/*
* 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 ... | yelshater/hadoop-2.3.0 | spark-core_2.10-1.0.0-cdh5.1.0/src/main/scala/org/apache/spark/scheduler/JobResult.scala | Scala | apache-2.0 | 1,145 |
package cn.edu.neu.chiewen.cknn.trajectory
import cn.edu.neu.chiewen.cknn.ResultKeeper
class Trajectory(val positions: List[(Double, Double)], val factory: TrajectoryFactory) extends Serializable with ResultKeeper {
def nowAt = positions.head
def isEnd = positions.isEmpty
def nextPosition = new Trajectory(pos... | chiewen/CkNN | CkNN/src/main/scala/cn/edu/neu/chiewen/cknn/trajectory/Trajectory.scala | Scala | gpl-2.0 | 449 |
package fpinscala.datastructures
sealed trait List[+A] // `List` data type, parameterized on a type, `A`
case object Nil extends List[Nothing] // A `List` data constructor representing the empty list
/* Another data constructor, representing nonempty lists. Note that `tail` is another `List[A]`,
which may be `Nil` or ... | 724399396/function-programming-in-scala | exercises/src/main/scala/fpinscala/datastructures/List.scala | Scala | mit | 5,304 |
/**
* Bolt
* ArrayValue
*
* Copyright (c) 2017 Osamu Takahashi
*
* This software is released under the MIT License.
* http://opensource.org/licenses/mit-license.php
*
* @author Osamu Takahashi
*/
package com.sopranoworks.bolt.values
import com.google.cloud.spanner.{Mutation, Type}
import scala.col... | OsamuTakahashi/bolt | src/main/scala/com/sopranoworks/bolt/values/ArrayValue.scala | Scala | mit | 3,106 |
import scala.quoted._
object Macros {
inline def assert2(expr: => Boolean): Unit = ${ assertImpl('expr) }
def assertImpl(expr: Expr[Boolean])(using QuoteContext) = '{
def foo(): Unit = $expr
foo()
}
}
| som-snytt/dotty | tests/run-macros/quote-change-owner/Macro_1.scala | Scala | apache-2.0 | 216 |
package com.twitter.server.handler
import com.twitter.finagle.Service
import com.twitter.finagle.http.{Request, Response, Uri}
import com.twitter.finagle.server.ServerRegistry
import com.twitter.finagle.util.StackRegistry
import com.twitter.io.Buf
import com.twitter.server.util.HtmlUtils.escapeHtml
import com.twitter.... | twitter/twitter-server | server/src/main/scala/com/twitter/server/handler/ServerRegistryHandler.scala | Scala | apache-2.0 | 4,978 |
package org.littlewings.javaee7.config
import javax.inject.Inject
import org.apache.deltaspike.core.api.config.ConfigResolver
import org.apache.deltaspike.core.api.projectstage.ProjectStage
import org.apache.deltaspike.testcontrol.api.junit.CdiTestRunner
import org.junit.runner.RunWith
import org.junit.{Before, Test}... | kazuhira-r/javaee7-scala-examples | cdi-deltaspike-configuration/src/test/scala/org/littlewings/javaee7/config/ConfigResolverSpec.scala | Scala | mit | 2,752 |
package fpinscala.gettingstarted
// A comment!
/* Another comment */
/** A documentation comment */
object MyModule {
def abs(n: Int): Int =
if (n < 0) -n
else n
private def formatAbs(x: Int) = {
val msg = "The absolute value of %d is %d"
msg.format(x, abs(x))
}
def main(args: Array[String]):... | damien-neveu/functional-programming-in-scala | exercises/src/main/scala/fpinscala/gettingstarted/GettingStarted.scala | Scala | mit | 4,993 |
/**
* Swaggy Jenkins
* Jenkins API clients generated from Swagger / Open API specification
*
* The version of the OpenAPI document: 1.1.2-pre.0
* Contact: [email protected]
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not ed... | cliffano/swaggy-jenkins | clients/scala-httpclient-deprecated/generated/src/main/scala/org/openapitools/client/model/ClockDifference.scala | Scala | mit | 485 |
package de.zalando.play.controllers
import java.util.Base64
import scala.language.implicitConversions
/**
* @since 20.02.2016.
*/
case class Base64String(value: String) {
override val toString: String = Base64String.base64string2string(this)
}
object Base64String {
implicit def string2base64string(s: String... | zalando/play-swagger | api/src/main/scala/de/zalando/play/controllers/stringWrappers.scala | Scala | mit | 903 |
// Copyright 2017 EPFL DATA Lab (data.epfl.ch)
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law... | epfldata/squid | core/src/main/scala/squid/ir/Variance.scala | Scala | apache-2.0 | 1,367 |
object Test extends App {
def fold[A, B](f: (A, => B) => B) = (b: B) => f(null.asInstanceOf[A], b)
def f[A, B](x: A, y: B): B = y
def bip[A, B] = fold[A, B]((x, y) => f(x, y))
def bop[A, B] = fold[A, B](f(_, _))
// these work:
fold[Int, Int]((x, y) => f(x, y))(0)
fold[Int, Int](f(_, _))(0)
// Used to ... | lrytz/scala | test/files/run/t7584b.scala | Scala | apache-2.0 | 463 |
package com.arcusys.valamis.lesson.tincan.model
import com.arcusys.valamis.lesson.model.{ BaseManifest, LessonType }
import com.arcusys.valamis.lesson.model.LessonType.LessonType
import com.arcusys.valamis.model.PeriodTypes
import com.arcusys.valamis.model.PeriodTypes.PeriodType
import org.joda.time.DateTime
case cla... | ViLPy/Valamis | valamis-tincan-lesson/src/main/scala/com/arcusys/valamis/lesson/tincan/model/TincanManifest.scala | Scala | lgpl-3.0 | 812 |
package top.myetl
import org.apache.spark.SparkContext
import org.apache.spark.rdd.RDD
import top.myetl.lucenerdd.convert.{BeanToDoc, DocToBean}
import top.myetl.lucenerdd.rdd.{IndexReadRDD, LuceneRDD}
import scala.reflect.ClassTag
/**
* Created by pengda on 17/5/12.
*/
package object lucenerdd {
/** SparkCo... | myetl/sparkLu | src/main/scala/top/myetl/lucenerdd/package.scala | Scala | apache-2.0 | 1,165 |
package lila.insight
case class Question[X](
dimension: Dimension[X],
metric: Metric,
filters: List[Filter[_]]
)
case class Filter[A](
dimension: Dimension[A],
selected: List[A]
) {
def isEmpty = selected.isEmpty || selected.sizeIs == Dimension.valuesOf(dimension).size
import reactivemongo.a... | luanlv/lila | modules/insight/src/main/Question.scala | Scala | mit | 404 |
package org.sbtidea
import android.AndroidSupport
import java.io.File
import xml.NodeSeq
// cheating for now
import sbt.ScalaInstance
class IdeaProjectDomain
object IdeaLibrary {
sealed abstract class Scope(val configName: Option[String])
case object CompileScope extends Scope(None)
case object RuntimeScope e... | mpeltonen/sbt-idea | src/main/scala/org/sbtidea/IdeaProjectDomain.scala | Scala | bsd-3-clause | 2,913 |
/*
* Copyright 2015 Foundational Development
*
* 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 appl... | rssvihla/datastax_work | spark_commons/benchmarks/low_latency_spark/src/main/scala/pro/foundev/reporting/RunTimeOptions.scala | Scala | apache-2.0 | 766 |
/*
* 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 ... | saltstar/spark | resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s/submit/steps/DependencyResolutionStep.scala | Scala | apache-2.0 | 2,556 |
/*
* MilmSearch is a mailing list searching system.
*
* Copyright (C) 2013 MilmSearch Project.
*
* 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 version 3
* of the License, or any... | mzkrelx/milm-search-core | src/main/scala/org/milmsearch/common/LoggingUtil.scala | Scala | gpl-3.0 | 1,689 |
package client.components.mui.policies.statements
import japgolly.scalajs.react._
import japgolly.scalajs.react.vdom.html_<^._
import shared.responses.policies.Statement
object PolicyStatementList {
case class Props(
statements: List[Statement]
)
case class State()
class Backend($ : BackendScope[Props... | beikern/foulkon-ui | client/src/main/scala/client/components/mui/policies/statements/PolicyStatementList.scala | Scala | apache-2.0 | 890 |
package controllers
import java.net.URLDecoder
import controllers.external.{TVContentShort, TVContentLong}
import models._
import org.joda.time.{DateTime, DateTimeZone}
import org.mockito.Mockito._
import org.scalatest.MustMatchers
import org.scalatest.mock.MockitoSugar
import org.scalatestplus.play.PlaySpec
import p... | tvlive/tv-api | test/unit/controllers/TVContentControllerSpec.scala | Scala | apache-2.0 | 22,132 |
package bad.robot.radiate.teamcity
import java.net.URL
import bad.robot.radiate.Hypermedia
import bad.robot.radiate.UrlSyntax._
import bad.robot.radiate.config.Authorisation
import bad.robot.radiate.teamcity.TeamCityEndpoints.buildsEndpointFor
case class TeamCityUrl(baseUrl: URL) {
def urlFor(endpoint: Hypermedia... | tobyweston/radiate | src/main/scala/bad/robot/radiate/teamcity/TeamCityUrl.scala | Scala | apache-2.0 | 501 |
//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
/** @author John Miller
* @builder scalation.util.bld.BldMM_Array
* @version 1.3
* @date Thu Sep 24 14:03:17 EDT 2015
* @see LICENSE (MIT style license file).
*
* @see www.programering.com/a/MDO2cjNwATI.html
*/
packa... | NBKlepp/fda | scalation_1.3/scalation_mathstat/src/main/scala/scalation/util/MM_ArrayC.scala | Scala | mit | 7,461 |
package com.twitter.finagle.service
import com.twitter.util._
import org.scalatest.FunSuite
import org.scalatest.junit.JUnitRunner
import org.junit.runner.RunWith
import org.scalatest.mock.MockitoSugar
import org.mockito.Mockito.{times, verify, when}
import org.mockito.{Matchers, Mockito}
import org.mockito.Matchers._... | latur19318/finagle | finagle-core/src/test/scala/com/twitter/finagle/service/RefcountedServiceTest.scala | Scala | apache-2.0 | 1,401 |
package com.tribbloids.spookystuff.parsing
// TODO: generalise!
trait PhaseVec
object PhaseVec {
case object Eye extends PhaseVec
case object NoOp extends PhaseVec
case class Skip(length: Int) extends PhaseVec {
// def next(bm: BacktrackingManager#LinearSearch): Option[Like] = {
//
// sk... | tribbloid/spookystuff | mldsl/src/main/scala/com/tribbloids/spookystuff/parsing/PhaseVec.scala | Scala | apache-2.0 | 898 |
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.