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 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... | SRGOM/scalatest | scalatest-test/src/test/scala/org/scalatest/fixture/AsyncWordSpecLikeSpec.scala | Scala | apache-2.0 | 4,208 |
package akashic.storage.patch
import akashic.storage.backend.NodePath
import akashic.storage.service.{Acl, Location, Versioning}
case class Bucket(root: NodePath) extends Patch {
val acl = Acl.makeCache(root("acl"))
val versioning = Versioning.makeCache(root("versioning"))
val location = Location.makeCache(root... | akiradeveloper/akashic-storage | src/main/scala/akashic/storage/patch/Bucket.scala | Scala | apache-2.0 | 933 |
// Copyright (c) 2011-2015 ScalaMock Contributors (https://github.com/paulbutcher/ScalaMock/graphs/contributors)
//
// 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, in... | hypertino/ScalaMock | frameworks/specs2/shared/src/test/scala/org/scalamock/test/specs2/FixtureContextTest.scala | Scala | mit | 2,821 |
/* NSC -- new Scala compiler
* Copyright 2005-2013 LAMP/EPFL
* @author Alexander Spoon
*/
package scala
package tools.nsc
package interpreter
import scala.language.{ implicitConversions, existentials }
import scala.annotation.tailrec
import Predef.{ println => _, _ }
import interpreter.session._
import StdReplTags... | hengyicai/OnlineAggregationUCAS | repl/scala-2.11/src/main/scala/org/apache/spark/repl/SparkILoop.scala | Scala | apache-2.0 | 34,765 |
package sjc.delta.std
import org.scalatest.{Matchers, FreeSpec}
import sjc.delta.Delta.DeltaOps
import sjc.delta.std.set.{deltaSet, SetPatch}
class SetSpec extends FreeSpec with Matchers {
"set" in {
Set(1, 2).delta(Set(2, 3)) shouldBe SetPatch(removed = Set(1), added = Set(3))
}
} | stacycurl/delta | core/src/test/scala/sjc/delta/std/SetSpec.scala | Scala | apache-2.0 | 293 |
/**
* 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... | racker/kafka | core/src/main/scala/kafka/server/DelayedFetch.scala | Scala | apache-2.0 | 6,665 |
package com.datawizards.sparklocal.rdd
import org.apache.spark.Partitioner
import org.apache.spark.rdd.RDD
import org.apache.spark.sql.SparkSession
import scala.collection.{GenIterable, GenMap, Map}
import scala.reflect.ClassTag
trait PairRDDFunctionsAPI[K, V] {
protected lazy val spark: SparkSession = SparkSessio... | piotr-kalanski/spark-local | src/main/scala/com/datawizards/sparklocal/rdd/PairRDDFunctionsAPI.scala | Scala | apache-2.0 | 4,889 |
package com.temportalist.weepingangels.common.generation
import java.util.Random
import com.temportalist.origin.api.common.lib.{BlockState, LogHelper, V3O}
import com.temportalist.weepingangels.common.WeepingAngels
import com.temportalist.weepingangels.common.init.WABlocks
import com.temportalist.weepingangels.common... | TheTemportalist/WeepingAngels | src/main/scala/com/temportalist/weepingangels/common/generation/VaultGenerator.scala | Scala | apache-2.0 | 12,993 |
/*
* 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/ct-calculations | src/main/scala/uk/gov/hmrc/ct/computations/CP503.scala | Scala | apache-2.0 | 1,536 |
package spark.broadcast
import java.io._
import java.net._
import java.util.{BitSet, UUID}
import java.util.concurrent.{Executors, ThreadFactory, ThreadPoolExecutor}
import spark._
trait Broadcast[T] extends Serializable {
val uuid = UUID.randomUUID
def value: T
// We cannot have an abstract readObject here ... | jperla/spark-advancers | core/src/main/scala/spark/broadcast/Broadcast.scala | Scala | bsd-3-clause | 7,570 |
/*
* Copyright (c) 2013 original 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 a... | eigengo/monitor | output-codahalemetrics/src/test/scala/org/eigengo/monitor/output/codahalemetrics/RegistryProviderSpec.scala | Scala | apache-2.0 | 1,496 |
/*
,i::,
:;;;;;;;
;:,,::;.
1ft1;::;1tL
t1;::;1,
:;::; _____ __ ___ __
fCLff ;:: tfLLC / ___/ / |/ /____ _ _____ / /_
CLft11 :,, i1tffLi \\__ \\ ____ / /|_/... | S-Mach/s_mach.codetools | codetools-core/src/main/scala/s_mach/codetools/impl/BlackboxHelperImpl.scala | Scala | mit | 10,292 |
/*
* Copyright 2015 ligaDATA
*
* 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 ... | traytonwhite/Kamanja | trunk/MetadataAPI/src/main/scala/com/ligadata/MetadataAPI/Utility/ConfigService.scala | Scala | apache-2.0 | 6,109 |
/*
* Copyright (C) 2005, The Beangle Software.
*
* 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 3 of the License, or
* (at your option) any later version.
*
* This... | beangle/ids | cas/src/main/scala/org/beangle/ids/cas/ticket/DefaultTicketCacheService.scala | Scala | lgpl-3.0 | 1,855 |
import scala.collection.mutable.ArrayBuffer
import scala.io.Source
object Day8 {
def openFile() : Array[String] = {
var lines = Array[String]()
val buffered = Source.fromFile("input.txt")
for (line <- buffered.getLines) {
lines = lines :+ line.trim
}
buffered.clo... | dooleykh/Advent2016 | 8/8.scala | Scala | mit | 1,985 |
/** Adapted from the original implementation of WeakHashSet in scala-reflect
*/
package dotty.tools.dotc.util
import java.lang.ref.{ReferenceQueue, WeakReference}
import scala.annotation.{ constructorOnly, tailrec }
import dotty.tools._
/**
* A HashSet where the elements are stored weakly. Elements in this set ar... | dotty-staging/dotty | compiler/src/dotty/tools/dotc/util/WeakHashSet.scala | Scala | apache-2.0 | 11,085 |
/*
* 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 | frontend/src/main/scala/quasar/std/std.scala | Scala | apache-2.0 | 907 |
package com.jd.scala.selling.actors
import akka.actor.Actor.Receive
import akka.actor.{ActorLogging, Actor}
import com.jd.scala.selling.data.PersonDAO
import com.jd.scala.selling.model.Person
import com.jd.scala.selling.model.Person._
import scala.util.{Failure, Success}
/**
* Created by justin on 14/08/2014.
*/
c... | justindav1s/learning-scala | src/main/scala/com/jd/scala/selling/actors/Creater.scala | Scala | apache-2.0 | 1,002 |
// Copyright (C) 2011-2012 the original author or authors.
// 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.
// You ... | firebase/scalastyle | src/test/scala/org/scalastyle/scalariform/ImportsCheckerTest.scala | Scala | apache-2.0 | 4,316 |
/*
* Copyright 2010-2011 Vilius Normantas <code@norma.lt>
*
* This file is part of Crossbow library.
*
* Crossbow 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 ... | ViliusN/Crossbow | crossbow-core/test/lt/norma/crossbow/indicators/HistoricalValuesTest.scala | Scala | gpl-3.0 | 9,913 |
package scala
package object cli {
import org.scalactic._
def readProperty(key: String): String Or ErrorMessage= {
val prompt = s"$key: "
JLineReader.readLine(prompt) match {
case None => Bad(s"Invalid input. A value for '$key' is required.")
case Some(value) if value.trim.isEmpty => Bad(s"Inv... | ngorongoro/habilis | cli/src/main/scala/cli/package.scala | Scala | unlicense | 1,622 |
/* Copyright (C) 2008-2010 Univ of Massachusetts Amherst, Computer Science Dept
This file is part of "FACTORIE" (Factor graphs, Imperative, Extensible)
http://factorie.cs.umass.edu, http://code.google.com/p/factorie/
This software is provided under the terms of the Eclipse Public License 1.0
as published by... | andrewmilkowski/factorie | src/main/scala/cc/factorie/Inferencer.scala | Scala | epl-1.0 | 6,718 |
package org.jetbrains.plugins.scala.testingSupport.scalatest.scala2_13.scalatest3_0_8
import org.jetbrains.plugins.scala.testingSupport.scalatest.ScalaTest2GoToSourceTest
class Scalatest2_13_3_0_8_GoToSourceTest extends Scalatest2_13_3_0_8_Base with ScalaTest2GoToSourceTest
| JetBrains/intellij-scala | scala/scala-impl/test/org/jetbrains/plugins/scala/testingSupport/scalatest/scala2_13/scalatest3_0_8/Scalatest2_13_3_0_8_GoToSourceTest.scala | Scala | apache-2.0 | 277 |
/*
* Copyright 2012 OneCalendar
*
* 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 w... | OneCalendar/OneCalendar | test/dao/EventDaoTest.scala | Scala | apache-2.0 | 10,390 |
/*
* Copyright (c) 2015, Nightfall Group
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of conditions a... | Nightfall/Instrumentality | mc1710/src/main/scala/moe/nightfall/instrumentality/mc1710/gui/EditorHostGui.scala | Scala | bsd-2-clause | 3,780 |
package com.github.shadowsocks.acl
import java.net.InetAddress
import java.util.Objects
import com.github.shadowsocks.utils.Utils
/**
* @author Mygod
*/
@throws[IllegalArgumentException]
class Subnet(val address: InetAddress, val prefixSize: Int) extends Comparable[Subnet] {
private def addressLength = address... | hangox/shadowsocks-android | mobile/src/main/scala/com/github/shadowsocks/acl/Subnet.scala | Scala | gpl-3.0 | 1,659 |
package io.hydrosphere.mist.master
import io.hydrosphere.mist.jobs.JobDetails
case class JobExecutionStatus(
id: String,
namespace: String,
startTime: Option[Long] = None,
endTime: Option[Long] = None,
status: JobDetails.Status = JobDetails.Status.Initialized
)
| KineticCookie/mist | src/main/scala/io/hydrosphere/mist/master/JobExecutionStatus.scala | Scala | apache-2.0 | 274 |
/*
* 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 ... | foryou2030/incubator-carbondata | integration/spark/src/main/scala/org/apache/carbondata/spark/csv/CarbonCsvRelation.scala | Scala | apache-2.0 | 8,959 |
package lib.neo4j.error
abstract class Neo4jError(msg: String, cause: Throwable = null)
extends RuntimeException(msg, cause)
case class ServiceError(msg: String, cause: Throwable = null)
extends Neo4jError(msg, cause)
case class ServerError(msg: String, cause: Throwable = null)
extends Neo4jError(msg, cause) | fynnfeldpausch/frame | app/lib/neo4j/error/Neo4jError.scala | Scala | mit | 318 |
package cromwell.backend.async
import cromwell.backend.BackendJobDescriptor
import cromwell.backend.async.AsyncBackendJobExecutionActor.JobId
import cromwell.core.path.Path
import cromwell.core.{CallOutputs, ExecutionEvent}
/**
* Trait to encapsulate whether an execution is complete and if so provide a result. Usef... | ohsu-comp-bio/cromwell | backend/src/main/scala/cromwell/backend/async/ExecutionHandle.scala | Scala | bsd-3-clause | 1,940 |
/*
* 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 ... | ConeyLiu/spark | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/aggregate/PivotFirst.scala | Scala | apache-2.0 | 6,046 |
package com.josephpconley.swagger2postman.models.swagger.v2
import play.api.libs.json.Json
case class SwaggerDoc(
swagger: String,
info: SwaggerInfo,
host: String,
basePath: String,
tags: Seq[SwaggerTag],
paths: Map[String, Map[String, SwaggerPath]])
object SwaggerDoc {
implicit val paramFmt = Json.for... | hasithalakmal/RIP | RIP_Test/swagger2postman-master/src/main/scala/com/josephpconley/swagger2postman/models/swagger/v2/SwaggerDoc.scala | Scala | apache-2.0 | 919 |
/* Copyright (C) 2008-2014 University of Massachusetts Amherst.
This file is part of "FACTORIE" (Factor graphs, Imperative, Extensible)
http://factorie.cs.umass.edu, http://github.com/factorie
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with... | hlin117/factorie | src/main/scala/cc/factorie/infer/Maximize.scala | Scala | apache-2.0 | 7,275 |
package dotty.tools
package dotc
package core
import Types._
import Flags._
import Contexts._
import util.{SimpleMap, DotClass}
import reporting._
import printing.{Showable, Printer}
import printing.Texts._
import config.Config
import collection.mutable
class TyperState(r: Reporter) extends DotClass with Showable {
... | yusuke2255/dotty | src/dotty/tools/dotc/core/TyperState.scala | Scala | bsd-3-clause | 7,140 |
import reactivemongo.bson.{
BSON,
BSONDecimal,
BSONDocument,
BSONDocumentHandler,
BSONDocumentReader,
BSONDocumentWriter,
BSONDouble,
BSONHandler,
BSONInteger,
BSONNull,
BSONReader,
BSONWriter,
Macros
}
import reactivemongo.bson.exceptions.DocumentKeyNotFound
import org.specs2.matcher.MatchRe... | cchantep/ReactiveMongo | macros/src/test/scala/MacroSpec.scala | Scala | apache-2.0 | 16,463 |
inline def label(x: Int, inline g: Int => String): String = g(x)
def f: Int => String = ???
def label2(g: Int) = label(g, f)
| dotty-staging/dotty | tests/pos/i9342a.scala | Scala | apache-2.0 | 125 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | practice-vishnoi/dev-spark-1 | mllib/src/main/scala/org/apache/spark/mllib/util/MLUtils.scala | Scala | apache-2.0 | 14,701 |
object Scl9437_Qualified {
def test(): Unit = {
val x: Result[_] = ???
x match {
case Result.<ref>Failure(x, y) =>
}
}
} | whorbowicz/intellij-scala | testdata/resolve/failed/overloadedUnapply/Scl9437_Qualified.scala | Scala | apache-2.0 | 142 |
/***
* Copyright 2014 Rackspace US, 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 applica... | rackerlabs/api-checker | core/src/test/scala/com/rackspace/com/papi/components/checker/GivenAWadlWithNestedResourcesAndMethodReferencesAndOddRoleNames.scala | Scala | apache-2.0 | 9,341 |
/*
* Copyright (c) 2012-2014 Snowplow Analytics Ltd. All rights reserved.
*
* This program is licensed to you under the Apache License Version 2.0,
* and you may not use this file except in compliance with the Apache License Version 2.0.
* You may obtain a copy of the Apache License Version 2.0 at http://www.apach... | wesley1001/snowplow | 3-enrich/scala-hadoop-enrich/src/test/scala/com.snowplowanalytics.snowplow.enrich.hadoop/good/SnowplowRawEventLzoSpec.scala | Scala | apache-2.0 | 6,293 |
import play.api.mvc.{Action, Controller}
import play.api.data.validation.Constraint
import de.zalando.play.controllers._
import PlayBodyParsing._
import PlayValidations._
import scala.util._
/**
* This controller is re-generated after each change in the specification.
* Please only place your hand-written cod... | zalando/play-swagger | play-scala-generator/src/test/resources/expected_results/controllers/nakadi_yaml.scala | Scala | mit | 3,943 |
package models
case class Product(ean: Long, name: String, description: String)
object Product {
var products = Set(
Product(5010255079763L, "Paperclips Large", "Large Plain Pack of 1000"),
Product(5018206244666L, "Giant Paperclips", "Giant Plain 51mm 100 pack"),
Product(5018306332812L, "Paperclip Giant... | spolnik/scala-workspace | play/products/app/models/Product.scala | Scala | apache-2.0 | 586 |
package blended.security
import blended.security.internal.SecurityActivator
import blended.testsupport.pojosr.{PojoSrTestHelper, SimplePojoContainerSpec}
import blended.testsupport.scalatest.LoggingFreeSpecLike
import javax.security.auth.Subject
import javax.security.auth.login.LoginContext
import org.osgi.framework.B... | woq-blended/blended | blended.security.test/src/test/scala/blended/security/AbstractLoginSpec.scala | Scala | apache-2.0 | 865 |
package org.jetbrains.plugins.scala
package codeInspection.typeChecking
import com.intellij.codeInspection.{ProblemHighlightType, ProblemsHolder}
import com.intellij.psi.PsiElement
import org.jetbrains.plugins.scala.codeInspection.collections.MethodRepr
import org.jetbrains.plugins.scala.codeInspection.typeChecking.Co... | SergeevPavel/intellij-scala | src/org/jetbrains/plugins/scala/codeInspection/typeChecking/ComparingUnrelatedTypesInspection.scala | Scala | apache-2.0 | 4,215 |
/**
* Copyright 2009 Jorge Ortiz
*
* 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... | scalaj/scalaj-time | src/main/scala/org/scala_tools/time/RichPeriod.scala | Scala | apache-2.0 | 1,513 |
/*
* Copyright 2013 David Savage
*
* 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... | davemssavage/modula | osgi/src/main/scala/org/chronologicalthought/modula/osgi/FrameworkImpl.scala | Scala | apache-2.0 | 1,960 |
/*
* Copyright 2015 Baptiste
*
* 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... | morinb/scala-rules | src/main/scala/org/bm/rules/Result.scala | Scala | apache-2.0 | 976 |
package polyite.pmpi
/**
* Do-Nothing dummy for when MPI is not used.
*/
object NoMPI extends IMPI {
override def Init(args : Array[String]) {}
override def Finalize() {}
override def rank() : Int = 0
override def size() : Int = 1
override def isRoot() : Boolean = true
override def getRightNeighborR... | stganser/polyite | src/polyite/pmpi/NoMPI.scala | Scala | mit | 524 |
package com.twitter.finagle.memcached.integration
import com.twitter.finagle.cacheresolver.CacheNodeGroup
import com.twitter.finagle.memcached.KetamaClientBuilder
import com.twitter.finagle.{Group, Name}
import com.twitter.io.Buf
import com.twitter.util.{Await, Future}
import java.net.{InetAddress, InetSocketAddress, ... | lucaslanger/finagle | finagle-memcached/src/test/scala/com/twitter/finagle/memcached/integration/KetamaClientTest.scala | Scala | apache-2.0 | 3,293 |
/*
* Copyright (c) 2014-2020 by The Monix Project Developers.
* See the project homepage at: https://monix.io
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache... | alexandru/monifu | monix-reactive/shared/src/main/scala/monix/reactive/internal/operators/RestartUntilObservable.scala | Scala | apache-2.0 | 3,347 |
package com.nthportal.euler.h0.t0
import com.nthportal.euler.ProjectEulerProblem
import com.nthportal.euler.maths.NumericFormat
object Problem4 extends ProjectEulerProblem {
override def apply(): Long = {
for {
i <- 100 to 999
j <- 100 to 999
product = i * j
if NumericFormat.isPalindrome... | NthPortal/euler-n-scala | src/main/scala/com/nthportal/euler/h0/t0/Problem4.scala | Scala | mit | 360 |
package com.s3dropbox.lambda
import com.amazonaws.services.lambda.runtime.events.S3Event
import com.amazonaws.services.lambda.runtime.events.models.s3.S3EventNotification.S3Entity
import com.amazonaws.services.lambda.runtime.{Context, RequestHandler}
import com.s3dropbox.lambda.LambdaMain._
import com.typesafe.scalalo... | ErrorsAndGlitches/S3DropboxLambda | src/main/scala/com/s3dropbox/lambda/LambdaMain.scala | Scala | mit | 1,350 |
package com.ttpresentation.dao
import reactivemongo.bson.{BSONDocument, BSONObjectID}
import scala.concurrent.Future
import reactivemongo.api.DB
import reactivemongo.api.collections.default.BSONCollection
import akka.actor.ActorSystem
import com.typesafe.scalalogging.slf4j.Logging
import org.mindrot.jbcrypt.BCrypt
imp... | ctcarrier/ttpresentation | src/main/scala/com/ttpresentation/dao/UserDao.scala | Scala | mit | 1,033 |
package core.app
import akka.http.scaladsl.server.Route
import common.graphql.UserContext
import common.routes.frontend.FrontendRoute
import common.slick.SchemaInitializer
import core.guice.bindings.CoreBinding
import core.guice.injection.InjectorProvider._
import shapes.ServerModule
import scala.collection.mutable
... | sysgears/apollo-universal-starter-kit | modules/core/server-scala/src/main/scala/core/app/CoreModule.scala | Scala | mit | 584 |
/*
* 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/spark | sql/core/src/test/scala/org/apache/spark/sql/CachedTableSuite.scala | Scala | apache-2.0 | 54,648 |
package org.jetbrains.plugins.scala
package codeInspection
package collections
import com.intellij.testFramework.EditorTestUtil
/**
* @author Lukasz Piepiora
*/
class EmulateFlattenInspectionTest extends OperationsOnCollectionInspectionTest {
override protected val classOfInspection: Class[_ <: OperationOnColl... | JetBrains/intellij-scala | scala/scala-impl/test/org/jetbrains/plugins/scala/codeInspection/collections/EmulateFlattenInspectionTest.scala | Scala | apache-2.0 | 6,142 |
package mllib.perf
import org.json4s.JsonDSL._
import org.json4s.JsonAST._
import org.apache.spark.SparkContext
import org.apache.spark.SparkContext._
import org.apache.spark.mllib.classification._
import org.apache.spark.mllib.clustering.{KMeansModel, KMeans}
import org.apache.spark.mllib.linalg.{Vector, Vectors}
im... | XiaoqingWang/spark-perf | mllib-tests/v1p4/src/main/scala/mllib/perf/MLAlgorithmTests.scala | Scala | apache-2.0 | 24,370 |
package mesosphere.marathon.core.appinfo.impl
import mesosphere.marathon.MarathonSchedulerService
import mesosphere.marathon.Protos.MarathonTask
import mesosphere.marathon.core.appinfo.{ TaskCounts, AppInfo, EnrichedTask }
import mesosphere.marathon.health.{ Health, HealthCheckManager, HealthCounts }
import mesosphere... | cgvarela/marathon | src/main/scala/mesosphere/marathon/core/appinfo/impl/AppInfoBaseData.scala | Scala | apache-2.0 | 5,100 |
/*
* Copyright 2006-2011 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... | lzpfmh/framework-2 | persistence/mapper/src/main/scala/net/liftweb/mapper/ProtoExtendedSession.scala | Scala | apache-2.0 | 3,402 |
package barbedwire
import scala.annotation.tailrec
/**
* A Rep-less implementation of FoldLeft
* Easier to run functionality tests on.
*
* A copy-paste of `FoldLeft.scala`.
*/
trait RepLessFolds {
/**
* a type alias for the combination function for
* foldLeft
* `A` is the type of elements that pass ... | manojo/staged-fold-fusion | src/main/scala/barbedwire/RepLessFold.scala | Scala | mit | 4,093 |
package kata.calc
import kata.calc.Calculator.evaluate
import org.scalatest.{FlatSpec, Matchers}
class StringCalculatorTest extends FlatSpec with Matchers {
it should " evaluate integer number " in {
evaluate("1023") shouldBe 1023
}
it should " evaluate float number " in {
evaluate("123.... | Alex-Diez/Scala-TDD-Katas | old-katas/string-calc/day-3/src/test/scala/kata/calc/StringCalculatorTest.scala | Scala | mit | 900 |
package models.admin
import scalaz._
import Scalaz._
import scalaz.effect.IO
import scalaz.Validation
import scalaz.Validation.FlatMap._
import scalaz.NonEmptyList._
import db._
import io.megam.auth.funnel.FunnelErrors._
import controllers.Constants._
import models.billing.BalancesResults
import net.liftweb.json._
i... | indykish/vertice_gateway | app/models/admin/Balances.scala | Scala | mit | 661 |
package org.apache.mesos.chronos.scheduler.jobs
import org.joda.time._
import org.specs2.mock._
import org.specs2.mutable._
class TaskUtilsSpec extends SpecificationWithJUnit with Mockito {
"TaskUtils" should {
"Get taskId" in {
val schedule = "R/2012-01-01T00:00:01.000Z/P1M"
val arguments = "-a 1 ... | mikkokupsu/chronos | src/test/scala/org/apache/mesos/chronos/scheduler/jobs/TaskUtilsSpec.scala | Scala | apache-2.0 | 2,771 |
/*
Copyright 2009 David Hall, Daniel Ramage
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 writi... | tjhunter/scalanlp-core | process/src/main/scala/breeze/text/transform/Transformer.scala | Scala | apache-2.0 | 888 |
package org.http4s
package headers
import org.http4s.parser.HttpHeaderParser
import org.http4s.util.NonEmptyList
object `Accept-Charset` extends HeaderKey.Internal[`Accept-Charset`] with HeaderKey.Recurring {
override def parse(s: String): ParseResult[`Accept-Charset`] =
HttpHeaderParser.ACCEPT_CHARSET(s)
}
fi... | hvesalai/http4s | core/src/main/scala/org/http4s/headers/Accept-Charset.scala | Scala | apache-2.0 | 947 |
/*
* 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 n... | TiVo/kafka | core/src/main/scala/kafka/server/BrokerToControllerChannelManager.scala | Scala | apache-2.0 | 13,055 |
/* Copyright 2009-2021 EPFL, Lausanne */
package stainless
package termination
import scala.collection.mutable.{Map => MutableMap, ListBuffer => MutableList}
trait TerminationChecker { self =>
val program: Program { val trees: Trees }
val context: inox.Context
import program.trees._
import program.symbols.{... | epfl-lara/stainless | core/src/main/scala/stainless/termination/TerminationChecker.scala | Scala | apache-2.0 | 8,197 |
package org.channing.free
final case class PostCommit(f: () => Unit) | channingwalton/doobie-play | src/main/scala/org/channing/free/PostCommit.scala | Scala | unlicense | 69 |
package org.denigma.graphs
import org.denigma.graphs.core.SpriteGraph
import org.denigma.graphs.semantic.{SemanticEdge, SemanticNode}
import org.denigma.graphs.tools.HtmlSprite
import org.denigma.graphs.visual.{Defs, EdgeView, LineParams, NodeView}
import org.scalajs.dom
import org.scalajs.dom.{Event, HTMLElement}
imp... | antonkulaga/semantic-graph | graphs/src/main/scala/org/denigma/graphs/semantic/SemanticGraph.scala | Scala | mpl-2.0 | 2,907 |
/*
* 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 ... | someorz/spark | sql/core/src/main/scala/org/apache/spark/sql/execution/command/createDataSourceTables.scala | Scala | apache-2.0 | 8,308 |
package org.betterers.spark.gis
import java.io.CharArrayWriter
import java.nio.ByteBuffer
import org.apache.spark.Logging
import org.apache.spark.sql.types._
import org.apache.spark.unsafe.types.UTF8String
import org.codehaus.jackson.JsonFactory
import scala.language.postfixOps
import scala.util.Try
/** User define... | drubbo/SparkGIS | src/main/scala/org/betterers/spark/gis/GeometryType.scala | Scala | apache-2.0 | 2,538 |
/*
* Copyright 2014 Commonwealth Computer Research, 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 applicabl... | mmatz-ccri/geomesa | geomesa-core/src/main/scala/org/locationtech/geomesa/core/filter/OrSplittingFilter.scala | Scala | apache-2.0 | 1,231 |
package com.twitter.finagle.factory
import com.twitter.finagle._
import com.twitter.finagle.stats.{NullStatsReceiver, StatsReceiver}
import com.twitter.util.{ Activity, Closable, Future, Promise, Time, Var}
import java.net.SocketAddress
import scala.collection.immutable
/**
* Proxies requests to the current defin... | JustinTulloss/finagle | finagle-core/src/main/scala/com/twitter/finagle/factory/BindingFactory.scala | Scala | apache-2.0 | 5,342 |
package helpers.changekeeper
object ValidVRMFormat {
val allValidVrmFormats = Seq(
"A9",
"A99",
"A999",
"A9999",
"AA9",
"AA99",
"AA999",
"AA9999",
"AAA9",
"AAA99",
"AAA999",
"AAA9999",
"AAA9A",
"AAA99A",
"AAA999A",
"9A",
"9AA",
"9AAA",
"99A"... | dvla/vehicles-change-keeper-online | test/helpers/changekeeper/ValidVRMFormat.scala | Scala | mit | 490 |
/*
* 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/domain | src/main/scala/uk/gov/hmrc/domain/Org.scala | Scala | apache-2.0 | 1,013 |
// The test which this should perform but does not
// is that f1 is recognized as irrefutable and f2 is not
// This can be recognized via the generated classes:
//
// A$$anonfun$f1$1.class
// A$$anonfun$f2$1.class
// A$$anonfun$f2$2.class
//
// The extra one in $f2$ is the filter.
//
// !!! Marking with exclamation poi... | yusuke2255/dotty | tests/untried/pos/irrefutable.scala | Scala | bsd-3-clause | 557 |
/**
* Copyright 2015 Thomson Reuters
*
* 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 ag... | nruppin/CM-Well | server/cmwell-util/src/main/scala/cmwell/util/exceptions/MultipleFailures.scala | Scala | apache-2.0 | 881 |
import _root_.io.gatling.core.scenario.Simulation
import ch.qos.logback.classic.{Level, LoggerContext}
import io.gatling.core.Predef._
import io.gatling.http.Predef._
import org.slf4j.LoggerFactory
import scala.concurrent.duration._
/**
* Performance test for the SonarInstance entity.
*/
class SonarInstanceGatlingT... | iMartinezMateu/gamecraft | gamecraft-sonar-manager/src/test/gatling/user-files/simulations/SonarInstanceGatlingTest.scala | Scala | mit | 3,628 |
package com.twitter.finagle
import org.junit.runner.RunWith
import org.scalatest.FunSuite
import org.scalatest.junit.{AssertionsForJUnit, JUnitRunner}
@RunWith(classOf[JUnitRunner])
class NameTreeParsersTest extends FunSuite with AssertionsForJUnit {
test("parsePath") {
assert(NameTreeParsers.parsePath("/") == ... | liamstewart/finagle | finagle-core/src/test/scala/com/twitter/finagle/NameTreeParsersTest.scala | Scala | apache-2.0 | 4,048 |
package ucesoft.cbm.expansion
trait ExpansionPortConfigurationListener {
def expansionPortConfigurationChanged(game:Boolean,exrom:Boolean) : Unit
} | abbruzze/kernal64 | Kernal64/src/ucesoft/cbm/expansion/ExpansionPortConfigurationListener.scala | Scala | mit | 149 |
package com.komanov.junk.scl_8869
// https://youtrack.jetbrains.com/issue/SCL-8869
class WrongConvertToAnonymous extends MockitoStubsCut {
val myInterface: MyInterface = null
myInterface.convert(1) answers (o => o match {
case t: Int => t.toString
})
myInterface.convert(1) answers (_ match {
case t: ... | dkomanov/stuff | src/com/komanov/junk/scl_8869/WrongConvertToAnonymous.scala | Scala | mit | 628 |
/*
* 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 n... | airbnb/kafka | core/src/main/scala/kafka/log/TransactionIndex.scala | Scala | apache-2.0 | 8,618 |
/*
* 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 ... | Sephiroth-Lin/incubator-carbondata | integration/spark-common-test/src/test/scala/org/apache/carbondata/spark/testsuite/filterexpr/TestAndEqualFilterEmptyOperandValue.scala | Scala | apache-2.0 | 2,858 |
package com.github.yandoroshenko.workhourscounter.calendar
import java.time.LocalDate
import play.api.libs.json.{JsArray, JsNumber, Json}
import scala.util.{Failure, Success, Try}
/**
* Created by Yan Doroshenko (yandoroshenko@protonmail.com) on 15.05.2017.
*/
trait HolidayCalendar extends Calendar {
case cl... | YanDoroshenko/work-hours-counter | src/main/scala/com/github/yandoroshenko/workhourscounter/calendar/HolidayCalendar.scala | Scala | gpl-3.0 | 1,673 |
/**
* 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... | ijuma/kafka | core/src/main/scala/kafka/tools/SimpleConsumerShell.scala | Scala | apache-2.0 | 12,990 |
// This is free and unencumbered software released into the public domain.
//
// Anyone is free to copy, modify, publish, use, compile, sell, or
// distribute this software, either in source code form or as a compiled
// binary, for any purpose, commercial or non-commercial, and by any
// means.
//
// In jurisdictions ... | pasviegas/shoushiling | cli/src/main/scala/com/pasviegas/shoushiling/cli/system/exceptions/package.scala | Scala | unlicense | 2,132 |
package org.apache.spark.ml.bundle.ops.feature
import ml.combust.bundle.BundleContext
import ml.combust.bundle.op.{OpModel, OpNode}
import ml.combust.bundle.dsl._
import org.apache.spark.ml.bundle.{ParamSpec, SimpleParamSpec, SimpleSparkOp, SparkBundleContext}
import org.apache.spark.ml.feature.Tokenizer
/**
* Crea... | combust/mleap | mleap-spark/src/main/scala/org/apache/spark/ml/bundle/ops/feature/TokenizerOp.scala | Scala | apache-2.0 | 1,290 |
package views.html
import play.templates._
import play.templates.TemplateMagic._
import play.api.templates._
import play.api.templates.PlayMagic._
import models._
import controllers._
import java.lang._
import java.util._
import scala.collection.JavaConversions._
import scala.collection.JavaConverters._
import play.... | dsarlis/SAD-Spring-2016-Project-Team4 | ApacheCMDA-Frontend/target/scala-2.10/src_managed/main/views/html/search.template.scala | Scala | mit | 7,934 |
package models.daos.slick
import com.mohiva.play.silhouette.core.LoginInfo
import com.mohiva.play.silhouette.core.providers.PasswordInfo
import com.mohiva.play.silhouette.contrib.daos.DelegableAuthInfoDAO
import play.api.db.slick._
import scala.concurrent.Future
import models.daos.slick.DBTableDefinitions._
import pla... | Wirwing/hello-conekta-play-framework | app/models/daos/slick/PasswordInfoDAOSlick.scala | Scala | mit | 2,117 |
package com.youdevise.albatross
import org.specs2.Specification
import Bounds._
import org.specs2.matcher.Matcher
class IntervalSpec extends Specification {
def is =
"An interval" ^
"is empty if it encloses no points" ! {
(open(0) to open(0)) must beEmpty
} ^
"is a singleton if it encloses onl... | tim-group/albatross | src/test/scala/IntervalSpec.scala | Scala | mit | 4,114 |
/*
* Copyright 2014 IBM Corp.
*
* 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... | bpburns/spark-kernel | kernel/src/main/scala/com/ibm/spark/kernel/protocol/v5/stream/KernelMessageStream.scala | Scala | apache-2.0 | 2,262 |
package sorm.reflection
import sorm._
import sext._, embrace._
// or InstanceReflection
class Reflected
( val instance : Any,
val reflection : Reflection )
{
def propertyValues
: Map[String, Any]
= reflection.properties.view.unzip._1.zipBy(propertyValue).toMap
def propertyValue
( ... | sorm/sorm | src/main/scala/sorm/reflection/Reflected.scala | Scala | mit | 548 |
/*
* Copyright 2017 Google Inc. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by ... | GoogleCloudDataproc/cloud-dataproc | spark-tensorflow/prepare/src/main/scala/com/google/cloud/ml/samples/criteo/CriteoPreprocessingApplication.scala | Scala | apache-2.0 | 4,640 |
/*
* 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 ... | ueshin/apache-flink | flink-runtime/src/main/scala/org/apache/flink/runtime/akka/AkkaUtils.scala | Scala | apache-2.0 | 33,672 |
package de.tototec.sbuild.addons
/**
* Addons supporting the Bundle Tool from Peter Kriens.
*/
package object bnd {
} | SBuild-org/sbuild | de.tototec.sbuild.addons/src/main/scala/de/tototec/sbuild/addons/bnd/package.scala | Scala | apache-2.0 | 121 |
/* __ *\\
** ________ ___ / / ___ __ ____ Scala.js Test Suite **
** / __/ __// _ | / / / _ | __ / // __/ (c) 2013, LAMP/EPFL **
** __\\ \\/ /__/ __ |/ /__/ __ |/_// /_\\ \\ http://scala-js.org/ **
** /____/\\___/... | jmnarloch/scala-js | test-suite/src/test/scala/org/scalajs/testsuite/javalib/AbstractListTest.scala | Scala | bsd-3-clause | 2,431 |
package org.jetbrains.plugins.scala.lang.scaladoc.psi.impl
import org.jetbrains.plugins.scala.lang.psi.impl.ScalaPsiElementImpl
import com.intellij.lang.ASTNode
import org.jetbrains.plugins.scala.lang.scaladoc.psi.api.ScDocParamRef
class ScDocParamRefImpl(node: ASTNode) extends ScalaPsiElementImpl(node) with ScDocPar... | JetBrains/intellij-scala | scala/scala-impl/src/org/jetbrains/plugins/scala/lang/scaladoc/psi/impl/ScDocParamRefImpl.scala | Scala | apache-2.0 | 378 |
/*
* Copyright (c) 2013. Regents of the University of California
*
* 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 require... | fnothaft/adam | adam-core/src/main/scala/edu/berkeley/cs/amplab/adam/algorithms/smithwaterman/SmithWatermanConstantGapScoring.scala | Scala | apache-2.0 | 1,397 |
/*
* 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 ... | nicklhy/mxnet | scala-package/examples/src/main/scala/ml/dmlc/mxnetexamples/visualization/VGG.scala | Scala | apache-2.0 | 4,519 |
trait Foo {
val x = "world"
foo(5)
def bar(x: Int): Int = 20
def foo(n: Int): String = x + n
}
class Bar extends Foo {
val y = "hello" // error
foo(5)
bar(10)
override def foo(n: Int): String = {
println("in foo")
y + x
}
}
class Qux extends Foo {
val y = "hello"
foo(5)
bar... | som-snytt/dotty | tests/init/neg/override2.scala | Scala | apache-2.0 | 327 |
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.