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 |
|---|---|---|---|---|---|
/*
* 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 ... | dotunolafunmiloye/spark | yarn/common/src/main/scala/org/apache/spark/scheduler/cluster/YarnClientSchedulerBackend.scala | Scala | apache-2.0 | 4,069 |
package org.akozlov.chapter07
import scalax.collection.Graph
import scalax.collection.edge._
import scalax.collection.GraphPredef._
import scalax.collection.GraphEdge._
import scalax.collection.edge.Implicits._
/**
* An Influence Diagram example based on Chapter 2 from the book
*/
object InfluenceDiagram extends A... | alexvk/ml-in-scala | chapter07/src/main/scala/InfluenceDiagram.scala | Scala | unlicense | 1,815 |
/*
* 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.collection
/** ... | lrytz/scala | src/library/scala/collection/WithFilter.scala | Scala | apache-2.0 | 2,660 |
package com.pygmalios.reactiveinflux.spark.utils
import com.pygmalios.reactiveinflux.{ReactiveInfluxConfig, ReactiveInfluxDbName}
import com.pygmalios.reactiveinflux.sync.{SyncReactiveInflux, SyncReactiveInfluxDb}
import scala.concurrent.duration.Duration
object Utils {
def withInflux[S](action: (SyncReactiveInflu... | pygmalios/reactiveinflux-spark | src/main/scala/com/pygmalios/reactiveinflux/spark/utils/Utils.scala | Scala | apache-2.0 | 647 |
package info.cmlubinski.newslearning.classify.trainingset
import java.security.SecureRandom
import org.apache.commons.codec.binary.Base64
import unfiltered.Cookie
import unfiltered.filter.Plan
import unfiltered.request._
import unfiltered.response._
import info.cmlubinski.newslearning.models.{DB, TrainingSet}
import... | cmc333333/news-learning | src/main/scala/classify/trainingset/New.scala | Scala | mit | 1,315 |
/*
* Copyright 2018 Dell Inc. or its subsidiaries. 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.
* A copy of the License is located at
*
* http://www.apache.org/licenses/LICENSE-2.0.txt
*
* or in the "... | EMCECS/ecs-samples | aws-scala-workshop/src/main/scala/com/dellemc/ecs/s3/sample/_30_EnableVersioning.scala | Scala | apache-2.0 | 3,177 |
package geotrellis.test.singleband.accumulo
import geotrellis.config.Dataset
import geotrellis.raster.Tile
import geotrellis.spark._
import geotrellis.spark.io._
import geotrellis.test.AccumuloTest
import geotrellis.test.singleband.load.TemporalS3Load
import geotrellis.util.{S3Support, SparkSupport}
import org.apache... | pomadchin/geotrellis-integration-tests | src/main/scala/geotrellis/test/singleband/accumulo/TemporalS3IngestTest.scala | Scala | apache-2.0 | 712 |
package edu.arizona.sista.twitter4food
import java.io.{FileOutputStream, PrintWriter, File}
import twitter4j._
import twitter4j.conf.ConfigurationBuilder
import java.util.Date
import scala.collection.JavaConversions.asScalaBuffer
object ScrapeIndividuals {
val SLEEP = 8000
def dateToString(d: Date... | clulab/twitter4food | src/main/scala/edu/arizona/sista/twitter4food/ScrapeIndividuals.scala | Scala | apache-2.0 | 9,202 |
/**
* Majyyka
*
* AspectRegistry.scala
*
* @author Myo-kun
* @license Lesser GNU Public License v3 (http://www.gnu.org/licenses/lgpl.html)
*/
package myokun.mods.majyyka.api
import java.util.LinkedHashMap
object AspectRegistry {
var aspects:LinkedHashMap[String, TAspect] = new LinkedHashMap[String, TA... | myoKun345/Majyyka | majyyka_common/myokun/mods/majyyka/api/AspectRegistry.scala | Scala | lgpl-3.0 | 333 |
package org.jetbrains.plugins.scala
package lang.psi.types
import com.intellij.psi.search.LocalSearchScope
import com.intellij.psi.search.searches.ClassInheritorsSearch
import com.intellij.psi.{PsiClass, PsiTypeParameter}
import org.jetbrains.plugins.scala.extensions._
import org.jetbrains.plugins.scala.lang.psi.api.s... | ilinum/intellij-scala | src/org/jetbrains/plugins/scala/lang/psi/types/ComparingUtil.scala | Scala | apache-2.0 | 3,576 |
import Deps._
import sbt.Keys._
import sbt._
import sbtassembly.AssemblyKeys._
import sbtassembly._
object ProjectBuild extends Build {
val extractServer = taskKey[Seq[File]]("Extract infinispan server")
lazy val getSparkVersion = taskKey[Unit]("Get Spark version used")
lazy val getInfinispanVersion = taskKe... | galderz/infinispan-spark | project/ProjectBuild.scala | Scala | apache-2.0 | 5,293 |
package com.arcusys.valamis.user
import com.arcusys.learn.liferay.LiferayClasses._
import com.arcusys.learn.liferay.services.WebServerServletTokenHelper
import com.liferay.portal.kernel.util.{DigesterUtil, HttpUtil}
import scala.collection.JavaConverters._
import scala.util.Try
package object util {
implicit class... | arcusys/JSCORM | valamis-core/src/main/scala/com/arcusys/valamis/user/util/util.scala | Scala | gpl-3.0 | 1,029 |
object I0 {
def i1(i2: => Int) = i2
def i3[I4, I5](i6: I4 => I5): (I4 => I5) { def apply(i7: I4): I5 } = i6
val i8 = i3(i1)
}
| som-snytt/dotty | tests/pending/fuzzy/AE-a08bc91c922a8a040c6a8434bad6bc70c32e0614.scala | Scala | apache-2.0 | 132 |
/*
* 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 ... | akopich/spark | external/kafka-0-10-sql/src/main/scala/org/apache/spark/sql/kafka010/KafkaWriter.scala | Scala | apache-2.0 | 3,820 |
package pl.pej.trelloilaro.api.requestBuilder.builder.board
import pl.pej.trelloilaro.api.requestBuilder.{AllRequestParam, RequestParam, RequestBuilder}
trait BoardsBuilder { this: RequestBuilder[_] =>
def withBoards(boards: Boards *) = withParams("boards", boards)
}
trait Boards extends RequestParam
object Boa... | tomaszym/trelloilaro | src/main/scala/pl/pej/trelloilaro/api/requestBuilder/builder/board/Boards.scala | Scala | mit | 678 |
package dsmoq.maintenance.controllers
import scala.util.Failure
import scala.util.Success
import scala.util.Try
import org.scalatra.ActionResult
import org.scalatra.BadRequest
import org.scalatra.InternalServerError
import org.slf4j.MarkerFactory
import com.typesafe.scalalogging.LazyLogging
import dsmoq.maintenance... | nkawa/dsmoq | server/maintenance/src/main/scala/dsmoq/maintenance/controllers/ResponseUtil.scala | Scala | apache-2.0 | 1,663 |
package tests.rescala
class DynamicEventTestSuite extends RETests {
allEngines("simple"){ engine => import engine._
val ev1 = Evt[Int]
val v1 = Var(8)
val snapshotEvent = Event {
ev1().map(i => i + v1())
}
val res = snapshotEvent.latest(0)
assert(res.now === 0)
ev1(10)
ass... | volkc/REScala | Tests/shared/src/test/scala/tests/rescala/DynamicEventTestSuite.scala | Scala | apache-2.0 | 428 |
package simulacrum
import scala.annotation.StaticAnnotation
import scala.language.experimental.macros
import scala.reflect.macros.Context
/**
* Annotation that may be applied to methods on a type that is annotated with `@typeclass`.
*
* Doing so changes the code generation strategy used when generating the syntax ... | malcolmgreaves/simulacrum | core/src/main/scala_2.10/simulacrum/typeclass.scala | Scala | bsd-3-clause | 18,540 |
/*
* Copyright 2014–2018 SlamData Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agr... | jedesah/Quasar | ejson/src/main/scala/quasar/ejson/jsonParser.scala | Scala | apache-2.0 | 1,631 |
/*
* 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 ... | aosagie/spark | sql/core/src/test/scala/org/apache/spark/sql/execution/SparkPlanSuite.scala | Scala | apache-2.0 | 3,613 |
/*******************************************************************************
* Copyright (C) 2012 Łukasz Szpakowski.
*
* 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 ver... | luckboy/LkbGraph | src/test/org/lkbgraph/algorithm/spec/MinSpanningTreeBehaviors.scala | Scala | lgpl-3.0 | 6,679 |
/*
* Copyright 2014 Alan Rodas Bonjour
*
* 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 ... | alanrodas/scaland | cli/src/main/scala/com/alanrodas/scaland/cli/definitions/package.scala | Scala | apache-2.0 | 1,327 |
package ru.pavkin.todoist.api.core.command
import cats.{FlatMap, Functor}
import ru.pavkin.todoist.api.RawRequest
import ru.pavkin.todoist.api.core.CommandReturns.Aux
import ru.pavkin.todoist.api.core._
import ru.pavkin.todoist.api.core.decoder.SingleCommandResponseDecoder
import ru.pavkin.todoist.api.utils.{Flattener... | vpavkin/todoist-api-scala | core/src/main/scala/ru/pavkin/todoist/api/core/command/SingleCommandRequestDefinition.scala | Scala | mit | 1,533 |
package concurrent
import play.libs.Akka
import scala.concurrent.ExecutionContext
object Pools {
implicit val jsPool: ExecutionContext = Akka.system.dispatchers.lookup("play.js-pool")
}
| dribba/play-node-benchmark | app/concurrent/Pools.scala | Scala | mit | 192 |
/*
* 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 ... | aljoscha/flink | flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/plan/nodes/physical/batch/BatchPhysicalSortAggregate.scala | Scala | apache-2.0 | 6,742 |
/**
* Copyright 2011-2017 GatlingCorp (http://gatling.io)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by appli... | MykolaB/gatling | gatling-app/src/main/scala/io/gatling/app/Gatling.scala | Scala | apache-2.0 | 2,842 |
/*
* 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 ... | mahak/spark | streaming/src/test/scala/org/apache/spark/streaming/DStreamScopeSuite.scala | Scala | apache-2.0 | 10,157 |
/*
* 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 ... | guoxiaolongzte/spark | sql/core/src/test/scala/org/apache/spark/sql/execution/benchmark/HashedRelationMetricsBenchmark.scala | Scala | apache-2.0 | 3,236 |
package rescala.fullmv
import rescala.core.{Reactive, Struct}
trait FullMVStruct extends Struct {
override type State[P, S <: Struct] = NodeVersionHistory[P, FullMVTurn, Reactive[FullMVStruct]]
}
| volkc/REScala | Research/Multiversion/src/main/scala/rescala/fullmv/FullMVStruct.scala | Scala | apache-2.0 | 201 |
package org.senkbeil.debugger.akka.messages
import org.senkbeil.debugger.akka.messages.structures.JDIThread
case class VMStartMessage(
thread: Option[JDIThread] = None
) extends MessageLike
| chipsenkbeil/scala-debugger-akka | src/main/scala/org/senkbeil/debugger/akka/messages/VMStartMessage.scala | Scala | apache-2.0 | 194 |
/*
* 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 ... | manishgupta88/carbondata | integration/spark2/src/main/scala/org/apache/spark/sql/CarbonSession.scala | Scala | apache-2.0 | 13,175 |
package example.repr
case class Resp(data: String)
case class GetResp(url: String, origin: String)
case class GetRespArg(name: String, age: Int)
case class GetRespWithQueryString(url: String, origin: String, args: GetRespArg)
| pepegar/hammock | example/src/main/scala/example/repr/Resp.scala | Scala | mit | 228 |
// This testcase is a snippet that did not compile correctly under
// pre-release 2.10.x. The relevant discussion around it can be
// found at:
// https://groups.google.com/forum/?fromgroups#!topic/scala-internals/qcyTjk8euUI[1-25]
//
// The reason it did not compile is related to the fact that ICode
// ops did not co... | lampepfl/dotty | tests/run/dead-code-elimination.scala | Scala | apache-2.0 | 1,002 |
package turkey
package tasks
import turkey.util._
import com.amazonaws.services.mturk.model.AssignmentStatus
import com.amazonaws.services.mturk.model.UpdateExpirationForHITRequest
import com.amazonaws.services.mturk.model.DeleteHITRequest
import com.amazonaws.services.mturk.model.ApproveAssignmentRequest
import com.... | julianmichael/turkey | turkey/jvm/src/main/scala/turkey/tasks/HITManager.scala | Scala | mit | 11,532 |
package models.admin.reports
import scalaz._
import Scalaz._
import scalaz.effect.IO
import scalaz.EitherT._
import scalaz.Validation
import scalaz.Validation.FlatMap._
import scalaz.NonEmptyList._
import models.tosca.KeyValueList
import net.liftweb.json._
import io.megam.util.Time
import org.joda.time.{DateTime, Peri... | indykish/vertice_gateway | app/models/admin/reports/Launches.scala | Scala | mit | 5,136 |
/***********************************************************************
* 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-accumulo/geomesa-accumulo-datastore/src/test/scala/org/locationtech/geomesa/accumulo/iterators/KryoLazyStatsIteratorTest.scala | Scala | apache-2.0 | 7,076 |
package ch2
import org.learningconcurrency._
import ch2._
object UnsafeUid extends App {
import scala.annotation.tailrec
private val unsafe = scala.concurrent.util.Unsafe.instance
private val uidCountOffset = unsafe.objectFieldOffset(UnsafeUid.getClass.getDeclaredField("uidCount"))
@volatile var uidCount... | tophua/spark1.52 | examples/src/main/scala/scalaDemo/threadConcurrency/ch2/Unsafe.scala | Scala | apache-2.0 | 744 |
/*
* 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/internal/GlobalMaxPooling1D.scala | Scala | apache-2.0 | 2,342 |
package lila.app
package templating
import java.util.Locale
import scala.collection.mutable
import org.joda.time.format._
import org.joda.time.format.ISODateTimeFormat
import org.joda.time.{ Period, PeriodType, DurationFieldType, DateTime }
import play.twirl.api.Html
import lila.api.Context
trait DateHelper { self:... | pavelo65/lila | app/templating/DateHelper.scala | Scala | mit | 3,021 |
package drt.client.components
import scalacss.Defaults._
object GlobalStyles extends StyleSheet.Inline {
import dsl._
style(unsafeRoot("body")(
paddingTop(70.px))
)
val bootstrapStyles = new BootstrapStyles
}
| somanythings/drt-scalajs-spa-exploration | client/src/main/scala/spatutorial/client/components/GlobalStyles.scala | Scala | apache-2.0 | 225 |
object Par {
def unit[A] (a:A): Par[A] = (es: ExecutionService) => UnitFuture(a)
private case class UnitFuture[A](get: A) extends Future[A]{
def isDone = true
def get(timeout: Long, units: TimeUnit) = get
def isCancelled = false
def cancel(evenIfRunning: Boolean): Boolean = fal... | Tomcruseal/FunctionalLearn | fpinscala/src/main/scala/fpinScala/pars/Par.scala | Scala | mit | 2,883 |
package models.analysis
import play.api.libs.json._
object SampleStatuses {
sealed trait SampleStatus {
val key: Int
}
object SampleStatus {
// scalastyle:off
def fromInt(i: Int): Option[SampleStatus] = i match {
case Intact.key => Some(Intact)
case Destroyed.key => Some(Dest... | MUSIT-Norway/musit | service_backend/app/models/analysis/SampleStatuses.scala | Scala | gpl-2.0 | 2,759 |
package semverfi
trait Show[T <: SemVersion] {
def show(v: T): String
}
object Show {
implicit object ShowNormal extends Show[NormalVersion] {
def show(v: NormalVersion) = "%d.%d.%d" format(
v.major, v.minor, v.patch
)
}
implicit object ShowPreRelease extends Show[PreReleaseVersion] {
def s... | softprops/semverfi | src/main/scala/show.scala | Scala | mit | 1,309 |
package org.scalgebra.generation
import algebra.ring._
import org.scalacheck._
import org.scalgebra.DenseMatrix
import scala.reflect.ClassTag
/**
* Generates DenseMatrices.
*
* @author Daniyar Itegulov
*/
object DenseMatrixGen {
def genRingDenseMatrix[T: Arbitrary : Ring : ClassTag]: Gen[DenseMatrix[T]] =
... | itegulov/scalgebra | src/test/scala/org/scalgebra/generation/DenseMatrixGen.scala | Scala | mit | 2,421 |
package scala.tools.nsc
import java.util.concurrent.TimeUnit
import org.openjdk.jmh.annotations._
import org.openjdk.jmh
import scala.tools.nsc.plugins.{Plugin, PluginComponent}
@BenchmarkMode(Array(jmh.annotations.Mode.AverageTime))
@Fork(2)
@Threads(1)
@Warmup(iterations = 5)
@Measurement(iterations = 5)
@OutputT... | scala/scala | test/benchmarks/src/main/scala/scala/tools/nsc/PhaseAssemblyBenchmark.scala | Scala | apache-2.0 | 2,125 |
package sangria.execution
import sangria.ast
import sangria.schema._
import sangria.introspection.{isIntrospection, TypeNameMetaField}
import scala.annotation.unchecked.uncheckedVariance
import scala.util.{Failure, Success, Try}
trait QueryReducer[-Ctx, +Out] {
type Acc
def initial: Acc
def reduceAlternative... | PhilAndrew/JumpMicro | JMSangriaGraphql/src/main/scala/sangria/execution/QueryReducer.scala | Scala | mit | 6,374 |
/*
* Copyright (c) 2016. Fengguo (Hugo) Wei and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Detailed co... | arguslab/argus-cit-intellij | jc-plugin/src/main/scala/org/argus/jc/incremental/jawa/remote/EventGeneratingClient.scala | Scala | epl-1.0 | 1,705 |
/*
* 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/study-category-theory | scalaz-test/src/test/com/github/dnvriend/custom/CustomFutureFunctorTest.scala | Scala | apache-2.0 | 1,212 |
/* Copyright 2015 UniCredit S.p.A.
*
* 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... | unicredit/riffel | src/test/scala/eu/unicredit/riffel/TestRunner.scala | Scala | apache-2.0 | 966 |
package org.shelmet.heap.parser
/**
* Primitive array type codes as defined by VM specification.
*/
object ArrayTypeCodes {
// Typecodes for array elements.
// Refer to newarray instruction in VM Spec.
final val T_BOOLEAN: Int = 4
final val T_CHAR: Int = 5
final val T_FLOAT: Int = 6
final val T_DOUBLE: I... | rorygraves/shelmet | src/main/scala/org/shelmet/heap/parser/ArrayTypeCodes.scala | Scala | gpl-2.0 | 442 |
package com.cds.learn.chapter7
import java.util.concurrent.atomic.{AtomicInteger, AtomicReference}
import java.util.concurrent.{Callable,ExecutorService}
import annotation.tailrec
/*
* Implementation is taken from `scalaz` library, with only minor changes. See:
*
* https://github.com/scalaz/scalaz/blob/scalaz-seve... | anancds/scala-project | fpis/src/main/scala/com/cds/learn/chapter7/Actor.scala | Scala | mit | 4,342 |
package com.twitter.server
import com.twitter.app.App
import com.twitter.finagle.stats.{StatsReceiver, LoadedStatsReceiver}
trait Stats { app: App =>
/**
* This returns the global [[LoadedStatsReceiver]] instance.
*
* @return a [[StatsReceiver]] instance.
* @see [[com.twitter.finagle.stats.LoadedStatsR... | twitter/twitter-server | server/src/main/scala/com/twitter/server/Stats.scala | Scala | apache-2.0 | 395 |
package io.findify.s3mock.route
import akka.http.scaladsl.model._
import akka.http.scaladsl.server.Directives._
import com.typesafe.scalalogging.LazyLogging
import io.findify.s3mock.provider.Provider
/**
* Created by shutty on 8/19/16.
*/
case class ListBuckets()(implicit provider:Provider) extends LazyLogging {
... | findify/s3mock | src/main/scala/io/findify/s3mock/route/ListBuckets.scala | Scala | mit | 593 |
/*
* 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/play-language | src/test/scala/views/LanguageSelectionSpec.scala | Scala | apache-2.0 | 4,955 |
package com.monsanto.arch.kamon.prometheus
import akka.actor.{ExtendedActorSystem, Extension, ExtensionId, ExtensionIdProvider}
import akka.event.Logging
import kamon.Kamon
import scala.concurrent.duration.{Duration, DurationInt}
import scala.concurrent.{Await, Future, Promise}
import scala.util.control.NonFatal
/**... | MonsantoCo/kamon-prometheus | library/src/main/scala/com/monsanto/arch/kamon/prometheus/Prometheus.scala | Scala | bsd-3-clause | 2,040 |
/* Title: Pure/Admin/build_log.scala
Author: Makarius
Management of build log files and database storage.
*/
package isabelle
import java.io.{File => JFile}
import java.time.format.{DateTimeFormatter, DateTimeParseException}
import java.util.Locale
import scala.collection.immutable.SortedMap
import s... | larsrh/libisabelle | modules/pide/2019-RC4/src/main/scala/Admin/build_log.scala | Scala | apache-2.0 | 44,034 |
package com.p3trur0.packtsub
import scala.util.Failure
import scala.util.Success
import scala.util.Try
import com.typesafe.config.ConfigFactory
trait PacktSubConfig
case class PacktConfig(email: String, pwd: String, crawlUrl: String, loginUrl: String) extends PacktSubConfig
case class MailConfig(to: String, subject... | P3trur0/packtsub | src/main/scala/com/p3trur0/packtsub/PacktSubConfiguration.scala | Scala | apache-2.0 | 1,528 |
/* __ *\
** ________ ___ / / ___ __ ____ Scala.js Test Suite **
** / __/ __// _ | / / / _ | __ / // __/ (c) 2013, LAMP/EPFL **
** __\ \/ /__/ __ |/ /__/ __ |/_// /_\ \ http://scala-js.org/ **
** /____/\___/_/ |_/... | andreaTP/scala-js | test-suite/src/test/scala/org/scalajs/testsuite/javalib/util/MapTest.scala | Scala | bsd-3-clause | 16,836 |
package org.http4s
package headers
import org.http4s.parser.HttpHeaderParser
import org.http4s.util.Writer
object `Set-Cookie` extends HeaderKey.Internal[`Set-Cookie`] with HeaderKey.Singleton {
override def parse(s: String): ParseResult[`Set-Cookie`] =
HttpHeaderParser.SET_COOKIE(s)
}
final case class `Set-Co... | hvesalai/http4s | core/src/main/scala/org/http4s/headers/Set-Cookie.scala | Scala | apache-2.0 | 513 |
/**
* 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... | SumoLogic/sumobot | src/main/scala/com/sumologic/sumobot/plugins/PluginsFromConfig.scala | Scala | apache-2.0 | 1,463 |
package chess
package variant
case object Atomic
extends Variant(
id = 7,
key = "atomic",
name = "Atomic",
shortName = "Atom",
title = "Nuke your opponent's king to win.",
standardInitialPosition = true
) {
def pieces = Standard.pieces
override def hasMoveEffects = tru... | ornicar/scalachess | src/main/scala/variant/Atomic.scala | Scala | mit | 6,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"); you... | chipsenkbeil/incubator-toree | protocol/src/test/scala/org/apache/toree/kernel/protocol/v5/content/ExecuteInputSpec.scala | Scala | apache-2.0 | 2,564 |
package com.twitter.scalding.examples
import com.twitter.scalding._
import com.twitter.scalding.mathematics.Matrix
/*
* MatrixTutorial2.scala
*
* Loads a directed graph adjacency matrix where a[i,j] = 1 if there is an edge from a[i] to b[j]
* and returns a graph containing only the nodes with outdegree smaller than... | wanyifu/scaldingtest | tutorial/MatrixTutorial2.scala | Scala | apache-2.0 | 1,489 |
// Databricks notebook source exported at Wed, 31 Aug 2016 00:07:54 UTC
// MAGIC %md
// MAGIC
// MAGIC #
// MAGIC
// MAGIC # RDDs, DataFrames and Datasets
// MAGIC
// MAGIC ## Using Wikipedia data
/... | bmc/rdds-dataframes-datasets-presentation-2016 | demo/RDDs-DataFrames-and-Datasets.scala | Scala | bsd-3-clause | 16,979 |
package linguistica.stemmer.porter
import org.scalatest._
import org.scalatest.matchers._
import org.scalatest.Assertions._
class RuleSpec extends FunSuite with Logic {
def checkStem(rule: SimpleRule, word: String, stem: String) = rule.stem(Word(word)) === Some(Word(stem))
def checkApply(rule: Rule, word: String... | vcherkassky/porter-stemmer | src/test/scala/linguistica/stemmer/porter/RuleSpec.scala | Scala | mit | 2,501 |
package com.example.datticker
// Android Imports
import android.os.Bundle
import android.widget.{LinearLayout, RelativeLayout, TextView, Button}
import android.view.ViewGroup.LayoutParams._
import android.view.{Gravity, View}
import android.app.Activity
import android.graphics.Color
// Macroid Imports
import macroid.... | b-mcg/datticker | src/main/scala/com/example/datticker/MainActivity.scala | Scala | gpl-3.0 | 4,309 |
/*
* 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... | yiheng/BigDL | spark/dl/src/test/scala/com/intel/analytics/bigdl/nn/tf/DecodeImageSpec.scala | Scala | apache-2.0 | 4,556 |
package com.github.mgoeminne.sitar.parser.acm
import com.github.mgoeminne.sitar.parser.{Book, Citation, CitationParser}
/**
* acm style for book citation
*/
private[acm] class ACMBookParser extends CitationParser
{
def lastName: Parser[String] = """[^,]+""".r ^^ { case l => l.split(" ").last}
def firstName:... | mgoeminne/sitar | src/main/scala/com/github/mgoeminne/sitar/parser/acm/ACMBookParser.scala | Scala | mit | 1,300 |
package scala.meta.trees
import com.intellij.psi.PsiElement
import scala.meta.internal.{ast => m, semantic => h}
class AbortException(reason: String) extends RuntimeException(reason) {
def this(place: Any, mess: String) = this(mess + s"[$place]")
}
class UnimplementedException(what: Any) extends
AbortException(... | ilinum/intellij-scala | src/scala/meta/trees/ScalaMetaException.scala | Scala | apache-2.0 | 1,268 |
package bar
object Bar {
def xxx(s: String): foo.Foo = foo.Foo.create(s)
}
| lrytz/scala | test/files/pos/t10350/Bar.scala | Scala | apache-2.0 | 79 |
package akka.dispatch.verification
import akka.actor.{ActorCell, ActorRef, ActorSystem, Props}
import akka.dispatch.{Envelope}
import java.util.concurrent.atomic.AtomicInteger
import java.util.concurrent.Semaphore,
scala.collection.mutable.HashMap,
scala.collection.mutable.HashSet
// ----------- Intern... | NetSys/demi | src/main/scala/verification/schedulers/AuxilaryTypes.scala | Scala | bsd-2-clause | 8,014 |
/*
* Copyright (c) 2014 Robert Conrad - All Rights Reserved.
* Unauthorized copying of this file, via any medium is strictly prohibited.
* This file is proprietary and confidential.
* Last modified by rconrad, 12/24/14 4:37 PM
*/
package base.common.lib
/**
* Description of "ISO" (not really) currencies that we... | robconrad/base-api | project-common/src/main/scala/base/common/lib/Currencies.scala | Scala | mit | 1,725 |
/*
* Copyright 2019 Google LLC 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 applicab... | CloudVLab/professional-services | tools/bigquery-zos-mainframe-connector/src/test/scala/com/ibm/jzos/MockRecordReader.scala | Scala | apache-2.0 | 1,121 |
package com.komanov.serialization.converters
import com.komanov.serialization.domain.{EventProcessor, Site, SiteEvent}
trait BasePerfTest[Input, Output] {
val N = 100000
def createInput(converter: MyConverter, site: Site): Input
def convert(converter: MyConverter, input: Input): Output
def doTest(): Unit ... | dkomanov/scala-serialization | scala-serialization/src/test/scala/com/komanov/serialization/converters/BasePerfTest.scala | Scala | mit | 4,551 |
/*
* Copyright (c) 2012, The Broad Institute
*
* 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 use,
* copy, modify, me... | iontorrent/Torrent-Variant-Caller-stable | public/scala/src/org/broadinstitute/sting/queue/util/EmailMessage.scala | Scala | mit | 4,493 |
package dwaspada.thedaam.application
sealed trait BaseCommandBus {
type H <: CommandHandler[Command]
}
object CommandBus extends BaseCommandBus {
def handle(command: Command): Unit = {
val handlerName = getHandlerName(command)
val handlerInstance: H = getClassInstance(handlerName)
handlerInstance.han... | dewey92/commuterline-ddd | src/main/scala/dwaspada/thedaam/application/CommandBus.scala | Scala | mit | 758 |
package com.example
import akka.actor.{ActorSystem, Props}
import akka.io.IO
import spray.can.Http
object Boot extends App {
// we need an ActorSystem to host our application in
implicit val system = ActorSystem("on-spray-can")
// create and start our service actor
val service = system.actorOf(Props[MyServi... | grinchy/farkle | src/main/scala/com/example/Boot.scala | Scala | apache-2.0 | 498 |
package org.eobjects.analyzer.result.html
import scala.xml.XML
/**
* A body element which wraps several other body elements in a div
*/
class CompositeBodyElement(cssClassName: String, children: Seq[BodyElement]) extends BodyElement {
override def toHtml(context: HtmlRenderingContext): String = {
val innerHtm... | datacleaner/AnalyzerBeans | components/html-rendering/src/main/scala/org/eobjects/analyzer/result/html/CompositeBodyElement.scala | Scala | lgpl-3.0 | 450 |
package concrete.constraint
import concrete._
import concrete.util.Interval
import scala.annotation.tailrec
trait FixPoint {
@annotation.tailrec
final def fixPoint(ps: ProblemState, shave: ProblemState => Outcome): Outcome = {
shave(ps) match {
case c: Contradiction =>
c
case ns: ProblemS... | concrete-cp/concrete | src/main/scala/concrete/constraint/FixPoint.scala | Scala | lgpl-2.1 | 2,516 |
package hu.gansperger.neptunapi.constants
object Request {
val requestType = (typ : String) => ("RequestType", typ)
val gridId = (id : String) => ("GridID", "c_messages_gridMessages")
val pageIndex = (page : Int) => ("pageindex", page.toString)
val pageSize = (pagesize : Int) => ("pagesize", page... | qwe2/neptun-api | src/main/scala/hu/gansperger/neptunapi/constants/Request.scala | Scala | mit | 808 |
// Copyright (c) 2014, Sam Thomson
package edu.cmu.lti.nlp.amr
import scala.annotation.tailrec
object CycleTester {
/**
Takes a directed graph, as a set of nodes and a map from node to its out-adjacent nodes,
and determines whether the graph contains a cycle.
*/
@tailrec
def hasCycle[T](nodes: Traver... | keenon/jamr | src/CycleTester.scala | Scala | bsd-2-clause | 1,485 |
package com.github.tminglei.slickpg
package utils
import slick.driver.{PostgresDriver, JdbcTypesComponent}
import slick.profile.RelationalProfile.ColumnOption.Length
import scala.reflect.ClassTag
import java.sql.{PreparedStatement, ResultSet}
trait PgCommonJdbcTypes extends JdbcTypesComponent { driver: PostgresDriver... | bearrito/slick-pg | core/src/main/scala/com/github/tminglei/slickpg/utils/PgCommonJdbcTypes.scala | Scala | bsd-2-clause | 1,441 |
/*
* 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 ... | guoxiaolongzte/spark | sql/core/src/test/scala/org/apache/spark/sql/DataFrameWindowFunctionsSuite.scala | Scala | apache-2.0 | 27,470 |
package collins.softlayer
import collins.power._
import collins.power.management._
import models.Asset
import play.api.{Application, Plugin}
import play.api.libs.json._
import com.twitter.finagle.Service
import com.twitter.finagle.builder.ClientBuilder
import com.twitter.finagle.http.{Http, RequestBuilder, Response}... | Shopify/collins | app/collins/softlayer/SoftLayerPlugin.scala | Scala | apache-2.0 | 6,284 |
package kr.ac.kaist.jsaf.shell
import java.io.{BufferedWriter, File, FileWriter}
import java.text.SimpleDateFormat
import java.util.Calendar
import edu.lu.uni.serval.idempotent.comm.ResultSender
import edu.lu.uni.serval.js.exp.safe.AlarmCollectorByPack
import edu.rice.cs.plt.tuple.{Option => JOption}
import kr.ac.kai... | darkrsw/safe | src/main/scala/kr/ac/kaist/jsaf/shell/BugDetectorProxy.scala | Scala | bsd-3-clause | 18,017 |
package chandu0101.scalajs.react.components
import chandu0101.scalajs.react.components.fascades._
import japgolly.scalajs.react._
import japgolly.scalajs.react.vdom.html_<^._
import org.scalajs.dom.{Event, document, html}
import scala.scalajs.js
import scala.scalajs.js.Dynamic.{global => g}
object GoogleMap {
def... | rleibman/scalajs-react-components | core/src/main/scala/chandu0101/scalajs/react/components/GoogleMap.scala | Scala | apache-2.0 | 3,609 |
package io.circe.numbers
import io.circe.numbers.testing.{ IntegralString, JsonNumberString }
import java.math.{ BigDecimal, BigInteger }
import org.scalatest.flatspec.AnyFlatSpec
import org.scalatestplus.scalacheck.ScalaCheckDrivenPropertyChecks
import scala.math.{ BigDecimal => SBigDecimal }
import scala.util.Try
c... | travisbrown/circe | modules/numbers/shared/src/test/scala/io/circe/numbers/BiggerDecimalSuite.scala | Scala | apache-2.0 | 7,851 |
package com.cloudray.scalapress.item.tag
import org.scalatest.{OneInstancePerTest, FunSuite}
import org.scalatest.mock.MockitoSugar
import javax.servlet.http.HttpServletRequest
import com.cloudray.scalapress.item.Item
import com.cloudray.scalapress.folder.Folder
import com.cloudray.scalapress.framework.{ScalapressRequ... | vidyacraghav/scalapress | src/test/scala/com/cloudray/scalapress/item/tag/LinkTagTest.scala | Scala | apache-2.0 | 1,060 |
/*
* 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... | zhangxiaoli73/BigDL | spark/dl/src/test/scala/com/intel/analytics/bigdl/integration/torch/AddSpec.scala | Scala | apache-2.0 | 4,285 |
package com.kolor.docker.api.entities
import scala.io.BufferedSource
class ConfigReader(config: BufferedSource) {
private lazy val lines = config.getLines()
def getProperty(name: String): String =
lines
.find(_.startsWith(s"$name="))
.map(_.replace(s"$name=", ""))
.getOrElse("")
}
| waveinch/reactive-docker | src/main/scala/com/kolor/docker/api/entities/ConfigReader.scala | Scala | mit | 312 |
/***********************************************************************
* Copyright (c) 2013-2016 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 is ... | tkunicki/geomesa | geomesa-spark/geomesa-spark-geotools/src/test/scala/org/locationtech/geomesa/spark/geotools/GeoToolsSpatialRDDProviderTest.scala | Scala | apache-2.0 | 3,018 |
package lila.db
package api
import play.api.libs.json._
import reactivemongo.bson._
import reactivemongo.core.commands._
import reactivemongo.api.{ SerializationPack, BSONSerializationPack }
import reactivemongo.api.commands.{
CollectionCommand, CommandWithPack, CommandWithResult, ImplicitCommandHelpers
}
trait Map... | r0k3/lila | modules/db/src/main/api/commands.scala | Scala | mit | 1,847 |
package com.github.diegopacheco.sandbox.scripts.scala.concurrency
import java.util.concurrent.atomic.AtomicReference
class Person(val name: AtomicReference[String]) {
def set(changedName: String) {
name.set(changedName)
}
}
object OldStuff {
def run{
var person = new Person(new AtomicReference("D... | diegopacheco/scala-playground | scala-playground/src/com/github/diegopacheco/sandbox/scripts/scala/concurrency/AtomicReference.scala | Scala | unlicense | 439 |
package demo
package components
package materialui
import chandu0101.macros.tojs.GhPagesMacros
import chandu0101.scalajs.react.components.materialui.MuiSlider
import japgolly.scalajs.react._
import japgolly.scalajs.react.vdom.html_<^._
object MuiSliderDemo {
val code = GhPagesMacros.exampleSource
// EXAMPLE:STA... | rleibman/scalajs-react-components | demo/src/main/scala/demo/components/materialui/MuiSliderDemo.scala | Scala | apache-2.0 | 899 |
/*
* 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 ... | mahmoudhanafy/spark-testing-base | src/main/1.3/scala/com/holdenkarau/spark/testing/SparkContextProvider.scala | Scala | apache-2.0 | 988 |
package learningconcurrency.ch3
import java.util.concurrent.atomic.AtomicLong
import parallelprogramming._
/**
* These abstractions permit several memory reads but
* only one concurrent write.
*
* They support linearizable operations, which are operations
* that seem to occur instantaneously to the rest of the s... | tomduhourq/learning-concurrent-programming | src/main/scala/learningconcurrency/ch3/AtomicPrimitives_2.scala | Scala | apache-2.0 | 1,151 |
package lila
package object memo extends PackageObject {
private[memo] def logger = lila.log("memo")
}
| luanlv/lila | modules/memo/src/main/package.scala | Scala | mit | 107 |
package helpers
/**
* @author zepeng.li@gmail.com
*/
abstract class BaseException(val code: String)
extends Exception with Loggable {
override def getMessage = code
}
| lizepeng/app.io | modules/models/app/helpers/BaseException.scala | Scala | apache-2.0 | 175 |
package org.fayalite.aws
import java.util
import com.amazonaws._
import com.amazonaws.internal.StaticCredentialsProvider
import com.amazonaws.regions.{Region, Regions, ServiceAbbreviations}
import com.amazonaws.services.ec2.AmazonEC2Client
import com.amazonaws.services.ec2.model._
import com.amazonaws.services.elasti... | ryleg/fayalite | gate/src/main/scala/org/fayalite/aws/AWS.scala | Scala | mit | 3,131 |
package build.unstable.tylog
import org.slf4j.event.Level
object Example extends App with TypedLogging {
type TraceID = String
sealed trait CallType
case object A extends CallType
case object B extends CallType
val traceId = "1"
// this adds callType/variation/traceID to MDC
log.tylog(Level.TRACE, ... | ernestrc/tylog | examples/src/main/scala/build/unstable/tylog/Example.scala | Scala | mit | 1,022 |
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.