code stringlengths 5 1M | repo_name stringlengths 5 109 | path stringlengths 6 208 | language stringclasses 1
value | license stringclasses 15
values | size int64 5 1M |
|---|---|---|---|---|---|
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you ... | tillrohrmann/flink | flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/planner/plan/nodes/physical/common/CommonPhysicalLookupJoin.scala | Scala | apache-2.0 | 14,964 |
/*
* 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 | external/kafka-0-10-sql/src/test/scala/org/apache/spark/sql/kafka010/KafkaMicroBatchSourceSuite.scala | Scala | apache-2.0 | 72,662 |
/*
* Copyright 2011-2018 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 applic... | wiacekm/gatling | gatling-charts/src/main/scala/io/gatling/charts/stats/ResultsHolder.scala | Scala | apache-2.0 | 2,044 |
package controllers.backend
import play.api.libs.json.Json
import com.overviewdocs.database.exceptions
import com.overviewdocs.models.ApiToken
import com.overviewdocs.models.tables.ApiTokens
class DbApiTokenBackendSpec extends DbBackendSpecification {
trait BaseScope extends DbBackendScope {
val backend = new ... | overview/overview-server | web/test/controllers/backend/DbApiTokenBackendSpec.scala | Scala | agpl-3.0 | 5,325 |
/*
* 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 org.scalajs.testsuite.javalib.util.con... | scala-js/scala-js | test-suite/shared/src/test/scala/org/scalajs/testsuite/javalib/util/concurrent/CopyOnWriteArrayListTest.scala | Scala | apache-2.0 | 3,400 |
/*
* Copyright 2015 eleflow.com.br.
*
* 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... | eleflow/uberdata | iuberdata_core/src/test/scala/eleflow/uberdata/TestXGBoost.scala | Scala | apache-2.0 | 8,898 |
import boxity.WhiteboxParserMacroSuite
import suites.IncorrectParserMacros
class WhiteboxMetaIncorrectMacros extends WhiteboxParserMacroSuite with IncorrectParserMacros
| Duhemm/parsermacros | tests/src/test/scala/WhiteboxMetaIncorrectMacros.scala | Scala | bsd-3-clause | 170 |
package com.hxm.earlgrey.jobs
import org.bson.BsonInvalidOperationException
import org.mongodb.scala.Document
/**
* Created by hxm on 17-4-11.
*/
/*case class Job(id: String, `type`: String, name: String, status: String,
startedTime: Option[String] = None, endedTime: Option[String] = None,
... | PatrickHuang888/Earlgrey | jobs/src/main/scala/com/hxm/earlgrey/jobs/Job.scala | Scala | apache-2.0 | 2,880 |
package com.alanjz.desksim.things
import java.awt.{Color, Graphics2D, Rectangle}
import com.alanjz.desksim.Universe
import com.alanjz.desksim.Universe.things
import scala.annotation.tailrec
/**
* Created by alan on 9/12/14.
*/
trait Thing {
val color : Color
val width : Int
val height : Int
var x : Float
... | spacenut/desk-simulator | src/com/alanjz/desksim/things/Thing.scala | Scala | gpl-2.0 | 847 |
package scala.offheap.numeric
import scala.offheap._
import scala.offheap.numeric.jni._
/* With @data it is not possible to override methods thus for instance copy can't be implemented
@data class DenseMatrix(rows: Int, columns: Int, stride: Int, dataAddr: Long) {
*/
class DenseMatrix private (val addr: Addr) extend... | florv/scala-offheap | core/src/main/scala/offheap/numeric/DenseMatrix.scala | Scala | bsd-3-clause | 22,056 |
package org.apache.flink.contrib.tensorflow.common.functions.util
import org.apache.flink.contrib.tensorflow.models.{Model, RichModel}
/**
* Utility methods for TensorFlow models.
*/
object ModelUtils {
/**
* Open a model.
*/
@throws(classOf[Exception])
def openModel(model: Model[_]): Unit = {
m... | cookieai/flink-tensorflow | flink-tensorflow/src/main/scala/org/apache/flink/contrib/tensorflow/common/functions/util/ModelUtils.scala | Scala | apache-2.0 | 561 |
/**
* Copyright (c) 2007-2011 Eric Torreborre <etorreborre@yahoo.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation
* the rights ... | yyuu/specs | src/test/scala/org/specs/mock/numberOfMessagesUnit.scala | Scala | mit | 3,497 |
package com.dadrox.sbt.junit
import org.scalatools.testing.Logger
import org.scalatools.testing.Runner
import org.scalatools.testing
import scala.collection.mutable.ListBuffer
import java.util.concurrent.atomic.AtomicInteger
// TODO?
// add:
// test-only filtering
//
class JunitFramework extends testing.Framework {
... | dadrox/sbt-junit | src/main/scala.bak/com/dadrox/sbt/junit/JunitFramework.scala | Scala | bsd-2-clause | 875 |
package com.bot4s.telegram.models
object BotCommandScope extends Enumeration {
type BotCommandScope = Value
val Default, AllPrivateChats, AllGroupChats, AllChatAdministrators, Chat, ChatAdministrators, ChatMember = Value
}
| mukel/telegrambot4s | core/src/com/bot4s/telegram/models/BotCommandScope.scala | Scala | apache-2.0 | 228 |
package reactor.core.scala.publisher
import java.lang.{Boolean => JBoolean, Iterable => JIterable, Long => JLong}
import java.util
import java.util.concurrent.Callable
import java.util.function.{BiFunction, Function, Supplier}
import java.util.logging.Level
import java.util.{Comparator, Collection => JCollection, List... | reactor/reactor-scala-extensions | src/main/scala/reactor/core/scala/publisher/SFlux.scala | Scala | apache-2.0 | 63,893 |
/*
* 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 ... | tejasapatil/spark | sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/WriteToDataSourceV2.scala | Scala | apache-2.0 | 6,891 |
package org.littlewings.javaee7.standalonejta
import javax.persistence._
import scala.beans.BeanProperty
object Book {
def apply(isbn: String, title: String, price: Int): Book = {
val b = new Book
b.isbn = isbn
b.title = title
b.price = price
b
}
}
@Entity
@Table(name = "book")
@SerialVersio... | kazuhira-r/javaee7-scala-examples | jta-implementations-standalone-jpa/entity/src/main/scala/org/littlewings/javaee7/standalonejta/Book.scala | Scala | mit | 605 |
/*
* Copyright (c) 2012, 2013 Roberto Tyley
*
* This file is part of 'BFG Repo-Cleaner' - a tool for removing large
* or troublesome blobs from Git repositories.
*
* BFG Repo-Cleaner is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* ... | rtyley/bfg-repo-cleaner | bfg/src/test/scala/com/madgag/git/bfg/cli/test/unpackedRepo.scala | Scala | gpl-3.0 | 1,118 |
package com.microsoft.awt.routes
import com.microsoft.awt.data.CredentialDAO._
import com.microsoft.awt.data.SessionDAO._
import com.microsoft.awt.data.UserDAO._
import com.microsoft.awt.data._
import com.microsoft.awt.forms.AccountActivationForm
import com.microsoft.awt.models.{AuthToken, Session, User}
import org.sc... | ldaniels528/awt | app-nodejs/src/main/scala/com/microsoft/awt/routes/AuthenticationRoutes.scala | Scala | apache-2.0 | 8,140 |
package scalaz.stream
import scalaz.Functor
object channel {
/** Promote an effectful function to a `Channel`. */
def lift[F[_],A,B](f: A => F[B]): Channel[F, A, B] =
Process constant f
}
final class ChannelSyntax[F[_], I, O](val self: Channel[F, I, O]) extends AnyVal {
/** Transform the input of this `... | shawjef3/scalaz-stream | src/main/scala/scalaz/stream/channel.scala | Scala | mit | 572 |
package org.psesd.srx.shared.core.config
import org.psesd.srx.shared.core.exceptions._
import org.scalatest.FunSuite
class SftpConfigTests extends FunSuite {
val testConfig = <sftp>
<uri>sftp://SRE:ThisIsMyPassphrase@notadomain.net/misc/local</uri>
<folder>testsd</folder>
<privateKeyPath>psesdtest</pri... | PSESD/srx-shared-core | src/test/scala/org/psesd/srx/shared/core/config/SftpConfigTests.scala | Scala | mit | 7,639 |
/*
* 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 ... | holdenk/spark | sql/hive/src/test/scala/org/apache/spark/sql/hive/orc/OrcReadBenchmark.scala | Scala | apache-2.0 | 14,825 |
package extruder.metrics.syntax
import extruder.metrics.data.CounterValue
trait CounterSyntax {
implicit class NumericCounterOps[T: Numeric](t: T) {
def toCounter: CounterValue[T] = CounterValue(t)
}
}
| janstenpickle/extruder | metrics/core/src/main/scala/extruder/metrics/syntax/CounterSyntax.scala | Scala | mit | 212 |
package com.crystal
package models
// Persistent Storage
import stores.DynamoDB
case class UserAction(userID: String, category: String, action: String, label: String,
property: String, value: String, tstamp: String) {
import UserAction._
def save() = {
store.save(
userID,
"c... | crystal-project-inc/streaming_user_segmentation | src/main/scala/com/crystal/models/UserAction.scala | Scala | mit | 1,523 |
package com.gilt.newrelic.example.akka
import com.gilt.newrelic.akka.TracingReceive
import com.gilt.newrelic.akka.Implicits.TracingReceiveConverter
import org.scalatest.WordSpec
import org.scalatest.DiagrammedAssertions
import akka.actor.Actor
import akka.actor.ActorSystem
import akka.actor.Props
import akka.event.L... | gilt/lib-newrelic | akka/src/test/scala/com/gilt/newrelic/akka/TracingReceiveConverterTest.scala | Scala | mit | 924 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | manishgupta88/carbondata | integration/spark-common-test/src/test/scala/org/apache/carbondata/integration/spark/testsuite/primitiveTypes/TestAdaptiveEncodingForPrimitiveTypes.scala | Scala | apache-2.0 | 30,754 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | michalsenkyr/spark | sql/core/src/main/scala/org/apache/spark/sql/execution/GetStructFieldObject.scala | Scala | apache-2.0 | 1,441 |
class NoReturnSeveralOutput {
def foo(i: Int) {
/*start*/
val x = 0
val y = "a"
val z = 1
val zz = "1"
/*end*/
println(x + y + z + zz)
}
}
/*
class NoReturnSeveralOutput {
def foo(i: Int) {
/*start*/
val (x: Int, y: String, z: Int, zz: String) = testMethodName
/*end*/
... | LPTK/intellij-scala | testdata/extractMethod/output/NoReturnSeveralOutput.scala | Scala | apache-2.0 | 490 |
/*
* 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/api/security/AcceptAllAuthenticator.scala | Scala | apache-2.0 | 2,054 |
package com.github.bomgar.auth.credentials
trait AwsCredentialsProvider {
def awsCredentials: AwsCredentials
}
| mathissimo/reactive-aws | core/src/main/scala/com/github/bomgar/auth/credentials/AwsCredentialsProvider.scala | Scala | apache-2.0 | 116 |
/*
* Copyright 2007-2011 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... | pbrant/framework | web/webkit/src/test/scala/net/liftweb/webapptest/ToHeadUsages.scala | Scala | apache-2.0 | 5,864 |
package sbt
import sbt.internal.util.{ AttributeKey, FullReader }
import sbt.internal.util.complete.{ Completion, Completions, DefaultParsers, History => CHistory, HistoryCommands, Parser, TokenCompletions }
import sbt.internal.util.Types.{ const, idFun }
import sbt.internal.inc.classpath.ClasspathUtilities.toLoader
i... | dansanduleac/sbt | main/command/src/main/scala/sbt/BasicCommands.scala | Scala | bsd-3-clause | 13,625 |
class B extends A {
type T = Int
}
| som-snytt/xsbt | sbt/src/sbt-test/source-dependencies/as-seen-from-a/B.scala | Scala | bsd-3-clause | 37 |
package com.wlangiewicz.workouttracker.dao
import com.wlangiewicz.workouttracker.WorkoutTrackerSpec
import com.wlangiewicz.workouttracker.domain._
import org.scalatest.BeforeAndAfter
class UserDaoSpec extends WorkoutTrackerSpec with BeforeAndAfter {
before {
cleanupUserDao()
}
"UserDao" should "not find u... | wlk/workout-tracker-akka-http | src/test/scala/com/wlangiewicz/workouttracker/dao/UserDaoSpec.scala | Scala | mit | 621 |
// package scalaxy.js
// @JavaScript
// object Collections {
// def doSomething {
// // val emptyArr = Array[Object]()
// val arr = Array(1, 2, 3, 4)
// // val arr2 = new Array[Int](10)
// val emptyObj = Map[String, Any]()
// val obj = Map[String, Any]()
// println(obj)
// val obj1 = M... | nativelibs4java/Scalaxy | Experiments/JS/Generator/src/test/scala/scalaxy/js/Run.scala | Scala | bsd-3-clause | 990 |
/*
* 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 ... | pronix/spark | sql/core/src/test/scala/org/apache/spark/sql/DataFrameSuite.scala | Scala | apache-2.0 | 34,050 |
/*
* Copyright (C) 2009-2018 Lightbend Inc. <https://www.lightbend.com>
*/
package play.utils
import javax.inject.Inject
import org.specs2.mutable.Specification
import play.api.inject.Binding
import play.api.inject.guice.GuiceInjectorBuilder
import play.api.{ Configuration, Environment, PlayException }
import sca... | Shenker93/playframework | framework/src/play-guice/src/test/scala/play/utils/ReflectSpec.scala | Scala | apache-2.0 | 2,935 |
/**
* Copyright 2013 SelfishInc
*
* 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... | SelfishInc/solr-mongo-connector | src/main/scala/me/selfish/solr/mongo/util/TimestampHelper.scala | Scala | apache-2.0 | 1,706 |
package io.dylemma.spac
import cats.data.Chain
import fs2.Pipe
import io.dylemma.spac.impl._
import org.tpolecat.typename.TypeName
import scala.collection.mutable
/** Primary "spac" abstraction which represents a transformation stage for a stream of data events
*
* Transformers effectively transform a stream of ... | dylemma/xml-spac | core/src/main/scala/io/dylemma/spac/Transformer.scala | Scala | mit | 23,750 |
package com.eevolution.context.dictionary.infrastructure.service
import java.util.UUID
import akka.NotUsed
import com.eevolution.context.dictionary.domain._
import com.eevolution.context.dictionary.domain.model.DesktopTrl
import com.eevolution.utils.PaginatedSequence
import com.lightbend.lagom.scaladsl.api.{Service, ... | adempiere/ADReactiveSystem | dictionary-impl/src/main/scala/com/eevolution/context/dictionary/infrastructure/service/DesktopTrlService.scala | Scala | gpl-3.0 | 2,047 |
package org.jetbrains.plugins.scala
package lang
package psi
package impl
package toplevel
import com.intellij.lang.ASTNode
import com.intellij.psi.scope.PsiScopeProcessor
import com.intellij.psi.{PsiElement, ResolveState}
import org.jetbrains.plugins.scala.lang.psi.api.statements.{ScPatternDefinition, ScVariableDefin... | triggerNZ/intellij-scala | src/org/jetbrains/plugins/scala/lang/psi/impl/toplevel/ScEarlyDefinitionsImpl.scala | Scala | apache-2.0 | 2,141 |
package hackerRank.algorithms
object LeftRotation {
def main(args: Array[String]) {
val stdin = scala.io.StdIn
val nd = stdin.readLine.split(" ")
val n = nd(0).trim.toInt
val d = nd(1).trim.toInt
val a = stdin.readLine.split(" ").map(_.trim.toInt)
var leftRotatedArray = new Array[Int](n)... | cricanr/AlgorithmsHackerRank | src/main/scala/hackerRank/algorithms/LeftRotation.scala | Scala | mit | 467 |
package knapsack
case class Building(
population:Int,
name:String
)
| panchul/sb_scala | knapsack/src/main/scala/Building.scala | Scala | apache-2.0 | 131 |
package Gvote
import scala.collection.AbstractSeq
abstract class SystemGeneralDecomptage(_nom : String) {
type ImplElection <: AbstractElection
type ImplElecteur <: AbstractElecteur
type Candidate <: Eligible
type ImplVote <: AbstractVote
type returnList <: AbstractSeq[_]; //Ajouter par Ceulain car j'avais besoi... | DoumbiaAmadou/FrameworkVote | src/Gvote/SystemGeneralDecomptage.scala | Scala | mit | 1,755 |
/**
* This file is part of warg.
*
* warg is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* warg is distributed in the hope t... | starub/warg | src/main/scala/org/warg/modules/dnd2ed/races/AvailableRacesChecker.scala | Scala | gpl-3.0 | 2,112 |
package redis
import scala.concurrent._
class SentinelSpec extends RedisClusterClients {
sequential
"sentinel monitored test" should {
"ping" in {
Await.result(sentinelMonitoredRedisClient.ping(), timeOut) mustEqual "PONG"
Await.result(redisClient.ping(), timeOut) mustEqual "PONG"
}
"mas... | 272029252/rediscala | src/test/scala/redis/SentinelSpec.scala | Scala | apache-2.0 | 2,873 |
package reaktor.scct
import org.specs2.mutable._
class EnvSpec extends Specification {
"Env" should {
"provide Option[String]'s" in {
val propName = "scct.test."+System.currentTimeMillis
try {
Env.sysOption(propName) mustEqual None
System.setProperty(propName, "1")
Env.sysOpt... | mtkopone/scct | src/test/scala/reaktor/scct/EnvSpec.scala | Scala | apache-2.0 | 653 |
package com.github.vooolll.domain
final case class FacebookPaging(before: Option[String], after: Option[String])
| vooolll/facebook4s | src/main/scala/com/github/vooolll/domain/FacebookPaging.scala | Scala | apache-2.0 | 114 |
package im.actor.server.bot
import akka.actor._
import akka.pattern.pipe
import akka.stream.scaladsl.{ Sink, Source }
import akka.stream.{ ActorMaterializer, OverflowStrategy }
import akka.util.Timeout
import im.actor.botkit.BotBase
import im.actor.config.ActorConfig
import im.actor.server.dialog.DialogExtension
impo... | lzpfmh/actor-platform | actor-server/actor-bots/src/main/scala/im/actor/server/bot/InternalBot.scala | Scala | mit | 1,904 |
package lila.tournament
package arena
import lila.tournament.{ Score => AbstractScore }
import lila.tournament.{ ScoringSystem => AbstractScoringSystem }
object ScoringSystem extends AbstractScoringSystem {
sealed abstract class Flag(val id: Int)
case object Double extends Flag(3)
case object StreakStarter exte... | Happy0/lila | modules/tournament/src/main/arena/ScoringSystem.scala | Scala | mit | 2,263 |
/*
* 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 ... | esi-mineset/spark | sql/core/src/test/scala/org/apache/spark/sql/SQLQuerySuite.scala | Scala | apache-2.0 | 96,477 |
package com.seanshubin.learn.datomic.contract
import java.io.{BufferedReader, BufferedWriter, InputStream, OutputStream}
import java.lang.Iterable
import java.nio.channels.SeekableByteChannel
import java.nio.charset.Charset
import java.nio.file.DirectoryStream.Filter
import java.nio.file._
import java.nio.file.attribu... | SeanShubin/learn-datomic | contract-test/src/main/scala/com/seanshubin/learn/datomic/contract/FilesNotImplemented.scala | Scala | unlicense | 5,886 |
package inloopio.collection
import java.lang.ref.ReferenceQueue
import java.lang.ref.WeakReference
import scala.reflect.ClassTag
import scala.runtime.BoxesRunTime
/**
* This class can be used to construct data structures that are based
* on hashtables. Class `HashTable[K]` implements a hashtable
* that maps keys... | dcaoyuan/inloopio-libs | inloopio-util/src/main/scala/inloopio/collection/WeakIdentityHashTable.scala | Scala | bsd-3-clause | 14,357 |
package net.bhardy.braintree.scala.gw
import net.bhardy.braintree.scala.exceptions.NotFoundException
import net.bhardy.braintree.scala.util.Http
import net.bhardy.braintree.scala.{Address, AddressRequest}
/**
* Provides methods to create, delete, find, and update {@link Address} objects.
* This class does not need ... | benhardy/braintree-scala | src/main/scala/gw/AddressGateway.scala | Scala | mit | 2,421 |
/*
* 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/v3/B475.scala | Scala | apache-2.0 | 933 |
package java.util.regex
import scala.annotation.switch
import scala.scalajs.js
final class Pattern private (jsRegExp: js.RegExp, _pattern: String, _flags: Int)
extends Serializable {
import Pattern._
def pattern(): String = _pattern
def flags(): Int = _flags
override def toString(): String = pattern
... | xuwei-k/scala-js | javalib/src/main/scala/java/util/regex/Pattern.scala | Scala | bsd-3-clause | 5,413 |
package com.airbnb.common.ml.util
import java.io.{BufferedReader, IOException, InputStreamReader}
import java.net.URI
import org.apache.hadoop.conf.Configuration
import org.apache.hadoop.fs.{FileSystem, Path}
object HDFSUtil extends ScalaLogging {
private lazy val hadoopConfiguration = new Configuration()
/**... | airbnb/aerosolve | airlearner/airlearner-utils/src/main/scala/com/airbnb/common/ml/util/HDFSUtil.scala | Scala | apache-2.0 | 2,005 |
package d_m
import scala.reflect.internal.SymbolTable
trait Extractors {
val global: SymbolTable
import global._
def isTermLambdaMarker(tree: Tree): Boolean
def freshName(s: String): String
object TermLambdaMarker {
def unapply(tree: Tree): Boolean = isTermLambdaMarker(tree)
}
object UnappliedType... | non/kind-projector | src/main/scala/Extractors.scala | Scala | mit | 1,655 |
/**
* Copyright 2015 Dropbox, 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... | trafi/djinni | src/source/PythonMarshal.scala | Scala | apache-2.0 | 15,441 |
package adty.spark.tyv2.template
import org.apache.hadoop.mapred.lib.MultipleTextOutputFormat
/**
* Created by zstorm on 2017/6/22.
*/
class RDDMultipleTextOutputFormat extends MultipleTextOutputFormat[Any, Any] {
override def generateFileNameForKeyValue(key: Any, value: Any, name: String): String = k... | 7u/spark-learning | azkaban/azprojects/ssponce/src/main/scala/adty/spark/tyv2/template/RDDMultipleTextOutputFormat.scala | Scala | apache-2.0 | 348 |
/*
* 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/fset-faststream | app/model/command/Allocation.scala | Scala | apache-2.0 | 4,485 |
/*
* 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 ... | Sephiroth-Lin/incubator-carbondata | integration/spark-common-test/src/test/scala/org/apache/carbondata/spark/testsuite/dataload/TestLoadDataFrame.scala | Scala | apache-2.0 | 3,678 |
package com.twitter.finagle.http.filter
import com.twitter.finagle.Service
import com.twitter.finagle.http.{Method, Request, Response, Status}
import com.twitter.util.{Await, Future}
import org.junit.runner.RunWith
import org.scalatest.FunSuite
import org.scalatest.junit.JUnitRunner
@RunWith(classOf[JUnitRunner])
cla... | travisbrown/finagle | finagle-http/src/test/scala/com/twitter/finagle/http/filter/MethodRequiredFilterTest.scala | Scala | apache-2.0 | 1,439 |
package io.udash.demos.jquery.views.functions
import io.udash.demos.jquery.views.FunctionView
import io.udash.wrappers.jquery._
import org.scalajs.dom.Element
import scalatags.JsDom.tags2
/** Based on examples from: <a href="http://api.jquery.com/animate/">jQuery Docs</a>. */
object AnimateView extends FunctionView {... | UdashFramework/scala-js-jquery | example/src/main/scala/io/udash/demos/jquery/views/functions/AnimateView.scala | Scala | apache-2.0 | 2,375 |
package models.service.analysis
import models.database.alias.Artist
import models.database.facade.service.ServiceArtistTrait
import models.service.api.ApiFacade
import models.service.util.ServiceAccessTokenHelper
import models.util.Logging
import play.api.Play.current
import play.api.libs.json.{JsValue, Json}
import p... | haffla/stream-compare | app/models/service/analysis/ServiceAnalysis.scala | Scala | gpl-3.0 | 4,825 |
/**
* Copyright (C) 2014-2015 Really Inc. <http://really.io>
*/
package io.really.model
import _root_.io.really.ReallyGlobals
import play.api.libs.json.{ JsObject, JsResult, JsValue, JsPath }
case class SequenceField[T](
key: FieldKey,
dataType: DataType[T],
validationExpression: Option[JsScript],
d... | reallylabs/really | modules/really-core/src/main/scala/io/really/model/SequenceField.scala | Scala | apache-2.0 | 657 |
/*
* 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... | SRGOM/scalatest | scalatest/src/main/scala/org/scalatest/enablers/Writability.scala | Scala | apache-2.0 | 4,279 |
package com.cloudray.scalapress.search.widget
import org.scalatest.{OneInstancePerTest, FunSuite}
import org.scalatest.mock.MockitoSugar
import com.cloudray.scalapress.search.SearchFormDao
import org.mockito.Mockito
import com.cloudray.scalapress.framework.ScalapressContext
/** @author Stephen Samuel */
class SearchF... | vidyacraghav/scalapress | src/test/scala/com/cloudray/scalapress/search/widget/SearchFormWidgetTest.scala | Scala | apache-2.0 | 812 |
/*
* Wire
* Copyright (C) 2016 Wire Swiss GmbH
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This progr... | wireapp/wire-android-sync-engine | zmessaging/src/test/scala/com/waz/model/EphemeralDurationSpec.scala | Scala | gpl-3.0 | 5,601 |
package de.sciss.mutagentx
import de.sciss.file._
import de.sciss.lucre.{event => evt}
import scala.concurrent.Await
import scala.concurrent.duration.Duration
object CleanDB extends App {
import Algorithm.executionContext
val dataDir = file("database")
val audioFile = file("audio_work") / "derrida1_1_216500... | Sciss/MutagenTx | src/main/scala/de/sciss/mutagentx/CleanDB.scala | Scala | gpl-3.0 | 1,992 |
package com.github.j5ik2o.forseti.adaptor.dao
import org.scalatest.{BeforeAndAfterAll, fixture}
import scalikejdbc.config.DBs
import scalikejdbc.scalatest.AutoRollback
trait DaoSpecSupport extends BeforeAndAfterAll with AutoRollback { this: fixture.FunSpec =>
override protected def beforeAll(): Unit = {
super.... | j5ik2o/forseti | server/server-adaptor-driver/src/test/scala/com/github/j5ik2o/forseti/adaptor/dao/DaoSpecSupport.scala | Scala | mit | 449 |
//:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
/** @author John Miller
* @version 1.2
* @date Mon Sep 28 11:18:16 EDT 2015
* @see LICENSE (MIT style license file).
*/
package scalation.stat
import scala.language.implicitConversions
import scalation.linalgebra.mem_mapp... | NBKlepp/fda | scalation_1.2/src/main/scala/scalation/stat/Conversions.scala | Scala | mit | 1,540 |
package org.scalafmt.config
import scala.io.Codec
import scala.meta.Dialect
import scala.meta.dialects._
import scala.meta.parsers.Parse._
import scala.util.control.NonFatal
import metaconfig.Conf
import metaconfig.ConfDecoder
import metaconfig.ConfError
import metaconfig.Configured
import metaconfig.Configured.Ok
o... | olafurpg/scalafmt | scalafmt-core/shared/src/main/scala/org/scalafmt/config/ScalafmtConfDecoders.scala | Scala | apache-2.0 | 1,155 |
import org.apache.spark.sql.SparkSession
object BigData01v2 {
// register case class external to main
case class Order(OrderID : String, CustomerID : String, EmployeeID : String,
OrderDate : String, ShipCountry : String)
//
case class OrderDetails(OrderID : String, ProductID : String, UnitPrice : Float,
Qty : I... | dineshpackt/Fast-Data-Processing-with-Spark-2 | code/BigData01v2.scala | Scala | mit | 1,930 |
/*
* 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... | slamdata/slamengine | qscript/src/test/scala/quasar/qscript/provenance/ProvSpec.scala | Scala | apache-2.0 | 9,040 |
// See the LICENCE.txt file distributed with this work for additional
// information regarding copyright ownership.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache... | scray/scray | scray-querying/modules/scray-querying/src/main/scala/scray/querying/description/configuration.scala | Scala | apache-2.0 | 6,416 |
package argus.macros
import org.scalactic.Equality
import org.scalatest.matchers.{ MatchResult, Matcher }
import scala.tools.reflect.ToolBox
/**
* @author Aish Fenton.
*/
trait ASTMatchers {
val runtimeUniverse = scala.reflect.runtime.universe
import runtimeUniverse._
import scala.reflect.runtime.currentMi... | aishfenton/Argus | argus/src/test/scala/argus/macros/ASTMatchers.scala | Scala | mit | 1,330 |
package search
/**
* @author Marcin Milewski
* @since 2014-10-12
*/
package object types {
type Word = String
type DocumentTitle = String
type SearchResult = (DocumentTitle, Double)
}
import search.types.{DocumentTitle, SearchResult, Word}
import scala.collection.mutable.ListBuffer
/**
* Representation o... | mmilewski/search-tfidf-scala | src/main/scala/search/Indexer.scala | Scala | mit | 4,578 |
/*
* 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/pensions-lifetime-allowance-frontend | app/models/amendModels/AmendOverseasPensionsModel.scala | Scala | apache-2.0 | 949 |
package controllers
import javax.inject._
import play.api.mvc._
/**
* This controller creates an `Action` to handle HTTP requests to the
* application's home page.
*/
@Singleton
class HomeController @Inject() extends Controller {
/**
* Create an Action to render an HTML page with a welcome message.
* The ... | dazito/messengr | app/controllers/HomeController.scala | Scala | apache-2.0 | 564 |
/*
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 use this f... | transcendent-ai-labs/DynaML | dynaml-core/src/main/scala/io/github/mandar2812/dynaml/optimization/CommitteeModelSolver.scala | Scala | apache-2.0 | 2,842 |
/**
* Copyright (C) 2009-2017 Lightbend Inc. <http://www.lightbend.com>
*/
package akka.actor
import java.util.concurrent.atomic.AtomicReference
import akka.routing._
import akka.util.WildcardIndex
import com.typesafe.config._
import scala.annotation.tailrec
object Deploy {
final val NoDispatcherGiven = ""
f... | rorygraves/perf_tester | corpus/akka/akka-actor/src/main/scala/akka/actor/Deployer.scala | Scala | apache-2.0 | 7,915 |
/*
* 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/controllers/businessmatching/updateservice/remove/UnableToRemoveBusinessTypesController.scala | Scala | apache-2.0 | 2,269 |
package io.vamp.model.artifact
import java.util.regex.Pattern
import com.typesafe.scalalogging.LazyLogging
import io.vamp.common._
import io.vamp.common.notification.NotificationErrorException
import io.vamp.model.notification.{ InvalidArgumentError, InvalidArgumentValueError }
import io.vamp.model.reader.Time
impor... | magneticio/vamp | model/src/main/scala/io/vamp/model/artifact/Breed.scala | Scala | apache-2.0 | 7,448 |
/**
* 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... | dchenbecker/kafka-sbt | core/src/main/scala/kafka/api/StopReplicaRequest.scala | Scala | apache-2.0 | 3,532 |
import org.opencv.highgui.{Highgui, VideoCapture}
import org.opencv.core.Core
object IsolatorOpenCVApp extends App {
import opencv._
System.loadLibrary(Core.NATIVE_LIBRARY_NAME)
args match {
case Array(inFile, outFile) =>
val start = System.currentTimeMillis()
using (new VideoCapture(inFile)... | okapies/isolator | src/main/scala/IsolatorOpenCVApp.scala | Scala | bsd-2-clause | 602 |
package dotty.tools.dotc.semanticdb
import scala.language.unsafeNulls
import java.net.URLClassLoader
import java.util.regex.Pattern
import java.io.File
import java.nio.file._
import java.nio.charset.StandardCharsets
import java.util.stream.Collectors
import java.util.Comparator
import scala.util.control.NonFatal
impo... | dotty-staging/dotty | compiler/test/dotty/tools/dotc/semanticdb/SemanticdbTests.scala | Scala | apache-2.0 | 8,005 |
package com.dividezero.stubby.core.util
import java.util.regex.Matcher
import java.util.regex.Pattern
import com.dividezero.stubby.core.model.StubMessage
object HttpMessageUtils {
val ContentTypeHeader = "Content-Type"
val TextContentType = Pattern.compile("text/.+")
val JsonContentType = Pattern.compile("ap... | themillhousegroup/http-stub-server-scala | core/src/main/scala/com/dividezero/stubby/core/util/HttpMessageUtils.scala | Scala | apache-2.0 | 2,336 |
/*
* Copyright 2017 Ahmad Mozafarnia
*
* 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... | ahmadmo/bama-api-demo | app/ir/bama/utils/Dates.scala | Scala | apache-2.0 | 1,520 |
import org.scalatest._
import scalikejdbc._
import example._
import rclosure._
import scala.collection.immutable.Map
import scala.collection.immutable.HashMap
class ExampleSpec extends FlatSpec with Matchers {
Class.forName ("org.h2.Driver")
ConnectionPool.singleton ("jdbc:h2:mem:hello", "user", "pass")
def ... | gerritjvv/rclosure | scala/src/test/scala/rclosureTests.scala | Scala | epl-1.0 | 919 |
package com.tajpure.scheme.compiler.value
class Type {
val BOOL: Value = Type.BOOL
val INT: Value = Type.INT
val FLOAT: Value = Type.FLOAT
val STRING: Value = Type.STRING
}
object Type {
val BOOL: Value = new BoolType()
val INT: Value = new IntType()
val FLOAT: Value = new FloatT... | tajpure/SoScheme | src/main/scala/com/tajpure/scheme/compiler/value/Type.scala | Scala | gpl-3.0 | 372 |
// scalac: -Xfatal-warnings
//
object Test {
def f(ch: Char): Any = ch match {
case 'a' => 1
case 'a' | 'c' => 1 // unreachable
}
// won't be compiled to a switch since it has an unreachable (duplicate) case
def f2(ch: Char): Any = (ch: @annotation.switch) match {
case 'a' | 'b' => 1
case 'b'... | martijnhoekstra/scala | test/files/neg/t6011.scala | Scala | apache-2.0 | 695 |
/**
* The MIT License (MIT) Copyright (c) 2014 University of Applied Sciences, Berlin, Germany
* For more detailed information, please read the licence.txt in the root directory.
**/
package org.onepercent.utils.scoring
import org.onepercent.utils.Config
/**
* Can classify a Tweet based on the given probabilitie... | isn0gud/onepercent | src/main/scala/org/onepercent/utils/scoring/TweetClassifier.scala | Scala | mit | 3,242 |
package io.buoyant.namer.consul
import com.twitter.finagle._
import com.twitter.finagle.stats.StatsReceiver
import com.twitter.util._
import io.buoyant.consul.v1
import io.buoyant.namer.Metadata
import scala.util.control.NoStackTrace
private[consul] case class SvcKey(name: String, tag: Option[String]) {
override de... | hhtpcd/linkerd | namer/consul/src/main/scala/io/buoyant/namer/consul/SvcAddr.scala | Scala | apache-2.0 | 4,679 |
package org.bitcoins.spvnode.serializers.messages.control
import org.bitcoins.core.number.UInt64
import org.bitcoins.core.serializers.RawBitcoinSerializer
import org.bitcoins.spvnode.messages.PongMessage
import org.bitcoins.spvnode.messages.control.PongMessage
/**
* Created by chris on 7/5/16.
*/
trait RawPongMes... | Christewart/bitcoin-s-spv-node | src/main/scala/org/bitcoins/spvnode/serializers/messages/control/RawPongMessageSerializer.scala | Scala | mit | 624 |
trait Foo[T <: Foo[T, Enum], Enum <: Enumeration] {
type StV = Enum#Value // error: Enum is not a legal path
type Meta = MegaFoo[T, Enum]
type Slog <: Enumeration
def getSingleton: Meta
}
trait MegaFoo[T <: Foo[T, Enum], Enum <: Enumeration] extends Foo[T, Enum] {
def doSomething(what: T, misc: StV, dog: M... | som-snytt/dotty | tests/neg/t1292.scala | Scala | apache-2.0 | 829 |
/*
* 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 ... | sahilTakiar/spark | sql/core/src/main/scala/org/apache/spark/sql/streaming/progress.scala | Scala | apache-2.0 | 10,163 |
/*
* ******************************************************************************
* * Copyright (C) 2013 Christopher Harris (Itszuvalex)
* * Itszuvalex@gmail.com
* *
* * This program is free software; you can redistribute it and/or
* * modify it under the terms of the GNU General Public License
* * as p... | BlockWorker/ItszuLib | src/main/scala/com/itszuvalex/itszulib/render/RenderUtils.scala | Scala | gpl-2.0 | 19,188 |
/*
* 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 ... | jinglining/flink | flink-table/flink-table-planner/src/test/scala/org/apache/flink/table/plan/RetractionRulesTest.scala | Scala | apache-2.0 | 14,398 |
package com.twitter.finatra.kafkastreams.integration.tracing
import com.twitter.conversions.DurationOps._
import com.twitter.finagle.Init
import com.twitter.finagle.context.Contexts
import com.twitter.finagle.filter.PayloadSizeFilter.ClientReqTraceKey
import com.twitter.finagle.stats.StatsReceiver
import com.twitter.f... | twitter/finatra | kafka-streams/kafka-streams/src/test/scala/com/twitter/finatra/kafkastreams/integration/tracing/TracingServerTest.scala | Scala | apache-2.0 | 4,846 |
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.