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 2013 Marek Radonsky
*
* 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 ... | radonsky/Taurus | app/Global.scala | Scala | apache-2.0 | 916 |
package omnibus.api.exceptions
class RequestTimeoutException extends Exception("The request is taking longer than expected") | agourlay/omnibus | src/main/scala/omnibus/api/exceptions/RequestExceptions.scala | Scala | apache-2.0 | 125 |
/*
* Copyright (c) 2012-2017 Snowplow Analytics Ltd. All rights reserved.
*
* This program is licensed to you under the Apache License Version 2.0,
* and you may not use this file except in compliance with the Apache License Version 2.0.
* You may obtain a copy of the Apache License Version 2.0 at http://www.apach... | snowplow/iglu | 0-common/scala-core/iglu-core-circe/src/test/scala/com/snowplowanalytics/iglu/core/circe/ContainersSpec.scala | Scala | apache-2.0 | 5,399 |
package rere.ql.queries
import java.util.UUID
import io.circe.{Json, JsonObject}
import rere.ql.types._
import rere.ql.values._
/**
* Implicit converters for standard types
*/
trait ValueQueries {
implicit def expr(nullRef: Null): ReqlNull = new ReqlNullQuery(nullRef)
implicit def expr(bool: Boolean): Reql... | pbaun/rere | modules/ql/src/main/scala/rere/ql/queries/ValueQueries.scala | Scala | apache-2.0 | 1,392 |
// Copyright 2012 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 to in writing,... | lookout/zipkin | zipkin-cassandra/src/main/scala/com/twitter/cassie/ClusterRemapper.scala | Scala | apache-2.0 | 4,143 |
class C {
def foo(a: Int): Unit = () => a
}
| folone/dotty | tests/untried/pos/t6028/t6028_1.scala | Scala | bsd-3-clause | 48 |
package controllers.circs.report_changes
import app.ConfigProperties._
import play.api.test.FakeRequest
import models.domain.{CircumstancesOtherInfo, MockForm}
import models.view.CachedChangeOfCircs
import play.api.test.Helpers._
import org.specs2.mutable._
import utils.pageobjects.circumstances.report_changes.GOtherC... | Department-for-Work-and-Pensions/ClaimCapture | c3/test/controllers/circs/report_changes/GOtherChangeInfoSpec.scala | Scala | mit | 2,647 |
/*
* Copyright (C) 2012-2014 Typesafe Inc. <http://www.typesafe.com>
*/
package com.qifun.statelessFuture
package test
package neg
import org.junit.Test
class NakedAwait {
@Test
def `await only allowed in async neg`() {
import _root_.com.qifun.statelessFuture.test.Async._
expectError("`await` must be e... | Atry/stateless-future-test | test/src/test/scala/com/qifun/statelessFuture/test/neg/NakedAwait.scala | Scala | bsd-3-clause | 4,220 |
/*
* Copyright 2012 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 ... | coursera/zipkin | zipkin-query/src/main/scala/com/twitter/zipkin/query/ThriftQueryService.scala | Scala | apache-2.0 | 6,996 |
package net.ultrametrics.fractactor
import scala.swing._
import java.awt.image.BufferedImage
class RenderPanel() extends Panel
{
var image = null : BufferedImage
def create(width: Int, height: Int) {
image = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB)
// set initial background white to... | pchuck/fractactor | src/main/scala/net/ultrametrics/fractactor/RenderPanel.scala | Scala | bsd-2-clause | 728 |
/**
* Copyright (C) 2007 Orbeon, Inc.
*
* This program is free software; you can redistribute it and/or modify it under the terms of the
* GNU Lesser General Public License as published by the Free Software Foundation; either version
* 2.1 of the License, or (at your option) any later version.
*
* This prog... | brunobuzzi/orbeon-forms | xforms/jvm/src/main/scala/org/orbeon/oxf/xforms/analysis/PartModelAnalysis.scala | Scala | lgpl-2.1 | 3,417 |
/*
* 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 ... | sryza/spark | graphx/src/test/scala/org/apache/spark/graphx/GraphOpsSuite.scala | Scala | apache-2.0 | 7,233 |
/*
* Copyright 2017 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... | liquidarmour/ct-calculations | src/main/scala/uk/gov/hmrc/ct/accounts/approval/boxes/AC199A.scala | Scala | apache-2.0 | 1,247 |
package com.gilt.pickling.avro
import com.gilt.pickling.TestObjs.{SelfReferencingObject, SingleOptionObject}
import org.apache.avro.Schema
import com.gilt.pickling.TestUtils._
import scala.Some
import org.apache.avro.generic.GenericData
import org.scalatest.{Assertions, FunSuite}
import scala.pickling._
object Comple... | gilt/gfc-avro | src/test/scala/com/gilt/pickling/avro/SelfReferenceObjectsTest.scala | Scala | apache-2.0 | 1,623 |
package com.btcontract.wallet
import Utils._
import R.string._
import android.net.Uri
import android.text._
import android.view._
import android.webkit.URLUtil
import android.widget._
import com.google.common.io.Files
import org.bitcoinj.core._
import org.bitcoinj.core.listeners._
import android.widget.RadioGroup.OnCh... | btcontract/VisualBitcoinWallet | app/src/main/java/com/btcontract/wallet/Utils.scala | Scala | gpl-3.0 | 26,114 |
package com.wangc.fast.p2
import scala.collection.immutable.StringOps
/**
* Created by wangchao on 2017/6/6.
*/
object Study2_test {
def main(args: Array[String]): Unit = {
println( test1(1) )
test2()
test4()
test6("Hello")
var so = new StringOps("asdfghjkl")
println(so*3)
println... | wang153723482/HelloWorld_my | HelloWorld_scala/src/com/wangc/fast/p2/Study2_test.scala | Scala | apache-2.0 | 1,058 |
package org.workcraft.graphics
import java.awt.geom.AffineTransform
import java.awt.geom.CubicCurve2D
import java.awt.geom.NoninvertibleTransformException
import java.awt.geom.Point2D
import java.awt.geom.Rectangle2D
import Java2DDecoration._
import java.awt.Color
import java.awt.Stroke
trait ParametricCurve {
def ... | tuura/workcraft-2.2 | Graphics/src/main/scala/org/workcraft/graphics/Geometry.scala | Scala | gpl-3.0 | 4,521 |
/*
Copyright 2016-17, Hasso-Plattner-Institut fuer Softwaresystemtechnik GmbH
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... | bpn1/ingestion | src/test/scala/de/hpi/ingestion/datalake/models/TestData.scala | Scala | apache-2.0 | 6,856 |
package elastic
import akka.actor.Actor.Receive
import akka.actor.{Props, Actor, ActorRef, ActorSystem}
import com.google.inject.Inject
import elastic.core.ElasticConnection
import elastic.requester._
import play.api.Logger
import scala.concurrent.Future
/**
* @author Artem Arakcheev
* @since 24.06.15
*/
trait E... | reactools/play-elastic-scala | app/elastic/ElasticDriver.scala | Scala | apache-2.0 | 1,114 |
/*
* 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 ... | aokolnychyi/spark | sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetInteroperabilitySuite.scala | Scala | apache-2.0 | 2,874 |
/*
* 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 | examples/src/main/scala/org/apache/spark/examples/ml/CountVectorizerExample.scala | Scala | apache-2.0 | 1,979 |
package jsky.app.ot.gemini.editor.auxfile
import edu.gemini.auxfile.api.{AuxFile, AuxFileException}
import jsky.app.ot.OTOptions
import scala.collection.JavaConverters._
import scala.swing.Component
class CheckAction(c: Component, model: AuxFileModel) extends AuxFileAction("Mark Checked", c, model) {
reactions += ... | arturog8m/ocs | bundle/jsky.app.ot/src/main/scala/jsky/app/ot/gemini/editor/auxfile/CheckAction.scala | Scala | bsd-3-clause | 1,076 |
package com.twitter.finagle.factory
import java.util.concurrent.locks.ReentrantReadWriteLock
import java.util.concurrent.atomic.AtomicInteger
import com.twitter.finagle.{Status, Service, ServiceFactory, ClientConnection, ServiceProxy, ServiceFactoryProxy}
import com.twitter.util.{Closable, Future, Stopwatch, Throw, Re... | lysu/finagle | finagle-core/src/main/scala/com/twitter/finagle/factory/ServiceFactoryCache.scala | Scala | apache-2.0 | 5,423 |
import stainless.lang._
import stainless.proof._
import stainless.annotation._
object Laws1 {
abstract class SomeLaw {
def value: BigInt
@law
def lawNotZero: Boolean = {
value != 0
}
}
abstract class RefinedLaw extends SomeLaw {
@law
override def lawNotZero: Boolean = {
va... | epfl-lara/stainless | frontends/benchmarks/verification/valid/MicroTests/Laws1.scala | Scala | apache-2.0 | 562 |
/**
* Swaggy Jenkins
* Jenkins API clients generated from Swagger / Open API specification
*
* The version of the OpenAPI document: 1.1.2-pre.0
* Contact: [email protected]
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not ed... | cliffano/swaggy-jenkins | clients/scala-httpclient-deprecated/generated/src/main/scala/org/openapitools/client/model/PipelineBranchesitemlatestRun.scala | Scala | mit | 945 |
/**
* Copyright 2011-2016 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... | ryez/gatling | gatling-jms/src/main/scala/io/gatling/jms/client/SimpleJmsClient.scala | Scala | apache-2.0 | 5,942 |
/*
* Copyright (C) 09/09/13 Romain Reuillon
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This pr... | ISCPIF/PSEExperiments | simpuzzle-src/models/sugarscape/src/main/scala/fr/geocites/sugarscape/SugarScapeState.scala | Scala | agpl-3.0 | 1,639 |
package org.jetbrains.plugins.scala.lang.dfa.invocationInfo.tests
import org.jetbrains.plugins.scala.lang.dfa.invocationInfo.InvocationInfoTestBase
import org.jetbrains.plugins.scala.lang.dfa.invocationInfo.arguments.Argument.{PassByName, PassByValue}
class RegularMethodCallInfoTest extends InvocationInfoTestBase {
... | JetBrains/intellij-scala | scala/scala-impl/test/org/jetbrains/plugins/scala/lang/dfa/invocationInfo/tests/RegularMethodCallInfoTest.scala | Scala | apache-2.0 | 7,217 |
/** **\\
** Copyright (c) 2012 Center for Organic and Medicinal Chemistry **
** Zurich University of Applied Sciences **
** Wรคdenswil, Switzerland **
\\** ... | stefan-hoeck/chemf | src/test/scala/chemf/graph/EdgeTest.scala | Scala | gpl-3.0 | 1,515 |
package org.jetbrains.plugins.scala.lang.dataFlow.impl.reachingDefs
import com.intellij.openapi.util.TextRange
import com.intellij.psi.util.PsiTreeUtil
import org.jetbrains.plugins.scala.ScalaFileType
import org.jetbrains.plugins.scala.base.ScalaLightCodeInsightFixtureTestAdapter
import org.jetbrains.plugins.scala.lan... | JetBrains/intellij-scala | scala/scala-impl/test/org/jetbrains/plugins/scala/lang/dataFlow/impl/reachingDefs/ReachingDefinitionsCollectorTest.scala | Scala | apache-2.0 | 2,824 |
package edu.berkeley.eecs.btrdb.sparkconn.rdd.partitioner
class QuasarRDDPartitioner {
}
| SoftwareDefinedBuildings/quasar-spark-connector | src/main/scala/edu/berkeley/eecs/btrdb/sparkconn/rdd/partitioner/QuasarRDDPartitioner.scala | Scala | gpl-3.0 | 91 |
/**
* 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"); yo... | mihbor/kafka | core/src/test/scala/unit/kafka/server/AlterReplicaLogDirsRequestTest.scala | Scala | apache-2.0 | 6,227 |
/*
* 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/main/scala/com/intel/analytics/bigdl/nn/keras/GaussianDropout.scala | Scala | apache-2.0 | 2,106 |
import scala.io.StdIn
/**
* <a href="https://www.urionlinejudge.com.br/judge/en/problems/view/1726">1726 Friends</a>
*
* @author ricardo.staroski
*/
object Main {
def main(args: Array[String]) {
var line: String = StdIn.readLine();
while (line != null) {
println(parseUnionOrDiffere... | staroski/URIOnlineJudge | 1726-friends-scala/src/Main.scala | Scala | gpl-3.0 | 5,288 |
/*
* Copyright 2001-2015 Artima, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agre... | dotty-staging/scalatest | examples/src/test/scala/org/scalatest/examples/asyncfeaturespec/beforeandafter/ExampleSpec.scala | Scala | apache-2.0 | 2,179 |
package org.scalatra
import java.net.URI
import javax.servlet.http.{HttpServletRequest, HttpServletResponse}
import servlet.ServletApiImplicits
/**
* Redirects unsecured requests to the corresponding secure URL.
*/
trait SslRequirement extends Handler with ServletApiImplicits {
abstract override def handle(req: H... | etorreborre/scalatra | core/src/main/scala/org/scalatra/SslRequirement.scala | Scala | bsd-2-clause | 928 |
/**
* 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... | unix1986/universe | tool/kafka-0.8.1.1-src/core/src/main/scala/kafka/api/OffsetResponse.scala | Scala | bsd-2-clause | 3,523 |
package models.gitolite
import org.joda.time.DateTime
import scalikejdbc._
case class UsersProjects(
id: Int,
userId: Int,
projectId: Int,
createdAt: DateTime,
updatedAt: DateTime,
projectAccess: Int,
generatedForPublicAccess: Option[Boolean] = None) {
def save()(implicit session: DBSession = UsersP... | thomaschoo/gitolite-to-gitbucket | src/main/scala/models/gitolite/UsersProjects.scala | Scala | mit | 4,293 |
package org.jetbrains.plugins.scala.worksheet.settings.ui
import com.intellij.application.options.ModulesComboBox
import com.intellij.core.JavaPsiBundle
import com.intellij.execution.ui.ConfigurationModuleSelector
import com.intellij.openapi.project.Project
import com.intellij.openapi.ui.ComboBox
import com.intellij.o... | JetBrains/intellij-scala | scala/worksheet/src/org/jetbrains/plugins/scala/worksheet/settings/ui/WorksheetSettingsPanel.scala | Scala | apache-2.0 | 6,682 |
/*
* OneTimeMPE.scala
* One-time algorithms that compute the most likely values of elements.
*
* Created By: Avi Pfeffer ([email protected])
* Creation Date: Jan 1, 2009
*
* Copyright 2013 Avrom J. Pfeffer and Charles River Analytics, Inc.
* See http://www.cra.com or email [email protected] for information... | jyuhuan/figaro | Figaro/src/main/scala/com/cra/figaro/algorithm/OneTimeMPE.scala | Scala | bsd-3-clause | 783 |
/*
* Copyright 2014 [email protected]
*
* 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... | mengke/eventful | eventful-core/src/main/scala/io/ibntab/eventful/aggregate/Aggregator.scala | Scala | apache-2.0 | 1,571 |
/* Generated File */
package models.queries.store
import com.kyleu.projectile.models.database.{DatabaseField, Row}
import com.kyleu.projectile.models.database.DatabaseFieldType._
import com.kyleu.projectile.models.queries.{BaseQueries, ResultFieldHelper}
import com.kyleu.projectile.models.result.data.DataField
import ... | KyleU/boilerplay | app/models/queries/store/StoreRowQueries.scala | Scala | cc0-1.0 | 5,165 |
import scala.language.dynamics
object MyDynamic extends Dynamic {
def selectDynamic(name: String): Any = ???
}
object Test extends App {
locally {
import java.lang.String
MyDynamic.id
}
}
| som-snytt/dotty | tests/pos/t8364.scala | Scala | apache-2.0 | 204 |
package com.karasiq.bittorrent.dispatcher
import java.net.InetSocketAddress
import akka.util.ByteString
import com.karasiq.bittorrent.protocol.extensions.PeerExtensions
import scala.collection.BitSet
trait TorrentPeerInfo {
def id: ByteString
def infoHash: ByteString
def completed: BitSet
}
case class PeerDa... | Karasiq/torrentstream | library/src/main/scala/com/karasiq/bittorrent/dispatcher/PeerData.scala | Scala | apache-2.0 | 802 |
/** MACHINE-GENERATED FROM AVRO SCHEMA. DO NOT EDIT DIRECTLY */
package example.idl.java
import other.ns.java.{ExternalDependency, Suit}
sealed trait ImportProtocol extends Product with Serializable
final case class DependentRecord(dependency: ExternalDependency, number: Int) extends ImportProtocol
final case class... | julianpeeters/avrohugger | avrohugger-core/src/test/expected/standard/example/idl/java/ImportProtocol.scala | Scala | apache-2.0 | 488 |
class P {
trait S1
val p = new P
trait S2 {
def f(x: p.S1): Int
}
}
class P2 extends P {
object O2 extends S2 {
def f(x: S1) = 5
}
}
| yusuke2255/dotty | tests/untried/neg/abstract-class-2.scala | Scala | bsd-3-clause | 155 |
package chee.cli
import com.typesafe.config.{Config, ConfigFactory, ConfigRenderOptions}
class ConfigCmd extends ScoptCommand {
case class Opts(
render: ConfigRenderOptions = ConfigRenderOptions.defaults().setOriginComments(false).setJson(false),
all: Boolean = false
)
type T = Opts
val defaults = ... | eikek/chee | src/main/scala/chee/cli/ConfigCmd.scala | Scala | gpl-3.0 | 1,072 |
package scales.report
import scales.Coverage
/** @author Stephen Samuel */
trait ScalesWriter {
def write(coverage: Coverage)
}
| crvidya/scales | src/main/scala/scales/report/ScalesWriter.scala | Scala | apache-2.0 | 135 |
package org.jetbrains.plugins.scala
package codeInspection
package scaladoc
import com.intellij.codeInspection._
import com.intellij.psi.{PsiElement, PsiElementVisitor, PsiErrorElement}
import org.jetbrains.plugins.scala.lang.psi.api.ScalaPsiElement
import org.jetbrains.plugins.scala.lang.psi.api.ScalaElementVisitor
i... | JetBrains/intellij-scala | scala/scala-impl/src/org/jetbrains/plugins/scala/codeInspection/scaladoc/ScalaDocParserErrorInspection.scala | Scala | apache-2.0 | 1,747 |
/**************************************************************************
Copyright 2014 Allen Institute for Artificial Intelligence Foundation
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 Li... | tomkwiat/dependency-graph-similarity-measure | src/main/scala/org/allenai/ari/solvers/graphmatch/tools/GraphToPhrase.scala | Scala | apache-2.0 | 3,245 |
/*
* 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 ... | andrewor14/iolap | sql/core/src/main/scala/org/apache/spark/sql/execution/joins/CartesianProduct.scala | Scala | apache-2.0 | 2,251 |
package eu.shiftforward.icfpc2015.model
case class UnitPos(unit: CellUnit, pos: Cell) {
lazy val cells: Set[Cell] = {
val cubedPos = pos.cube
val cubedUnitPivot = unit.pivot.cube
val (x, y, z) = (cubedPos.x - cubedUnitPivot.x, cubedPos.y - cubedUnitPivot.y, cubedPos.z - cubedUnitPivot.z)
unit.member... | ShiftForward/icfpc2015 | src/main/scala/eu/shiftforward/icfpc2015/model/UnitPos.scala | Scala | mit | 652 |
/*
* Copyright (c) 2014-2020 by The Monix Project Developers.
* See the project homepage at: https://monix.io
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache... | alexandru/monifu | monix-reactive/shared/src/main/scala/monix/reactive/internal/consumers/TransformInputConsumer.scala | Scala | apache-2.0 | 1,502 |
package org.coursera.naptime.ari.graphql.schema
import org.coursera.naptime.ResourceName
sealed trait SchemaError {
def resourceName: ResourceName
def key: String
def message: String
}
case class HasGetButMissingMultiGet(resourceName: ResourceName) extends SchemaError {
val key = "HAS_GET_BUT_MISSING_MULTIGE... | coursera/naptime | naptime-graphql/src/main/scala/org/coursera/naptime/ari/graphql/schema/SchemaErrors.scala | Scala | apache-2.0 | 2,338 |
/*
* Copyright 2016 The BigDL Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agr... | intel-analytics/BigDL | scala/dllib/src/test/scala/com/intel/analytics/bigdl/dllib/nn/ClampSpec.scala | Scala | apache-2.0 | 1,059 |
package com.socrata.teaparty.components
import com.socrata.teaparty.{TeaPot, TeaType}
import com.socrata.teaparty.teadatabase.TeaDatabase
trait TeaReaderComponent {
type TeaReader <: TeaReaderLike
trait TeaReaderLike {
def lookupTea(tea:TeaType):Option[TeaPot]
def list:List[TeaType]
}
def TeaReader(... | socrata-platform/socrata-httparty | src/main/scala/com/socrata/teaparty/components/TeaReaderComponent.scala | Scala | mit | 697 |
package com.github.sstone.amqp.samples
import akka.pattern.ask
import akka.actor.{Actor, Props, ActorSystem}
import com.github.sstone.amqp._
import com.github.sstone.amqp.Amqp._
import com.github.sstone.amqp.RpcServer.{ProcessResult, IProcessor}
import com.github.sstone.amqp.RpcClient.Request
import akka.util.Timeout
... | sstone/amqp-client | src/main/scala/com/github/sstone/amqp/samples/OneToAnyRpc.scala | Scala | mit | 2,830 |
package mr.merc.politics
import mr.merc.economics.{Population, WorldConstants, WorldStateParliamentActions}
import mr.merc.log.Logging
import mr.merc.politics.PoliticsAi.{ChangeParty, GiveUpPower, PoliticsAiAction, UsurpPower}
import mr.merc.politics.Regime.{Absolute, Constitutional, Democracy}
class PoliticsAi(state... | RenualdMarch/merc | src/main/scala/mr/merc/politics/PoliticsAi.scala | Scala | gpl-3.0 | 3,523 |
package com.sksamuel.elastic4s.http.search.queries.specialized
import com.sksamuel.elastic4s.json.XContentBuilder
import com.sksamuel.elastic4s.searches.queries.funcscorer._
object ScoreFunctionBuilderFn {
def apply(func: ScoreFunction): XContentBuilder =
func match {
case r: RandomScoreFunction => Rand... | Tecsisa/elastic4s | elastic4s-http/src/main/scala/com/sksamuel/elastic4s/http/search/queries/specialized/ScoreFunctionBuilderFn.scala | Scala | apache-2.0 | 756 |
package org.jetbrains.plugins.scala.codeInspection.methodSignature.quickfix
import com.intellij.openapi.project.Project
import com.intellij.codeInspection.ProblemDescriptor
import org.jetbrains.plugins.scala.lang.psi.api.expr.ScMethodCall
import org.jetbrains.plugins.scala.lang.psi.impl.ScalaPsiElementFactory
import o... | consulo/consulo-scala | src/org/jetbrains/plugins/scala/codeInspection/methodSignature/quickfix/RemoveCallParentheses.scala | Scala | apache-2.0 | 726 |
/*
* Copyright 1998-2016 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... | kloun/lorsource | src/main/scala/ru/org/linux/tag/TagInfo.scala | Scala | apache-2.0 | 708 |
/**
* Copyright (C) 2015 Stratio (http://stratio.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by ap... | luismcl/crossdata | elasticsearch/src/main/scala/com/stratio/crossdata/connector/elasticsearch/ElasticSearchConnectionUtils.scala | Scala | apache-2.0 | 4,563 |
/**
* 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... | themarkypantz/kafka | core/src/test/scala/unit/kafka/coordinator/group/GroupCoordinatorTest.scala | Scala | apache-2.0 | 65,573 |
package constants
object Properties {
val PAST_MIN = 5
}
| jiancoding/stock-data | app/constants/Properties.scala | Scala | apache-2.0 | 60 |
package org.jetbrains.plugins.scala.failed.typeInference
import org.jetbrains.plugins.scala.DependencyManagerBase._
import org.jetbrains.plugins.scala.base.libraryLoaders.{IvyManagedLoader, LibraryLoader}
import org.jetbrains.plugins.scala.lang.typeInference.TypeInferenceTestBase
/**
* @author mucianm
* @since 28... | JetBrains/intellij-scala | scala/scala-impl/test/org/jetbrains/plugins/scala/failed/typeInference/ScalaZTest.scala | Scala | apache-2.0 | 2,696 |
package org.podval.families.template.split.instance
import org.podval.families.template.split.family.T1Base
abstract class T1Instance extends T1Base[Instance] {
final override def add(t2: Instance#T1): Instance#T1 = ???
}
| dubinsky/podval-families | src/main/scala/org/podval/families/template/split/instance/T1Instance.scala | Scala | apache-2.0 | 226 |
package com.scalaAsm.x86
package Instructions
package General
// Description: Make Stack Frame for Procedure Parameters
// Category: general/stack
trait ENTER extends InstructionDefinition {
val mnemonic = "ENTER"
}
object ENTER extends TwoOperands[ENTER] with ENTERImpl
trait ENTERImpl extends ENTER {
implicit ... | bdwashbu/scala-x86-inst | src/main/scala/com/scalaAsm/x86/Instructions/General/ENTER.scala | Scala | apache-2.0 | 463 |
package com.ubirch.chain.config
import com.ubirch.util.config.ConfigBase
/**
* author: cvandrei
* since: 2017-01-19
*/
object ChainConfig extends ConfigBase {
/**
* The interface the server runs on.
*
* @return interface
*/
def interface: String = config.getString(ChainConfigKeys.INTERFACE)... | ubirch/ubirch-chain-service | config/src/main/scala/com/ubirch/chain/config/ChainConfig.scala | Scala | apache-2.0 | 3,124 |
package org.mbari.kdtree
import scala.annotation.tailrec
/**
* Strategy for ordering a multi-dimensional type along a given dimension
*
* @author Brian Schlining
* @since 2014-09-26T10:57:00
*/
trait DimensionalOrdering[A] {
/**
* @return The number of dimensions
*/
def dimensions: Int
/**
* Com... | hohonuuli/opencv-imgofinterest | src/main/scala/org/mbari/kdtree/DimensionalOrdering.scala | Scala | mit | 2,489 |
package de.uni_potsdam.hpi.coheel.programs
import java.lang.Iterable
import de.uni_potsdam.hpi.coheel.io.OutputFiles._
import de.uni_potsdam.hpi.coheel.ml.CoheelClassifier.POS_TAG_GROUPS
import de.uni_potsdam.hpi.coheel.programs.DataClasses._
import de.uni_potsdam.hpi.coheel.util.Util
import de.uni_potsdam.hpi.coheel... | stratosphere/coheel | src/main/scala/de/uni_potsdam/hpi/coheel/programs/TrainingDataProgram.scala | Scala | apache-2.0 | 10,551 |
package extracells.client
import cpw.mods.fml.common.eventhandler.SubscribeEvent
import extracells.common.CommonProxy
import net.minecraftforge.client.event.TextureStitchEvent
import net.minecraftforge.common.MinecraftForge
class ClientProxy extends CommonProxy {
MinecraftForge.EVENT_BUS.register(this)
override ... | ruifung/ExtraCells2 | src/main/scala/extracells/client/ClientProxy.scala | Scala | mit | 493 |
val nodupes = Map(1 -> "a", 2-> "b", 3 -> "c")
/*start*/nodupes map {_.swap}/*end*/
//Map[String, Int] | ilinum/intellij-scala | testdata/typeInference/bugs/SCL1823.scala | Scala | apache-2.0 | 102 |
package com.github.shadowsocks.acl
import java.io.{File, FileNotFoundException, IOException}
import com.github.shadowsocks.ShadowsocksApplication.app
import com.github.shadowsocks.utils.IOUtils
import com.j256.ormlite.field.DatabaseField
import scala.collection.mutable
import scala.io.Source
/**
* ACL handler com... | hangim/shadowsocks-android | mobile/src/main/scala/com/github/shadowsocks/acl/Acl.scala | Scala | gpl-3.0 | 5,876 |
package com.github.wakfudecrypt.types.data
import com.github.wakfudecrypt._
@BinaryDecoder
case class NationLaw(
id: Int,
lawConstantId: Int,
params: Array[String],
basePointsModification: Int,
percentPointsModification: Int,
lawPointCost: Int,
lawLocked: Boolean,
applicableToCitizen: Boolean,
appli... | jac3km4/wakfudecrypt | types/src/main/scala/com/github/wakfudecrypt/types/data/NationLaw.scala | Scala | mit | 516 |
package json2caseclass.implementation
import json2caseclass.model.CaseClass._
object CaseClassNameGenerator {
def makeUnique(takenClassNames: Set[String], name: ClassName): Option[ClassName] = {
val suffixes = "" #:: Stream.from(1).map(_.toString)
val namesWithSuffix = suffixes.map(suffix => s"$name$... | battermann/sbt-json | src/main/scala/json2caseclass/implementation/CaseClassNameGenerator.scala | Scala | mit | 454 |
/**
* 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... | shuliangtao/apache-camel-2.13.0-src | components/camel-scala/src/main/scala/org/apache/camel/scala/RichMessage.scala | Scala | apache-2.0 | 3,243 |
/*
* Copyright: Copyright (C) 2015, Jaguar Land Rover
* License: MPL-2.0
*/
package org.genivi.sota.resolver.db
import java.util.UUID
import akka.stream.ActorMaterializer
import eu.timepit.refined.api.Refined
import eu.timepit.refined.refineV
import eu.timepit.refined.string.Regex
import org.genivi.sota.common.Dev... | PDXostc/rvi_sota_server | external-resolver/src/main/scala/org/genivi/sota/resolver/db/DeviceRepository.scala | Scala | mpl-2.0 | 9,456 |
/*
* Copyright 2014 Frugal Mechanic (http://frugalmechanic.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required... | frugalmechanic/fm-common | jvm/src/main/scala/fm/common/OutputStreamResource.scala | Scala | apache-2.0 | 8,641 |
package ilc
package examples
import longRunning._
class HistogramVerification extends BenchmarkVerification(
new WordCountBenchData(HistogramGenerated) {
override def base = 2
override def last = 2
override def step = 10
})
| inc-lc/ilc-scala | bigClients/src/test/scala/ilc/examples/verification.scala | Scala | mit | 242 |
//(a - 3 pts)
// Consider the following scala programs.
// For each program state what the program outputs assuming all parameters are call-by-value.
// Write a short explanation for the output.
// Program 1:
def bob(x: Int): Int = {
println("Bob"); x + 1
}
def joe(x: Int,y: Int): Int = {
println("Joe");
val a =... | xianminx/cs3101-2 | homework/week4/Part1a.scala | Scala | apache-2.0 | 1,190 |
/*
* Copyright 2015-2020 Noel Welsh
*
* 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... | underscoreio/doodle | core/shared/src/main/scala/doodle/algebra/generic/GenericTransform.scala | Scala | apache-2.0 | 855 |
package mpsc
import java.time.LocalDateTime
import java.time.temporal.ChronoUnit
import java.util
import org.slf4j.{Logger, LoggerFactory}
import scala.annotation.tailrec
class Executor(queue: util.Queue[Task], waiter: Waiter) extends Thread {
val logger: Logger = LoggerFactory.getLogger(this.getClass)
overrid... | algru/mpsc-tasks-executor | src/main/scala/mpsc/Executor.scala | Scala | mit | 1,162 |
/*
* 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/test/scala/uk/gov/hmrc/ct/computations/CP17Spec.scala | Scala | apache-2.0 | 1,065 |
package com.ecfront.lfp
import java.io.{File, RandomAccessFile}
import java.nio.channels.FileChannel
import akka.actor.{Actor, ActorLogging, ActorRef}
import sun.nio.ch.DirectBuffer
/**
* ่ก้ๅๆถ้็ฑป
* @param lineProcess ่กๆฐๆฎๅค็
*/
class LineCollector(lineProcess: ActorRef) extends Actor with ActorLogging {
def recei... | gudaoxuri/large-file-processor | src/main/scala/com/ecfront/lfp/LineCollector.scala | Scala | apache-2.0 | 2,133 |
object ch9_13 {
import ch9.{ParseError, Location, Parsers}
type Parser[+A] = Location => Result[A]
sealed trait Result[+A]
case class Success[+A](get: A, charsConsumed: Int) extends Result[A]
case class Failure(get: ParseError) extends Result[Nothing]
object Reference extends Parsers[Parser] {
/** As ... | rucka/fpinscala | src/main/scala/fpinscala/ch9/Exercise13.scala | Scala | gpl-2.0 | 1,835 |
/*
* This file is part of the \\BlueLaTeX project.
*
* 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 ... | tdurieux/bluelatex | blue-web/src/main/scala/gnieh/blue/web/WebApp.scala | Scala | apache-2.0 | 1,492 |
/*
* 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/cache | api/src/main/scala/org/beangle/cache/Broadcaster.scala | Scala | lgpl-3.0 | 1,547 |
/*
* 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/core/src/main/scala/org/apache/spark/sql/UDFRegistration.scala | Scala | apache-2.0 | 70,366 |
/*
* 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/main/scala/edu/ucla/cs/starai/forclift/rcr/NoTruthRCR.scala | Scala | apache-2.0 | 3,077 |
/*
* Copyright 2001-2013 Artima, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agre... | svn2github/scalatest | src/test/scala/org/scalatest/ShouldTripleEqualsToleranceSpec.scala | Scala | apache-2.0 | 48,217 |
override def toString : String = {
return this.textContent
} | richnou/vui2 | vui2-html/src/gen/Wrapper.body.scala | Scala | agpl-3.0 | 74 |
package com.cloudray.scalapress.plugin.variations
import org.scalatest.{OneInstancePerTest, FlatSpec}
import org.scalatest.mock.MockitoSugar
import org.mockito.{Matchers, Mockito}
import com.cloudray.scalapress.item.{ItemType, TypeDao}
import com.cloudray.scalapress.plugin.variations.controller.DimensionListController... | vidyacraghav/scalapress | src/test/scala/com/cloudray/scalapress/plugin/variations/DimensionListControllerTest.scala | Scala | apache-2.0 | 1,653 |
package japgolly.scalajs.react.core
import japgolly.scalajs.react._
import japgolly.univeq.UnivEq
import scala.annotation.nowarn
import scala.util.NotGiven
sealed trait Compilation3Test {
import CompilationTest._
import Compilation3Test._
sealed trait TestComponentBuilder {
val step1 = ScalaComponent.build... | japgolly/scalajs-react | tests/src/test/scala-3/japgolly/scalajs/react/core/Compilation3Test.scala | Scala | apache-2.0 | 1,075 |
package ru.makkarpov.scalingua.extract
import java.io.{File, FileInputStream, InputStreamReader}
import java.nio.charset.StandardCharsets
import com.grack.nanojson.{JsonObject, JsonParser, JsonParserException}
import ru.makkarpov.scalingua.pofile.Message.{Plural, Singular}
import ru.makkarpov.scalingua.pofile._
impor... | makkarpov/scalingua | scalingua/shared/src/main/scala/ru/makkarpov/scalingua/extract/TaggedParser.scala | Scala | apache-2.0 | 2,847 |
import scala.quoted._
object scalatest {
inline def assert(condition: => Boolean): Unit = ${ assertImpl('condition, '{""}) }
def assertImpl(cond: Expr[Boolean], clue: Expr[Any])(using qctx: QuoteContext) : Expr[Unit] = {
import qctx.tasty._
import util._
def isImplicitMethodType(tp: Type): Boolean =... | som-snytt/dotty | tests/run-macros/reflect-select-value-class/assert_1.scala | Scala | apache-2.0 | 1,479 |
package nyaya
package object util {
@inline implicit final class NyayaUtilAnyExt[A](private val a: A) extends AnyVal {
@inline def `JVM|JS`(js: => A): A = Platform.choose(a, js)
}
}
| japgolly/nyaya | util/shared/src/main/scala/nyaya/util/package.scala | Scala | lgpl-2.1 | 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 may ... | practice-vishnoi/dev-spark-1 | core/src/main/scala/org/apache/spark/ui/jobs/ExecutorTable.scala | Scala | apache-2.0 | 5,271 |
package streamz.akka.persistence
import java.io.File
import akka.actor._
import akka.persistence._
import akka.testkit.TestKit
import scalaz._
import Scalaz._
import scalaz.stream.Process
import org.apache.commons.io.FileUtils
import org.scalatest._
class PersistenceSpec extends TestKit(ActorSystem("test")) with W... | Astrac/streamz | streamz-akka-persistence/src/test/scala/streamz/akka/persistence/PersistenceSpec.scala | Scala | apache-2.0 | 3,063 |
package fi.pelam.javafxactor
import java.util.concurrent.{CountDownLatch, TimeUnit}
import javafx.application.Application
import javafx.stage.Stage
import javax.annotation.concurrent.GuardedBy
import grizzled.slf4j.Logging
/**
* Basically a dummy application with static
* initialization to allow JavaFxDispatcher... | pelamfi/pelam-scala-incubator | src/main/scala/fi/pelam/javafxactor/JavaFxApplication.scala | Scala | apache-2.0 | 2,324 |
/*
* 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/amls-frontend | test/views/businessactivities/who_is_your_accountant_is_ukSpec.scala | Scala | apache-2.0 | 3,027 |
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.