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 |
|---|---|---|---|---|---|
package guiobjects
import gui.{Tooltip, TopRight}
/**
* ScoreBoard lists players from first to last in terms of points.
*/
object ScoreBoard extends Tooltip() {
setPoint(TopRight)
setSize(200, 10)
private val background = createTexture()
background.setAllPoints()
background.setVertexColor(... | sherpal/oh-hell-card-game | gameplaying/src/main/scala/guiobjects/ScoreBoard.scala | Scala | mit | 702 |
/*
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/main/scala/de/hpi/ingestion/graphframes/models/ResultGraph.scala | Scala | apache-2.0 | 1,878 |
/*
* Copyright 2013 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... | twitter/storehaus | storehaus-algebra/src/main/scala/com/twitter/storehaus/algebra/UnpivotedMergeableStore.scala | Scala | apache-2.0 | 1,965 |
class C:
type T >: String <: Any
class D extends C:
class T // error
| som-snytt/dotty | tests/neg/override-inner-class.scala | Scala | apache-2.0 | 75 |
package ohnosequences.sbt.nice.release
import ohnosequences.sbt.nice._
import sbt._, Keys._
import ohnosequences.sbt.GithubRelease
import VersionSettings.autoImport._
import com.markatta.sbttaglist.TagListPlugin.autoImport._
import scala.collection.immutable.SortedSet
import java.nio.file.Files
import AssemblySetting... | ohnosequences/nice-sbt-settings | src/main/scala/release/tasks.scala | Scala | agpl-3.0 | 13,620 |
import scala.tools.partest.ReplTest
object Test extends ReplTest {
def code =
"""def f(x: => Int): Int = x
f _
"""
// replace indylambda function names by <function1>
override def eval() = {
val lines = super.eval
val r = """\\$\\$Lambda.*""".r
lines.map(l => r.replaceAllIn(l, "<function1>"))
}
}
| felixmulder/scala | test/files/run/t6434.scala | Scala | bsd-3-clause | 318 |
package actors
//#messages
case class TransformationJob(text: String)
case class TransformationResult(text: String)
case class JobFailed(reason: String, job: TransformationJob)
case object BackendRegistration
//#messages
| luzhuomi/playakkahbase | scala/playAkka/app/actors/TransformationMessages.scala | Scala | gpl-2.0 | 222 |
package org.http4s
package headers
object `X-Powered-By` extends HeaderKey.Default
| ZizhengTai/http4s | core/src/main/scala/org/http4s/headers/X-Powered-By.scala | Scala | apache-2.0 | 85 |
package mathParser.algebra
import mathParser.MathParser
import org.scalatest.{FunSuite, Matchers}
import spire.math.Complex
import mathParser.implicits._
class ParseComplexSpec extends FunSuite with Matchers {
val lang = MathParser.complexLanguage
import lang.{optimize, parse, constantNode}
test("parse comple... | gregor-i/mathParser | math-parser/src/test/scala/mathParser/algebra/ParseComplexSpec.scala | Scala | mit | 861 |
/**
* Copyright (c) 2013 Saddle Development Team
*
* 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 ... | jyt109/saddle | saddle-core/src/main/scala/org/saddle/util/Concat.scala | Scala | apache-2.0 | 12,459 |
package dundertext.ui.editor
import org.scalajs.dom
import org.scalajs.dom.html
class EditorsPanel(tr: html.TableRow) {
val td: html.Element = dom.document.createElement("td").asInstanceOf[html.Element]
tr.appendChild(td)
td.className = "dt-editor"
val left: EditorPanel = new EditorPanel(td)
}
| dundertext/dundertext | ui/src/main/scala/dundertext/ui/editor/EditorsPanel.scala | Scala | gpl-3.0 | 306 |
/**
* 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... | wangcy6/storm_app | frame/kafka-0.11.0/kafka-0.11.0.1-src/core/src/test/scala/integration/kafka/api/PlaintextProducerSendTest.scala | Scala | apache-2.0 | 4,746 |
/*
* 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 not u... | knockdata/spark-highcharts | src/main/scala/com/knockdata/spark/highcharts/Init.scala | Scala | apache-2.0 | 3,215 |
package rps
import org.mockito.Mockito._
import org.scalatest.mock.MockitoSugar
trait ComputerAiGestureChooserMock extends MockitoSugar {
/**
* builds a gesture chooser which produces the given gestures
*/
def computerGestureChooserWhichReturns(gestures: Gesture*): ComputerAiGestureChooser = {
val aiG... | fkoehler/rock-paper-scissors-scala | src/test/scala/rps/ComputerAiGestureChooserMock.scala | Scala | apache-2.0 | 481 |
package com.avsystem.commons
package serialization.cbor
import com.avsystem.commons.jiop.JFactory
import com.avsystem.commons.serialization.GenCodec.OOOFieldsObjectCodec
import com.avsystem.commons.serialization._
import scala.collection.compat._
trait CborOptimizedCodecs {
/**
* Creates a `GenCodec` for map t... | AVSystem/scala-commons | commons-core/src/main/scala/com/avsystem/commons/serialization/cbor/CborOptimizedCodecs.scala | Scala | mit | 4,749 |
package eu.ace_design.island.map.processes
import eu.ace_design.island.geom.{Face, Registry}
import eu.ace_design.island.map._
import eu.ace_design.island.util.{LogSilos, Logger}
/**
* A face is considered as an ocean one if it is a water face connected to the borders of the m. Lakes are faces
* identified as water... | ace-design/island | engine/src/main/scala/eu/ace_design/island/map/processes/IdentifyLakesAndOcean.scala | Scala | lgpl-3.0 | 3,207 |
package models
import java.util.UUID
import org.joda.time.{DateTime, LocalDate, LocalTime}
import play.api.libs.functional.syntax.{unlift, _}
import play.api.libs.json.{JsPath, Json, Reads, Writes}
import utils.date.DateTimeJsonFormatter._
trait ReportCardRescheduledLike extends UniqueEntity
case class ReportCardRes... | THK-ADV/lwm-reloaded | app/models/ReportCardRescheduled.scala | Scala | mit | 1,938 |
package org.jetbrains.plugins.scala
package lang
package psi
package stubs
package impl
import com.intellij.psi.PsiElement
import com.intellij.psi.stubs.{IStubElementType, StubBase, StubElement}
import org.jetbrains.plugins.scala.lang.psi.api.toplevel.templates.ScExtendsBlock
import scala.collection.immutable.ArraySe... | JetBrains/intellij-scala | scala/scala-impl/src/org/jetbrains/plugins/scala/lang/psi/stubs/impl/ScExtendsBlockStubImpl.scala | Scala | apache-2.0 | 681 |
package org.bitcoins.core.serializers
import org.bitcoins.core.currency.Satoshis
import org.bitcoins.core.gen.CurrencyUnitGenerator
import org.scalacheck.{Prop, Properties}
/**
* Created by chris on 6/23/16.
*/
class RawSatoshisSerializerSpec extends Properties("RawSatoshiSerializerSpec") {
property("Symmetric... | SuredBits/bitcoin-s-sidechains | src/test/scala/org/bitcoins/core/serializers/RawSatoshisSerializerSpec.scala | Scala | mit | 454 |
/***********************************************************************
* Copyright (c) 2013-2022 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... | locationtech/geomesa | geomesa-filter/src/main/scala/org/locationtech/geomesa/filter/function/FastProperty.scala | Scala | apache-2.0 | 1,238 |
package com.datastax.spark.connector.sql
import org.scalatest.BeforeAndAfterEach
import scala.concurrent.Future
import org.apache.spark.Logging
import org.apache.spark.sql.SaveMode._
import org.apache.spark.sql.cassandra.{
AnalyzedPredicates,
CassandraPredicateRules,
CassandraSourceRelation,
TableRef
}
impor... | jimenefe/spark-cassandra-connector | spark-cassandra-connector/src/it/scala/com/datastax/spark/connector/sql/CassandraDataSourceSpec.scala | Scala | apache-2.0 | 9,648 |
package com.socrata.util.`implicits-impl`
import java.util.Comparator
class ComparatorOrdering[T](comparator: Comparator[T]) extends Ordering[T] {
def compare(x: T, y: T) = comparator.compare(x, y)
}
class ComparableOrdering[T <: Comparable[T]] extends Ordering[T] {
def compare(x: T, y: T) = x.compareTo(y)
}
ob... | socrata-platform/socrata-utils | src/main/scala/com/socrata/util/implicits-impl/JavaComparisonCompat.scala | Scala | apache-2.0 | 418 |
package de.endrullis.sta
import java.awt.Color
import utils.ColorUtils
/**
* Color variable.
*
* @author Stefan Endrullis <[email protected]>
*/
object ColorVar {
def apply[TM](startColor: Color): ColorVar[TM] = new ColorVar[TM](startColor, VarState(startColor))
}
case class ColorVar[TM](sta... | xylo/scala-tikz-animations | src/de/endrullis/sta/ColorVar.scala | Scala | apache-2.0 | 1,026 |
package org.jetbrains.plugins.scala.lang.resolve2
/**
* @author Alexander Podkhalyuzin
*/
class OverloadingTest extends ResolveTestBase {
override def folderPath: String = {
super.folderPath + "overloading/"
}
def testAmbiguos(): Unit = doTest()
def testCanConformsWeak(): Unit = doTest()
def testCann... | JetBrains/intellij-scala | scala/scala-impl/test/org/jetbrains/plugins/scala/lang/resolve2/OverloadingTest.scala | Scala | apache-2.0 | 1,461 |
/*
Copyright 2013 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, software
distr... | mikegagnon/decl | src/test/scala/com/mikegagnon/decl/TaskSetSpec.scala | Scala | apache-2.0 | 24,124 |
/*
* 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 ... | rednaxelafx/apache-spark | sql/core/src/main/scala/org/apache/spark/sql/execution/joins/HashedRelation.scala | Scala | apache-2.0 | 35,848 |
package uk.gov.dvla.vehicles.presentation.common.views
object ValtechRadioView {
final val KeeperType_Private = "Private"
final val KeeperType_Business = "Business"
}
| dvla/vehicles-presentation-common | common-test/app/uk/gov/dvla/vehicles/presentation/common/views/ValtechRadioView.scala | Scala | mit | 172 |
package freecli
package argument
import dsl._
object implicits extends AllImplicits
trait AllImplicits
extends ArgumentDslImplicits
with ArgumentFieldImplicits
with MergerImplicits | pavlosgi/freecli | core/src/main/scala/freecli/argument/implicits.scala | Scala | apache-2.0 | 188 |
/*
* This file is a part of the "sur la plaque" toolkit for cycling
* data analytics and visualization.
*
* Copyright (c) 2013--2014 William C. Benton and Red Hat, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You m... | willb/sur-la-plaque | analysis/src/main/scala/com/freevariable/surlaplaque/data/trackpoint.scala | Scala | apache-2.0 | 3,304 |
package gitbucket.core.api
import gitbucket.core.util.RepositoryName
import org.json4s.jackson.JsonMethods.parse
import org.json4s._
import org.scalatest.FunSuite
import java.util.{Calendar, TimeZone, Date}
class JsonFormatSpec extends FunSuite {
val date1 = {
val d = Calendar.getInstance(TimeZone.getTimeZon... | zhoffice/gitbucket | src/test/scala/gitbucket/core/api/JsonFormatSpec.scala | Scala | apache-2.0 | 15,672 |
package cmdreader.std
import types._
import util._
import cmdreader._
class OGe extends CommandOperator {
override def getName(): String = "ge"
override def isValidArg0(n: Int): Boolean = n == 2
override def apply(args: Array[Type]): Type = {
try {
MathUtil.rel(args(0), args(1), !_.lt(_))
}
ca... | bluebear94/bag | src/main/scala/cmdreader/std/OGe.scala | Scala | gpl-3.0 | 655 |
/*
* Copyright (C) 2016-2019 Lightbend Inc. <https://www.lightbend.com>
*/
package com.lightbend.lagom.internal.javadsl.testkit
import java.util.concurrent.CompletionStage
import akka.Done
import akka.actor.ActorRef
import akka.stream.Materializer
import akka.stream.javadsl.Flow
import akka.stream.javadsl.Source
i... | rcavalcanti/lagom | testkit/javadsl/src/main/scala/com/lightbend/lagom/internal/javadsl/testkit/TopicStub.scala | Scala | apache-2.0 | 1,875 |
package com.eigengo.lift.analysis.exercise.rt
/**
* Accelerometer data groups ``values`` at the given ``samplingRate``
* @param samplingRate the sampling rate in Hz
* @param values the values
*/
case class AccelerometerData(samplingRate: Int, values: List[AccelerometerValue])
/**
* Accelerometer data
* @param x... | lachatak/lift | analysis/exercise-rt-protocol/src/main/scala/com/eigengo/lift/analysis/exercise/rt/AccelerometerData.scala | Scala | apache-2.0 | 421 |
package lila.study
import play.api.libs.json._
import reactivemongo.api.bson._
import scala.concurrent.duration._
import lila.common.Future
import lila.db.AsyncColl
import lila.db.dsl._
import lila.user.User
case class StudyTopic(value: String) extends AnyVal with StringValue
object StudyTopic {
val minLength = ... | luanlv/lila | modules/study/src/main/StudyTopic.scala | Scala | mit | 4,798 |
package java.time
case class ZoneId(code:String) {
}
object ZoneId {
val SHORT_IDS = Map(
"ACT" -> "Australia/Darwin",
"AET" -> "Australia/Sydney",
"AGT" -> "America/Argentina/Buenos_Aires",
"ART" -> "Africa/Cairo",
"AST" -> "America/Anchorage",
"BET" -> "America/Sao_Paulo",
"BST" -> "A... | 7thsense/play-json-extra | scalajs-joda-time/src/main/scala/java/time/ZoneId.scala | Scala | apache-2.0 | 1,019 |
/*
* 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 | app/models/notifications/ReminderDetails.scala | Scala | apache-2.0 | 748 |
/*
* 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-blink/src/main/scala/org/apache/flink/table/planner/codegen/calls/MethodCallGen.scala | Scala | apache-2.0 | 2,736 |
package spatutorial.client.components
import spatutorial.components.JQuery
import scala.language.implicitConversions
import scala.scalajs.js
/**
* Common Bootstrap components for scalajs-react
*/
object Bootstrap {
implicit def jq2bootstrap(jq: JQuery): BootstrapJQuery = jq.asInstanceOf[BootstrapJQuery]
// s... | read-write-web/rww-scala-js | src/main/scala/spatutorial/client/components/Bootstrap.scala | Scala | apache-2.0 | 778 |
package scala.reflect.quasiquotes
import org.scalacheck._, Prop._, Gen._, Arbitrary._
import scala.tools.reflect.{ToolBox, ToolBoxError}
import scala.reflect.runtime.currentMirror
import scala.reflect.runtime.universe._, Flag._, internal.reificationSupport.setSymbol
abstract class QuasiquoteProperties(name: String) e... | scala/scala | test/scalacheck/scala/reflect/quasiquotes/QuasiquoteProperties.scala | Scala | apache-2.0 | 4,468 |
package fpscala.errorhandling
case class Person(name: Name, age: Age)
sealed class Name(val value: String)
sealed class Age(val value: Int)
object Person {
def map2[A, B, C](a: Either[List[String], A], b: Either[List[String], B])(f: (A, B) => C): Either[List[String], C] = {
a match {
case Left(es) => b ma... | hnfmr/fpscala | Person.scala | Scala | mit | 942 |
package x7c1.linen.repository.source.unread
import x7c1.linen.database.struct.HasSourceId
import x7c1.linen.repository.source.unread.selector.SourceRowSelector
import x7c1.wheat.modern.database.selector.SelectorProvidable
sealed trait SourceRowContent
object SourceRowContent {
implicit object providable extends Se... | x7c1/Linen | linen-repository/src/main/scala/x7c1/linen/repository/source/unread/SourceRowContent.scala | Scala | mit | 821 |
/*
* Copyright 2013 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... | twitter/storehaus | storehaus-core/src/main/scala/com/twitter/storehaus/BatchedReadableStore.scala | Scala | apache-2.0 | 2,029 |
package spark.streaming.util
import spark.SparkContext
import spark.SparkContext._
import it.unimi.dsi.fastutil.objects.{Object2LongOpenHashMap => OLMap}
import scala.collection.JavaConversions.mapAsScalaMap
object RawTextHelper {
/**
* Splits lines and counts the words in them using specialized object-to-long... | koeninger/spark | streaming/src/main/scala/spark/streaming/util/RawTextHelper.scala | Scala | bsd-3-clause | 2,573 |
/*
* Copyright 2011-2017 Chris de Vreeze
*
* 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 agree... | dvreeze/yaidom | jvm/src/test/scala/eu/cdevreeze/yaidom/queryapitests/AbstractUpdateTest.scala | Scala | apache-2.0 | 8,750 |
package com.scalegun.aws
package lambda
import com.amazonaws.services.lambda._
import com.amazonaws.services.lambda.model._
import com.amazonaws._
import scala.collection.JavaConverters._
import java.util._
import java.nio._
import java.nio.charset._
trait Requests {
val region: String
val clientConfiguration: Cl... | scalegun/aws-utils | src/main/scala/com/scalegun/aws/lambda/Requests.scala | Scala | mit | 1,818 |
package org.jetbrains.plugins.scala
package format
import org.jetbrains.plugins.scala.base.SimpleTestCase
import org.jetbrains.plugins.scala.lang.psi.api.expr.ScExpression
import org.jetbrains.plugins.scala.lang.psi.impl.ScalaPsiElementFactory.createExpressionFromText
import org.junit.Assert._
/**
* Pavel Fatin
*/
... | ilinum/intellij-scala | test/org/jetbrains/plugins/scala/format/FormattedStringFormatterTest.scala | Scala | apache-2.0 | 3,700 |
/*
* 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 ... | apache/flink | flink-table/flink-table-planner/src/test/scala/org/apache/flink/table/planner/plan/stream/sql/agg/DistinctAggregateTest.scala | Scala | apache-2.0 | 7,193 |
/*
* 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/crypto | src/test/scala/uk/gov/hmrc/crypto/CryptoGCMWithKeysFromConfigSpec.scala | Scala | apache-2.0 | 7,858 |
package com.codahale.jerkson.ser
import org.codehaus.jackson.JsonGenerator
import org.codehaus.jackson.map.{SerializerProvider, JsonSerializer}
import org.codehaus.jackson.map.annotate.JsonCachable
@JsonCachable
class OptionSerializer extends JsonSerializer[Option[_]] {
def serialize(value: Option[_], json: JsonGen... | cphylabs/jerkson-old | src/main/scala/com/codahale/jerkson/ser/OptionSerializer.scala | Scala | mit | 437 |
package org.akka.essentials.future.example
import akka.actor.ActorSystem
import akka.actor.Props
case class Order(userId: Int, orderNo: Int, amount: Float, noOfItems: Int)
case class Address(userId: Int, fullName: String, address1: String, address2: String)
case class OrderHistory(order: Order, address: Address)
obje... | rokumar7/trial | ActorMessagingExample/src/main/scala/org/akka/essentials/future/example/TestActorSystem.scala | Scala | unlicense | 574 |
package org.tensorframes.impl
import org.apache.spark.sql.Row
import org.apache.spark.sql.types.StructType
import org.tensorframes.{ColumnInformation, Logging, NodePath, Shape}
import org.{tensorflow => tf}
import scala.collection.mutable
/**
* Converts data between the C++ runtime of TensorFlow and the Spark runti... | tjhunter/tensorframes | src/main/scala/org/tensorframes/impl/TFDataOps.scala | Scala | apache-2.0 | 8,506 |
/*
* 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... | lresende/incubator-toree | client/src/test/scala/org/apache/toree/kernel/protocol/v5/client/socket/ShellClientSpec.scala | Scala | apache-2.0 | 3,105 |
/*
* Copyright (C) 2020 MapRoulette contributors (see CONTRIBUTORS.md).
* Licensed under the Apache License, Version 2.0 (see LICENSE).
*/
package org.maproulette.framework.psql
import java.sql.SQLException
import org.scalatestplus.play.PlaySpec
/**
* @author mcuthbert
*/
class GroupingSpec extends PlaySpec ... | mgcuthbert/maproulette2 | test/org/maproulette/framework/psql/GroupingSpec.scala | Scala | apache-2.0 | 823 |
import org.scalatest._
import org.apache.log4j.Level
import scala.util.Random
class SparkSpec extends UnitTestSpec with SparkLocalMode with BeforeAndAfter {
before {
setLoggingLevel(Level.ERROR)
initSparkContext
}
after {
resetSparkContext
}
"A Spark" should "reduce RDD"... | sadikovi/sbt-multi-project-example | foo/src/test/scala/SparkSpec.scala | Scala | mit | 753 |
package com.sksamuel.elastic4s.anaylzers
trait AnalyzerDsl {
def stopAnalyzer(name: String): StopAnalyzerDefinition = StopAnalyzerDefinition(name)
def standardAnalyzer(name: String): StandardAnalyzerDefinition = StandardAnalyzerDefinition(name)
def patternAnalyzer(name: String, regex: String): PatternAnalyzerDef... | beni55/elastic4s | elastic4s-core/src/main/scala/com/sksamuel/elastic4s/anaylzers/AnalyzerDsl.scala | Scala | apache-2.0 | 471 |
package yuuto.yuutolib.block
import java.util.List
import net.minecraft.inventory.Container
import net.minecraft.entity.player.InventoryPlayer
import net.minecraft.inventory.IInventory
import net.minecraft.inventory.Slot
import net.minecraft.entity.player.EntityPlayer
import net.minecraft.item.ItemStack
/**
* @autho... | AnimeniacYuuto/YuutoLib | src/main/scala/yuuto/yuutolib/block/ContainerAlt.scala | Scala | gpl-3.0 | 2,752 |
package com.ereisman.esurient.etl.format
import java.io.OutputStream
import java.sql.ResultSet
/**
* Pluggable interface to output each record from a ResultSet for output to HDFS.
*/
trait EtlOutputFormatter {
def formatRecord(resultSet: ResultSet, toHdfsFile: OutputStream): Long = { 0L }
}
| initialcontext/esurient | src/main/scala/com/ereisman/esurient/etl/format/EtlOutputFormatter.scala | Scala | apache-2.0 | 302 |
// Copyright (C) 2017 Calin Cruceru <[email protected]>.
//
// See the LICENCE file distributed with this work for additional
// information regarding copyright ownership.
package org.symnet
package models.iptables
package extensions.tcp
// project
import core.{BaseParsers, Match}
object SynMatch extends... | calincru/iptables-sefl | src/main/scala/org/symnet/models/iptables/extensions/tcp/SynMatch.scala | Scala | mit | 698 |
/*
* (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/VectorFieldSpec.scala | Scala | apache-2.0 | 92,585 |
package codechicken.microblock
import net.minecraft.world.World
import net.minecraft.entity.player.EntityPlayer
import net.minecraft.util.MovingObjectPosition
import codechicken.lib.vec.Vector3
import codechicken.lib.vec.BlockCoord
import codechicken.lib.vec.Rotation
import codechicken.multipart.ControlKeyModifer._
im... | kenzierocks/ForgeMultipart | src/codechicken/microblock/MicroblockPlacement.scala | Scala | lgpl-2.1 | 5,764 |
/*
* 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 ... | aray/spark | resource-managers/mesos/src/test/scala/org/apache/spark/scheduler/cluster/mesos/MesosCoarseGrainedSchedulerBackendSuite.scala | Scala | apache-2.0 | 26,574 |
package ch08_stack
class BrowserDemo(var currentPageOpt: Option[String], val backStack: StackDemo[String],
val forwardStack: StackDemo[String]) {
def this() = this(None, new StackDemo[String], new StackDemo[String])
def open(page: String) = {
currentPageOpt.foreach(backStack.push)
forwa... | wangzheng0822/algo | scala/src/main/scala/ch08_stack/BrowserDemo.scala | Scala | apache-2.0 | 797 |
package com.ximalaya.ratel.server
import com.esotericsoftware.kryo.Kryo
import com.esotericsoftware.kryo.io.Output
import com.ximalaya.ratel.common.{MessageType, RpcRequest}
import io.netty.buffer.ByteBuf
import io.netty.channel.ChannelHandlerContext
import io.netty.handler.codec.MessageToByteEncoder
/**
* Created ... | dongjiaqiang/Ratel | ratel-rpc/src/main/scala/com/ximalaya/ratel/server/ResponseEncoder.scala | Scala | mit | 1,040 |
package com.letstalkdata.scalinear
import scala.reflect.ClassTag
object Vector {
/**
* Creates a new Vector that contains the supplied values.
* @param values the values use to fill the Vector.
* @tparam T the type of object to be stored in the Vector.
* @return a new Vector that contains the supplied ... | phdoerfler/scalinear | src/main/scala/com/letstalkdata/scalinear/Vector.scala | Scala | mit | 7,356 |
/* Copyright (C) 2016 Luis Rodero-Merino
*
* This file is part of MxCompanions
*
* 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 2 of the License, or
* (at your option) any... | lrodero/mxcompanions | src/main/scala/mxcompanions/circuitbreaker/StateMonad.scala | Scala | gpl-2.0 | 2,859 |
package top.spoofer.hbrdd.config
import org.apache.hadoop.conf.Configuration
import org.apache.hadoop.hbase.HBaseConfiguration
class HbRddConfig(config: Configuration) extends Serializable {
def getHbaseConfig = HBaseConfiguration.create(config)
}
object HbRddConfig {
type configOption = (String, String)
priva... | TopSpoofer/hbrdd | src/main/scala/top/spoofer/hbrdd/config/HbRddConfig.scala | Scala | apache-2.0 | 1,494 |
/*
Copyright (c) 2012-2014, Université de Lorraine, Nancy, France
Copyright (c) 2014-2015, Christophe Calvès
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... | christophe-calves/zk.scala | scala/src/main/scala/zk/examples/COOL.scala | Scala | bsd-3-clause | 2,536 |
/*
* 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 ... | gioenn/xSpark | core/src/main/scala/org/apache/spark/ExecutorAllocationManager.scala | Scala | apache-2.0 | 32,356 |
/***********************************************************************
* Copyright (c) 2013-2016 Commonwealth Computer Research, Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Apache License, Version 2.0
* which accompanies this distribution and is ... | mdzimmerman/geomesa | geomesa-accumulo/geomesa-accumulo-datastore/src/main/scala/org/locationtech/geomesa/accumulo/util/BatchMultiScanner.scala | Scala | apache-2.0 | 3,630 |
package models.analysis.events
import models.analysis.ActorStamp
import org.joda.time.DateTime
import play.api.libs.json.{Format, Json}
/**
* Analysis' performed on sample objects may e.g. be part of a larger study. In
* some of these cases it's desirable for the result(s) to have restrictions on
* visibility for ... | kpmeen/musit | service_management/app/models/analysis/events/Restriction.scala | Scala | gpl-2.0 | 844 |
package edu.osu.cse.groenkeb.logic.model
case class ModelException(msg: String) extends Exception(msg) | bgroenks96/PropLogic | modelvf/src/main/scala/edu/osu/cse/groenkeb/logic/model/ModelException.scala | Scala | mit | 103 |
package scala2ch.models.stream
import akka.stream.{ActorMaterializer}
import akka.stream.scaladsl._
import org.joda.time.DateTime
import scalikejdbc._
import scala2ch.models.{ThreadTag, Thread, Tag}
object ThreadFlow {
case class Create(ownerId: Long, title: String, createdAt: DateTime)
case class Delete(id: Long... | TanUkkii007/scala2ch | src/main/scala/scala2ch/models/stream/ThreadFlow.scala | Scala | mit | 2,441 |
package nomad.strat.service.rest
import nomad.strat.service.persistence.entities.Dummy1
import spray.json.DefaultJsonProtocol
// Collector of all json format we'd like to use on REST interface
// Can be Slick mapped case classes too.
object JsonProtocol extends DefaultJsonProtocol {
implicit val dummy1Format = json... | NomadHu/first_steps | service/src/main/scala/nomad/strat/service/rest/JsonProtocol.scala | Scala | apache-2.0 | 342 |
package domala.internal.macros.reflect.mock
case class MockEmbeddable(value1: Int, value2: String)
| bakenezumi/domala | core/src/test/scala/domala/internal/macros/reflect/mock/MockEmbeddable.scala | Scala | apache-2.0 | 100 |
/**
* Copyright: Copyright (C) 2016, Jaguar Land Rover
* License: MPL-2.0
*/
package org.genivi.sota.db
import slick.driver.MySQLDriver.api._
/**
* Some database operators are shared between the core and the
* resolver.
*/
object Operators {
/**
* The database layer, Slick, doesn't know that MariaDB... | PDXostc/rvi_sota_server | common/src/main/scala/org/genivi/sota/db/Operators.scala | Scala | mpl-2.0 | 946 |
trait C[+T <: C[T, U], -U <: C[T, U]] {
}
trait HasY { type Y }
// This works in scalac.
trait Foo1[-X] { def bar[Y <: X](y: Y) = y }
// A variant of Foo1 using a dependent method type (doesn't work using
// scalac)
trait Foo2[-X] { def bar(x: HasY { type Y <: X })(y: x.Y) = y }
// This works in scalac.
trait Foo3[... | som-snytt/dotty | tests/pos/variances.scala | Scala | apache-2.0 | 501 |
/*
* Copyright 2018 data Artisans GmbH, 2019 Ververica 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 app... | dataArtisans/flink-training-exercises | src/main/scala/com/ververica/flinktraining/solutions/datastream_scala/broadcast/NearestTaxiSolution.scala | Scala | apache-2.0 | 5,372 |
/*
* Scala.js (https://www.scala-js.org/)
*
* Copyright EPFL.
*
* Licensed under Apache License 2.0
* (https://www.apache.org/licenses/LICENSE-2.0).
*
* See the NOTICE file distributed with this work for
* additional information regarding copyright ownership.
*/
package scala.scalajs.js.annotation
import sc... | scala-js/scala-js | library/src/main/scala/scala/scalajs/js/annotation/JSName.scala | Scala | apache-2.0 | 676 |
package games.input
case class Position(x: Int, y: Int)
private[games] class BiMap[R, T](entries: (R, T)*) {
private val map = entries.toMap
private val reverseMap = entries.map { case (a, b) => (b, a) }.toMap
def getForLocal(loc: R): Option[T] = map.get(loc)
def getForRemote(rem: T): Option[R] = reverseMap.... | joelross/scalajs-games | demo/shared/src/main/scala/games/input/Input.scala | Scala | bsd-3-clause | 330 |
package silky.audit
import java.util.{Date, TimeZone}
import clairvoyance.ProducesCapturedInputsAndOutputs
import clairvoyance.plugins.SequenceDiagram
import clairvoyance.scalatest.ClairvoyantContext
import clairvoyance.scalatest.tags.skipInteractions
import org.scalatest.MustMatchers
import org.scalatest.refspec.Ref... | PILTT/silky | src/test/scala/silky/audit/SequenceDiagramSpec.scala | Scala | apache-2.0 | 2,503 |
/*
* 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/self-assessment-api | test/mocks/connectors/MockPropertyConnector.scala | Scala | apache-2.0 | 1,537 |
/* 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 scaps.api
sealed trait Definition {
def name: String
def shortName: String =
EntityName.splitNam... | scala-search/scaps | api/shared/src/main/scala/scaps/api/Definitions.scala | Scala | mpl-2.0 | 5,316 |
package pl.touk.nussknacker.engine.canonize
import cats.data.{NonEmptyList, ValidatedNel}
import cats.instances.list._
import cats.syntax.traverse._
import pl.touk.nussknacker.engine.canonicalgraph._
import pl.touk.nussknacker.engine.graph._
import pl.touk.nussknacker.engine.graph.node.{BranchEnd, BranchEndData}
obje... | TouK/nussknacker | scenario-api/src/main/scala/pl/touk/nussknacker/engine/canonize/ProcessCanonizer.scala | Scala | apache-2.0 | 5,284 |
/*
* Copyright 2013-2015 Websudos, Limited.
*
* 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 c... | dan-mi-sun/phantom | phantom-dsl/src/main/scala/com/websudos/phantom/builder/query/TruncateQuery.scala | Scala | bsd-2-clause | 2,217 |
package com.twitter.server.util
import com.twitter.finagle.stats.{BroadcastStatsReceiver, StatsReceiver}
import com.twitter.util.Try
import java.lang.management.ManagementFactory
import java.lang.reflect.Method
import scala.collection.mutable
object JvmStats {
import com.twitter.conversions.string._
import scala.... | nshkrob/twitter-server | src/main/scala/com/twitter/server/util/JvmStats.scala | Scala | apache-2.0 | 6,088 |
package mesosphere.marathon.core.appinfo.impl
import mesosphere.marathon.Protos.MarathonTask
import mesosphere.marathon.core.appinfo.{ EnrichedTask, TaskCounts, AppInfo }
import mesosphere.marathon.state._
import mesosphere.marathon.upgrade.DeploymentManager.DeploymentStepInfo
import mesosphere.marathon.upgrade.{ Depl... | cgvarela/marathon | src/test/scala/mesosphere/marathon/core/appinfo/impl/AppInfoBaseDataTest.scala | Scala | apache-2.0 | 9,731 |
package akka.ainterface.remote
import akka.actor.ActorRef
import akka.ainterface.NodeName
import akka.ainterface.remote.transport.TcpConnectionProtocol
import akka.ainterface.remote.transport.TcpConnectionProtocol.ReadSuccess
import akka.util.ByteString
import java.nio.charset.StandardCharsets
import java.security.Mes... | ainterface/ainterface | ainterface/src/main/scala/akka/ainterface/remote/handshake/package.scala | Scala | apache-2.0 | 2,708 |
/*
* (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/cogdebugger/ui/fieldvisualizations/complex/TestComplexFieldSuperPanel.scala | Scala | apache-2.0 | 2,049 |
/*
* 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 ... | wangmiao1981/spark | sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/optimizer/FilterPushdownSuite.scala | Scala | apache-2.0 | 48,504 |
// Copyright (C) 2011-2012 the original author or authors.
// See the LICENCE.txt file distributed with this work for additional
// information regarding copyright ownership.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You ... | chrisjwwalker/cjww-diagnostics | app/config/ExternalUrls.scala | Scala | apache-2.0 | 1,089 |
package reopp.workers.strategies
import reopp.workers.Node
import reopp.common._
import Utils.addID
/**
* Created by IntelliJ IDEA.
* User: jose
* Date: 04/05/12
* Time: 14:22
* To change this template use File | Settings | File Templates.
*/
trait Strategy[S<:Solution[S],C<:Constraints[S,C],St<:Strategy[S,C,... | joseproenca/ip-constraints | code/src/main/scala/reopp/workers/strategies/Strategy.scala | Scala | mit | 5,059 |
package com.airbnb.aerosolve.training.pipeline
import com.airbnb.aerosolve.core.{Example, FeatureVector, LabelDictionaryEntry}
import com.airbnb.aerosolve.core.models.{FullRankLinearModel, LinearModel}
import com.airbnb.aerosolve.core.transforms.Transformer
import com.airbnb.aerosolve.core.util.FloatVector
import com.... | airbnb/aerosolve | training/src/test/scala/com/airbnb/aerosolve/training/pipeline/PipelineTestingUtil.scala | Scala | apache-2.0 | 5,276 |
package code
package model
import net.liftweb.mapper._
object Task extends Task with LongKeyedMetaMapper[Task]
class Task extends LongKeyedMapper[Task] {
def getSingleton = Task
def primaryKeyField = id
object id extends MappedLongIndex[Task](this)
object parent extends MappedLongForeignKey[Task, Task](this,... | dodie/time-admin | src/main/scala/code/model/Task.scala | Scala | apache-2.0 | 652 |
/* sbt -- Simple Build Tool
* Copyright 2008, 2009 Mark Harrah
*/
package sbt
import jline.{Completor, ConsoleReader, History}
import java.io.{File,PrintWriter}
import complete.Parser
abstract class JLine extends LineReader
{
protected[this] val handleCONT: Boolean
protected[this] val reader: ConsoleReader
... | gilt/xsbt | util/complete/LineReader.scala | Scala | bsd-3-clause | 3,630 |
/* Copyright 2017-18, Emmanouil Antonios Platanios. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless ... | eaplatanios/tensorflow | tensorflow/scala/api/src/main/scala/org/platanios/tensorflow/api/learn/hooks/package.scala | Scala | apache-2.0 | 2,350 |
/**
* Copyright 2015 Mohiva Organisation (license at mohiva dot 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 req... | cemcatik/play-silhouette | silhouette/test/com/mohiva/play/silhouette/api/actions/SecuredActionSpec.scala | Scala | apache-2.0 | 33,792 |
package com.github.etacassiopeia.s99.list
/**
* <h1>P24</h1>
* Lotto: Draw N different random numbers from the set 1..M
*
* @author Mohsen Zainalpour
* @version 1.0
* @since 2/05/16
*/
object P24 {
def main(args: Array[String]) {
println(lotto(6, 49))
}
def lotto(n: Int, m: Int): List[Int] = ... | EtaCassiopeia/S-99 | src/main/scala/com/github/etacassiopeia/s99/list/P24.scala | Scala | apache-2.0 | 416 |
package com.datastax.spark.connector.sql
class CassandraPrunedScanSpec extends CassandraDataSourceSpec {
override def pushDown = false
} | viirya/spark-cassandra-connector | spark-cassandra-connector/src/it/scala/com/datastax/spark/connector/sql/CassandraPrunedScanSpec.scala | Scala | apache-2.0 | 139 |
/*******************************************************************************
* (C) Copyright 2015 Haifeng Li
*
* 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.apac... | arehart13/smile | scala/src/main/scala/smile/manifold/package.scala | Scala | apache-2.0 | 2,906 |
package edu.rice.habanero.benchmarks.philosopher
import java.util.concurrent.atomic.{AtomicBoolean, AtomicLong}
import edu.rice.habanero.actors.{JumiActor, JumiActorState, JumiPool}
import edu.rice.habanero.benchmarks.{Benchmark, BenchmarkRunner}
/**
*
* @author <a href="http://shams.web.rice.edu/">Shams Imam</a> ... | shamsmahmood/savina | src/main/scala/edu/rice/habanero/benchmarks/philosopher/PhilosopherJumiActorBenchmark.scala | Scala | gpl-2.0 | 3,740 |
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.