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 2006-2010 WorldWide Conferencing, LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applica... | jeppenejsum/liftweb | framework/lift-base/lift-util/src/main/scala/net/liftweb/util/SecurityHelpers.scala | Scala | apache-2.0 | 11,461 |
package org.jetbrains.plugins.scala
package lang.psi.api
import com.intellij.openapi.progress.ProgressManager
import com.intellij.psi._
import com.intellij.psi.impl.migration.PsiMigrationManager
import com.intellij.psi.scope.{NameHint, PsiScopeProcessor}
import com.intellij.psi.search.GlobalSearchScope
import com.inte... | ilinum/intellij-scala | src/org/jetbrains/plugins/scala/lang/psi/api/FileDeclarationsHolder.scala | Scala | apache-2.0 | 10,280 |
// Databricks notebook source exported at Tue, 28 Jun 2016 10:37:19 UTC
// MAGIC %md
// MAGIC
// MAGIC # [Scalable Data Science](http://www.math.canterbury.ac.nz/~r.sainudiin/courses/ScalableDataScience/)
// MAGIC
// MAGIC
// MAGIC ## Course Project - High Order Spectral Clustering
// MAGIC ### by Xin Zhao
// MAGIC ... | lamastex/scalable-data-science | db/studentProjects/04_XinZhao/050_CaseStudy_HighOrderSpectralClustering.scala | Scala | unlicense | 14,354 |
package edu.uchicago.cs.encsel.dataset.feature
import java.io.File
import edu.uchicago.cs.encsel.dataset.column.Column
import edu.uchicago.cs.encsel.model.DataType
import org.junit.Assert._
import org.junit.Test
import scala.io.Source
class FeaturesTest {
@Test
def testFeatures: Unit = {
val col = new Colu... | harperjiang/enc-selector | src/test/scala/edu/uchicago/cs/encsel/dataset/feature/FeaturesTest.scala | Scala | apache-2.0 | 3,181 |
package com.example.http4s.blaze
import com.codahale.metrics._
import com.example.http4s.ExampleService
import org.http4s.server.Router
import org.http4s.server.blaze.BlazeBuilder
import org.http4s.server.metrics._
import org.http4s.util.StreamApp
object BlazeMetricsExample extends StreamApp {
val metricRegistry = ... | ZizhengTai/http4s | examples/blaze/src/main/scala/com/example/http4s/blaze/BlazeMetricsExample.scala | Scala | apache-2.0 | 587 |
package io.github.pauljamescleary.petstore
import cats.effect._
import cats.implicits._
import fs2.Stream
import io.github.pauljamescleary.petstore.config.{DatabaseConfig, PetStoreConfig}
import io.github.pauljamescleary.petstore.endpoint.{OrderEndpoints, PetEndpoints}
import io.github.pauljamescleary.petstore.reposit... | jastice/intellij-scala | scala/scala-impl/testdata/localProjects/scala-pet-store/src/main/scala/io/github/pauljamescleary/petstore/Server.scala | Scala | apache-2.0 | 1,706 |
package componentswing
import componentwork._,
java.awt.Image,
scala.collection.mutable.{Map => MMap},
java.awt.{Point,Dimension,Image},
java.awt.{Component => SC}
//IFrame
class IFrameF extends Interface {
def setTitle(s:String) = {}
def show () = {}
}
class IFrameS extends In... | AlexCAB/whfzf | componentswing/Interfaces.scala | Scala | mit | 1,178 |
import edu.uta.diql._
import org.apache.spark._
import org.apache.spark.sql._
import org.apache.spark.rdd._
object Test {
def main ( args: Array[String] ) {
val conf = new SparkConf()
.setAppName("Spark SQL Sum")
.setMaster("local[2]")
val sc = new SparkContext(conf)
val spark = SparkSessi... | fegaras/DIQL | tests/sqlgen/spark/Sum.scala | Scala | apache-2.0 | 720 |
/*
* 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 ... | bravo-zhang/spark | sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/BucketingUtils.scala | Scala | apache-2.0 | 2,574 |
/*
* 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... | danielcsant/sparta | serving-core/src/main/scala/com/stratio/sparta/serving/core/SpartaConfig.scala | Scala | apache-2.0 | 5,897 |
/*
* Copyright 2015 Ayasdi 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 i... | yl2695/spark-csv | src/test/scala/com/databricks/spark/csv/CsvFastSuite.scala | Scala | apache-2.0 | 12,025 |
package org.json4s
import org.specs2.mutable.Specification
private case class OptionalFields(optString: Option[String], optInt: Option[Int], optDouble: Option[Double], optObj: Option[OptionalFields])
private case class MyId(id: String) extends AnyVal
private case class MyModel(ids: Seq[MyId])
private case class Anoth... | dacr/json4s | tests/src/test/scala/org/json4s/SerializationSpec.scala | Scala | apache-2.0 | 7,213 |
package wakfutcp.protocol.messages.client
import wakfutcp.protocol.{ClientMessage, Codec}
final case class FighterReadyRequestMessage(
ready: Boolean
) extends ClientMessage {
override val id = 8149
override val arch = 3
}
object FighterReadyRequestMessage {
import Codec._
import cats.syntax.invariant._
... | OpenWakfu/wakfutcp | protocol/src/main/scala/wakfutcp/protocol/messages/client/FighterReadyRequestMessage.scala | Scala | mit | 426 |
package pl.suder.scala.auctionHouse
import akka.actor._
import akka.testkit.{ TestProbe, ImplicitSender, TestActorRef, TestKit }
import org.scalatest.{ Matchers, OneInstancePerTest, WordSpecLike }
import pl.suder.scala.auctionHouse._
import pl.suder.scala.auctionHouse.Message._
import scala.concurrent.duration.`packag... | Materix/Sem7-Scala | src/main/test/pl/suder/scala/auctionHouse/AuctionSearchTest.scala | Scala | mit | 1,848 |
/*
* 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 ... | Dax1n/spark-core | core/src/main/scala/org/apache/spark/storage/DiskBlockManager.scala | Scala | apache-2.0 | 6,461 |
/*
* 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.ir
import scala.annotatio... | gzm0/scala-js | ir/shared/src/main/scala/org/scalajs/ir/Trees.scala | Scala | apache-2.0 | 46,542 |
package org.scalacoin.protocol.script
/**
* Created by chris on 12/26/15.
*/
trait ScriptSignature {
def asm : String
def hex : String
}
case class ScriptSignatureImpl(asm : String, hex : String) extends ScriptSignature | scalacoin/scalacoin | src/main/scala/org/scalacoin/protocol/script/ScriptSignature.scala | Scala | mit | 227 |
package scife
package enumeration
package iterable
package lzy
package testcase
import scife.{ enumeration => e }
import e.iterable._
import e.dependent._
import scalaz.LazyTuple2
import scife.util.logging._
import scife.util._
import org.scalatest._
import org.scalatest.prop._
import org.scalacheck.Gen
import sca... | kaptoxic/SciFe | src/test/scala/scife/enumeration/iterable/lzy/testcase/SortedTreeTest.scala | Scala | gpl-2.0 | 10,348 |
package fpinscala.applicative
import org.junit.runner.RunWith
import org.scalatest.FlatSpec
import org.scalatest.prop.PropertyChecks
import org.scalacheck.Arbitrary
import org.scalacheck.Arbitrary.arbitrary
import org.scalacheck.Gen
import java.util.Date
import scala.util.Try
@RunWith(classOf[org.scalatest.junit.JUni... | fpinscala-muc/fpinscala-mhofsche | exercises/src/test/scala/fpinscala/applicative/ApplicativeSpec.scala | Scala | mit | 17,520 |
package com.twitter.finagle.factory
import com.twitter.util
import com.twitter.util.{Future, Duration}
import com.twitter.finagle.util.Timer
import com.twitter.finagle.{ServiceFactory, ServiceFactoryProxy, ServiceTimeoutException}
/**
* A factory wrapper that times out the service acquisition after the
* given tim... | enachb/finagle_2.9_durgh | finagle-core/src/main/scala/com/twitter/finagle/factory/TimeoutFactory.scala | Scala | apache-2.0 | 801 |
/***********************************************************************
* 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-tools/src/main/scala/org/locationtech/geomesa/tools/utils/CLArgResolver.scala | Scala | apache-2.0 | 1,680 |
package gitbucket.core.controller.api
import gitbucket.core.api.{ApiGroup, CreateAGroup, ApiRepository, ApiUser, JsonFormat}
import gitbucket.core.controller.ControllerBase
import gitbucket.core.service.{AccountService, RepositoryService}
import gitbucket.core.util.Implicits._
import gitbucket.core.util.{AdminAuthentic... | McFoggy/gitbucket | src/main/scala/gitbucket/core/controller/api/ApiOrganizationControllerBase.scala | Scala | apache-2.0 | 2,384 |
package com.letstalkdata.scalinear
import org.scalatest._
/**
* Author: Phillip Johnson
* Date: 7/6/15
*/
abstract class UnitSpec extends FlatSpec
with Matchers
with OptionValues
with Inside
with Inspectors | phdoerfler/scalinear | src/test/scala/com/letstalkdata/scalinear/UnitSpec.scala | Scala | mit | 219 |
/*
* 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 ... | gioenn/xSpark | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/unresolved.scala | Scala | apache-2.0 | 16,707 |
/*
* Copyright 2017 Nicolas Rinaudo
*
* 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... | nrinaudo/kantan.mongodb | core/src/main/scala/kantan/mongodb/io/UndefinedCodec.scala | Scala | apache-2.0 | 1,190 |
package com.twitter.server.filters
import com.twitter.conversions.DurationOps._
import com.twitter.finagle.Service
import com.twitter.finagle.http.{Request, Response}
import com.twitter.util.{Await, Future}
import org.scalatest.funsuite.AnyFunSuite
class AdminThreadPoolFilterTest extends AnyFunSuite {
test("work do... | twitter/twitter-server | server/src/test/scala/com/twitter/server/filters/AdminThreadPoolFilterTest.scala | Scala | apache-2.0 | 875 |
package com.redhat.samples.camel.spring
import org.apache.camel.builder.RouteBuilder
import org.apache.camel.test.spring.CamelSpringTestSupport
import org.junit.Test
import org.springframework.context.support.ClassPathXmlApplicationContext
class BasicTest extends CamelSpringTestSupport {
override def createApplica... | tadayosi/samples-camel | spring/src/test/scala/com/redhat/samples/camel/spring/BasicTest.scala | Scala | apache-2.0 | 786 |
/*
* 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... | wangyixiaohuihui/spark2-annotation | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/JoinedRow.scala | Scala | apache-2.0 | 5,554 |
/*
* 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 ... | maropu/spark | mllib/src/test/scala/org/apache/spark/ml/linalg/VectorUDTSuite.scala | Scala | apache-2.0 | 1,852 |
package spire.algebra
import scala.annotation.tailrec
import scala.{specialized => spec}
trait EuclideanRing[@spec(Byte, Short, Int, Long, Float, Double) A] extends CRing[A] {
def quot(a: A, b: A): A
def mod(a: A, b: A): A
def quotmod(a: A, b: A): (A, A) = (quot(a, b), mod(a, b))
def gcd(a: A, b: A): A
def... | lrytz/spire | core/src/main/scala/spire/algebra/EuclideanRing.scala | Scala | mit | 615 |
package a { class C1(private[a] val v0: String) }
package b { class C2(v1: String) extends a.C1(v1) { def foo = v1 } }
object Test extends App {
new b.C2("x")
val c2Fields = classOf[b.C2].getDeclaredFields
assert(c2Fields.size == 1, c2Fields.map(_.getName).toList)
}
| som-snytt/dotty | tests/run/t6793.scala | Scala | apache-2.0 | 275 |
package autolift.scalaz
import scalaz.{Functor, MonadPlus}
import autolift.{LiftFilter, LiftFilterSyntax, LiftFilterContext}
trait ScalazLiftFilter[Obj, Fn] extends LiftFilter[Obj, Fn]
object ScalazLiftFilter extends LowPriorityScalazLiftFilter{
def apply[Obj, Fn](implicit lift: LiftFilter[Obj, Fn]) = lift
impl... | wheaties/AutoLifts | autolift-scalaz/src/main/scala/autolift/scalaz/LiftFilter.scala | Scala | apache-2.0 | 929 |
/*
* 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 ... | paulcastro/openwhisk | tests/src/test/scala/common/rest/WskRest.scala | Scala | apache-2.0 | 58,607 |
package se.studieren.vs
import org.apache.spark.SparkContext
import se.studieren.vs.examples.{ApproximatePi, Example, TextSearch}
object RunAll extends AbstractRun {
val waitUserInput = true
val examples: Array[Example] =
Array(
ApproximatePi,
TextSearch
)
def main(args: Array[String]) {
... | Meash/apache_spark_demo | src/main/java/se/studieren/vs/RunAll.scala | Scala | mit | 780 |
/**
* Copyright (C) 2015 Orbeon, Inc.
*
* This program is free software; you can redistribute it and/or modify it under the terms of the
* GNU Lesser General Public License as published by the Free Software Foundation; either version
* 2.1 of the License, or (at your option) any later version.
*
* This program i... | brunobuzzi/orbeon-forms | xforms/jvm/src/main/scala/org/orbeon/oxf/xforms/submission/SerializationParameters.scala | Scala | lgpl-2.1 | 10,669 |
package infrastructure.user
import com.google.inject._
import _root_.test.DBTestTrait
import module.BindModule
import org.scalatest._
import scalikejdbc.DBSession
import scalikejdbc.scalatest._
import skinny._
/**
* UserRepositoryImplのテスト.
* 実際のDBにアクセスするパターン。dbUnit使用。
*/
class UserRepositoryImplSpec extends fixtur... | nemuzuka/vss-kanban | src/test/scala/infrastructure/user/UserRepositoryImplSpec.scala | Scala | mit | 1,139 |
package models;
class UniqueConstraintException(cause: Throwable) extends Error(cause)
| ruimo/store2 | app/models/UniqueConstraintException.scala | Scala | apache-2.0 | 88 |
class BankAccount(initialBalance: Double) {
private var balance = initialBalance
def deposit(amount: Double) = { balance += amount; balance }
def withdraw(amount: Double) = { balance -= amount; balance }
}
class CheckingAccount(initialBalance: Double) extends BankAccount(initialBalance) {
override def deposit(... | Gerhut/scala-for-the-impatient | Chapter8/1.scala | Scala | unlicense | 570 |
import actor.GlobalActorsModule
import play.api.GlobalSettings
import com.softwaremill.macwire.wiredInModule
object Global extends GlobalSettings with GlobalActorsModule{
lazy val wired = wiredInModule(Application)
override def getControllerInstance[A](controllerClass: Class[A]) = wired.lookupSingleOrThrow(contr... | ThoughtWorksIoTGurgaon/asgard | app/Global.scala | Scala | mit | 334 |
/*
* Copyright 2014 Treode, 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... | Treode/store | disk/stub/com/treode/disk/stubs/StubDiskEvents.scala | Scala | apache-2.0 | 1,049 |
/*
* Copyright 2019 ACINQ SAS
*
* 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... | ACINQ/eclair | eclair-node/src/main/scala/fr/acinq/eclair/api/directives/EclairDirectives.scala | Scala | apache-2.0 | 1,934 |
import sbt._
import Keys._
import java.io.{FileInputStream, FileOutputStream}
object BuildSettings {
val sonatypeRepo = "http://oss.sonatype.org/service/local/staging/deploy/maven2"
lazy val credentialsSetting = credentials ++=
(Seq("build.publish.user", "build.publish.password").map(k => Option(System.getPro... | nickhristov/norbert | project/Build.scala | Scala | apache-2.0 | 8,026 |
package com.getjenny.starchat.entities.io
/**
* Created by Angelo Leto <angelo@getjenny.com> on 24/03/17.
*/
import com.getjenny.starchat.entities.persistents.{AggAnnotations, QADocumentAnnotations, QADocumentCore}
trait QADocumentUpdateBase {
/* list of document ids to update (bulk editing) */
val conversatio... | GetJenny/starchat | src/main/scala/com/getjenny/starchat/entities/io/QADocumentUpdateBase.scala | Scala | gpl-2.0 | 1,064 |
package com.herokuapp.ochimikan.directives
import akka.event.Logging.LogLevel
import scala.collection.LinearSeq
import scala.language.implicitConversions
import spray.http.{
HttpHeader,
HttpRequest,
HttpResponse,
HttpResponsePart
}
import spray.routing.Directive0
import spray.routing.directives.{
DebuggingDi... | kikuomax/ochimikan-records | src/main/scala/com/herokuapp/ochimikan/directives/LoggingDirectives.scala | Scala | mit | 3,137 |
/**
* Magmanics Licensing. This web application allows for centralized control
* of client application activation, with optional configuration parameters
* to control licensable features, and storage of supplementary information
* about the client machine. Client applications may interface with this
* central serv... | manicmonkey/licensing | Licensing-Server/src/main/scala/com/magmanics/licensing/service/AuthenticationService.scala | Scala | gpl-3.0 | 4,156 |
package scala.slick.compiler
import scala.collection.mutable.HashMap
import scala.slick.ast._
/** Replace IntrinsicSymbols by AnonSymbols and collect them in a LetDynamic */
class LocalizeRefs extends Phase {
val name = "localizeRefs"
def apply(tree: Node, state: CompilationState): Node = {
val map = new Hash... | boldradius/slick | src/main/scala/scala/slick/compiler/LocalizeRefs.scala | Scala | bsd-2-clause | 887 |
package pl.combosolutions.backup.psm.elevation
import org.specs2.mock.Mockito
import org.specs2.mutable.Specification
import pl.combosolutions.backup.{ Async, Result }
import pl.combosolutions.backup.psm.programs.GenericProgram
import pl.combosolutions.backup.psm.programs.posix.GrepFiles
import pl.combosolutions.backu... | MateuszKubuszok/BackupDSL | modules/psm/src/test/scala/pl/combosolutions/backup/psm/elevation/ElevatorProgramsSpec.scala | Scala | mit | 1,662 |
/*
* 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 ... | chenc10/Spark-PAF | core/src/main/scala/org/apache/spark/ui/exec/ExecutorThreadDumpPage.scala | Scala | apache-2.0 | 3,499 |
package lila
package object video extends PackageObject {
type Target = Int
type Tag = String
type Lang = String
private[video] def logger = lila.log("video")
}
| luanlv/lila | modules/video/src/main/package.scala | Scala | mit | 177 |
// This only tests direct access to the methods in Statics,
// not the whole scheme.
object Test
{
import java.{ lang => jl }
import scala.runtime.Statics.anyHash
def allSame[T](xs: List[T]) = assert(xs.distinct.size == 1, "failed: " + xs)
def mkNumbers(x: Int): List[Number] =
List(x.toByte, x.toShort, x,... | felixmulder/scala | test/files/run/hashCodeStatics.scala | Scala | bsd-3-clause | 816 |
/*
* Copyright (C) 2009-2017 Lightbend Inc. <https://www.lightbend.com>
*/
package play.sbt.routes
import play.routes.compiler.RoutesCompiler.GeneratedSource
import sbt._
import xsbti.Position
import java.util.Optional
import scala.collection.mutable
import scala.language.implicitConversions
/**
* Fix compatibili... | zaneli/playframework | framework/src/sbt-plugin/src/main/scala-sbt-1.0/play/sbt/routes/RoutesCompilerCompat.scala | Scala | apache-2.0 | 1,994 |
package apdl.generation
import apdl.ApdlCodeGenerationException
import apdl.parser._
class CLikeTransformCodeGenerator {
def apply(apdlAst: ApdlAst): String = apdlAst match {
case e: Expr => e match {
case Add(left, right) => s"(${apply(left)} + ${apply(right)})"
case Mul(left, right) => s"(${apply(... | SnipyJulmy/APDL | src/main/scala/apdl/generation/CLikeTransformCodeGenerator.scala | Scala | lgpl-3.0 | 4,804 |
/*
* Copyright 2001-2014 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... | dotty-staging/scalatest | scalactic-test/src/test/scala/org/scalactic/exceptions/ValidationFailedExceptionSpec.scala | Scala | apache-2.0 | 1,900 |
/*
* Copyright 2020 Precog Data
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to ... | djspiewak/quasar | foundation/src/main/scala/quasar/contrib/iota/EqualKMaterializer.scala | Scala | apache-2.0 | 2,314 |
/*
* 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 ... | apache/flink | flink-table/flink-table-planner/src/test/scala/org/apache/flink/table/planner/factories/utils/TestCollectionTableFactory.scala | Scala | apache-2.0 | 7,905 |
/*
* 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/main/scala/com/intel/analytics/bigdl/dllib/nn/Max.scala | Scala | apache-2.0 | 3,244 |
object App {
def main(args: Array[String]): Unit = {
println(makeMessage())
System.exit(0)
}
def makeMessage() : String = "App.main()"
}
| jorgeacf/project-templates | src/main/scala/App.scala | Scala | gpl-3.0 | 156 |
object Test extends dotty.runtime.LegacyApp {
val res0 = Stream.cons(1, Stream.cons( { println("ouch"); 2 }, Stream.empty))
println(res0.take(1).force)
}
| folone/dotty | tests/run/t2176.scala | Scala | bsd-3-clause | 158 |
package alexsmirnov.pbconsole.serial
import java.io.Closeable
import java.util.concurrent.Executors
import java.util.concurrent.ThreadFactory
import java.util.concurrent.atomic.AtomicInteger
import org.slf4j.LoggerFactory
import scala.concurrent.ExecutionContext
import scala.util.matching.Regex
import org.reactivest... | alexsmirnov/printrbot-g2-console | src/main/scala/alexsmirnov/pbconsole/serial/Port.scala | Scala | bsd-3-clause | 1,920 |
/**
* Copyright 2017 RiskSense, Inc.
* This file is part of ipaddr library.
*
* Ipaddr is free software 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.apac... | risksense/ipaddr | src/main/scala/com/risksense/ipaddr/Ipv4.scala | Scala | apache-2.0 | 7,046 |
// This is a generator for java methods to forward to, as a workaround for
// scala bug#11770
//
// Run this generator like a script:
// scala GeneratorWorkaroundJava.scala > ../src/main/scala-2.13+/com/twitter/bijection/clojure/Workaround11770.java
def conversionN(n: Int) = {
val intypes = (1 to n).map(i => "I" + i... | twitter/bijection | bijection-clojure/codegen/GeneratorWorkaroundJava.scala | Scala | apache-2.0 | 3,083 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | trueyao/spark-lever | mllib/src/test/scala/org/apache/spark/mllib/feature/IDFSuite.scala | Scala | apache-2.0 | 4,152 |
package service
import java.util.UUID
sealed trait GroupingStrategy {
import GroupingStrategy._
@scala.annotation.tailrec
private def go(min: Int, max: Int, limit: Option[Int], p: Vector[UUID]): List[Vector[UUID]] = {
(p.size % min, p.size / min) match {
case (m, d) if m == d =>
p.grouped(mi... | THK-ADV/lwm-reloaded | app/service/GroupingStrategy.scala | Scala | mit | 1,224 |
package edu.umass.cs.automan.adapters.mturk
import java.util.{Calendar, Date, UUID}
import com.amazonaws.mturk.requester.AssignmentStatus
import edu.umass.cs.automan.adapters.mturk.logging.MTMemo
import edu.umass.cs.automan.adapters.mturk.logging.tables.DBAssignment
import edu.umass.cs.automan.core.info.QuestionType.... | dbarowy/AutoMan | tools/AcceptAllFromDB/src/main/scala/edu/umass/cs/automan/adapters/mturk/AcceptAllFromDB.scala | Scala | gpl-2.0 | 4,952 |
// Copyright 2017 Pants project contributors (see CONTRIBUTORS.md).
// Licensed under the Apache License, Version 2.0 (see LICENSE).
package org.pantsbuild.example.scalac.plugin
class Global
| landism/pants | examples/src/scala/org/pantsbuild/example/scalac/plugin/Global.scala | Scala | apache-2.0 | 193 |
package net.sansa_stack.rdf.common.partition.layout
import scala.reflect.runtime.universe.Type
import scala.reflect.runtime.universe.typeOf
import net.sansa_stack.rdf.common.partition.core.RdfPartitionerDefault
import net.sansa_stack.rdf.common.partition.schema.SchemaStringDouble
import org.apache.jena.graph.Triple
... | SANSA-Stack/SANSA-RDF | sansa-rdf/sansa-rdf-common/src/main/scala/net/sansa_stack/rdf/common/partition/layout/TripleLayoutDouble.scala | Scala | apache-2.0 | 840 |
package com.twitter.finagle.loadbalancer
import com.twitter.conversions.time._
import com.twitter.finagle
import com.twitter.finagle._
import com.twitter.finagle.client.StringClient
import com.twitter.finagle.param.Stats
import com.twitter.finagle.server.StringServer
import com.twitter.finagle.stats.{InMemoryHostStats... | mkhq/finagle | finagle-core/src/test/scala/com/twitter/finagle/loadbalancer/LoadBalancerFactoryTest.scala | Scala | apache-2.0 | 10,340 |
package org.scalaide.core.internal.jdt.util
import scala.tools.nsc.settings.ScalaVersion
import org.scalaide.core.IScalaInstallation
import org.scalaide.core.internal.project.ScalaInstallation.availableBundledInstallations
import org.eclipse.core.runtime.NullProgressMonitor
import org.scalaide.core.IScalaPlugin
import... | Kwestor/scala-ide | org.scala-ide.sdt.core/src/org/scalaide/core/internal/jdt/util/ClasspathContainerSetter.scala | Scala | bsd-3-clause | 3,846 |
package org.openapitools.client.api
import argonaut._
import argonaut.EncodeJson._
import argonaut.DecodeJson._
import org.http4s.{EntityDecoder, EntityEncoder}
import org.http4s.argonaut._
import org.joda.time.DateTime
import FreeStyleBuild._
case class FreeStyleBuild (
`class`: Option[String],
number: Option[I... | cliffano/swaggy-jenkins | clients/scalaz/generated/src/main/scala/org/openapitools/client/api/FreeStyleBuild.scala | Scala | mit | 1,128 |
package skinny.controller.feature
import skinny.micro.SkinnyMicroBase
/**
* X-Frame-Options header support
*
* - https://www.owasp.org/index.php/List_of_useful_HTTP_headers
*/
trait AsyncXFrameOptionsHeaderFeature { self: SkinnyMicroBase with AsyncBeforeAfterActionFeature =>
// NOTE: There are three possib... | skinny-framework/skinny-framework | framework/src/main/scala/skinny/controller/feature/AsyncXFrameOptionsHeaderFeature.scala | Scala | mit | 795 |
package akka.rtcweb.protocol.sctp.chunk
import scodec.Codec
import scodec.bits.BitVector
import scodec.codecs._
/**
* from rfc6525
*
*
*/
private[sctp] case class ReConfig() extends SctpChunk
object ReConfig {
/**
* {{{
* 0 1 2 3
* 0 1 2 3 4 5 6 7... | danielwegener/akka-rtcweb | src/main/scala/akka/rtcweb/protocol/sctp/chunk/ReConfig.scala | Scala | apache-2.0 | 1,583 |
package pl.gosub.akka_streams.workshop
import java.nio.file.FileSystems
import akka.Done
import akka.actor.ActorSystem
import akka.stream.scaladsl.{FileIO, Flow, Keep, RunnableGraph, Sink, Source}
import akka.stream.testkit.scaladsl.{TestSink, TestSource}
import akka.stream._
import akka.stream.testkit.TestSubscriber... | gosubpl/akka-streams-workshop | src/test/scala/pl/gosub/akka_streams/workshop/AdvancedFlowSpec.scala | Scala | mit | 6,743 |
package microtools.decorators
import scala.concurrent.Future
trait FutureDecorator[T] {
def apply(block: => Future[T]): Future[T]
def andThen(other: FutureDecorator[T]): FutureDecorator[T] =
new CombinedFutureDecorator[T](this, other)
}
class CombinedFutureDecorator[T](first: FutureDecorator[T], second: Futu... | 21re/play-micro-tools | src/main/scala/microtools/decorators/FutureDecorator.scala | Scala | mit | 459 |
/*
* See.scala
*
*/
package see
import see.values._
/** Interface describing an evaluation result.
* Pure trait, so we can use it from Java.
*
*/
trait IResult {
/** Forces result into java boolean.
* Guaranteed to succeed.
*/
def toBool: Boolean
/** Forces result into a reparsable Java str... | acruise/see | src/main/scala/see/See.scala | Scala | bsd-3-clause | 7,818 |
/*
* Copyright © 2011 Sattvik Software & Technology Resources, Ltd. Co.
* 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/LI... | sattvik/baitha | src/test/scala/com/sattvik/baitha/testutils/sdkVersions.scala | Scala | apache-2.0 | 2,530 |
/*
* 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 ... | maropu/spark | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/BoundAttribute.scala | Scala | apache-2.0 | 3,741 |
/*
* 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 ... | witgo/zen | ml/src/main/scala/com/github/cloudml/zen/ml/clustering/algorithm/FPlusLDA.scala | Scala | apache-2.0 | 7,425 |
/*
*************************************************************************************
* Copyright 2011 Normation SAS
*************************************************************************************
*
* This file is part of Rudder.
*
* Rudder is free software: you can redistribute it and/or modify
* it under the... | bmwjanos/rudder | rudder-core/src/main/scala/com/normation/cfclerk/domain/TechniqueResource.scala | Scala | gpl-3.0 | 4,968 |
package argonaut
import Data._
import JsonIdentity._
import scala.collection.immutable.{ SortedSet, SortedMap }
import scala.collection.mutable.ArrayBuffer
import scalaz._, Scalaz._
import scalaz.scalacheck.ScalaCheckBinding._
import scalaz.scalacheck.ScalazArbitrary.{UnitArbitrary => _, _}
import org.scalacheck._, Ar... | julien-truffaut/argonaut | src/test/scala/argonaut/CodecSpecification.scala | Scala | bsd-3-clause | 7,955 |
/**
* Copyright 2013 Netflix, 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 i... | mattrjacobs/RxJava | language-adaptors/rxjava-scala/src/examples/scala/rx/lang/scala/examples/RxScalaDemo.scala | Scala | apache-2.0 | 49,439 |
package strd.net.http.matching
import java.nio.ByteBuffer
import io.netty.handler.codec.http.HttpMethod
import strd.net.http._
import strd.util._
/**
* @author Kirill chEbba Chebunin
*/
object MatchingTest extends App {
val req = new HttpReq {
val ip: String = ""
val uri: String = "foo/bar/14/baz?param1... | onerinvestments/strd | strd-commons/src/main/scala/strd/net/http/matching/MatchingTest.scala | Scala | apache-2.0 | 2,350 |
package org.scalatest.tools.maven
import org.scalatest.matchers.{MatchResult, Matcher}
/**
* @author Jon-Anders Teigen
*/
trait PluginMatchers {
def containSlice(slice: String*) = new Matcher[Array[String]] {
def apply(seq: Array[String]) = {
MatchResult(
seq containsSlice slice,
"The " ... | scalatest/scalatest-maven-plugin | src/test/scala/org/scalatest/tools/maven/PluginMatchers.scala | Scala | apache-2.0 | 1,267 |
/*
* 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/tf/BiasAddGradSpec.scala | Scala | apache-2.0 | 1,178 |
package ocr
import model.WithId
case class OcrEntity(
id: String,
userId: String,
result: OcrTextAnnotation
) extends WithId
case class OcrText(text: String)
case class OcrTextOnly(
id: String,
result: OcrText
) extends WithId
| Leonti/receipts-rest-service | app/src/main/scala/ocr/OcrEntity.scala | Scala | mit | 251 |
/***********************************************************************
* 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-memory/geomesa-cqengine/src/test/scala/org/locationtech/geomesa/memory/cqengine/utils/CQIndexingOptionsTest.scala | Scala | apache-2.0 | 4,119 |
package com.twitter.finagle.loadbalancer
/**
* Information about a [[Balancer load balancer]].
*
* This class is thread-safe and while the class itself is immutable,
* it proxies data from a [[Balancer]] which may be mutable.
*
* @param label the [[com.twitter.finagle.param.Label]] used to identify the client
*... | twitter/finagle | finagle-core/src/main/scala/com/twitter/finagle/loadbalancer/Metadata.scala | Scala | apache-2.0 | 1,887 |
/*
* Copyright (C) 19/08/13 Romain Reuillon
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This pr... | ISCPIF/PSEExperiments | openmole-src/openmole/core/org.openmole.core.workspace/src/main/scala/org/openmole/core/workspace/AuthenticationProvider.scala | Scala | agpl-3.0 | 1,174 |
/* Copyright 2009-2016 EPFL, Lausanne */
import leon.annotation._
import leon.lang._
object RedBlackTree {
sealed abstract class Color
case class Red() extends Color
case class Black() extends Color
sealed abstract class Tree
case class Empty() extends Tree
case class Node(color: Color, left: Tree, val... | epfl-lara/leon | src/test/resources/regression/verification/newsolvers/invalid/RedBlackTree.scala | Scala | gpl-3.0 | 4,057 |
/**
* Main program for computing what weights can be assembled from a given set
* of plates.
*
* @author Joe Carnahan
*/
package weights
import java.io.BufferedWriter
import java.io.FileWriter
object Main {
val minSteps = List(1.0, 2.0, 4.0)
def main(args: Array[String]): Unit =
minSteps.map((minStep:... | joecarnahan/weights | src/main/scala/weights/Main.scala | Scala | mit | 627 |
import com.excilys.ebi.gatling.core.Predef._
import com.excilys.ebi.gatling.http.Predef._
import akka.util.duration._
import bootstrap._
class CreateRelationships extends Simulation {
val httpConf = httpConfig
.baseURL("http://localhost:9292")
val nbrNodes = 100000
val nodesRange = 1 to nbrNodes
val rnd ... | maxdemarzi/neo_accumulate_writes | neo4j_simulations/CreateRelationships.scala | Scala | mit | 763 |
package epic.logo
trait IterationCallback[T, W, OracleS, MaxerS] {
def startIteration(iter : Int, weights : Weights[W]) : Unit = {}
def startMinibatch(iter : Int, weights : Weights[W], miniBatch : Array[MinibatchInput[T, W]]) : Unit = {}
def endMinibatch(iter : Int, weights : Weights[W], miniBatch : Array[Mini... | langkilde/epic | src/main/scala/epic/logo/IterationCallback.scala | Scala | apache-2.0 | 804 |
package romanowski.slower
object J {
def fromJ = I.fromI
def toJ = fromJ
}
| romanowski/presentations | code/src/main/scala/romanowski/slower/J.scala | Scala | unlicense | 81 |
package immortan
import java.util.concurrent.Executors
import akka.actor.{Actor, ActorRef, Props}
import fr.acinq.bitcoin.ByteVector32
import fr.acinq.eclair.MilliSatoshi
import fr.acinq.eclair.blockchain.CurrentBlockCount
import fr.acinq.eclair.channel._
import fr.acinq.eclair.transactions.{RemoteFulfill, RemoteReje... | btcontract/wallet | app/src/main/java/immortan/Channel.scala | Scala | apache-2.0 | 6,359 |
package pl.combosolutions.backup.psm.filesystem
object FileType extends Enumeration {
type FileType = Value
val File, Directory, SymbolicLink = Value
}
| MateuszKubuszok/BackupDSL | modules/psm/src/main/scala/pl/combosolutions/backup/psm/filesystem/FileType.scala | Scala | mit | 159 |
/*
* 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 ... | javalovelinux/SparkGroovyScript | sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/Sink.scala | Scala | apache-2.0 | 1,587 |
package sri.web.examples.routerexample
import sri.core.ReactElement
import sri.universal.components.View
import sri.web.router._
import sri.web.styles.WebStyleSheet
object WebRouterExample {
object HomePage extends WebStaticPage
object StaticQueryPage extends WebStaticPage
object StaticStatePage extends WebS... | hamazy/sri | web-examples/src/main/scala/sri/web/examples/routerexample/WebRouterExample.scala | Scala | apache-2.0 | 1,949 |
package com.twitter.scalding.parquet.scrooge
import cascading.flow.FlowDef
import com.twitter.scalding._
import com.twitter.scalding.source.NullSink
import com.twitter.scalding.typed.cascading_backend.CascadingBackend
import org.scalatest.FunSuite
class PlanningTests extends FunSuite {
// How many steps would this ... | jzmq/scalding | scalding-parquet-scrooge/src/test/scala/com/twitter/scalding/parquet/scrooge/PlanningTests.scala | Scala | apache-2.0 | 5,413 |
/*
* Copyright (C) 2016 DANS - Data Archiving and Networked Services (info@dans.knaw.nl)
*
* 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
... | DANS-KNAW/easy-process-sip | src/test/scala/nl.knaw.dans.easy.multideposit/actions/AddDatasetMetadataToDepositSpec.scala | Scala | apache-2.0 | 15,097 |
/*
* 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/sj-platform | core/sj-common/src/main/scala/com/bwsw/common/AvroSerializer.scala | Scala | apache-2.0 | 2,053 |
/**
* Copyright 2012 Mikio Hokari
*
* 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 ... | pokarim/archerial | src/main/scala/com/archerial/Value.scala | Scala | apache-2.0 | 5,123 |
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.