code stringlengths 5 1M | repo_name stringlengths 5 109 | path stringlengths 6 208 | language stringclasses 1
value | license stringclasses 15
values | size int64 5 1M |
|---|---|---|---|---|---|
/*
* Copyright 2021 HM Revenue & Customs
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or a... | hmrc/ct-calculations | src/main/scala/uk/gov/hmrc/ct/ct600/v2/B56.scala | Scala | apache-2.0 | 1,171 |
package sbt.internal.util
package complete
class FixedSetExamplesTest extends UnitSpec {
"adding a prefix" should "produce a smaller set of examples with the prefix removed" in {
val _ = new Examples {
fixedSetExamples.withAddedPrefix("f")() should contain theSameElementsAs (List("oo", "ool", "u"))
... | Duhemm/util | internal/util-complete/src/test/scala/sbt/complete/FixedSetExamplesTest.scala | Scala | bsd-3-clause | 793 |
/*
* Copyright 2011 T8 Webware
*
* 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... | Banno/salat-avro | src/main/scala/schema.scala | Scala | apache-2.0 | 3,655 |
package org.jetbrains.plugins.scala
package lang
package psi
package api
package expr
import com.intellij.psi.{PsiElement, PsiNameValuePair}
import org.jetbrains.plugins.scala.lang.lexer.ScalaTokenTypes
import org.jetbrains.plugins.scala.lang.psi.api.base.ScLiteral
import org.jetbrains.plugins.scala.lang.psi.api.tople... | ilinum/intellij-scala | src/org/jetbrains/plugins/scala/lang/psi/api/expr/ScNameValuePair.scala | Scala | apache-2.0 | 771 |
object Leap {
def leapYear(year: Int): Boolean = {
def divisibleBy(i: Int) = year % i == 0
divisibleBy(4) && (divisibleBy(400) || !divisibleBy(100))
}
}
| exercism/xscala | exercises/practice/leap/.meta/Example.scala | Scala | mit | 165 |
/*
* 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 ... | WangTaoTheTonic/flink | flink-libraries/flink-table/src/main/scala/org/apache/flink/table/api/TableEnvironment.scala | Scala | apache-2.0 | 35,961 |
/*******************************************************************************
Copyright (c) 2013, S-Core.
All rights reserved.
Use is subject to license terms.
This distribution may include materials developed by third parties.
*********************************************************************... | daejunpark/jsaf | src/kr/ac/kaist/jsaf/analysis/typing/models/jquery/JQueryDeferred.scala | Scala | bsd-3-clause | 2,573 |
package com.datastax.spark.connector.types
import java.net.InetAddress
import java.nio.ByteBuffer
import java.util.concurrent.TimeUnit
import java.util.{Calendar, GregorianCalendar, UUID, Date, TimeZone}
import scala.collection.JavaConversions._
import scala.collection.immutable.{TreeMap, TreeSet}
import scala.reflec... | jimenefe/spark-cassandra-connector | spark-cassandra-connector/src/main/scala/com/datastax/spark/connector/types/TypeConverter.scala | Scala | apache-2.0 | 32,848 |
package lila.playban
import org.joda.time.DateTime
case class UserRecord(
_id: String,
o: Option[List[Outcome]],
b: Option[List[TempBan]]) {
def userId = _id
def outcomes: List[Outcome] = ~o
def bans: List[TempBan] = ~b
def banInEffect = bans.lastOption.??(_.inEffect)
lazy val nbOutcomes = ou... | r0k3/lila | modules/playban/src/main/model.scala | Scala | mit | 1,787 |
// Generated by the Scala Plugin for the Protocol Buffer Compiler.
// Do not edit!
//
// Protofile syntax: PROTO2
package com.google.protobuf.descriptor
/** @param deprecated
* Is this service deprecated?
* Depending on the target platform, this can emit Deprecated annotations
* for the service, or it wil... | dotty-staging/ScalaPB | scalapb-runtime/non-jvm/src/main/scala/com/google/protobuf/descriptor/ServiceOptions.scala | Scala | apache-2.0 | 9,268 |
/*
* Copyright 2016 Coral realtime streaming analytics (http://coral-streaming.github.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... | coral-streaming/coral | src/main/scala/io/coral/actors/transform/MinMaxActor.scala | Scala | apache-2.0 | 1,966 |
/*
Copyright 2012-2015, University of Geneva.
This file is part of Great Balls of Fire (GBF).
Great Balls of Fire (GBF) 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 (... | unigeSPC/gbf | simulator/src/conc/Collector.scala | Scala | gpl-3.0 | 1,494 |
package com.wavesplatform
import com.wavesplatform.account._
import com.wavesplatform.common.state.ByteStr
import com.wavesplatform.common.utils.EitherExt2
import com.wavesplatform.lang.ValidationError
import com.wavesplatform.lang.directives.values.V3
import com.wavesplatform.lang.script.v1.ExprScript
import com.wave... | wavesplatform/Waves | node/src/test/scala/com/wavesplatform/TransactionGen.scala | Scala | mit | 32,579 |
package com.twitter.zk.coordination
import java.util.concurrent.RejectedExecutionException
import org.apache.zookeeper.{CreateMode, KeeperException}
import com.twitter.concurrent.Permit
import com.twitter.util.Future
import com.twitter.zk.coordination.ZkAsyncSemaphore.{
LackOfConsensusException,
PermitMismatchEx... | twitter/util | util-zk/src/main/scala/com/twitter/zk/coordination/ShardCoordinator.scala | Scala | apache-2.0 | 4,560 |
/* NSC -- new Scala compiler
* Copyright 2005-2014 LAMP/EPFL, Typesafe Inc.
* @author Adriaan Moors
*/
package scala
package tools.nsc
import scala.reflect.internal.Positions
/** Similar to Reporting: gather global functionality specific to parsing.
*/
trait Parsing { self : Positions with Reporting =>
def cu... | felixmulder/scala | src/compiler/scala/tools/nsc/Parsing.scala | Scala | bsd-3-clause | 971 |
package com.github.dkanellis.skyspark.scala.test_utils
import org.apache.log4j.{Level, Logger}
import org.apache.spark.{SparkConf, SparkContext}
trait SparkAddOn {
private val conf = new SparkConf()
.setMaster("local[*]")
.setAppName("spark-tests")
def withSpark(f: SparkContext => Unit) = {
setLogLev... | AkiKanellis/SkySpark | skyspark-scala/src/test/scala/com/github/dkanellis/skyspark/scala/test_utils/SparkAddOn.scala | Scala | mit | 631 |
/*
* Copyright 1998-2019 Linux.org.ru
* 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... | fat0troll/lorsource | src/main/scala/ru/org/linux/util/markdown/LorCutParser.scala | Scala | apache-2.0 | 4,072 |
package org.alcaudon.api
import scala.collection.mutable.{Map, Set}
import scalax.collection.Graph
import scalax.collection.GraphEdge.DiEdge
import scalax.collection.GraphPredef._
private[alcaudon] object DataflowGraphBuilder {
sealed trait Kind
case object ComputationType extends Kind
case object SourceType ex... | fcofdez/alcaudon | src/main/scala/org/alcaudon/api/DataflowGraphBuilder.scala | Scala | apache-2.0 | 1,590 |
package es.weso.rdf.validator
import es.weso.rdf._;
import es.weso.rdfgraph.nodes._
import es.weso.monads.Result
import es.weso.shex.Typing
trait RDFValidator {
type Label
type ValidationResult
type ValidationSchema
type Node = RDFNode
def id: String
val rdf: RDFReader
val schema: ValidationSchema... | jorgeyp/ShExcala | src/main/scala/es/weso/rdf/validator/RDFValidator.scala | Scala | mit | 1,151 |
/*
*************************************************************************************
* Copyright 2011 Normation SAS
*************************************************************************************
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero Ge... | jooooooon/rudder | rudder-core/src/main/scala/com/normation/rudder/services/servers/NodeConfigurationService.scala | Scala | agpl-3.0 | 4,344 |
/**
* Generated by Scrooge
* version: 3.13.0
* rev: 0921444211eb6b3d2ac9fd31a1bf189f94c6ae85
* built at: 20140325-114520
*/
package com.twitter.zipkin.gen
import com.twitter.scrooge.{
TFieldBlob, ThriftException, ThriftStruct, ThriftStructCodec3, ThriftStructFieldInfo, ThriftUtil}
import org.apache.thrift... | pkoryzna/zipkin | zipkin-scrooge/target/src_managed/main/com/twitter/zipkin/gen/Endpoint.scala | Scala | apache-2.0 | 13,496 |
package play.api.test
import play.api.mvc._
import play.api.libs.json.JsValue
import play.api.libs.concurrent.Promise
import collection.immutable.TreeMap
import play.core.utils.CaseInsensitiveOrdered
import xml.NodeSeq
/**
* Fake HTTP headers implementation.
*
* @param data Headers data.
*/
case class FakeHeaders... | noel-yap/setter-for-catan | play-2.1.1/framework/src/play-test/src/main/scala/play/api/test/Fakes.scala | Scala | apache-2.0 | 6,275 |
package example.travel.model
import net.liftweb.common.{Full,Box,Empty,Failure}
import net.liftweb.mapper._
import net.liftweb.sitemap.Loc._
import scala.xml.{NodeSeq,Node}
object Customer extends Customer
with KeyedMetaMapper[Long, Customer]
with MetaMegaProtoUser[Customer]{
override def dbTableName =... | timperrett/lift-in-action | chapter-3/src/main/scala/example/travel/model/Customer.scala | Scala | apache-2.0 | 1,113 |
/*
* Copyright 2007-2010 WorldWide Conferencing, LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applica... | lift/lift | framework/lift-base/lift-webkit/src/main/scala/net/liftweb/http/provider/HTTPContext.scala | Scala | apache-2.0 | 2,949 |
package io.react2.scalata.translation
/**
* @author dbalduini
*/
sealed abstract class Field
// Containers
case class ObjField(bindings: Map[String, Field]) extends Field {
def +(b: (String, Field)) = ObjField(bindings + b)
def -(k: String) = ObjField(bindings - k)
}
case class SeqField(elems: List[ObjField]) ... | React2/scalata | src/main/scala/io/react2/scalata/translation/fields.scala | Scala | apache-2.0 | 1,373 |
/*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
package swave.core.impl.stages
import com.typesafe.config.ConfigFactory
import scala.concurrent.duration._
im... | sirthias/swave | core-tests/src/test/scala/swave/core/impl/stages/WithTimeoutSpec.scala | Scala | mpl-2.0 | 2,957 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | Panos-Bletsos/spark-cost-model-optimizer | mllib/src/test/scala/org/apache/spark/ml/classification/DecisionTreeClassifierSuite.scala | Scala | apache-2.0 | 16,483 |
/*
* Copyright 2014–2020 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... | slamdata/quasar | qsu/src/test/scala/quasar/qsu/LPtoQSSpec.scala | Scala | apache-2.0 | 5,023 |
package io.cumulus.stream.utils
import akka.NotUsed
import akka.stream.scaladsl.Flow
import akka.util.ByteString
object Counter {
/**
* Count the number of bytes of a stream.
*/
def apply: Flow[ByteString, Long, NotUsed] =
Flow[ByteString].fold(0l)((size, bytes) => size + bytes.size)
} | Cumulus-Cloud/cumulus | server/cumulus-core/src/main/scala/io/cumulus/stream/utils/Counter.scala | Scala | mit | 307 |
package org.openurp.edu.eams.teach.lesson.task.service.genstrategy
import org.openurp.edu.eams.teach.lesson.task.service.TaskGenObserver
trait LessonGenStrategy {
def gen(source: String, context: Map[String, Any], progressBar: TaskGenObserver): Unit
def preview(source: String, context: Map[String, Any]): Any... | openurp/edu-eams-webapp | schedule/src/main/scala/org/openurp/edu/eams/teach/lesson/task/service/genstrategy/LessonGenStrategy.scala | Scala | gpl-3.0 | 326 |
package chapter12
object Exercise8 extends App {
// val a = Array("Hello", "World")
// val b = Array("hello", "world")
// a.corresponds(b)(_.equalsIgnoreCase(_))
val lengths = Array(2, 3, 1, 4)
val strings1 = Array("11", "222", "3", "4444")
println(strings1.corresponds(lengths)(_.length == _))
val... | vsuharnikov/books-exercises | scala/scala-for-the-impatient/src/main/scala/chapter12/Exercise8.scala | Scala | mit | 420 |
package com.sksamuel.elastic4s.searches.aggs
import com.sksamuel.elastic4s.ScriptBuilder
import org.elasticsearch.search.aggregations.AggregationBuilders
import org.elasticsearch.search.aggregations.bucket.terms.TermsAggregationBuilder
import scala.collection.JavaConverters._
object TermsAggregationBuilder {
def a... | FabienPennequin/elastic4s | elastic4s-tcp/src/main/scala/com/sksamuel/elastic4s/searches/aggs/TermsAggregationBuilder.scala | Scala | apache-2.0 | 1,147 |
package com.emajliramokade
package services
package impl
import api.model.EmailRegistracija.Zahtjev
import hr.ngs.patterns.ISerialization
import scala.concurrent.Future
class OracleRemoteEmailSubscriber(
val serialization: ISerialization[String])
extends abstracts.RemoteEmailSubscriber
with RemotingDi... | element-doo/ekade | code/scala/Services/src/main/scala/com/emajliramokade/services/impl/OracleRemoteEmailSubscriber.scala | Scala | bsd-3-clause | 480 |
/**
* Copyright 2020 Confluent 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 a... | confluentinc/examples | clients/cloud/scala/src/main/scala/io/confluent/examples/clients/scala/Streams.scala | Scala | apache-2.0 | 3,546 |
def add(x:Int, y:Int) = x + y
println(add(6,7))
def numberStatus(a:Int) =
if (a < 10) "Less than 10"
else if (a > 10) "Greater than 10"
else "It is 10"
| chrisheckler/Scala_scripts | basicMethod.scala | Scala | mit | 163 |
/**
* 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... | solidfire/jsvcgen | jsvcgen-core/src/main/scala/com/solidfire/jsvcgen/model/ValidationException.scala | Scala | apache-2.0 | 928 |
// bytecode should reflect volatile annotation
trait VolatileAbort {
@volatile private var abortflag = false
}
class DefaultSignalling extends VolatileAbort
object Test {
def main(args: Array[String]): Unit = {
val field = classOf[DefaultSignalling].getDeclaredFields.find(_.getName.contains("abortflag")).get
... | scala/scala | test/files/run/trait_fields_volatile.scala | Scala | apache-2.0 | 403 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | maropu/spark | core/src/main/scala/org/apache/spark/api/r/BaseRRunner.scala | Scala | apache-2.0 | 11,433 |
/***********************************************************************
* Copyright (c) 2017-2019 IBM
* Copyright (c) 2013-2019 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 ac... | elahrvivaz/geomesa | geomesa-cassandra/geomesa-cassandra-datastore/src/main/scala/org/locationtech/geomesa/cassandra/data/CassandraQueryPlan.scala | Scala | apache-2.0 | 3,359 |
package spotlight.analysis
import scala.reflect.ClassTag
import akka.actor.ActorRef
import cats.syntax.validated._
import com.typesafe.config.{ Config, ConfigFactory }
import omnibus.commons.AllIssuesOr
import demesne.CommandLike
import omnibus.akka.envelope.WorkId
import spotlight.model.outlier.AnalysisPlan
import sp... | dmrolfs/spotlight | core/src/main/scala/spotlight/analysis/OutlierDetectionMessage.scala | Scala | mit | 3,623 |
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2015-2021 Andre White.
*
* 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
*
* https://www.apache.org/licenses/LICENSE... | adarro/ddo-calc | subprojects/common/ddo-core/src/main/scala/io/truthencode/ddo/model/effect/EffectStatus.scala | Scala | apache-2.0 | 819 |
package org.typedsolutions.aws.kinesis.model
case class GetShardIteratorRequest(
streamName: String,
shardId: String,
shardIteratorType: ShardIteratorType.Value,
startingSequenceNumber: Option[String] = None) extends Command
object ShardIteratorType {
sealed trait Value
case object AtSequenceNumbe... | mattroberts297/akka-kinesis | src/main/scala/org/typedsolutions/aws/kinesis/model/GetShardIteratorRequest.scala | Scala | mit | 924 |
///////////////////////////////////////////////////////////////
// © ООО «Праймтолк», 2011-2013 //
// Все права принадлежат компании ООО «Праймтолк». //
///////////////////////////////////////////////////////////////
/**
* ${PROJECT_NAME}
* © Primetalk Ltd., 2013.
* All rights ... | ppopoff/SynapseGrid | synapse-grid-concurrent/src/main/scala/ru/primetalk/synapse/concurrent/HTime.scala | Scala | bsd-2-clause | 2,115 |
class Foo
class Test {
def update[B](x : B, b : Int): Unit = {}
def apply[B](x : B) = 1
}
class Test2 {
type B = Foo
def update(x : B, b : Int): Unit = {}
def apply(x : B) = 1
}
object Test {
def main(a : Array[String]): Unit = {
val a = new Test
val f = new Foo
a(f) = 1 /... | som-snytt/dotty | tests/pos/t3278.scala | Scala | apache-2.0 | 659 |
package com.cds.learn.chapter4
/**
* Created by chendongsheng5 on 2017/5/27.
*/
//hide std library `Option` and `Either`, since we are writing our own in this chapter
import scala.{Option => _, Either => _, Left => _, Right => _, _} // hide std library `Option` and `Either`, since we are writing our own in this ch... | anancds/scala-project | fpis/src/main/scala/com/cds/learn/chapter4/Either.scala | Scala | mit | 2,841 |
package controllers
import org.specs2.mutable.Specification
import play.api.test.Helpers._
import scala.Some
import play.api.test.{FakeRequest, FakeApplication}
import models.{Composites, Steps}
class StepsControllerSpec extends Specification {
"GET /steps/list.json" should {
"return JSON" in {
running(... | TechnologyConversations/TechnologyConversationsBdd | test/controllers/StepsControllerSpec.scala | Scala | apache-2.0 | 1,373 |
package org.bitcoins.dlc.oracle.util
import org.bitcoins.core.api.dlcoracle._
import org.bitcoins.core.api.dlcoracle.db._
import org.bitcoins.core.protocol.dlc.compute.SigningVersion
import org.bitcoins.core.protocol.tlv._
import org.bitcoins.core.util.sorted.OrderedNonces
trait EventDbUtil {
/** Takes in a [[Even... | bitcoin-s/bitcoin-s | dlc-oracle/src/main/scala/org/bitcoins/dlc/oracle/util/EventDbUtil.scala | Scala | mit | 3,446 |
package sssg.scanner
import java.io.File
import sssg.domain
import sssg.domain.Content
/**
* sssg.scanner
* User: nk
* Date: 2016-03-14 13:42
*/
trait ContentScanner {
def getContent(file: File): (Iterable[Content], Iterable[domain.Error])
}
| nikosk/sssg | src/main/scala/sssg/scanner/ContentScanner.scala | Scala | mit | 257 |
trait P { def reflected: Boolean }
trait Q { def reflected: Boolean }
class PQ(val reflected: Boolean) extends P with Q { }
trait A
trait B
trait C { val y: P }
class ABC extends A with B with C {
private def reflected = (
Thread.currentThread.getStackTrace
takeWhile (_.getMethodName != "main")
exist... | yusuke2255/dotty | tests/pending/run/t3425b/Base_1.scala | Scala | bsd-3-clause | 2,881 |
package nounou.elements
///**
// * @author ktakagaki
// * //@date 07/13/2014.
// */
//case class Frame(val frame: Int, val segment: Int) {
// def toArray() = Array( frame, segment )
//}
| ktakagaki/nounou.rebooted150527 | src/main/scala/nounou/elements/Frame.scala | Scala | apache-2.0 | 188 |
/*
* Copyright 2014-2021 Netflix, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agr... | brharrington/atlas | atlas-core/src/test/scala/com/netflix/atlas/core/index/QueryIndexSuite.scala | Scala | apache-2.0 | 11,916 |
package services
import spray.http.MediaTypes._
import spray.routing._
trait IndexService extends HttpService {
val indexRoute = path("") {
get {
respondWithMediaType(`text/html`) {
complete {
html.index().toString()
}
}
}
}
}
| max-leuthaeuser/SCROLLDemo | src/main/scala/services/IndexService.scala | Scala | gpl-3.0 | 281 |
/*
* Copyright 2014–2020 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... | slamdata/quasar | common/src/test/scala/quasar/common/data/DataGenerators.scala | Scala | apache-2.0 | 4,805 |
package org.elasticsearch.spark.sql
import scala.collection.mutable.LinkedHashMap
import org.elasticsearch.spark.serialization.ScalaValueReader
import org.elasticsearch.hadoop.cfg.Settings
import org.elasticsearch.hadoop.util.StringUtils
import scala.collection.mutable.ArrayBuffer
class ScalaRowValueReader extends Sc... | Gavin-Yang/elasticsearch-hadoop | spark/sql-12/src/main/scala/org/elasticsearch/spark/sql/ScalaRowValueReader.scala | Scala | apache-2.0 | 567 |
package redis.commands
import java.util.concurrent.TimeUnit
import org.openjdk.jmh.annotations._
import redis.{Redis, RedisStateHelper}
import scala.concurrent.{Future, Await}
@OutputTimeUnit(TimeUnit.SECONDS)
@State(Scope.Benchmark)
class Hgetall extends RedisStateHelper {
@Param(Array("1000", "5000", "10000"))... | etaty/rediscala | benchmark/src/main/scala/redis/commands/Hgetall.scala | Scala | apache-2.0 | 1,603 |
// Generated by the Scala Plugin for the Protocol Buffer Compiler.
// Do not edit!
//
// Protofile syntax: PROTO3
package com.google.protobuf.`type`
import _root_.scalapb.internal.compat.JavaConverters._
/** Enum type definition.
*
* @param name
* Enum type name.
* @param enumvalue
* Enum value definiti... | scalapb/ScalaPB | scalapb-runtime/src/main/scalajvm/com/google/protobuf/type/Enum.scala | Scala | apache-2.0 | 15,134 |
package org.denigma.kappa.notebook.views.common
import org.scalajs.dom._
import scala.scalajs.js
import scala.scalajs.js.annotation.{JSName, ScalaJSDefined}
object PopStateEventExt {
implicit def fromPop(ev: PopStateEvent): PopStateEventExt = {
new PopStateEventExt(ev.`type`, ev.state, ev.bubbles)
}
}
@js.n... | antonkulaga/kappa-notebook | app/js/src/main/scala/org/denigma/kappa/notebook/views/common/PopStateEventExt.scala | Scala | mpl-2.0 | 639 |
/*
* Part of GDL book_api.
* Copyright (C) 2017 Global Digital Library
*
* See LICENSE
*/
package io.digitallibrary.bookapi
import com.typesafe.scalalogging.LazyLogging
import io.digitallibrary.language.model.LanguageTag
import io.digitallibrary.network.Domains
import io.digitallibrary.network.secrets.PropertyK... | GlobalDigitalLibraryio/book-api | src/main/scala/io/digitallibrary/bookapi/BookApiProperties.scala | Scala | apache-2.0 | 5,599 |
/*
* 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 | mongodb/src/main/scala/quasar/physical/mongodb/MongoDbIO.scala | Scala | apache-2.0 | 16,760 |
/* Copyright (C) 2012-2013 Treode, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agr... | Treode/cps | src/test/scala/com/treode/cps/stub/scheduler/RandomSpec.scala | Scala | apache-2.0 | 1,323 |
package com.twitter.inject.thrift
import com.twitter
import com.twitter.concurrent.AsyncSemaphore
import com.twitter.finagle
import com.twitter.finagle._
import com.twitter.finagle.exp.BackupRequestFilter
import com.twitter.finagle.filter.RequestSemaphoreFilter
import com.twitter.finagle.param.HighResTimer
import com.... | syamantm/finatra | inject/inject-thrift-client/src/main/scala/com/twitter/inject/thrift/ThriftClientFilterChain.scala | Scala | apache-2.0 | 9,366 |
/*
active-learning-scala: Active Learning library for Scala
Copyright (c) 2014 Davi Pereira dos Santos
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
... | active-learning/active-learning-scala | src/main/scala/app/db/ClassName.scala | Scala | gpl-2.0 | 888 |
package scutil.jcollection.extension
import java.lang.{
Iterable => JIterable
}
object IterableJCollectionSyntaxImplicits extends IterableJCollectionSyntaxImplicits
trait IterableJCollectionSyntaxImplicits {
implicit final class IterableJCollectionSyntaxExt[T](peer:Iterable[T]) {
def toJIterable:JIterable[T] = n... | ritschwumm/scutil | modules/jdk/src/main/scala/scutil/jcollection/extension/IterableJCollectionSyntaxImplicits.scala | Scala | bsd-2-clause | 354 |
/*
* 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 ... | gyfora/flink | flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/plan/nodes/datastream/DataStreamPythonCalc.scala | Scala | apache-2.0 | 4,903 |
package unfiltered.netty
import unfiltered.util.RunnableServer
import java.util.concurrent.Executors
import org.jboss.netty.bootstrap.ServerBootstrap
import org.jboss.netty.channel.socket.nio.NioServerSocketChannelFactory
import java.net.InetSocketAddress
import org.jboss.netty.handler.codec.http.{HttpRequestDecoder, ... | softprops/Unfiltered | netty-server/src/main/scala/servers.scala | Scala | mit | 3,857 |
package hello
import org.springframework.boot.SpringApplication
import org.springframework.context.annotation._
import org.springframework.boot.autoconfigure.EnableAutoConfiguration
/**
* This object bootstraps Spring Boot web application.
* Via Gradle: gradle bootRun
*
* @author rajas
* @since 1.0
*/
@EnableA... | rajashegiste/hello | src/main/scala/hello/HelloWebApplication.scala | Scala | mit | 454 |
package at.logic.gapt.prooftool
/**
* Created by IntelliJ IDEA.
* User: mrukhaia
* Date: Oct 27, 2010
* Time: 12:08:33 PM
*/
import at.logic.gapt.formats.xml.{ ProofDatabase, XMLExporter }
import at.logic.gapt.proofs.lk.algorithms._
import at.logic.gapt.proofs.lksk.algorithms.eliminateDefinitions
import at.logic... | gisellemnr/gapt | src/main/scala/at/logic/gapt/prooftool/Main.scala | Scala | gpl-3.0 | 38,115 |
/*
* Copyright (c) 2011, Daniel Spiewak
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* - Redistributions of source code must retain the above copyright notice, this
* list of cond... | djspiewak/anti-xml | src/main/scala/com/codecommit/antixml/conversion.scala | Scala | bsd-3-clause | 7,765 |
/*
* Copyright 2022 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/iht-frontend | test/iht/controllers/application/debts/DebtsOverviewControllerTest.scala | Scala | apache-2.0 | 3,014 |
class A {
val a: Int | String = 1
val b: AnyVal = 2
val c = List(a, b)
val c1: List[AnyVal | String] = c
}
| lampepfl/dotty | tests/pos/preserve-union.scala | Scala | apache-2.0 | 116 |
package clashcode.robot
import scala.util.Random
case class EvalResult(points: Int, path: List[FieldPos])
/**
* The evaluator checks how well a robot performs and calculates its points (=fitness).
*
* The robot is evaluated on 200 different fields of size 10x10.
* Those fields are always the same pseudo-randomly... | clashcode/akka-workshop-backend | app/clashcode/robot/Evaluator.scala | Scala | mit | 1,716 |
package org.jetbrains.plugins.scala
package lang
package completion3
import com.intellij.codeInsight.completion.CompletionType.SMART
import com.intellij.testFramework.EditorTestUtil
/**
* @author Alexander Podkhalyuzin
*/
class ScalaSomeSmartCompletionTest extends ScalaCodeInsightTestBase {
import EditorTestUt... | loskutov/intellij-scala | test/org/jetbrains/plugins/scala/lang/completion3/ScalaSomeSmartCompletionTest.scala | Scala | apache-2.0 | 4,071 |
package geotrellis.raster.op.local
import geotrellis._
import geotrellis._
/**
* Local operations involve each individual value in a raster without information
* about other values in the raster.
*/
trait LocalOperation extends Op[Raster] {}
| Tjoene/thesis | Case_Programs/geotrellis-0.7.0/src/main/scala/geotrellis/raster/op/local/LocalOperation.scala | Scala | gpl-2.0 | 248 |
package com.scalaAsm.x86
package Instructions
package x87
// Description: Exchange Register Contents
// Category: general/datamov
trait FXCH extends InstructionDefinition {
val mnemonic = "FXCH"
}
object FXCH extends ZeroOperands[FXCH] with FXCHImpl
trait FXCHImpl extends FXCH {
implicit object _0 extends NoOp{... | bdwashbu/scala-x86-inst | src/main/scala/com/scalaAsm/x86/Instructions/x87/FXCH.scala | Scala | apache-2.0 | 412 |
package com.scalainaction.mongo
import com.mongodb.Mongo
class MongoClient(val host:String, val port:Int) {
require(host != null, "You have to provide a host name")
private val mongo = new Mongo(host, port)
def this() = this("127.0.0.1", 27017)
def version = mongo.getVersion
def dropDB(name:String) =... | delor/learning-scala | scala-in-action/src/main/scala/com/scalainaction/mongo/MongoClient.scala | Scala | unlicense | 446 |
package org.ai4fm.filehistory.core
import java.io.File
/**
* @author Andrius Velykis
*/
object FileHistoryUtil {
def historyManager(historyRoot: File, historyFileDir: File): IFileHistoryManager =
new org.ai4fm.filehistory.core.internal.FileHistoryManager(historyRoot, historyFileDir)
}
| andriusvelykis/proofprocess | org.ai4fm.filehistory.core/src/org/ai4fm/filehistory/core/FileHistoryUtil.scala | Scala | epl-1.0 | 302 |
package mgoeminne.scalaggplot.aes
case class group_order() extends Aesthetic | mgoeminne/scala-ggplot | src/main/scala/mgoeminne/scalaggplot/aes/group_order.scala | Scala | lgpl-3.0 | 77 |
package codesniffer.core
import java.io.InputStream
import java.util.Properties
import com.caibowen.gplume.misc.Str.Utils._
import com.caibowen.gplume.resource.{InputStreamCallback, InputStreamProviderProxy, InputStreamSupport}
import scala.collection.JavaConversions._
/**
* @author BowenCai
* @since ... | xkommando/CodeSniffer | core/src/main/scala/codesniffer/core/StrLoader.scala | Scala | lgpl-3.0 | 1,724 |
package com.logentries.scala
import org.apache.log4j.LogManager
object Main {
def main(args: Array[String]) {
val log = LogManager.getRootLogger()
log.debug("Hello, Scala world!")
Thread.sleep(1000)
}
}
| m0wfo/logentries-scala-demo | src/main/scala/com/logentries/scala/Main.scala | Scala | mit | 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 ... | Aegeaner/spark | sql/core/src/main/scala/org/apache/spark/sql/internal/BaseSessionStateBuilder.scala | Scala | apache-2.0 | 11,904 |
package org.scalatra.commands
import grizzled.slf4j.Logger
import mojolly.inflector.InflectorImports._
import org.scalatra.validation._
import scala.annotation.implicitNotFound
import scala.concurrent.{ ExecutionContext, Future }
import scala.util.{ Try, Failure => Fail, Success => Succ }
import scalaz.{ Failure, _ }... | seratch/scalatra | commands/src/main/scala/org/scalatra/commands/executors.scala | Scala | bsd-2-clause | 6,982 |
/*
* Copyright 2009 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... | stevej/scala-stats | src/test/scala/com/twitter/stats/StatsSocketSpec.scala | Scala | apache-2.0 | 2,353 |
package models.request
import models.Task
import play.api.libs.functional.syntax._
import play.api.libs.json.Reads._
import play.api.libs.json._
sealed case class JobResult(task: Task, log: Seq[String])
object JobResult {
implicit val jobResultReads: Reads[JobResult] = (
(JsPath \\ "task").read[Task] and
... | kuhnuri/kuhnuri-queue | app/models/request/JobResult.scala | Scala | apache-2.0 | 385 |
package sfc.placement
import sfc.placement.Vertex.Vertex
class Intersection(val x: Int, val y: Int) {
override def toString = "(" + x + "," + y + ")"
val hasAboveAdjacent = x % 2 != y % 2
def adjacentPositionArgs[T](
whenTopOfHexagon: Intersection => Set[T], whenBottomOfHexagon: Intersection => Set[T]): S... | noel-yap/setter-for-catan | src/main/sfc/placement/Intersection.scala | Scala | apache-2.0 | 1,635 |
package controllers
import com.yetu.oauth2resource.actions.Authorized
import play.api.mvc._
import scala.concurrent.Future
class Application(auth: Authorized) extends Controller {
def index = auth.async {
Future.successful(Ok("Great! The access token you provided was correct."))
}
} | yetu/oauth2-resource-server | sampleOAuth2ResourceServer/app/controllers/Application.scala | Scala | mit | 297 |
package scoverage
import scala.collection.mutable.HashMap
import scalajssupport.{
File => SupportFile,
FileWriter => SupportFileWriter,
FileFilter => SupportFileFilter,
Source => SupportSource
}
object Platform {
type ThreadSafeMap[A, B] = HashMap[A, B]
lazy val ThreadSafeMap = HashMap
type File = Supp... | gslowikowski/scalac-scoverage-plugin | scalac-scoverage-runtime/js/src/main/scala/scoverage/Platform.scala | Scala | apache-2.0 | 441 |
package com.giyeok.jparser
import com.giyeok.jparser.utils.UnicodeUtil
import com.giyeok.jparser.Inputs.CharsGrouping
import scala.collection.immutable.ListSet
object Symbols {
sealed trait Symbol {
val id: Int = Symbol.getId(this)
}
object Symbol {
private var symbolsMap: Map[Symbol, I... | Joonsoo/moon-parser | base/src/main/scala/com/giyeok/jparser/Symbols.scala | Scala | mit | 10,970 |
package blockplus.context
import blockplus.Color
import scala.collection.JavaConversions._
import blockplus.move.Move
import scala.language.postfixOps
object Scorer {
def apply(history: MoveHistory): Map[Color, Int] = (
for (
(color, moves) <- history.data.groupBy(_.getColor)
) yield (color... | arie-benichou/blockplus | src/main/scala/blockplus/context/Scorer.scala | Scala | gpl-3.0 | 735 |
package terminationProofs
import leon._
import mem._
import higherorder._
import lang._
import annotation._
import instrumentation._
import invariant._
object SortingnConcat {
sealed abstract class LList {
@inline
def isEmpty: Boolean = this == SNil()
lazy val tail: LList = {
require(!isEmpty)
... | epfl-lara/leon | testcases/lazy-datastructures/terminationProofs/SortingnConcat.scala | Scala | gpl-3.0 | 3,081 |
package com.gxq.learn.recontool.utils
import com.gxq.learn.recontool.entity.ReconToolTSchema
import org.apache.spark.SparkContext
import play.api.libs.json.Json
import play.api.libs.json.JsValue
import play.api.libs.json.JsResult
import play.api.libs.json.JsSuccess
import play.api.libs.json.JsPath
import play.api.libs... | gong1989313/spark-bigdata | gpfDWReconTool/src/main/scala/com/gxq/learn/recontool/utils/TSchemaUtil.scala | Scala | apache-2.0 | 1,227 |
package com.gilt.handlebars.scala.partial
import java.io.File
import java.nio.charset.CodingErrorAction
import com.gilt.handlebars.scala.binding.BindingFactory
import com.gilt.handlebars.scala.parser._
import com.gilt.handlebars.scala.{Handlebars, HandlebarsImpl}
import scala.io.{Codec, Source}
/**
* @author chick... | mwunsch/handlebars.scala | src/main/scala/com/gilt/handlebars/scala/partial/PartialHelper.scala | Scala | apache-2.0 | 3,201 |
package com.twitter.finatra.httpclient.modules
import com.google.inject.Provides
import com.twitter.finagle.Service
import com.twitter.finagle.http.{Request, Response}
import com.twitter.finatra.httpclient.{HttpClient, RichHttpClient}
import com.twitter.finatra.json.FinatraObjectMapper
import com.twitter.inject.Twitte... | kaushik94/finatra | httpclient/src/main/scala/com/twitter/finatra/httpclient/modules/HttpClientModule.scala | Scala | apache-2.0 | 853 |
package com.twitter.finagle.pool
import com.twitter.finagle._
import com.twitter.finagle.stats.{NullStatsReceiver, StatsReceiver}
import com.twitter.util.{Future, Promise, Time, Throw, Return}
import java.util.ArrayDeque
import scala.annotation.tailrec
import scala.collection.JavaConverters._
object WatermarkPool {
... | mkhq/finagle | finagle-core/src/main/scala/com/twitter/finagle/pool/WatermarkPool.scala | Scala | apache-2.0 | 6,162 |
/** Copyright 2016 - 2021 Martin Mauch (@nightscape)
*
* 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... | crealytics/spark-excel | src/main/scala/com/crealytics/spark/v2/excel/ExcelHelper.scala | Scala | apache-2.0 | 7,242 |
/*
* Copyright (c) 2021, salesforce.com, inc.
* All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
*/
package com.krux.hyperion.aws
/**
* @param hostname The host of the proxy which Task Run... | realstraw/hyperion | core/src/main/scala/com/krux/hyperion/aws/AdpHttpProxy.scala | Scala | bsd-3-clause | 1,012 |
package pl.touk.nussknacker.engine.benchmarks.interpreter
import java.util.concurrent.TimeUnit
import cats.effect.IO
import org.openjdk.jmh.annotations.{Benchmark, BenchmarkMode, Mode, OutputTimeUnit, Scope, State}
import pl.touk.nussknacker.engine.api.{Context, MethodToInvoke, ParamName, Service}
import pl.touk.nuss... | TouK/nussknacker | benchmarks/src/test/scala/pl/touk/nussknacker/engine/benchmarks/interpreter/ManyParamsInterpreterBenchmark.scala | Scala | apache-2.0 | 3,363 |
/*
* Copyright (C) 2014 Ivan Cukic <ivan at mi.sanu.ac.rs>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published
* by the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version... | ivan-cukic/litef-conductor | src/main/scala/dataapi/DataspaceService.scala | Scala | apache-2.0 | 9,436 |
object Test {
val a = 42
def main(args: Array[String]) = {
val a: Int = a // error
}
}
| som-snytt/dotty | tests/neg/i2005.scala | Scala | apache-2.0 | 98 |
package org.hammerlab.guacamole.windowing
import org.hammerlab.genomics.loci.set.test.TestLociSet
import org.hammerlab.guacamole.reads.ReadsUtil
import org.scalatest.{FunSuite, Matchers}
class SlidingWindowSuite
extends FunSuite
with Matchers
with ReadsUtil {
test("test sliding read window, duplicate rea... | hammerlab/guacamole | src/test/scala/org/hammerlab/guacamole/windowing/SlidingWindowSuite.scala | Scala | apache-2.0 | 9,389 |
package p
object X {
val x = 42
}
| scala/scala | test/files/pos/ambiguous-same/p.scala | Scala | apache-2.0 | 37 |
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.