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 ... | jkbradley/spark | sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/continuous/ContinuousTextSocketSource.scala | Scala | apache-2.0 | 9,818 |
package com.sksamuel.elastic4s.requests.indexes
import com.fasterxml.jackson.annotation.JsonProperty
import com.sksamuel.elastic4s.requests.common.{DocumentRef, Shards}
case class IndexResponse(@JsonProperty("_id") id: String,
@JsonProperty("_index") index: String,
@J... | sksamuel/elastic4s | elastic4s-domain/src/main/scala/com/sksamuel/elastic4s/requests/indexes/IndexResponse.scala | Scala | apache-2.0 | 796 |
/*
* 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 | protocol/src/main/scala/com/ibm/spark/kernel/protocol/v5/content/StreamContent.scala | Scala | apache-2.0 | 1,082 |
/*
* The MIT License (MIT)
*
* Copyright (c) 2017 Lars Kroll <bathtor@googlemail.com>
*
* 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 limitatio... | Bathtor/common-utils | scala/src/main/scala-2.13/com/larskroll/common/collections/MultiMap.scala | Scala | mit | 2,394 |
package com.jonatantierno.rhymes
trait Verse extends Rhymes{
def getVerses(target: String, text: String): String =
flattenResult(getVersesAsList(target,text))
def getVersesAsList(target: String, text: String): List[String] =
getRhymes(lastWord(target), text)
.filter((rhyme: String) =... | jonatantierno/rhymes | app/models/com/jonatantierno/rhymes/Verses.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 ... | sanjeevtripurari/HiBench | src/sparkbench/src/main/scala/com/intel/sparkbench/IOCommon.scala | Scala | apache-2.0 | 4,543 |
package cfc.shale.redis_client.containers
import cfc.shale.redis_client.commands._
case class RedisStringOption(key: String)
extends RedisContainer[Option[String]] {
override def get: RedisCommand[Option[String]] =
RedisGetStringOption(key)
override def set(value: Option[String]): RedisCommand[Unit] =
... | cardforcoin/shale-scala | redis-client/src/main/scala/cfc/shale/redis_client/containers/RedisStringOption.scala | Scala | mit | 426 |
// Copyright 2017,2018,2019,2020 Commonwealth Bank of Australia
//
// 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 a... | CommBank/grimlock | grimlock-core/src/test/scala/commbank/grimlock/statistics/TestStatisticsMaximum.scala | Scala | apache-2.0 | 7,237 |
package unfiltered.response
class DelegatingResponse[+T](val delegate: HttpResponse[T])
extends HttpResponse[T](delegate.underlying) {
val outputStream = delegate.outputStream
def status(statusCode: Int) {
delegate.status(statusCode)
}
def status: Int =
delegate.status
def redirect(url: String) {
... | beni55/unfiltered | library/src/main/scala/response/delegating.scala | Scala | mit | 431 |
/*
* 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 ... | pgandhi999/spark | core/src/main/scala/org/apache/spark/status/ElementTrackingStore.scala | Scala | apache-2.0 | 7,368 |
package mimir.exec.result
import java.sql.SQLException
import mimir.algebra._
import mimir.provenance._
import mimir.ctables._
trait Row
{
def tuple: Seq[PrimitiveValue]
def tupleMap: Map[ID,PrimitiveValue] =
tupleSchema.zip(tuple).map { x => (x._1._1 -> x._2) }.toMap
def apply(idx: Int): PrimitiveValue
... | UBOdin/mimir | src/main/scala/mimir/exec/result/Row.scala | Scala | apache-2.0 | 2,011 |
/*
* Copyright (c) 2014 Sanoma Oyj. 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.apache.org/licenses/LI... | Sanoma-CDA/maxmind-geoip2-scala | src/main/scala/com/sanoma/cda/geo/Point.scala | Scala | apache-2.0 | 5,461 |
abstract class Tree
case class Sum(l: Tree, r: Tree) extends Tree
case class Var(n: String) extends Tree
case class Const(v: Int) extends Tree | grant/hello-scala | src/Tree.scala | Scala | mit | 142 |
package org.eichelberger.sfc.study.composition
import org.eichelberger.sfc.SpaceFillingCurve._
import org.eichelberger.sfc.{Dimension, DefaultDimensions}
import org.joda.time.{DateTimeZone, DateTime}
import scala.util.Random
case class XYZTPoint(x: Double, y: Double, z: Double, t: DateTime)
case class MinMax[T](min... | cne1x/sfseize | src/main/scala/org/eichelberger/sfc/study/composition/CompositionSampleData.scala | Scala | apache-2.0 | 4,961 |
package org.scaroo.scalding.hive.sources
import cascading.tap.{MultiSourceTap, Tap}
import cascading.tap.hive.{HiveViewAnalyzer, }
import com.twitter.scalding._
case class HiveSource(query: String)(implicit analyzer: HiveViewAnalyzer) extends Source {
override def createTap(readOrWrite: AccessMode)(implicit mode: ... | amazari/scalding-hive | src/main/scala/org/scaroo/scalding/hive/sources/HiveSource.scala | Scala | apache-2.0 | 560 |
/*
* 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 ... | spark0001/spark2.1.1 | core/src/main/scala/org/apache/spark/rdd/PairRDDFunctions.scala | Scala | apache-2.0 | 57,063 |
/* NEST (New Scala Test)
* Copyright 2007-2013 LAMP/EPFL
*/
package scala.tools.partest
package nest
import scala.tools.nsc.util.ClassPath
import scala.tools.nsc.io.{ Path, File, Directory }
import scala.tools.nsc.Properties.{ propOrNone }
import Path._
/** Get current value for path settings -- these depend on th... | som-snytt/scala-partest | src/main/scala/scala/tools/partest/nest/PathSettings.scala | Scala | bsd-3-clause | 3,180 |
import org.specs2.mutable._
import org.specs2.runner._
import org.junit.runner._
import play.api.libs.ws._
import play.api.mvc._
import play.api.mvc.Results._
import play.api.test._
import play.api.test.Helpers._
import play.core.server.akkahttp.AkkaHttpServer
class ServerSpec extends PlaySpecification {
"Function... | jyotikamboj/container | pf-framework/src/play-akka-http-server/src/sbt-test/akka-http/system-property/tests/ServerSpec.scala | Scala | mit | 912 |
/*
* ____ ____ _____ ____ ___ ____
* | _ \\ | _ \\ | ____| / ___| / _/ / ___| Precog (R)
* | |_) | | |_) | | _| | | | | /| | | _ Advanced Analytics Engine for NoSQL Data
* | __/ | _ < | |___ | |___ |/ _| | | |_| | Copyright (C) 2010 - 2013 SlamData, In... | precog/platform | auth/src/main/scala/com/precog/auth/MongoAPIKeyManager.scala | Scala | agpl-3.0 | 11,637 |
package org.oneugene.join
import org.scalatest.FlatSpec
import org.scalatest.Matchers
import org.scalatest.OptionValues
import org.scalatest.prop.PropertyChecks
class JoinPerformance extends FlatSpec with Matchers with OptionValues with PropertyChecks {
case class ClassA(id: Int, value: String)
case class Class... | oneugene/evgeniy-portfolio | join/src/test/scala/org/oneugene/join/JoinPerformance.scala | Scala | mit | 2,380 |
/* Copyright 2009-2021 EPFL, Lausanne */
package stainless
package genc
import extraction.throwing.trees._
import collection.mutable.{ Set => MutableSet }
private[genc] object ExtraOps {
// copied from AdtSpecialization
def root(id: Identifier)(using symbols: Symbols): Identifier = {
symbols.getClass(id).pa... | epfl-lara/stainless | core/src/main/scala/stainless/genc/phases/ExtraOps.scala | Scala | apache-2.0 | 5,717 |
package org.jetbrains.plugins.scala
package lang.scaladoc
import base.ScalaLightCodeInsightFixtureTestAdapter
/**
* User: Dmitry Naydanov
* Date: 2/25/12
*/
class WikiClosingTagTypedTest extends ScalaLightCodeInsightFixtureTestAdapter {
import ScalaLightCodeInsightFixtureTestAdapter.CARET_MARKER
def testCod... | consulo/consulo-scala | test/org/jetbrains/plugins/scala/lang/scaladoc/WikiClosingTagTypedTest.scala | Scala | apache-2.0 | 3,070 |
/**
* Copyright 2016 Martin Snyder
*
* Apache License
* Version 2.0, January 2004
* http://www.apache.org/licenses/
*/
package com.martinsnyder.logger
import com.martinsnyder.logger.SimpleLogger.Entry
object LoggerExample {
def loggedAdder(a: Int, b: Int): SimpleLogger[Int] =
SimpleLogger(List(Entry... | MartinSnyder/monadic-logging | src/main/scala/com/martinsnyder/logger/LoggerExample.scala | Scala | apache-2.0 | 810 |
package ua.kpi.teacherjournal
import android.app._
import android.content.Context
import android.graphics.Color._
import android.os.Bundle
import android.text.format.DateUtils
import android.view._
import Data.timeUntilClassEnd
import org.scaloid.common._
import scala.language.postfixOps
import ua.kpi.teacherjournal.J... | sochka/teacher-journal | src/ua/kpi/teacherjournal/BottomBar.scala | Scala | gpl-3.0 | 3,117 |
package org.specs2.cats
import cats.data.Xor
import cats.data.Validated
class CatsMatchersSpec extends org.specs2.Specification with CatsMatchers {
def is = s2"""
Xor matchers ${XorMatchers}
Validated matchers ${ValidatedMatchers}
"""
def XorMatchers = s2"""
Xor.Right ${XorMatcherSpec().right}
... | thefunctionalists/cats-specs2 | src/test/scala/matchersSpec.scala | Scala | mit | 1,497 |
package com.sksamuel.elastic4s.requests.searches.queries.funcscorer
import com.sksamuel.elastic4s.requests.searches.queries.Query
import com.sksamuel.exts.OptionImplicits._
case class LinearDecayScore(field: String,
origin: String,
scale: String,
... | stringbean/elastic4s | elastic4s-core/src/main/scala/com/sksamuel/elastic4s/requests/searches/queries/funcscorer/LinearDecayScore.scala | Scala | apache-2.0 | 1,078 |
package sjs.react.bootstrap
import japgolly.scalajs.react.extra.LogLifecycle
import sjs.react.bootstrap.utils.ValidComponentChildren
import japgolly.scalajs.react.Addons.ReactCloneWithProps
import japgolly.scalajs.react._
import japgolly.scalajs.react.vdom.prefix_<^._
import scala.scalajs.js
object Nav /* mixins: ... | aparo/scalajs-react-extra | react-bootstrap/src/main/scala/sjs/react/bootstrap/Nav.scala | Scala | apache-2.0 | 7,661 |
package com.nefariouszhen.khronos
case class TimeSeriesPoint(tm: Time, value: Double) extends Ordered[TimeSeriesPoint] {
override def compare(that: TimeSeriesPoint): Int = tm.nanos.compareTo(that.tm.nanos)
}
| khronos-metrics/khronos | khronos-core/src/main/scala/com/nefariouszhen/khronos/TimeSeriesPoint.scala | Scala | apache-2.0 | 211 |
package com.softwaremill.vesplar.spout
import backtype.storm.topology.base.BaseRichSpout
import backtype.storm.topology.OutputFieldsDeclarer
import java.util
import backtype.storm.task.TopologyContext
import backtype.storm.spout.SpoutOutputCollector
import backtype.storm.tuple.{Values, Fields}
import twitter4j._
impor... | adamw/vesplar | analyzer/src/main/scala/com/softwaremill/vesplar/spout/TweetsSpout.scala | Scala | apache-2.0 | 1,738 |
package com.twitter.finagle.http2.transport
import com.twitter.finagle.netty4.http.{HttpCodecName, Http2CodecName}
import com.twitter.finagle.param.Stats
import com.twitter.finagle.Stack.Params
import com.twitter.finagle.stats.InMemoryStatsReceiver
import io.netty.channel._
import io.netty.channel.embedded.EmbeddedCha... | mkhq/finagle | finagle-http2/src/test/scala/com/twitter/finagle/http2/transport/NpnOrAlpnHandlerTest.scala | Scala | apache-2.0 | 2,378 |
package gov.uk.dvla.vehicles.dispose.runner
import cucumber.api.CucumberOptions
import cucumber.api.junit.Cucumber
import org.junit.runner.RunWith
@RunWith(classOf[Cucumber])
@CucumberOptions(
features = Array("acceptance-tests/src/test/resources/SummaryPage.feature"),
glue = Array("gov.uk.dvla.vehicles.dispose.s... | dvla/vehicles-online | acceptance-tests/src/test/scala/gov/uk/dvla/vehicles/dispose/runner/SummaryPage.scala | Scala | mit | 383 |
package com.pharmpress.dmdbrowser.service
import javax.inject.Inject
import com.pharmpress.common.model.dmd.{Amp, Ampp, DmdIdentifiable, TradeFamily, Vmp, Vmpp, Vtm}
import com.pharmpress.elasticsearch.IElasticSearch
import com.sksamuel.elastic4s.ElasticDsl._
import org.apache.commons.lang3.math.NumberUtils
import pl... | pharmpress/DmdBrowserScalaJs | jvm/app/com/pharmpress/dmdbrowser/service/SearchService.scala | Scala | apache-2.0 | 2,386 |
/*
* Copyright 2011-2022 GatlingCorp (https://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... | gatling/gatling | gatling-commons/src/main/scala/io/gatling/commons/Exclude.scala | Scala | apache-2.0 | 920 |
/*
* Copyright (c) 2017. Yuriy Stul
*/
package com.stulsoft.kafka3
import com.typesafe.scalalogging.LazyLogging
import scala.concurrent.Await
import scala.concurrent.duration.Duration
/**
* @author Yuriy Stul
*/
object Main3Producer extends App with LazyLogging {
val topic = "main3TestTopic"
logger.info("... | ysden123/poc | pkafka/kafka3/src/main/scala/com/stulsoft/kafka3/Main3Producer.scala | Scala | mit | 585 |
package wav.devtools.sbt.karaf
import sbt._
package object packaging {
private [packaging] type SbtTask[T] = Def.Initialize[Task[T]]
private[devtools] def nullToEmpty(s: String): String = if (s == null) "" else s
}
| wav/osgi-tooling | sbt-karaf-packaging/src/main/scala/wav/devtools/sbt/karaf/packaging/package.scala | Scala | apache-2.0 | 224 |
/* NSC -- new Scala compiler
* Copyright 2002-2013 LAMP/EPFL
* @author Paul Phillips
*/
package scala.tools.nsc
package interpreter
import reporters._
import SparkIMain._
import scala.reflect.internal.util.Position
/** Like ReplGlobal, a layer for ensuring extra functionality.
*/
class SparkReplReporter(intp: ... | hengyicai/OnlineAggregationUCAS | repl/scala-2.11/src/main/scala/org/apache/spark/repl/SparkReplReporter.scala | Scala | apache-2.0 | 1,639 |
package nicol.font
/*
Copied from Tom Streller's (scan) Nicol-0.1.2 project (https://github.com/scan/Nicol)
due to a lack of scala 2.10 compatible version
*/
import nicol.opengl._
/**
* Represents a loaded font. Currently, BitmapFonts are not yet supported. For Font loading,
* the [[java.awt.Font]] system is ... | fehu/agent-tareas | lwjgl/src/main/scala/nicol/font/Font.scala | Scala | mit | 3,859 |
package chandu0101.scalajs.react.components
package materialui
import chandu0101.macros.tojs.JSMacro
import japgolly.scalajs.react._
import japgolly.scalajs.react.raw.React
import japgolly.scalajs.react.vdom.{VdomElement, VdomNode}
import scala.scalajs.js
/**
* This file is generated - submit issues instead of PR ... | rleibman/scalajs-react-components | core/src/main/scala/chandu0101/scalajs/react/components/materialui/MuiStepper.scala | Scala | apache-2.0 | 1,661 |
package ch.epfl.bluebrain.nexus.iam.config
import akka.http.scaladsl.model.Uri
import ch.epfl.bluebrain.nexus.commons.cache.KeyValueStoreConfig
import ch.epfl.bluebrain.nexus.commons.http.JsonLdCirceSupport.OrderedKeys
import ch.epfl.bluebrain.nexus.iam.config.AppConfig._
import ch.epfl.bluebrain.nexus.iam.config.Voca... | hygt/nexus-iam | src/main/scala/ch/epfl/bluebrain/nexus/iam/config/AppConfig.scala | Scala | apache-2.0 | 6,740 |
package extra
import play.api.data.validation._
// --- //
object Constraints {
val validUrl: Constraint[String] = Constraint("constraints.url") { url =>
try {
new java.net.URL(url) // Can throw `MalformedURLException`.
Valid
} catch {
case e: Throwable => Invalid(Seq(ValidationError("URL ... | MyShroom/myshroom-api | app/extra/Constraints.scala | Scala | gpl-2.0 | 357 |
/*
* 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... | JerryYanWan/BigDL | spark/dl/src/main/scala/com/intel/analytics/bigdl/nn/ClassNLLCriterion.scala | Scala | apache-2.0 | 7,642 |
package com.alexitc.coinalerts.config
import javax.inject.Inject
import play.api.Configuration
import scala.concurrent.duration.{DurationLong, FiniteDuration}
trait FixedPriceAlertsTaskConfig {
def initialDelay: FiniteDuration
def interval: FiniteDuration
}
class PlayFixedPriceAlertsTaskConfig @Inject()(conf... | AlexITC/crypto-coin-alerts | alerts-server/app/com/alexitc/coinalerts/config/FixedPriceAlertsTaskConfig.scala | Scala | gpl-3.0 | 690 |
package net.akmorrow13.endive.pipelines
import breeze.linalg.{argmax, DenseMatrix, DenseVector}
import breeze.numerics._
import breeze.stats.distributions.{Gaussian, ThreadLocalRandomGenerator, RandBasis}
import net.akmorrow13.endive.EndiveConf
import net.akmorrow13.endive.featurizers.Motif
import net.akmorrow13.endiv... | akmorrow13/endive | src/main/scala/net/akmorrow13/endive/pipelines/CKSPipeline.scala | Scala | apache-2.0 | 9,749 |
/*
* Copyright 2014 Adam Rosenberger
*
* 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... | arosenberger/nalloc | sandbox/src/main/scala/org/nalloc/bitb/kcits/sandbox/map/MethodValue.scala | Scala | apache-2.0 | 1,390 |
#!/bin/bash
exec scala "$0" "$@"
!#
/***************************************************************************************
* allDeps.scala processes a list of sbt projects, creating a discrete set of their
* jar dependencies for the repo in the current working directory.
*
***************************************... | traytonwhite/Kamanja | trunk/SampleApplication/Medical/bin/allDeps.scala | Scala | apache-2.0 | 3,487 |
package org.bitcoins.spvnode.messages.data
import org.bitcoins.core.number.UInt64
import org.bitcoins.core.protocol.CompactSizeUInt
import org.bitcoins.core.util.Factory
import org.bitcoins.spvnode.messages.GetDataMessage
import org.bitcoins.spvnode.serializers.messages.data.RawGetDataMessageSerializer
/**
* Create... | Christewart/bitcoin-s-spv-node | src/main/scala/org/bitcoins/spvnode/messages/data/GetDataMessage.scala | Scala | mit | 1,063 |
/*
* (c) Copyright 2016 Hewlett Packard Enterprise Development LP
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required b... | hpe-cct/cct-core | src/test/scala/cogx/runtime/execution/CircuitEvaluatorSpec.scala | Scala | apache-2.0 | 7,372 |
/*
* 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/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/bitwiseExpressions.scala | Scala | apache-2.0 | 9,204 |
package ac.ncic.syssw.pppuc03
case class Vector3D(x: Double, y: Double, z: Double) {
def dot(v: Vector3D): Double = x*v.x + y*v.y + z*v.z
def cross(v: Vector3D) = Vector3D(y*v.z - z*v.y, z*v.x - x*v.z, x*v.y - y*v.x)
def scalarTriple(v1: Vector3D, v2: Vector3D) = this dot (v1 cross v2)
def vectorTriple(v1: Vec... | qzan9/PPPuC03-Scala | src/main/scala/ac/ncic/syssw/pppuc03/Vector3D.scala | Scala | mit | 371 |
/*
* 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 | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/basicOperators.scala | Scala | apache-2.0 | 21,248 |
/*
* Copyright 2020 Spotify AB.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to ... | spotify/scio | scio-parquet/src/main/scala/com/spotify/scio/parquet/tensorflow/ParquetExampleIO.scala | Scala | apache-2.0 | 5,882 |
package se.lu.nateko.cp.meta.core
import java.net.URI
import java.time.Instant
import spray.json._
import se.lu.nateko.cp.meta.core.data.TimeInterval
import java.time.{LocalDateTime, LocalDate}
trait CommonJsonSupport extends DefaultJsonProtocol{common =>
implicit object urlFormat extends RootJsonFormat[URI] {
de... | ICOS-Carbon-Portal/meta | core/src/main/scala/se/lu/nateko/cp/meta/core/CommonJsonSupport.scala | Scala | gpl-3.0 | 2,433 |
package org.peelframework.wordcount.cli.command
import java.lang.{System => Sys}
import anorm.SqlParser._
import anorm._
import org.peelframework.core.cli.command.Command
import org.peelframework.core.config.loadConfig
import org.peelframework.core.results.DB
import org.peelframework.core.util.console._
import net.so... | aalexandrov/peel-wordcount | peel-wordcount-peelextensions/src/main/scala/org/peelframework/wordcount/cli/command/QueryRuntimes.scala | Scala | apache-2.0 | 4,256 |
package filodb.coordinator
import scala.concurrent.duration._
import akka.actor.{ActorRef, Address}
import akka.testkit.TestProbe
import com.typesafe.config.ConfigFactory
import filodb.core.{DatasetRef, TestData}
import filodb.core.downsample.DownsampleConfig
import filodb.core.metadata.Dataset
import filodb.core.st... | tuplejump/FiloDB | coordinator/src/test/scala/filodb.coordinator/ShardManagerSpec.scala | Scala | apache-2.0 | 22,369 |
/*
* Copyright (C) 2014 GRNET S.A.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distrib... | grnet/snf-vmcatcher | src/main/scala/gr/grnet/egi/vmcatcher/cmdline/helper/NotEmptyStringValidator.scala | Scala | gpl-3.0 | 1,236 |
package io.angstrom.smally.util
import com.twitter.finagle.redis.Client
import com.twitter.finagle.redis.util._
object Counter {
private val InitialValue = 10000000L; // (ten million)
private val CounterKey = "smally:counter"
def apply(client: Option[Client]) = new Counter(client.get)
}
class Counter(client: ... | cacoco/smally-scala | src/main/scala/io/angstrom/smally/util/Counter.scala | Scala | apache-2.0 | 691 |
package org.ucl.compgs04.output
import org.ucl.compgs04.model.FileLineHistory
trait Output {
/**
* Takes a file history and outputs it to wherever (command line/file/etc.)
* @param fileHistory - the result
*/
def processToOutput(fileHistory: FileLineHistory): Unit
}
| krivachy/git-line-history | src/main/scala/org/ucl/compgs04/output/Output.scala | Scala | mit | 282 |
/*
* Copyright (c) 2013-2014 Erik van Oosten
*
* 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 ... | scullxbones/metrics-scala | src/main/akka/nl/grons/metrics/scala/FutureMetrics.scala | Scala | apache-2.0 | 1,544 |
package com.github.ldaniels528.trifecta.ui.controllers
import java.io.File
import java.util.UUID
import _root_.kafka.common.TopicAndPartition
import com.github.ldaniels528.commons.helpers.OptionHelper.Risky._
import com.github.ldaniels528.commons.helpers.OptionHelper._
import com.github.ldaniels528.commons.helpers.Re... | ldaniels528/trifecta | app-play/app/com/github/ldaniels528/trifecta/ui/controllers/KafkaPlayRestFacade.scala | Scala | apache-2.0 | 30,082 |
trait E[T]
class X {
val e1: E[Int] = ???
val e2: E[String] = ???
val e3: E[List[Int]] = ???
val e4: E[List[String]] = ???
val e5: E[Double] = ???
val e6: E[(String, String)] = ???
val e7: E[(String, Int)] = ???
val e8: E[(Int, List[String])] = ???
val e9: E[Long] = ???
val e10: E[(Long, Long)] = ?... | dotty-staging/dotty | tests/pos/i12915.scala | Scala | apache-2.0 | 2,569 |
/***********************************************************************
* Copyright (c) 2013-2018 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... | ddseapy/geomesa | geomesa-index-api/src/main/scala/org/locationtech/geomesa/index/api/FilterPlan.scala | Scala | apache-2.0 | 1,705 |
package models
import java.util.Date
import javax.inject.{Inject, Provider, Singleton}
import scala.collection.immutable
import scala.concurrent.{ExecutionContext, Future}
import play.api.libs.json.JsObject
import play.api.{Configuration, Logger}
import services.AuditedModel
import org.elastic4play.models.{
Attr... | CERT-BDF/TheHive | thehive-backend/app/models/Audit.scala | Scala | agpl-3.0 | 6,311 |
/*
* 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 ... | bdrillard/spark | core/src/main/scala/org/apache/spark/TestUtils.scala | Scala | apache-2.0 | 13,694 |
import java.net.URI
import scala.tools.nsc.doc.base._
import scala.tools.nsc.doc.model._
import scala.tools.partest.ScaladocModelTest
object Test extends ScaladocModelTest {
override def code = """
package scala.test.scaladoc.T8857
/**
* A link:
*
* [[scala.Option$ object Option]... | felixmulder/scala | test/scaladoc/run/t8557.scala | Scala | bsd-3-clause | 1,676 |
package org.katis.capnproto.runtime
import java.nio.ByteBuffer
import java.nio.channels.ReadableByteChannel
import BufferedInputStreamWrapper._
object BufferedInputStreamWrapper {
def readAtLeast(reader: ReadableByteChannel, buf: ByteBuffer, minBytes: Int): Int = {
var numRead = 0
while (numRead < minByte... | katis/capnp-scala | runtime/shared/src/main/scala-2.11/org/katis/capnproto/runtime/BufferedInputStreamWrapper.scala | Scala | mit | 1,922 |
package controllers
import javax.inject.Inject
import org.lyranthe.prometheus.client.Registry
import play.api.mvc.InjectedController
class Healthchecks @Inject()(prometheusRegistry: Registry)
extends InjectedController {
def getMetrics = Action {
Ok(prometheusRegistry.outputText)
}
}
| gilt/sundial | app/controllers/Healthchecks.scala | Scala | mit | 301 |
package net.liftweb.http
import scala.xml.NodeSeq
import net.liftweb.util.TimeHelpers._
import net.liftweb.util.Props
/**
* A snippet timer is a general interface for timing snippets. A few default implementations are
* provided and can be selected by setting LiftRules.snippetTimer as you need.
*/
trait SnippetTim... | lift/framework | web/webkit/src/main/scala/net/liftweb/http/SnippetTimer.scala | Scala | apache-2.0 | 867 |
package com.eevolution.context.dictionary.infrastructure.service.impl
import java.util.UUID
import com.eevolution.context.dictionary.infrastructure.repository.WindowAccessRepository
import com.eevolution.context.dictionary.infrastructure.service.WindowAccessService
import com.lightbend.lagom.scaladsl.api.ServiceCall
... | adempiere/ADReactiveSystem | dictionary-impl/src/main/scala/com/eevolution/context/dictionary/infrastructure/service/impl/WindowAccessServiceImpl.scala | Scala | gpl-3.0 | 2,070 |
package yuuto.yuutogates.plugs
import net.minecraft.item.ItemStack
import yuuto.yuutogates.api.base.PlugGate
import yuuto.yuutogates.api.gates.IGateAND
import yuuto.yuutogates.api.material.GateMaterial
/**
* Created by Yuuto on 9/25/2015.
*/
class PlugGateAND extends PlugGate with IGateAND{
def this(material:Gat... | AnimeniacYuuto/YuutoGates | src/main/scala/yuuto/yuutogates/plugs/PlugGateAND.scala | Scala | lgpl-3.0 | 417 |
package cromwell.backend.standard
import com.typesafe.config.Config
import cromwell.backend.validation._
/**
* Validates a collection of runtime attributes for a Standard Backend.
*
* There are two collections of runtime attributes, the first that are required for the standard async execution, and
* custom va... | ohsu-comp-bio/cromwell | backend/src/main/scala/cromwell/backend/standard/StandardValidatedRuntimeAttributesBuilder.scala | Scala | bsd-3-clause | 2,845 |
/*
* 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 ... | michalsenkyr/spark | core/src/main/scala/org/apache/spark/deploy/SparkSubmitArguments.scala | Scala | apache-2.0 | 25,658 |
/*
* Copyright 2010 Twitter, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License. You may obtain
* a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed t... | yeghishe/ostrich | src/main/scala/com/twitter/ostrich/admin/RuntimeEnvironment.scala | Scala | apache-2.0 | 9,787 |
object Example1 {
opaque type Foo[A] <: A = A
}
object Example2 {
opaque type Foo[A] >: A = A
} | som-snytt/dotty | tests/pos/i8573.scala | Scala | apache-2.0 | 100 |
/**
* 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-core/src/main/scala/io/gatling/core/protocol/Protocols.scala | Scala | apache-2.0 | 1,489 |
// 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 may obtain a copy of the License at
//
// http://www.apache... | AndreasPetter/cassandra-hadoop-vnodes | cassandra-hadoop-vnodes-core/src/main/scala/scray/cassandra/hadoop/CassandraVNodeInputFormat.scala | Scala | apache-2.0 | 3,311 |
/*
* Copyright 2014 The Guardian
*
* 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... | guardian/prout | app/Global.scala | Scala | apache-2.0 | 982 |
package test
import org.specs2.mutable.Specification
import com.julianpeeters.avro.annotations._
import java.io.File
import org.apache.avro.io.{DecoderFactory, EncoderFactory}
import org.apache.avro.generic.GenericData.Record
import org.apache.avro.generic._
import org.apache.avro.specific._
import org.apache.avro.S... | rvvincelli/avro-scala-macro-annotations | tests/src/test/scala/AvroTypeProviderTests/AvroTypeProviderDefaultValueTest.scala | Scala | apache-2.0 | 15,092 |
package com.scalableminds.webknossos.tracingstore.tracings.volume
import com.scalableminds.webknossos.datastore.models.datasource.ElementClass
import com.scalableminds.webknossos.datastore.geometry.Vec3DoubleProto
object VolumeTracingDefaults {
val editRotation: Vec3DoubleProto = Vec3DoubleProto(0, 0, 0)
val el... | scalableminds/webknossos | webknossos-tracingstore/app/com/scalableminds/webknossos/tracingstore/tracings/volume/VolumeTracingDefaults.scala | Scala | agpl-3.0 | 428 |
// Copyright 2017 EPFL DATA Lab (data.epfl.ch)
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law... | epfldata/squid | src/test/scala/squid/feature/Analyse.scala | Scala | apache-2.0 | 1,009 |
/*
* Copyright 2016 Guy Van den Broeck and Wannes Meert (UCLA and KU Leuven)
*
* 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
*
* Un... | UCLA-StarAI/Forclift | src/test/scala/edu/ucla/cs/starai/forclift/bugs/TestBug4.scala | Scala | apache-2.0 | 1,935 |
package com.rocketfuel.sdbc.base.jdbc
import TestDbms._
import org.scalatest.FunSuite
import scalaz.Scalaz._
class StringContextSpec
extends FunSuite {
test("empty string is identity") {
val s = select""
assertResult("")(s.queryText)
assertResult("")(s.originalQueryText)
}
test("$i is replaced ... | rocketfuel/sdbc | jdbc/src/test/scala/com/rocketfuel/sdbc/base/jdbc/StringContextSpec.scala | Scala | bsd-3-clause | 1,875 |
package akka.scalajs.wsserver
import scala.collection.mutable
import scala.concurrent.Future
import akka.actor._
import akka.scalajs.wscommon._
import play.api.libs.json._
import play.api.libs.iteratee.Concurrent.Channel
import org.scalajs.spickling._
import org.scalajs.spickling.playjson._
object ServerProxy {
... | sjrd/scala-js-actors | akka-websocket-bridge/src/main/scala/akka/scalajs/wsserver/ServerProxy.scala | Scala | bsd-3-clause | 1,340 |
package dao
import dao.helper.TableFilter
import dao.helper.TableFilter.{onEndFilter, onStartFilter}
import database.{BlacklistDb, BlacklistTable}
import javax.inject.Inject
import models.Blacklist
import slick.jdbc.PostgresProfile.api._
import scala.concurrent.{ExecutionContext, Future}
object BlacklistDao extends ... | THK-ADV/lwm-reloaded | app/dao/BlacklistDao.scala | Scala | mit | 1,770 |
package com.sksamuel.elastic4s.api
import com.sksamuel.elastic4s.Indexes
import com.sksamuel.elastic4s.requests.searches.queries.Query
import com.sksamuel.elastic4s.requests.validate.ValidateRequest
trait ValidateApi {
def validateIn(indexes: Indexes): ValidateExpectsQuery = new ValidateExpectsQuery(indexes)
cla... | sksamuel/elastic4s | elastic4s-core/src/main/scala/com/sksamuel/elastic4s/api/ValidateApi.scala | Scala | apache-2.0 | 449 |
object Test {
class C[T](private val x: T) {
private def foo[Z](z: Z): T = x
private var y: T = _
inline def get1 = x
inline def get2[U](c: C[U]) = c.x
inline def foo1(x: Int) = foo(x)
inline def foo2[U](c: C[U]) = c.foo(x)
inline def set1(z: T) = { y = z; y }
inline def set2[U](... | som-snytt/dotty | tests/run/transparentPrivates.scala | Scala | apache-2.0 | 679 |
/**
* Copyright 2016, deepsense.io
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed ... | deepsense-io/seahorse-workflow-executor | deeplang/src/main/scala/io/deepsense/deeplang/doperables/spark/wrappers/params/common/HasOptionalQuantilesColumnParam.scala | Scala | apache-2.0 | 2,491 |
import scalajs.js.annotation.JSExport
import scalajs.js
import biz.enef.angulate._
@JSExport
object Main {
val module = angular.createModule("demo", js.Array(
modules.docks.AngulateDocks())
)
}
| jokade/angulate-docks | demo/Main.scala | Scala | mit | 203 |
package play.api.libs
/**
* Utilities functions for Collections
*/
object Collections {
/**
* Produces a Seq from a seed and a function.
*
* Example, produces a List from 0 to 100.
*
* {{{
* unfoldLeft(0) { state match
* case a if a > 100 => None
* case a => (a + 1, a + 1)
* }
* ... | michaelahlers/team-awesome-wedding | vendor/play-2.2.1/framework/src/play/src/main/scala/play/api/libs/Collections.scala | Scala | mit | 720 |
package filodb.query.exec
import monix.eval.Task
import monix.reactive.Observable
import filodb.core.query._
import filodb.query._
/**
* Simply concatenate results from child ExecPlan objects
*/
trait DistConcatExec extends NonLeafExecPlan {
require(children.nonEmpty)
protected def args: String = ""
prot... | tuplejump/FiloDB | query/src/main/scala/filodb/query/exec/DistConcatExec.scala | Scala | apache-2.0 | 2,127 |
package org.zmpp.tads3
import T3Assert._
class FileException extends Exception
class FileNotFoundException extends FileException
object TadsFile {
val FileAccessRead = 1
val FileAccessWrite = 2
val FileAccessReadWriteKeep = 3
val FileAccessReadWreteTrunc = 4
// TADS 3 system specific f... | logicmoo/zmpp2 | zmpp-tads3/src/main/scala/org/zmpp/tads3/TadsFile.scala | Scala | bsd-3-clause | 3,782 |
/*
* Copyright (c) 2011-15 Miles Sabin
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agr... | triggerNZ/shapeless | core/src/main/scala/shapeless/ops/hlists.scala | Scala | apache-2.0 | 109,540 |
/*
* 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 ... | BryanCutler/spark | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/higherOrderFunctions.scala | Scala | apache-2.0 | 42,130 |
package com.twitter.cache
import com.twitter.util.{Promise, Future}
import java.util.concurrent.ConcurrentMap
/**
* A [[com.twitter.cache.FutureCache]] backed by a
* `java.util.concurrent.ConcurrentMap`
*
* Any correct implementation should make sure that you evict failed
* results, and don't interrupt the under... | twitter/util | util-cache/src/main/scala/com/twitter/cache/ConcurrentMapCache.scala | Scala | apache-2.0 | 1,222 |
/**
* 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... | mihbor/kafka | core/src/main/scala/kafka/server/ReplicaManager.scala | Scala | apache-2.0 | 78,573 |
package com.malaska.spark.training.timeseries
import org.apache.log4j.{Level, Logger}
import org.apache.spark.sql.SparkSession
object TumblingWindows {
Logger.getLogger("org").setLevel(Level.OFF)
Logger.getLogger("akka").setLevel(Level.OFF)
def main(args:Array[String]): Unit = {
val leadLagJson = args(0)
... | TedBear42/spark_training | src/main/scala/com/malaska/spark/training/timeseries/TumblingWindows.scala | Scala | apache-2.0 | 1,388 |
package com.twitter.zipkin.storage.cassandra
import com.datastax.driver.core.Cluster
import com.twitter.conversions.time.intToTimeableNumber
import com.twitter.util.Await.{ready, result}
import com.twitter.util.Duration
import com.twitter.zipkin.storage.SpanStoreSpec
import java.util.Collections
import junit.framework... | hydro2k/zipkin | zipkin-cassandra/src/test/scala/com/twitter/zipkin/storage/cassandra/CassandraSpanStoreSpec.scala | Scala | apache-2.0 | 1,944 |
/*
* 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/commons | core/src/main/scala/org/beangle/commons/lang/time/WeekTime.scala | Scala | lgpl-3.0 | 6,774 |
/*
* 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-crud-rest/src/main/scala/com/bwsw/sj/crud/rest/instance/InstanceDestroyer.scala | Scala | apache-2.0 | 4,616 |
package com.github.ligangty.scala.jsoup
import java.io.IOException
/**
* Signals that a HTTP request resulted in a not OK HTTP response.
*/
class HttpStatusException private(message: String) extends IOException(message) {
private var statusCode: Int = 0
private var url: String = null
def this(message: Strin... | ligangty/scalajsoup | src/main/scala/com/github/ligangty/scala/jsoup/HttpStatusException.scala | Scala | mit | 622 |
package com.esri
case class SnapXY(val x: Double,
val y: Double,
val distanceOnLine: Double,
val distanceToLine: Double,
val rho: Double,
val side: Byte
) extends Snap
| mraad/spark-snap-points | src/main/scala/com/esri/SnapXY.scala | Scala | apache-2.0 | 276 |
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.