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 |
|---|---|---|---|---|---|
/*
* 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/tradingpremises/agent_removal_reasonSpec.scala | Scala | apache-2.0 | 3,543 |
/**
* Provide security features
*/
trait Secured {
private def check(request: RequestHeader) = {
if(request.session.get("id").isDefined){
Some(
User(
request.session.get("id").get.toLong
,request.session.get("email").get
,request.session.get("name").get
... | Nexysweb/play-helpers | traits/tSecured.scala | Scala | gpl-2.0 | 1,304 |
package edu.mit.csail.sdg.ormolu.rel
import edu.mit.csail.sdg.ormolu.form.Formula
import edu.mit.csail.sdg.hsqldb.data.access.Subquery
case class Comprehension(sub: Formula, args: Variable*) extends Relation {
require(args forall {_.arity == 1}, "The arguements of a comprehension must have arity 1")
over... | dlreeves/ormolu | src/edu/mit/csail/sdg/ormolu/rel/Comprehension.scala | Scala | mit | 707 |
/*
* Ported from https://github.com/hamcrest/JavaHamcrest/
*/
package org.hamcrest.core
import org.hamcrest.BaseMatcher
import org.hamcrest.Description
import org.hamcrest.Matcher
class IsEqual[T](expectedValue: AnyRef) extends BaseMatcher[T] {
override def matches(actualValue: AnyRef): Boolean =
IsEqual.are... | lrytz/scala-js | junit-runtime/src/main/scala/org/hamcrest/core/IsEqual.scala | Scala | bsd-3-clause | 1,016 |
package mesosphere.mesos
import mesosphere.marathon.core.instance.Instance
import mesosphere.marathon.core.launcher.impl.TaskLabels
import mesosphere.marathon.state.{ PersistentVolume, ResourceRole, RunSpec, DiskType, DiskSource }
import mesosphere.marathon.stream.Implicits._
import mesosphere.marathon.tasks.{ PortsMa... | natemurthy/marathon | src/main/scala/mesosphere/mesos/ResourceMatcher.scala | Scala | apache-2.0 | 20,531 |
package io.reactors.common
import scala.reflect.ClassTag
class ConqueueBuffer[@specialized(Byte, Char, Int, Long, Float, Double) T: ClassTag](
val k: Int, val isLazy: Boolean, private var conqueue: Conqueue[T]
) {
import Conc._
import Conqueue._
require(k > 0)
private var leftChunk: Array[T] = _
pri... | storm-enroute/reactors | reactors-common/shared/src/main/scala/io/reactors/common/ConqueueBuffer.scala | Scala | bsd-3-clause | 5,862 |
/*
* This file is part of Apparat.
*
* Copyright (C) 2010 Joa Ebert
* http://www.joa-ebert.com/
*
* 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 Lice... | joa/apparat | apparat-core/src/main/scala/apparat/graph/analysis/Dominance.scala | Scala | lgpl-2.1 | 3,904 |
package skinny.engine.scalate
import java.io.File
import org.fusesource.scalate.TemplateEngine
class SkinnyEngineTemplateEngine(
sourceDirectories: Traversable[File] = None,
mode: String = sys.props.getOrElse("scalate.mode", "production"))
extends TemplateEngine(sourceDirectories, mode) | holycattle/skinny-framework | engine-scalate/src/main/scala/skinny/engine/scalate/SkinnyEngineTemplateEngine.scala | Scala | mit | 298 |
package waldap.core.controller
import waldap.core.util.Implicits._
import waldap.core.util.Keys
class PreprocessController extends ControllerBase {
get(context.currentPath.startsWith("/user") && context.loginAccount.map { _.isAdmin }.getOrElse(false)) {
org.scalatra.Forbidden("Access Denied")
}
get(contex... | kounoike/waldap | src/main/scala/waldap/core/controller/PreprocessController.scala | Scala | apache-2.0 | 1,277 |
/**
* This file is part of the TA Buddy project.
* Copyright (c) 2013 Alexey Aksenov ezh@ezh.msk.ru
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Affero General Global License version 3
* as published by the Free Software Foundation with the addition of t... | digimead/digi-TABuddy-desktop | part-core-ui/src/main/scala/org/digimead/tabuddy/desktop/core/ui/definition/IWizard.scala | Scala | agpl-3.0 | 2,585 |
/*
* Scala (https://www.scala-lang.org)
*
* Copyright EPFL and Lightbend, Inc.
*
* Licensed under Apache License 2.0
* (http://www.apache.org/licenses/LICENSE-2.0).
*
* See the NOTICE file distributed with this work for
* additional information regarding copyright ownership.
*/
package scala.tools.nsc.interp... | martijnhoekstra/scala | src/repl-frontend/scala/tools/nsc/interpreter/jline/FileBackedHistory.scala | Scala | apache-2.0 | 3,836 |
import scala.annotation.tailrec
/*
Reference: http://aperiodic.net/phil/scala/s-99
P02 (*) Find the last but one element of a list.
Example:
scala> penultimate(List(1, 1, 2, 3, 5, 8))
res0: Int = 5
*/
@tailrec
def penultimate[T](l: List[T]): T = {
l match {
case Nil | _ :: Nil => throw new NoSuchEl... | mcamou/s-99 | src/P02.scala | Scala | apache-2.0 | 448 |
package freecli
package object argument {
type ArgumentDsl[A] = dsl.ArgumentDsl[A]
}
| pavlosgi/freecli | core/src/main/scala/freecli/argument/package.scala | Scala | apache-2.0 | 88 |
package mimir.ctables;
import java.io.{StringReader,FileReader}
import org.specs2.mutable._
import mimir._
import mimir.ctables._
import mimir.ctables.vgterm._
import mimir.parser._
import mimir.algebra._
import mimir.sql._
import mimir.optimizer._
import mimir.optimizer.operator._
import mimir.exec._
import mimir.p... | UBOdin/mimir | src/test/scala/mimir/ctables/OperatorDeterminismSpec.scala | Scala | apache-2.0 | 10,724 |
package org.scalaide.core.internal.launching
import org.eclipse.core.runtime.CoreException
import org.eclipse.core.runtime.NullProgressMonitor
import org.eclipse.debug.core.DebugPlugin
import org.eclipse.debug.core.ILaunchConfiguration
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy
import org.eclipse.de... | scala-ide/scala-ide | org.scala-ide.sdt.core/src/org/scalaide/core/internal/launching/ScalaJUnitLaunchShortcut.scala | Scala | bsd-3-clause | 6,619 |
package systems.opalia.commons.scripting.ejs
import java.io.IOException
import java.nio.file.{Path, Paths}
import org.scalatest._
import play.api.libs.json._
import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.duration._
import scala.concurrent.{Await, ExecutionContext, Future}
import sca... | OpaliaSystems/commons | src/test/scala/systems/opalia/commons/scripting/ejs/EjsTest.scala | Scala | apache-2.0 | 6,564 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | shaneknapp/spark | sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/ui/HiveThriftServer2Listener.scala | Scala | apache-2.0 | 13,230 |
/*
* Copyright 2014 Databricks
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to i... | mattroberts297/spark-xml | src/main/scala/com/databricks/spark/xml/util/InferSchema.scala | Scala | apache-2.0 | 12,847 |
package be.stijnvermeeren.my2048ai.move
case object Undo extends InGameMove
| stijnvermeeren/2048-ai | src/main/scala/be/stijnvermeeren/my2048ai/move/Undo.scala | Scala | cc0-1.0 | 77 |
/*
* 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 ... | techaddict/spark | mllib/src/main/scala/org/apache/spark/ml/regression/RandomForestRegressor.scala | Scala | apache-2.0 | 12,606 |
package piecewise.intervaltree
import cats.kernel.Order
trait IntervalOps[I[_]]{
def contain[V](interval: I[V], v: V)(implicit ord: Order[V]): Boolean
def relation[V](interval: I[V], v: V)(implicit ord: Order[V]): Int
def isLowerBound[V](interval: I[V], v: V)(implicit ord: Order[V]): Boolean
def isUpperBoun... | daniil-timofeev/gridsplines | piecewise/src/main/scala/piecewise/intervaltree/IntervalOps.scala | Scala | apache-2.0 | 1,123 |
/*
* 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
* distribute... | wvlet/airframe | airframe-http-recorder/src/main/scala/wvlet/airframe/http/recorder/HttpRecordStore.scala | Scala | apache-2.0 | 9,991 |
/*
* Copyright (c) 2014-2018 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... | Wogan/monix | monix-reactive/shared/src/test/scala/monix/reactive/subjects/BaseConcurrentSubjectSuite.scala | Scala | apache-2.0 | 5,953 |
package org.dbpedia.spotlight.db.io.util
import org.codehaus.jackson.{JsonToken, JsonFactory}
/**
* TokenOccurrenceParser based on the Jackson Streaming API.
*
* @author Joachim Daiber
*/
class JacksonTokenOccurrenceParser extends TokenOccurrenceParser {
val jFactory = new JsonFactory()
def parse(tokens: St... | Skunnyk/dbpedia-spotlight-model | index/src/main/scala/org/dbpedia/spotlight/db/io/util/JacksonTokenOccurrenceParser.scala | Scala | apache-2.0 | 872 |
package com.nummulus.amqp.driver.test
import org.scalatest._
import com.nummulus.amqp.driver.api.provider.AmqpProviderRequest
import com.nummulus.amqp.driver.fixture.BoundProviderFixture
class ProviderIntegrationTest extends FlatSpec with Matchers {
behavior of "AmqpProvider"
val SomeDeliveryTag = 1
it sho... | nummulus/amqp-driver | amqp-driver-test/src/test/scala/com/nummulus/amqp/driver/test/ProviderIntegrationTest.scala | Scala | apache-2.0 | 515 |
package macros
class Foo {
def bar(y: Int) = 10
} | xeno-by/old-scalameta-sbt | sbt/src/sbt-test/source-dependencies/macro-scalahost-3/changes/Foo.scala | Scala | bsd-3-clause | 52 |
package com.rumblesan.scalaglitch.types
import java.io.File
import java.awt.image.BufferedImage
trait GlitchTypes {
type Coord = (Int, Int)
type PixelShifter = Coord => Coord
}
sealed trait GlitchedImage
case class GlitchedJpeg(image: BufferedImage) extends GlitchedImage
case class GlitchedGif(images: List[B... | rumblesan/cuttr | scala-glitch/src/main/scala/types/GlitchTypes.scala | Scala | bsd-2-clause | 538 |
package java.util
object RandomSuite extends tests.Suite {
/** Helper class to access next */
class HackRandom(seed: Long) extends Random(seed) {
override def next(bits: Int): Int = super.next(bits)
}
test("seed 10") {
val random = new HackRandom(10)
assert(random.next(10) == 747)
assert(ran... | cedricviaccoz/scala-native | unit-tests/src/main/scala/java/util/RandomSuite.scala | Scala | bsd-3-clause | 7,809 |
package org.apache.spark.sql.types
import magellan._
import org.apache.spark.sql.catalyst.InternalRow
import org.apache.spark.sql.catalyst.expressions.GenericInternalRow
class PointUDT extends UserDefinedType[Point] with GeometricUDT {
override val sqlType: StructType = StructType(
Seq(
StructField("type... | harsha2010/magellan | src/main/scala/org/apache/spark/sql/types/PointUDT.scala | Scala | apache-2.0 | 1,754 |
import sbt._
import Keys._
import play.Project._
object ApplicationBuild extends Build {
val appName = "eswcss-project"
val appVersion = "1.0-SNAPSHOT"
val appDependencies = Seq(
// Select Play modules
//jdbc, // The JDBC connection pool and the play.api.db API
//anorm, // Sca... | laurensdv/buzzword_detector | project/Build.scala | Scala | gpl-2.0 | 984 |
package com.lucidchart.open.cashy.utils
import org.apache.commons.mail.HtmlEmail
import play.api.Play.configuration
import play.api.Play.current
import play.api.Logger
case class MailerSMTPConfiguration(
host: String,
port: Int,
user: String,
pass: String
)
case class MailerAddress(
email: String,
name: ... | lucidsoftware/cashy | app/com/lucidchart/open/cashy/utils/Mailer.scala | Scala | apache-2.0 | 1,954 |
package dnd5_dm_db.lang.eng
import dnd5_dm_db.lang.Lang
import dnd5_dm_db.model._
trait SkillAndLanguageText {
self : Lang =>
val skills : String = "Skills"
val skill : Skill => String = {
case Athletics => "Athletics"
case Acrobatics => "Acrobatics"
case SleightOfHand => "Sleight of hand"
case... | lorilan/dnd5_dm_db | src/main/scala/dnd5_dm_db/lang/eng/SkillAndLanguageText.scala | Scala | gpl-3.0 | 1,717 |
package breeze.optimize
/*
Copyright 2015 David Hall, Daniel Ramage, Debasish Das
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... | scalanlp/breeze | math/src/main/scala/breeze/optimize/SpectralProjectedGradient.scala | Scala | apache-2.0 | 5,163 |
/*
* Copyright (c) 2014-2021 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... | monifu/monix | monix-catnap/shared/src/main/scala/monix/catnap/Semaphore.scala | Scala | apache-2.0 | 11,943 |
/*
* Copyright 2015 cookie.ai
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to i... | cookieai/cookie-datasets | src/main/scala/ai/cookie/spark/sql/sources/mnist/mnist.scala | Scala | apache-2.0 | 2,798 |
/*
* Copyright 2015 Webtrends (http://www.webtrends.com)
*
* See the LICENCE.txt file distributed with this work for additional
* information regarding copyright ownership.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* Yo... | Webtrends/wookiee | wookiee-core/src/main/scala/com/webtrends/harness/health/ActorHealth.scala | Scala | apache-2.0 | 4,641 |
package io.iohk.ethereum.consensus.ethash
package validators
import io.iohk.ethereum.consensus.difficulty.DifficultyCalculator
import io.iohk.ethereum.consensus.validators.{BlockHeaderError, BlockHeaderValid, BlockHeaderValidatorSkeleton}
import io.iohk.ethereum.domain.BlockHeader
import io.iohk.ethereum.utils.Blockch... | input-output-hk/etc-client | src/main/scala/io/iohk/ethereum/consensus/ethash/validators/MockedPowBlockHeaderValidator.scala | Scala | mit | 725 |
/**
* Copyright (C) 2012 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 prog... | evlist/orbeon-forms | src/main/scala/org/orbeon/oxf/xforms/function/xxforms/XXFormsCases.scala | Scala | lgpl-2.1 | 1,467 |
/*
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/iago | src/main/scala/com/twitter/parrot/processor/RecordParser.scala | Scala | apache-2.0 | 1,152 |
/*
* Copyright 2019 Spotify AB.
*
* 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 ... | spotify/scio | scio-jmh/src/test/scala/com/spotify/scio/jmh/CoderBenchmark.scala | Scala | apache-2.0 | 12,561 |
package com.geeksville.andropilot.gui
import android.os.Bundle
import android.widget.ArrayAdapter
import scala.collection.JavaConverters._
import com.geeksville.util.ThreadTools._
import android.support.v4.app.Fragment
import android.view.LayoutInflater
import android.view.ViewGroup
import com.ridemission.scandroid.An... | geeksville/arduleader | andropilot/src/main/scala/com/geeksville/andropilot/gui/OverviewFragment.scala | Scala | gpl-3.0 | 5,328 |
/*
* Copyright 2016 Dennis Vriend
*
* 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... | dnvriend/intro-to-akka-streams | src/test/scala/com/github/dnvriend/streams/flow/RunnableFlowTest.scala | Scala | apache-2.0 | 6,230 |
import org.scalatra.LifeCycle
import javax.servlet.ServletContext
import com.typesafe.scalalogging.LazyLogging
import slick.driver.H2Driver.api._
import akka.actor.ActorSystem
import com.github.mtodo.auth.{Signup, Signin, Users}
class ScalatraBootstrap extends LifeCycle with LazyLogging {
val users = TableQuery... | mtodo/auth | src/main/scala/com/github/mtodo/auth/ScalatraBootstrap.scala | Scala | mit | 608 |
/*
* 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 ... | Panos-Bletsos/spark-cost-model-optimizer | sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/optimizer/RewriteDistinctAggregatesSuite.scala | Scala | apache-2.0 | 3,657 |
/**
* 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... | wangcy6/storm_app | frame/kafka-0.11.0/kafka-0.11.0.1-src/core/src/test/scala/unit/kafka/server/checkpoints/OffsetCheckpointFileTest.scala | Scala | apache-2.0 | 3,038 |
package hr.element.beepo.client
package xml
import sms._
import hr.element.etb.Pimps._
trait SmsXMLConverter extends XMLConverter { this: Sms =>
def toXml =
<SmsIptRequest>
<phone>{ phones.map{ p =>
<string>{ p }</string>
}}</phone>
<messageText>{ this.body }</messageText>
</SmsIptRequest>
}
| element-doo/beepo | code/scala/client/src/main/scala/hr/element/beepo/client/xml/SMSXMLConverter.scala | Scala | bsd-3-clause | 308 |
package models.gift
import enumeratum.{Enum, EnumEntry, PlayJsonEnum}
import models.user._
import org.joda.time.DateTime
case class Comment(
id: Option[Long] = None,
objectid: Long,
user: User,
creationDate: DateTime = DateTime.now,
category: Comment.Category,
content: String)
object Commen... | epot/Gifter | app/models/gift/Comment.scala | Scala | mit | 708 |
package build
import org.scalajs.linker.interface._
object TestSuiteLinkerOptions {
def semantics(s: Semantics): Semantics = {
import Semantics.RuntimeClassNameMapper
s.withRuntimeClassNameMapper(
RuntimeClassNameMapper.keepAll().andThen(
RuntimeClassNameMapper.regexReplace(
... | scala-js/scala-js | project/TestSuiteLinkerOptions.scala | Scala | apache-2.0 | 1,387 |
// Databricks notebook source exported at Sun, 19 Jun 2016 02:59:22 UTC
// MAGIC %md
// MAGIC
// MAGIC # [Scalable Data Science](http://www.math.canterbury.ac.nz/~r.sainudiin/courses/ScalableDataScience/)
// MAGIC
// MAGIC
// MAGIC ### prepared by [Raazesh Sainudiin](https://nz.linkedin.com/in/raazesh-sainudiin-4595... | lamastex/scalable-data-science | db/xtraResources/ProgGuides1_6/MLlibProgrammingGuide/dataTypes/002_LabeledPoint.scala | Scala | unlicense | 11,570 |
package org.jetbrains.plugins.scala.lang.resolve
import org.jetbrains.plugins.scala.{LatestScalaVersions, ScalaVersion}
import org.jetbrains.plugins.scala.base.ScalaLightCodeInsightFixtureTestAdapter
class ParenlessMethodCallOverloadingResolutionTest
extends ScalaLightCodeInsightFixtureTestAdapter
with SimpleR... | JetBrains/intellij-scala | scala/scala-impl/test/org/jetbrains/plugins/scala/lang/resolve/ParenlessMethodCallOverloadingResolutionTest.scala | Scala | apache-2.0 | 820 |
package support
import io.circe.generic.auto._
import org.joda.time.DateTime
import support.Helpers._
import scala.io.Source
import scala.tools.nsc.io.File
import scala.util.{Failure, Success, Try}
case class Log(
file: String,
suite: String,
test: String,
... | loicknuchel/scala-class | src/main/scala/support/Logger.scala | Scala | unlicense | 2,735 |
/*
* 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 ... | zzcclp/carbondata | integration/spark/src/test/scala/org/apache/carbondata/spark/testsuite/dataretention/DataRetentionTestCase.scala | Scala | apache-2.0 | 10,806 |
/*
* Copyright 2014 porter <https://github.com/eikek/porter>
*
* 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... | eikek/porter | api/src/main/scala/porter/auth/AuthToken.scala | Scala | apache-2.0 | 1,125 |
/*
* La Trobe University - Distributed Deep Learning System
* Copyright 2016 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/generic/Dropout_Generic_Baseline.scala | Scala | apache-2.0 | 3,394 |
object Test {
def main(args: Array[String]): Unit = {
println(rewrite("foo"))
println(rewrite("foo" + "foo"))
rewrite {
println("apply")
}
}
}
| dotty-staging/dotty | tests/run-macros/expr-map-3/Test_2.scala | Scala | apache-2.0 | 172 |
/* __ *\\
** ________ ___ / / ___ Scala API **
** / __/ __// _ | / / / _ | (c) 2003-2013, LAMP/EPFL **
** __\\ \\/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\\___/_/... | felixmulder/scala | src/library/scala/collection/generic/SeqFactory.scala | Scala | bsd-3-clause | 1,091 |
/*
* 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 | sql/core/src/main/scala/org/apache/spark/sql/execution/command/SetCommand.scala | Scala | apache-2.0 | 6,739 |
/*
* Copyright (c) 2016 Fred Cecilia, Valentin Kasas, Olivier Girardot
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including without limitation the rights to
... | ogirardot/typesafe-kafka-streams | src/main/scala/fr/psug/kafka/streams/TKStream.scala | Scala | mit | 34,627 |
package io.mpjsons.impl.deserializer.mutables
import io.mpjsons.impl.deserializer.jsontypes.AbstractJsonArrayDeserializer
import io.mpjsons.impl.util.{Context, ObjectConstructionUtil, TypesUtil}
import io.mpjsons.impl.{DeserializerFactory, StringIterator}
import scala.collection.mutable.ArrayBuffer
import scala.refle... | marpiec/mpjsons | src/main/scala/io/mpjsons/impl/deserializer/mutables/ArrayDeserializer.scala | Scala | apache-2.0 | 1,290 |
package org.jetbrains.plugins.scala
package lang
package autoImport
import com.intellij.openapi.project.Project
import com.intellij.openapi.util.io.FileUtil
import com.intellij.openapi.util.text.StringUtil
import com.intellij.openapi.vfs.{CharsetToolkit, LocalFileSystem}
import com.intellij.psi.util.PsiTreeUtil.getPar... | JetBrains/intellij-scala | scala/scala-impl/test/org/jetbrains/plugins/scala/lang/autoImport/AutoImportTestBase.scala | Scala | apache-2.0 | 4,299 |
/**
* This file is part of the TA Buddy project.
* Copyright (c) 2014 Alexey Aksenov ezh@ezh.msk.ru
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Affero General Global License version 3
* as published by the Free Software Foundation with the addition of t... | digimead/digi-TABuddy-desktop | part-model-editor/src/main/scala/org/digimead/tabuddy/desktop/model/editor/ui/view/editor/bar/element/New.scala | Scala | agpl-3.0 | 4,053 |
/*
* Copyright 2015 Heiko Seeberger
*
* 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... | jnickels/reactive-flows | src/main/scala/de/heikoseeberger/reactiveflows/SharedJournalManager.scala | Scala | apache-2.0 | 3,629 |
package skinny.engine.test
import scala.language.implicitConversions
/**
* Contains implicit conversions for making test DSL easier
* to use. This is included by all `Client` implementations.
*/
trait ImplicitConversions {
implicit def stringToByteArray(str: String): Array[Byte] = str.getBytes("UTF-8")
}
| holycattle/skinny-framework | engine-test/src/main/scala/skinny/engine/test/ImplicitConversions.scala | Scala | mit | 315 |
/*
* Copyright (c) 2012, 2013, 2014, 2015, 2016 SURFnet BV
* 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, thi... | BandwidthOnDemand/nsi-safnari | app/controllers/PathComputationEngine.scala | Scala | bsd-3-clause | 8,305 |
package fr.hmil.roshttp.body
import java.nio.ByteBuffer
import monix.reactive.Observable
trait BodyPart {
def contentType: String
def content: Observable[ByteBuffer]
}
| hmil/RosHTTP | shared/src/main/scala/fr/hmil/roshttp/body/BodyPart.scala | Scala | mit | 175 |
package jp.ijufumi.openreports
/**
* Job Workers
*
* @see http://skinny-framework.org/documentation/worker_jobs.html
*/
package object worker {}
| ijufumi/openreports_scala | src/main/scala/jp/ijufumi/openreports/worker/package.scala | Scala | mit | 154 |
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
package com.azure.cosmos.spark.diagnostics
import java.util.UUID
private[spark] case class DiagnosticsContext(correlationActivityId: UUID, details: String)
| Azure/azure-sdk-for-java | sdk/cosmos/azure-cosmos-spark_3_2-12/src/main/scala/com/azure/cosmos/spark/diagnostics/DiagnosticsContext.scala | Scala | mit | 255 |
/*
* 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 ... | aliyun/aliyun-emapreduce-sdk | examples/src/main/scala/com/aliyun/emr/examples/sql/streaming/StructuredLoghubSinkHive.scala | Scala | artistic-2.0 | 2,915 |
package com.linecorp.armeria.server.scalapb
import armeria.scalapb.hello.HelloServiceGrpc.{HelloServiceBlockingStub, HelloServiceStub}
import armeria.scalapb.hello._
import com.google.common.base.Stopwatch
import com.linecorp.armeria.client.grpc.GrpcClients
import com.linecorp.armeria.common.SerializationFormat
import... | line/armeria | scalapb/scalapb_2.13/src/test/scala/com/linecorp/armeria/server/scalapb/HelloServiceTest.scala | Scala | apache-2.0 | 7,053 |
package hydrograph.engine.spark.components
import hydrograph.engine.core.component.entity.UniqueSequenceEntity
import hydrograph.engine.core.component.utils.OperationUtils
import hydrograph.engine.spark.components.base.OperationComponentBase
import hydrograph.engine.spark.components.handler.OperationHelper
import hydr... | capitalone/Hydrograph | hydrograph.engine/hydrograph.engine.spark/src/main/scala/hydrograph/engine/spark/components/UniqueSequenceComponent.scala | Scala | apache-2.0 | 2,413 |
/*
* 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 org.scalajs.testsuite.javalib.util
im... | scala-js/scala-js | test-suite/shared/src/test/scala/org/scalajs/testsuite/javalib/util/TrivialImmutableMap.scala | Scala | apache-2.0 | 1,286 |
package sodium
import java.util.ArrayList
import java.util.Arrays
import org.junit.After
import org.junit.Assert.assertEquals
import org.junit.Test
class CellTester {
import CellTester._
@After def tearDown() {
System.gc()
Thread.sleep(100)
}
@Test
def testHold() {
val e = new StreamSink[Int]... | kevintvh/sodium | scala/src/test/scala/sodium/CellTester.scala | Scala | bsd-3-clause | 11,480 |
//
// OrcDesktopEventAction.scala -- Scala class OrcDesktopEventAction and trait OrcDesktopActions
// Project OrcScala
//
// Created by dkitchin on Jan 24, 2011.
//
// Copyright (c) 2016 The University of Texas at Austin. All rights reserved.
//
// Use and redistribution of this file is governed by the license terms in... | orc-lang/orc | OrcScala/src/orc/run/OrcDesktopEventAction.scala | Scala | bsd-3-clause | 1,395 |
/*
* Copyright 2017 HM Revenue & Customs
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or a... | liquidarmour/ct-calculations | src/main/scala/uk/gov/hmrc/ct/ct600j/v3/J20.scala | Scala | apache-2.0 | 980 |
package fr.hurrycane
import java.util.concurrent.TimeUnit
import akka.actor.{ ActorRef, ActorSystem }
import akka.http.scaladsl.Http
import akka.http.scaladsl.server.Directives._
import akka.http.scaladsl.server.Route
import akka.http.scaladsl.settings.RoutingSettings
import akka.stream.ActorMaterializer
import com.n... | haris44/Bot-API | src/main/scala/fr/hurrycane/Server.scala | Scala | bsd-3-clause | 3,818 |
/*
* 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/funspec-test/src/test/scala/org/scalatest/funspec/FunSpecSpec.scala | Scala | apache-2.0 | 64,537 |
/* __ *\\
** ________ ___ / / ___ __ ____ Scala.js Test Suite **
** / __/ __// _ | / / / _ | __ / // __/ (c) 2013, LAMP/EPFL **
** __\\ \\/ /__/ __ |/ /__/ __ |/_// /_\\ \\ http://scala-js.org/ **
** /____/\\___/... | lrytz/scala-js | test-suite/shared/src/test/scala/org/scalajs/testsuite/compiler/MatchTest.scala | Scala | bsd-3-clause | 3,245 |
import org.garage.guru.domain._
import scalaz._
package object domain {
import scala.util.Try
import scalaz.Bind
type Repo = Repository[FreeParkingLot, TakenParkingLot, Vehicle, VehicleId]
type ParkingAction[A] = ReaderT[Try, Repo, A]
type DomainService = ParkingService[FreeParkingLot, TakenParkingLot, Veh... | ddd-fun/garage-guru-fun | src/main/scala/org/garage/guru/domain/domain.scala | Scala | apache-2.0 | 946 |
package com.twitter.server.handler
import com.twitter.finagle.http
import com.twitter.io.Charsets
import com.twitter.logging.{Level, Logger}
import com.twitter.server.util.HttpUtils._
import com.twitter.util.Await
import org.junit.runner.RunWith
import org.scalatest.FunSuite
import org.scalatest.junit.JUnitRunner
@Ru... | takei-shg/twitter-server | src/test/scala/com/twitter/server/handler/LoggingHandlerTest.scala | Scala | apache-2.0 | 1,905 |
package com.theseventhsense.datetime
import com.theseventhsense.utils.types.SSDateTime
import com.theseventhsense.utils.types.SSDateTime.Instant
import moment.Moment
/**
* Created by erik on 2/18/16.
*/
object SSDateTimeZoneOps extends TSSDateTimeZoneOps {
override def isValid(s: String): Boolean = true
over... | 7thsense/utils-datetime | js/src/main/scala/com/theseventhsense/datetime/SSDateTimeZoneOps.scala | Scala | mit | 632 |
package spark.streaming.api.java
import java.util.{List => JList}
import java.lang.{Long => JLong}
import scala.collection.JavaConversions._
import spark.streaming._
import spark.streaming.StreamingContext._
import spark.api.java.function.{Function => JFunction, Function2 => JFunction2}
import spark.{RDD, Partitione... | koeninger/spark | streaming/src/main/scala/spark/streaming/api/java/JavaPairDStream.scala | Scala | bsd-3-clause | 27,381 |
/*
* 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 ... | himanshudhami/PredictionIO | examples/experimental/scala-stock/src/main/scala/Algorithm.scala | Scala | apache-2.0 | 2,470 |
package com.ajjpj.adiagram_.render.base
import com.ajjpj.adiagram_.geometry.{ARect, APoint}
import javafx.scene.image.Image
import javafx.scene.canvas.{Canvas, GraphicsContext}
import com.ajjpj.adiagram_.geometry.transform.Translation
import com.ajjpj.adiagram_.render.RenderHelper
import com.ajjpj.adiagram_.ui.fw.Dige... | arnohaase/a-diagram | src/main/scala-old/com/ajjpj/adiagram_/render/base/PartialImage.scala | Scala | apache-2.0 | 1,893 |
//
// Game Gardens - a platform for hosting simple multiplayer Java games
// Copyright (c) 2005-2013, Three Rings Design, Inc. - All rights reserved.
// https://github.com/threerings/game-gardens/blob/master/LICENSE
package com.threerings.gardens.web.logic
import com.samskivert.servlet.RedirectException
import com.sa... | threerings/game-gardens | server/src/main/scala/com/threerings/gardens/web/logic/login.scala | Scala | bsd-3-clause | 1,491 |
package org.rebeam.tree.demo
import java.io.File
import java.util.concurrent.atomic.AtomicLong
import org.rebeam.tree.{DeltaIOContext, DeltaIOContextSource, Moment}
import org.rebeam.tree.server.{ServerStore, ServerStoreValueExchange}
import org.rebeam.tree.Delta._
import org.rebeam.tree.sync.Sync._
import org.rebeam... | trepidacious/tree-material-ui | jvm/src/main/scala/org/rebeam/tree/demo/ServerDemoApp.scala | Scala | gpl-3.0 | 6,224 |
package nsmc.mongo
class MetadataException(message: String = null, cause: Throwable = null) extends RuntimeException(message, cause) | shotishu/spark-mongodb-connector | src/main/scala/nsmc/mongo/MetadataException.scala | Scala | apache-2.0 | 133 |
package spire
package std
import scala.collection.SeqLike
import scala.collection.mutable.Builder
import scala.collection.generic.CanBuildFrom
import spire.algebra._
import spire.NoImplicit
@SerialVersionUID(0L)
class SeqCModule[A, SA <: SeqLike[A, SA]](implicit val scalar: CRing[A], cbf: CanBuildFrom[SA,A,SA])
ex... | adampingel/spire | core/src/main/scala/spire/std/seq.scala | Scala | mit | 8,598 |
package com.hyenawarrior
import java.lang.String._
import com.hyenawarrior.OldNorseGrammar.grammar.enums.Case._
import com.hyenawarrior.OldNorseGrammar.grammar.enums.GNumber._
import com.hyenawarrior.OldNorseGrammar.grammar.nouns.stemclasses.NounStemClass
import com.hyenawarrior.OldNorseGrammar.grammar.nouns.{Noun, _... | HyenaSoftware/IG-Dictionary | OldNorseGrammarEngine/src/test/scala/com/hyenawarrior/NounTestAux.scala | Scala | lgpl-3.0 | 3,706 |
/* __ *\
** ________ ___ / / ___ __ ____ Scala.js Test Suite **
** / __/ __// _ | / / / _ | __ / // __/ (c) 2013, LAMP/EPFL **
** __\ \/ /__/ __ |/ /__/ __ |/_// /_\ \ http://scala-js.org/ **
** /____/\___/_/ |_/... | colinrgodsey/scala-js | test-suite/src/test/scala/org/scalajs/testsuite/javalib/StackTraceElementTest.scala | Scala | bsd-3-clause | 1,240 |
/*
* Copyright (c) 2002-2018 "Neo Technology,"
* Network Engine for Objects in Lund AB [http://neotechnology.com]
*
* This file is part of Neo4j.
*
* Neo4j is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundatio... | HuangLS/neo4j | community/cypher/acceptance/src/test/scala/org/neo4j/internal/cypher/acceptance/MergeRelationshipAcceptanceTest.scala | Scala | apache-2.0 | 16,170 |
package monocle.syntax
import monocle.function.{At, Each, FilterIndex, Index}
import monocle._
trait AppliedPSetter[S, T, A, B] {
def value: S
def optic: PSetter[S, T, A, B]
def replace(b: B): T = optic.replace(b)(value)
def modify(f: A => B): T = optic.modify(f)(value)
/** alias to replace */
@depr... | julien-truffaut/Monocle | core/shared/src/main/scala/monocle/syntax/AppliedPSetter.scala | Scala | mit | 4,936 |
import scala.math.BigInt
//import BigInt.*
object test {
1 * BigInt(0)
}
| dotty-staging/dotty | tests/pos/bigint.scala | Scala | apache-2.0 | 77 |
package org.sofi.deadman.http.api
import akka.actor._
import akka.pattern.ask
import akka.stream._
import akka.stream.scaladsl._
import akka.util.Timeout
import cats.data.Validated._
import org.sofi.deadman.http.request._
import org.sofi.deadman.messages.command._, ResponseType._
import org.sofi.deadman.messages.valid... | SocialFinance/deadman-switch | service/src/main/scala/org/sofi/deadman/http/api/CommandApi.scala | Scala | bsd-3-clause | 2,982 |
/************************************************************************
Tinaviz
*************************************************************************
This application is part of the Tinasoft project: http://tinasoft.eu
Tinaviz main developer: julian.bilcke @ iscpif.fr (twitter... | moma/tinaviz | src/main/scala/eu/tinasoft/tinaviz/graph/Graph.scala | Scala | gpl-3.0 | 35,823 |
/*
* Copyright (c) 2002-2018 "Neo Technology,"
* Network Engine for Objects in Lund AB [http://neotechnology.com]
*
* This file is part of Neo4j.
*
* Neo4j is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundatio... | HuangLS/neo4j | community/cypher/cypher-compiler-2.3/src/main/scala/org/neo4j/cypher/internal/compiler/v2_3/commands/expressions/ExtractFunction.scala | Scala | apache-2.0 | 2,154 |
package com.ecfront.ez.framework.service.message
import com.ecfront.common.Resp
import com.ecfront.ez.framework.core.EZServiceAdapter
import com.ecfront.ez.framework.core.rpc.AutoBuildingProcessor
import com.fasterxml.jackson.databind.JsonNode
import scala.collection.mutable
object ServiceAdapter extends EZServiceAd... | gudaoxuri/ez-framework | services/message/src/main/scala/com/ecfront/ez/framework/service/message/ServiceAdapter.scala | Scala | apache-2.0 | 846 |
package varys.framework.master.scheduler
import scala.collection.mutable.{ArrayBuffer, HashMap, Map}
import varys.framework.master.{CoflowInfo, CoflowState, FlowInfo, SlaveInfo}
import varys.Logging
/**
* Implementation of a generalized coflow scheduler that works using the
* following steps:
* 1. Order coflows... | mosharaf/varys | core/src/main/scala/varys/framework/master/scheduler/OrderingBasedScheduler.scala | Scala | apache-2.0 | 3,933 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | dbtsai/spark | resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s/KubernetesVolumeUtils.scala | Scala | apache-2.0 | 3,924 |
package actors.flights
import actors.DateRange
import actors.routing.FlightsRouterActor
import actors.routing.FlightsRouterActor._
import controllers.ArrivalGenerator
import drt.shared.ApiFlightWithSplits
import drt.shared.CrunchApi.MillisSinceEpoch
import drt.shared.FlightsApi.FlightsWithSplits
import drt.shared.Term... | UKHomeOffice/drt-scalajs-spa-exploration | server/src/test/scala/actors/flights/StreamingFlightsByDaySpec.scala | Scala | apache-2.0 | 5,254 |
package commitlog
import java.io.{File, IOException}
import java.nio.file._
import java.nio.file.attribute.BasicFileAttributes
import java.util.concurrent.atomic.AtomicLong
import com.bwsw.commitlog.{CommitLog, CommitLogRecord}
import com.bwsw.commitlog.CommitLogFlushPolicy.{OnCountInterval, OnRotation, OnTimeInterva... | bwsw/tstreams-transaction-server | src/test/scala/commitlog/CommitLogTest.scala | Scala | apache-2.0 | 5,429 |
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.