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 com.sksamuel.scapegoat.inspections.string
import com.sksamuel.scapegoat.{ Inspection, InspectionContext, Inspector, Levels }
/** @author Stephen Samuel */
class LooksLikeInterpolatedString extends Inspection {
final val regex1 = "\\\\$\\\\{[a-z][.a-zA-Z0-9_]*\\\\}".r
final val regex2 = "\\\\$[a-z][.a-zA-... | pwwpche/scalac-scapegoat-plugin | src/main/scala/com/sksamuel/scapegoat/inspections/string/LooksLikeInterpolatedString.scala | Scala | apache-2.0 | 1,138 |
/*
* 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... | hmrc/api-gateway | app/uk/gov/hmrc/apigateway/connector/impl/ThirdPartyApplicationConnector.scala | Scala | apache-2.0 | 2,235 |
package dotty.tools
package dotc
package util
import scala.language.unsafeNulls
import printing.{Showable, Printer}
import printing.Texts._
import core.Contexts.Context
import Spans.{Span, NoSpan}
import scala.annotation.internal.sharable
/** A source position is comprised of a span and a source file */
case class S... | dotty-staging/dotty | compiler/src/dotty/tools/dotc/util/SourcePosition.scala | Scala | apache-2.0 | 3,633 |
package dotty.tools.dotc.printing
import dotty.tools.dotc.ast.Trees._
import dotty.tools.dotc.ast.untpd.{Tree, PackageDef, Template, TypeDef}
import dotty.tools.dotc.ast.{Trees, untpd}
import dotty.tools.dotc.printing.Texts._
import dotty.tools.dotc.core.Contexts._
import dotty.tools.dotc.core.StdNames.nme
import dott... | dotty-staging/dotty | compiler/src/dotty/tools/dotc/printing/DecompilerPrinter.scala | Scala | apache-2.0 | 3,553 |
package wow.auth.protocol.packets
import wow.auth.protocol.AuthResults.AuthResult
import wow.common.codecs._
import wow.auth.protocol.{AuthResults, OpCodes, ServerPacket}
import scodec._
import scodec.codecs._
/**
* Packet values for successful challenge.
*/
case class ServerLogonChallengeSuccess(serverKey: BigIn... | SKNZ/SpinaciCore | wow/core/src/main/scala/wow/auth/protocol/packets/ServerLogonChallenge.scala | Scala | mit | 1,418 |
package com.twitter.scalding
import cascading.pipe.joiner._
import org.specs._
class StarJoinJob(args : Args) extends Job(args) {
val in0 = Tsv("input0").read.mapTo((0,1) -> ('x0, 'a)) { input : (Int, Int) => input }
val in1 = Tsv("input1").read.mapTo((0,1) -> ('x1, 'b)) { input : (Int, Int) => input }
val in2 ... | AoJ/scalding | src/test/scala/com/twitter/scalding/CoGroupTest.scala | Scala | apache-2.0 | 1,380 |
/**
* Copyright (C) 2011 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 program i... | brunobuzzi/orbeon-forms | xforms/jvm/src/main/scala/org/orbeon/oxf/xforms/PartGlobalOps.scala | Scala | lgpl-2.1 | 4,253 |
/* __ *\\
** ________ ___ / / ___ __ ____ Scala.js API **
** / __/ __// _ | / / / _ | __ / // __/ (c) 2013, LAMP/EPFL **
** __\\ \\/ /__/ __ |/ /__/ __ |/_// /_\\ \\ http://scala-lang.org/ **
** /____/\\___/... | swhgoon/scala-js | library/src/main/scala/scala/scalajs/js/Math.scala | Scala | bsd-3-clause | 7,203 |
package almhirt.akkax
import scala.concurrent.duration._
import scala.concurrent.ExecutionContext
import akka.actor.ActorRef
import akka.pattern._
import almhirt.common._
import almhirt.almfuture.all._
sealed trait ComponentState
object ComponentState {
case object Startup extends ComponentState { override def toS... | chridou/almhirt | almhirt-core/src/main/scala/almhirt/akkax/ComponentControl.scala | Scala | apache-2.0 | 5,283 |
import scala.tools.partest.instrumented.Instrumentation._
object Test {
def main(args: Array[String]): Unit = {
startProfiling()
// tests optimization in Cleanup for varargs reference arrays
Array("")
Array(true)
Array(true, false)
Array(1: Byte)
Array(1: Byte, 2: Byte)
Array(1: Sh... | lrytz/scala | test/files/instrumented/t6611.scala | Scala | apache-2.0 | 626 |
package org.wartremover.contrib.warts
import org.wartremover.{ WartTraverser, WartUniverse }
object RefinedClasstag extends WartTraverser {
def ctMessage(typeName: String): String = s"Refined types should not be used in Classtags since only the first type will be checked at runtime. Type found: $typeName"
def mf... | wartremover/wartremover-contrib | core/src/main/scala/wartremover/contrib/warts/RefinedClasstag.scala | Scala | apache-2.0 | 1,774 |
package notebook.core.parser.impl
import java.io.StringWriter
import net.java.textilej.parser.MarkupParser
import net.java.textilej.parser.builder.HtmlDocumentBuilder
import net.java.textilej.parser.markup.mediawiki.MediaWikiDialect
import notebook.core.parser.Parser
private[core] object MediaWikiParser extends Parse... | fkmt-disk/notebook | src/main/scala/notebook/core/parser/impl/MediaWikiParser.scala | Scala | mit | 641 |
/*
* Copyright (C) 2014 - 2019 Dennis Vriend <https://github.com/dnvriend>
* Copyright (C) 2019 - 2021 Lightbend Inc. <https://www.lightbend.com>
*/
package akka.persistence.jdbc.config
import akka.persistence.jdbc.util.ConfigOps._
import com.typesafe.config.Config
import scala.concurrent.duration._
object Confi... | dnvriend/akka-persistence-jdbc | core/src/main/scala/akka/persistence/jdbc/config/AkkaPersistenceConfig.scala | Scala | apache-2.0 | 11,408 |
/*
* File MessageHandler.scala is part of JsonRecipes.
* JsonRecipes is opensource Minecraft mod(released under LGPLv3), created by anti344.
* Full licence information can be found in LICENCE and LICENCE.LESSER files in jar-file of the mod.
* Copyright Β© 2014, anti344
*/
package net.anti344.jsonrecipes.handlers
... | mc-anti344/JsonRecipes | src/main/scala/net/anti344/jsonrecipes/handlers/MessageHandler.scala | Scala | gpl-3.0 | 1,699 |
/*
* MUSIT is a museum database to archive natural and cultural history data.
* Copyright (C) 2016 MUSIT Norway, part of www.uio.no (University of Oslo)
*
* 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 Softw... | kpmeen/musit | musit-models/src/main/scala/no/uio/musit/models/OrgId.scala | Scala | gpl-2.0 | 1,436 |
package chandu0101.scalajs.react.components.materialui
import japgolly.scalajs.react._
import materialui.Mui
import scala.scalajs.js
/**
* key: PropTypes.string,
style: PropTypes.js.Any,
ref: PropTypes.String,
inset: React.PropTypes.bool,
*/
object MuiListDivider {
def apply(key: js.UndefOr[String] = js.unde... | coreyauger/scalajs-react-components | core/src/main/scala/chandu0101/scalajs/react/components/materialui/MuiLists.scala | Scala | apache-2.0 | 4,923 |
/*
* 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 ... | vjagadish/samza-clone | samza-kv/src/main/scala/org/apache/samza/storage/kv/BaseKeyValueStorageEngineFactory.scala | Scala | apache-2.0 | 5,672 |
/*
* 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 ... | WindCanDie/spark | mllib/src/main/scala/org/apache/spark/ml/feature/HashingTF.scala | Scala | apache-2.0 | 4,582 |
// Copyright 2017 Dennis Vriend
//
// 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 i... | dnvriend/serverless-test | aws-lambda-handler/src/main/scala/com/github/dnvriend/ops/ByteBufferOps.scala | Scala | apache-2.0 | 965 |
import sbt._
import Keys._
import com.typesafe.sbt.SbtMultiJvm
import com.typesafe.sbt.SbtMultiJvm.MultiJvmKeys.MultiJvm
object ApplicationBuild extends Build {
val appName = "akka-raft"
val appVersion = "1.0-SNAPSHOT"
import Dependencies._
val debugInUse = SettingKey[Boolean]("debug-in-use", "debug is use... | ktoso/akka-raft | project/Build.scala | Scala | apache-2.0 | 2,027 |
object Test {
def ser[T](s: Seq[T]): Unit = {
val bos = new java.io.ByteArrayOutputStream()
val oos = new java.io.ObjectOutputStream(bos)
oos.writeObject(s)
val ois = new java.io.ObjectInputStream(new java.io.ByteArrayInputStream(bos.toByteArray))
val obj = ois.readObject()
println(obj)
... | som-snytt/dotty | tests/run/serialize-stream.scala | Scala | apache-2.0 | 546 |
/***********************************************************************
* Copyright (c) 2013-2015 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 ... | drackaer/geomesa | geomesa-utils/src/main/scala/org/locationtech/geomesa/utils/geotools/package.scala | Scala | apache-2.0 | 1,266 |
package lara.epfl.scalasca.rules
import lara.epfl.scalasca.core._
import scala.tools.nsc._
import reflect.runtime.universe.Transformer
import scala.tools.reflect.ToolBox
case class BlockConstantPropagationMapper(symbolTable: Map[Global#Symbol, SymbolImage]) extends RuleResult with SymbolMapper {
override def getMap... | jean-andre-gauthier/scalasca | src/main/scala/lara/epfl/scalasca/rules/BlockConstantPropagation.scala | Scala | bsd-3-clause | 4,939 |
/*
Copyright 2010 the original author or 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... | markusgumbel/dshl7 | core/src/main/scala/net/gumbix/hl7dsl/DSL/PersonDSL.scala | Scala | apache-2.0 | 2,687 |
package com.wavesplatform.state
import com.typesafe.config.Config
import net.ceedubs.ficus.Ficus._
case class Settings(
networkConfigFile: String,
aliasesFile: String,
restTxsFile: String,
blocksFile: String,
accountsFile: String,
assetsFile: String,
dataFile: String
)
object Settings {
... | wavesplatform/Waves | benchmark/src/main/scala/com/wavesplatform/state/Settings.scala | Scala | mit | 480 |
/*
* Scala (https://www.scala-lang.org)
*
* Copyright EPFL and Lightbend, Inc.
*
* Licensed under Apache License 2.0
* (http://www.apache.org/licenses/LICENSE-2.0).
*
* See the NOTICE file distributed with this work for
* additional information regarding copyright ownership.
*/
package scala
package sys
imp... | scala/scala | src/library/scala/sys/PropImpl.scala | Scala | apache-2.0 | 1,558 |
package controllers
import play.api.mvc._
import play.api.libs.json._
import play.api.libs.json.Reads._
import play.api.libs.functional.syntax._
import play.api.cache._
import javax.inject.Inject
import closeness.core.vertex.Graph
import closeness.core.vertex.Edge
//import closeness.core.vertex.Node
class Application... | restarac/close2center | closeness-web/app/controllers/Application.scala | Scala | gpl-3.0 | 2,050 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | pgandhi999/spark | sql/core/src/main/scala/org/apache/spark/sql/execution/python/ExtractPythonUDFs.scala | Scala | apache-2.0 | 11,616 |
package com.sksamuel.scapegoat.inspections.string
import com.sksamuel.scapegoat.{Inspection, InspectionContext, Inspector, Levels}
/**
* @author
* Stephen Samuel
*/
class SubstringZero
extends Inspection(
text = "String.substring(0)",
defaultLevel = Levels.Info,
description = "Checks for St... | sksamuel/scapegoat | src/main/scala/com/sksamuel/scapegoat/inspections/string/SubstringZero.scala | Scala | apache-2.0 | 1,092 |
package demo.akka.stream
import akka.actor.ActorSystem
import akka.stream.ActorMaterializer
import akka.stream.scaladsl.{Sink, Source, Flow}
import scala.concurrent.Future
object Demo1 extends App {
implicit val system = ActorSystem()
import system.dispatcher
implicit val mat = ActorMaterializer()
val sour... | MartinSeeler/akka-stream-introduction | src/main/scala/demo/akka/stream/Demo1.scala | Scala | mit | 552 |
package models
import java.util.Date
import com.mongodb.casbah.Imports._
import org.bson.types.ObjectId
import models.mongoContext._
import play.api.Play.current
import play.api.libs.json._
import play.api.libs.json.Json._
import libs.json._
import com.novus.salat.annotations.raw.Salat
import com.novus.salat.dao.{Sala... | xebia-france/xndf | app/models/domain.scala | Scala | mit | 6,811 |
package com.esri
import com.vividsolutions.jts.geom._
/**
*/
object GeomFact extends Serializable {
val geomFact = new GeometryFactory(new PrecisionModel(1000000.0))
def createPoint(x: Double, y: Double) = {
geomFact.createPoint(new Coordinate(x, y))
}
def createMultiPolygons(polygons: Array[Polygon]... | mraad/spark-pip | src/main/scala/com/esri/GeomFact.scala | Scala | apache-2.0 | 508 |
package org.helianto.message.service
import org.helianto.message.config.{MailerProperties, SmsProperties}
import org.helianto.message.domain.{Message, MessageLog, TotalVoiceSmsMessage}
import org.helianto.message.repository.MessageLogRepository
import org.slf4j.{Logger, LoggerFactory}
import org.springframework.beans.... | iservport/helianto-spring | src/main/scala/org/helianto/message/service/TotalVoiceService.scala | Scala | apache-2.0 | 1,947 |
package demy.mllib.feature
import org.apache.spark.ml.Transformer
import org.apache.spark.ml.param.{Param, ParamMap}
import org.apache.spark.ml.util.{Identifiable, DefaultParamsWritable, DefaultParamsReadable}
import org.apache.spark.ml.linalg.SparseVector
import org.apache.spark.sql.{Dataset, DataFrame}
import org.ap... | forchard-epi/demy | mllib/src/main/scala/feature/ArrayHasher.scala | Scala | bsd-3-clause | 2,079 |
/*
* 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 ... | jasonpet/openwhisk | tests/src/test/scala/org/apache/openwhisk/core/database/test/behavior/ArtifactStoreBehaviorBase.scala | Scala | apache-2.0 | 6,615 |
package org.loklak.data
import akka.actor._
/**
* Created by Scott on 6/4/16.
*/
case object ClearESCount
class DataAccessActor extends Actor with ActorLogging{
var count = 0
def receive = {
case (id:String,json:String) => DAO.store(id,json); count = count + 1
case ClearESCount => count = 0
}
}
| DengYiping/loklak-scala | src/main/scala/org/loklak/data/DataAccessActor.scala | Scala | mit | 316 |
package org.apache.spark.core.utils
import com.typesafe.config.Config
import org.apache.spark.SparkConf
import scala.collection.JavaConverters._
object ContextUtils {
def configToSparkConf(config:Config, contextName:String): SparkConf ={
val sparkConf = new SparkConf()
.setAppName(contextName)
.set... | linzhe/matrix | src/main/scala/org/apache/spark/core/utils/ContextUtils.scala | Scala | apache-2.0 | 537 |
package org.elasticsearch.spark.serialization
import scala.collection.Map
import scala.collection.immutable.Nil
import org.elasticsearch.hadoop.serialization.Generator
import org.elasticsearch.hadoop.serialization.builder.JdkValueWriter
import org.elasticsearch.hadoop.serialization.builder.ValueWriter.Result
import or... | girirajsharma/elasticsearch-hadoop | spark/core/main/scala/org/elasticsearch/spark/serialization/ScalaValueWriter.scala | Scala | apache-2.0 | 3,431 |
package example
import cucumber.api.scala.{EN, ScalaDsl}
import org.scalatest.Matchers
import org.scalatest.concurrent.{Eventually, ScalaFutures}
object ServiceSteps {
lazy val defaultStartedService = {
CalculatorServer.start(8080)
}
}
class ServiceSteps extends ScalaDsl with EN with Matchers with ScalaFutur... | Tapad/sbt-docker-compose | examples/basic-with-tests-cucumber/src/test/scala/ServiceSteps.scala | Scala | bsd-3-clause | 1,085 |
package com.sksamuel.elastic4s.admin
import com.sksamuel.elastic4s.{Indexes, IndexesAndTypes}
trait IndexAdminApi {
def refreshIndex(first: String, rest: String*): RefreshIndexDefinition = refreshIndex(first +: rest)
def refreshIndex(indexes: Iterable[String]): RefreshIndexDefinition = refreshIndex(Indexes(index... | tyth/elastic4s | elastic4s-core/src/main/scala/com/sksamuel/elastic4s/admin/IndexAdminApi.scala | Scala | apache-2.0 | 3,171 |
package manu.tron.service.impl
import manu.tron.service.MinimaxService
import manu.tron.common.Vocabulary._
/**
* Created by manu on 2/6/14.
*/
trait MinimaxServiceComponent {
val minimaxService: MinimaxService
class MinimaxServiceImpl extends MinimaxService {
override def minimax(status: GameStatus,
... | implicitdef/tron | src/main/scala/manu/tron/service/impl/MinimaxServiceComponent.scala | Scala | mit | 1,964 |
package scapi.sigma.damgardjurik.product
import java.math.BigInteger
import akka.actor.{Actor, ActorSystem, Props}
import edu.biu.scapi.midLayer.asymmetricCrypto.encryption.{DJKeyGenParameterSpec, ScDamgardJurikEnc}
import edu.biu.scapi.midLayer.asymmetricCrypto.keys.{DamgardJurikPrivateKey, DamgardJurikPublicKey}
im... | kushti/scala-scapi | src/main/scala/scapi/sigma/damgardjurik/product/Dealer.scala | Scala | cc0-1.0 | 1,983 |
/*
* 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 ... | mahak/spark | sql/core/src/main/scala/org/apache/spark/sql/execution/columnar/InMemoryRelation.scala | Scala | apache-2.0 | 16,087 |
package com.project.akka.guice
import org.scalatest.FeatureSpecLike
import com.google.inject.Guice
import scala.concurrent.duration._
import akka.util.Timeout
import akka.actor.{ActorRef, Props, ActorSystem, Actor}
import javax.inject.Inject
import com.project.akka.guice.PerformanceTest._
import akka.pattern.ask
impor... | alessandrosimi/akka-guice | src/test/scala/com/project/akka/guice/PerformanceTest.scala | Scala | apache-2.0 | 3,766 |
package lamdheal
import lamdheal.TypeSystem._
import java.io.FileReader
import scala.io.Source
/* Copyright 2013 Davi Pereira dos Santos
This file is part of Lamdheal.
Lamdheal is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
... | lamdheal/lamdheal-j | src/lamdheal/CompilingToScala.scala | Scala | gpl-3.0 | 3,713 |
import com.julianpeeters.toolbox.provider._
import models.{ ClassData, FieldData }
import com.novus.salat._
import com.novus.salat.global._
import com.mongodb.casbah.Imports._
import org.specs2._
import mutable._
import specification._
class IntSpec extends mutable.Specification {
val valueMembers: List[FieldDat... | julianpeeters/toolbox-type-provider | src/test/scala/singleField/IntSpec.scala | Scala | apache-2.0 | 925 |
/***********************************************************************
* Copyright (c) 2013-2019 Commonwealth Computer Research, Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Apache License, Version 2.0
* which accompanies this distribution and... | elahrvivaz/geomesa | geomesa-cassandra/geomesa-cassandra-tools/src/main/scala/org/locationtech/geomesa/cassandra/tools/commands/CassandraExplainCommand.scala | Scala | apache-2.0 | 1,347 |
/*
* sbt-haxe
* Copyright 2014 ζ·±ε³ε²ε‘η½η»ζιε
¬εΈ (Shenzhen QiFun Network Corp., LTD)
*
* 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
*
... | ThoughtWorksInc/sbt-haxe | src/main/scala/com/thoughtworks/microbuilder/sbtHaxe/HaxeJavaPlugin.scala | Scala | apache-2.0 | 2,808 |
package org.jetbrains.plugins.scala
package codeInspection
package internal
import org.jetbrains.plugins.scala.codeInspection.collections.{OperationOnCollectionInspection, Qualified, Simplification, SimplificationType, invocation, invocationText}
import org.jetbrains.plugins.scala.extensions._
import org.jetbrains.plu... | JetBrains/intellij-scala | scala/scala-impl/src/org/jetbrains/plugins/scala/codeInspection/internal/InstanceOfInspection.scala | Scala | apache-2.0 | 1,337 |
/*
* (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/main/scala/cogx/compiler/codegenerator/opencl/hyperkernels/ReplicateHyperKernel.scala | Scala | apache-2.0 | 3,725 |
package io.finch
import java.util.UUID
import cats.Show
import cats.effect.IO
import com.twitter.finagle.http.{FileElement, RequestBuilder, SimpleElement}
import com.twitter.finagle.http.exp.Multipart
import com.twitter.io.Buf
import io.finch.data.Foo
class MultipartSpec extends FinchSpec {
behavior of "multipart... | ImLiar/finch | core/src/test/scala/io/finch/MultipartSpec.scala | Scala | apache-2.0 | 3,571 |
package com.danielasfregola.twitter4s.entities
final case class TweetUpdate(status: String,
in_reply_to_status_id: Option[Long] = None,
possibly_sensitive: Boolean = false,
lat: Option[Long] = None,
long... | DanielaSfregola/twitter4s | src/main/scala/com/danielasfregola/twitter4s/entities/TweetUpdate.scala | Scala | apache-2.0 | 592 |
package org.jetbrains.plugins.scala.dfa.lattice
import org.jetbrains.plugins.scala.dfa.lattice.MeetSemiLatticeOps.MeetSemiLatticeExt
import org.jetbrains.plugins.scala.dfa.latticeTop
import scala.language.implicitConversions
/**
* A meet-semi-lattice is a [[SemiLattice]] with a reflexive `meet` operation
* where e... | JetBrains/intellij-scala | scala/dfa/src/org/jetbrains/plugins/scala/dfa/lattice/MeetSemiLattice.scala | Scala | apache-2.0 | 1,975 |
package com.sksamuel.scrimage.metadata
import com.sksamuel.scrimage.{Tag, ImageMetadata}
import org.scalatest.{ Matchers, WordSpec }
/** @author Stephen Samuel */
class ImageMetadataTest extends WordSpec with Matchers {
private val stream = getClass.getResourceAsStream("/vossen.jpg")
"metadata" should {
"re... | carlosFattor/scrimage | scrimage-core/src/test/scala/com/sksamuel/scrimage/metadata/ImageMetadataTest.scala | Scala | apache-2.0 | 646 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | witgo/spark | core/src/main/scala/org/apache/spark/ui/jobs/AllJobsPage.scala | Scala | apache-2.0 | 20,858 |
import org.scalatest.BeforeAndAfterAll
import org.scalatestplus.play.{OneAppPerSuite, PlaySpec}
import play.api.Logger
import play.api.test.FakeApplication
import play.api.test.Helpers._
class BranchTests extends PlaySpec with OneAppPerSuite with BeforeAndAfterAll {
implicit val context = play.api.libs.concurrent.Ex... | thomas-tosoni/scala-gitlab-api | test/BranchTests.scala | Scala | mit | 2,068 |
package ru.org.codingteam.horta
import java.nio.file.Paths
import akka.actor.{ActorSystem, Props}
import com.typesafe.config.ConfigFactory
import com.typesafe.scalalogging.StrictLogging
import org.jivesoftware.smack.SmackConfiguration
import ru.org.codingteam.horta.configuration.Configuration
import ru.org.codingteam... | codingteam/horta-hell | src/main/scala/ru/org/codingteam/horta/Application.scala | Scala | mit | 2,740 |
package services.migration
import akka.actor._
import play.Logger
import scala.util.Random
import akka.util.Timeout
import scala.concurrent.duration._
import akka.pattern.ask
import scala.concurrent.Future
import akka.contrib.throttle.Throttler._
import akka.contrib.throttle.TimerBasedThrottler
trait ThrottleControl... | guardian/flex-content-migrator | app/services/migration/Throttle.scala | Scala | mit | 3,129 |
package org.ninjatasks
import org.scalatest.{Matchers, FlatSpec}
/**
*
* Created by Gilad Ber on 6/14/2014.
*/
abstract class UnitSpec extends FlatSpec with Matchers | giladber/ninja-tasks | src/test/scala/org/ninjatasks/UnitSpec.scala | Scala | apache-2.0 | 170 |
package com.varunvats.practice.array
import com.varunvats.practice.sorting.UnitSpec
class SelfCrossingSpec extends UnitSpec {
val theSequenceOfNumbers = afterWord("the sequence of numbers")
"A sequence of points" must {
"not be self-crossing" when theSequenceOfNumbers {
"has fewer than or equal to 3 ... | varunvats/practice | jvm/src/test/scala/com/varunvats/practice/array/SelfCrossingSpec.scala | Scala | mit | 1,707 |
package model
import play.api.libs.json._
/**
* Represents the Swagger definition for ExtensionClassContainerImpl1.
* @param additionalProperties Any additional properties this model may have.
*/
@javax.annotation.Generated(value = Array("org.openapitools.codegen.languages.ScalaPlayFrameworkServerCodegen"), dat... | cliffano/swaggy-jenkins | clients/scala-play-server/generated/app/model/ExtensionClassContainerImpl1.scala | Scala | mit | 1,616 |
/**
* 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... | guozhangwang/kafka | core/src/test/scala/kafka/tools/GetOffsetShellTest.scala | Scala | apache-2.0 | 7,151 |
// 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-service/src/main/scala/scray/core/service/scrayTServer.scala | Scala | apache-2.0 | 4,681 |
/*
* 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 ... | nilsgrabbert/spark | sql/core/src/test/scala/org/apache/spark/sql/SubquerySuite.scala | Scala | apache-2.0 | 29,648 |
package com.realizationtime.btdogg.commons
import java.nio.file.Path
import scala.util.{Failure, Success, Try}
case class ParsingResult[+T](key: TKey, path: Path, result: Try[T]) {
def copyFailed[R](): ParsingResult[R] = {
result match {
case Failure(t) => ParsingResult[R](key, path, Failure(t))
ca... | bwrega/btdogg | src/main/scala/com/realizationtime/btdogg/parsing/ParsingResult.scala | Scala | mit | 651 |
/**
* Copyright 2013 Netflix, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed ... | zjrstar/RxScala | src/main/scala/rx/lang/scala/Notification.scala | Scala | apache-2.0 | 5,182 |
package com.henryp.sparkfinance
import com.henryp.sparkfinance.feeds._
import com.henryp.sparkfinance.logging.Logging
import org.apache.spark.SparkContext
import org.apache.spark.mllib.stat.Statistics
import org.apache.spark.rdd.RDD
import scala.reflect.ClassTag
package object sparkjobs extends Logging {
/**
*... | PhillHenry/SparkFinance | sparkjobs/src/main/scala/com/henryp/sparkfinance/sparkjobs/package.scala | Scala | apache-2.0 | 2,587 |
/*
* Licensed to Cloudera, Inc. under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. Cloudera, Inc. licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use thi... | hdinsight/hue | apps/spark/java/livy-server/src/test/scala/com/cloudera/hue/livy/server/SessionManagerSpec.scala | Scala | apache-2.0 | 1,973 |
package pl.touk.nussknacker.engine.util.config
import com.typesafe.config.ConfigFactory
import org.scalatest.{FunSuite, Matchers}
import java.net.URI
import java.nio.file.Files
import scala.jdk.CollectionConverters.mapAsJavaMapConverter
class ConfigFactoryExtSpec extends FunSuite with Matchers {
test("loads in co... | TouK/nussknacker | utils/utils-internal/src/test/scala/pl/touk/nussknacker/engine/util/config/ConfigFactoryExtSpec.scala | Scala | apache-2.0 | 1,177 |
package poly.util.progressbar
import java.time._
import poly.util.logging._
/**
* A simple console-based progress bar.
* @param task Name of the progress bar.
* @param initialMax Initial estimation of the number of steps when the task is complete.
* @param length The length of the progress bar shown in console. D... | ctongfei/poly-util | src/main/scala/poly/util/progressbar/ProgressBar.scala | Scala | mit | 2,888 |
package com.wavesplatform.transaction.assets
import com.wavesplatform.account.{AddressScheme, KeyPair, PrivateKey, PublicKey}
import com.wavesplatform.crypto
import com.wavesplatform.lang.ValidationError
import com.wavesplatform.transaction.Asset.IssuedAsset
import com.wavesplatform.transaction._
import com.wavesplatf... | wavesplatform/Waves | node/src/main/scala/com/wavesplatform/transaction/assets/BurnTransaction.scala | Scala | mit | 3,040 |
/*
* 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 ... | h2oai/sparkling-water | benchmarks/src/main/scala/ai/h2o/sparkling/benchmarks/TrainAlgorithmFromDataFrameViaCsvConversionBenchmark.scala | Scala | apache-2.0 | 2,102 |
package io.slicker.core
/**
* Page request that allows to set limit/offset values for a request in terms of pagination
*
* @param page Page number. Should always be equal or greater than 1
* @param perPage Number of entities to get from request. Should always be equal or greater than 0
* @param sort Fi... | ImLiar/slicker | slicker-core/src/main/scala/io/slicker/core/PageRequest.scala | Scala | apache-2.0 | 1,342 |
package se.culvertsoft.mgen.cpppack.generator.impl.classh
import se.culvertsoft.mgen.api.model.ClassType
import se.culvertsoft.mgen.compiler.util.SourceCodeBuffer
object MkDefaultCtor {
def apply(t: ClassType)(implicit txtBuffer: SourceCodeBuffer) {
txtBuffer.tabs(1).textln(s"${t.shortName()}();")
}
} | culvertsoft/mgen | mgen-cppgenerator/src/main/scala/se/culvertsoft/mgen/cpppack/generator/impl/classh/MkDefaultCtor.scala | Scala | mit | 316 |
/*
* Copyright (c) 2009 Sony Pictures Imageworks Inc.
*
* 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, thi... | azinman/scala-migrations | src/test/scala/com/imageworks/migration/tests/grant_and_revoke/Migrate_200811241940_CreateUser.scala | Scala | bsd-3-clause | 2,203 |
package com.example
import akka.actor.Actor
import spray.routing._
import spray.http._
import MediaTypes._
// we don't implement our route structure directly in the service actor because
// we want to be able to test it independently, without having to spin up an actor
class MyServiceActor extends Actor with MyServic... | weixing0/scala-lang | spray-test/src/main/scala/com/example/MyServiceActor.scala | Scala | apache-2.0 | 1,107 |
/*
* Scala (https://www.scala-lang.org)
*
* Copyright EPFL and Lightbend, Inc.
*
* Licensed under Apache License 2.0
* (http://www.apache.org/licenses/LICENSE-2.0).
*
* See the NOTICE file distributed with this work for
* additional information regarding copyright ownership.
*/
package scala.reflect.macros
p... | lrytz/scala | src/compiler/scala/reflect/macros/compiler/Validators.scala | Scala | apache-2.0 | 10,569 |
import sbt._
import Keys._
import sbtrelease._
import ReleaseStateTransformations._
import xerial.sbt.Sonatype._
import scoverage._
object BuildSettings {
val buildOrganization = "com.github.snowgooseyk"
val buildVersion = "0.1.3-SNAPSHOT"
val buildScalaVersion = "2.11.6"
val clossBuildScalaVersio... | snowgooseyk/sscsv | project/Build.scala | Scala | mit | 2,976 |
//package dsentric.operators
//
//import dsentric.contracts.ContractFor
//import dsentric.failure._
//import dsentric.schema._
//import dsentric.{DArray, DCodec, DNull, DObject, Path, Raw, RawObject, StringCodec}
//
//import scala.util.matching.Regex
//
//trait Validators extends ValidatorOps {
//
//
//
// def >(x:Lon... | HigherState/dsentric | maps/src/main/scala/dsentric/operators/Validators.scala | Scala | apache-2.0 | 19,591 |
package hasheq
package immutable
import hasheq.std.int._
class HashSetTest extends TestSuite {
// test set of Int
checkAll(SetRepr.properties[HashSet, Int]("SetRepr[HashSet, Int]"))
// test set of Int modulo 10
object Mod10
implicit object IntEqMod10 extends Equiv[Int, Mod10.type] {
def mod10(i: Int):... | TomasMikula/hasheq | src/test/scala/hasheq/immutable/HashSetTest.scala | Scala | bsd-3-clause | 944 |
package scala.pickling.open.sum1
import org.scalatest.FunSuite
import scala.pickling._, scala.pickling.Defaults._, json._
package outer {
abstract class Person {
val name: String
val age: Int
}
case class Firefighter(val name: String, val age: Int, val since: Int) extends Person
package inner {
... | eed3si9n/pickling-historical | core/src/test/scala/pickling/run/open-sum1.scala | Scala | bsd-3-clause | 875 |
package uk.gov.homeoffice.configuration
import com.typesafe.config.ConfigFactory
trait HasConfig extends ConfigFactorySupport {
implicit val config = ConfigFactory.load
} | UKHomeOffice/rtp-io-lib | src/main/scala/uk/gov/homeoffice/configuration/HasConfig.scala | Scala | mit | 174 |
package uk.org.nbn.nbnv.importer.darwin
import uk.org.nbn.nbnv.importer.testing.BaseFunSuite
import uk.org.nbn.nbnv.importer.Options
import uk.org.nbn.nbnv.importer.utility.ResourceLoader
class ReaderSuite extends BaseFunSuite with ResourceLoader {
test("an empty value should be an empty string, not null") {
// ... | JNCC-dev-team/nbn-importer | importer/src/test/scala/uk/org/nbn/nbnv/importer/darwin/ReaderSuite.scala | Scala | apache-2.0 | 511 |
package io.youi
import io.youi.net.URL
object Cache {
var implementation: CacheImplementation = _
def cached(url: URL): String = {
assert(implementation != null, "CacheImplementation must be set before Cache can be used.")
implementation.cached(url)
}
}
trait CacheImplementation {
def cached(url: UR... | outr/youi | core/shared/src/main/scala/io/youi/Cache.scala | Scala | mit | 332 |
package lore.compiler.feedback
class LambdaReporter(f: Feedback => Unit) extends Reporter {
private var _hasErrors = false
override def report(feedback: Feedback): Unit = this.synchronized {
if (feedback.isError) _hasErrors = true
f(feedback)
}
override def hasErrors: Boolean = this.synchronized(_hasEr... | marcopennekamp/lore | compiler/src/lore/compiler/feedback/LambdaReporter.scala | Scala | mit | 328 |
/*
* 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 ... | sgururajshetty/carbondata | integration/spark2/src/main/scala/org/apache/spark/sql/parser/CarbonSpark2SqlParser.scala | Scala | apache-2.0 | 27,896 |
package sampler.abc.actor.children.worker
import org.scalatest.FreeSpec
import org.scalatest.mockito.MockitoSugar
class AborterTest extends FreeSpec with MockitoSugar {
trait Setup {
val instance = new Aborter {}
val exception = new DetectedAbortionException()
}
"Aborter should /" - {
"throw... | tearne/Sampler | sampler-abc/src/test/scala/sampler/abc/actor/children/worker/AborterTest.scala | Scala | apache-2.0 | 936 |
package org.aprsdroid.app
import _root_.android.Manifest
import _root_.android.content.{Context, Intent}
import _root_.android.location.{Location, LocationManager}
import _root_.android.os.Bundle
import _root_.android.content.SharedPreferences
import _root_.android.content.SharedPreferences.OnSharedPreferenceChangeLis... | ge0rg/aprsdroid | src/LocationPrefs.scala | Scala | gpl-2.0 | 2,898 |
/**
* Copyright (C) 2015 Evgeny Igumnov http://evgeny.igumnov.com igumnov@gmail.com
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation.
*
* This program i... | evgenyigumnov/protectednet | app/io/protectednet/model/Networks.scala | Scala | agpl-3.0 | 1,794 |
package beam.router
import java.io.{File, PrintWriter}
import beam.agentsim.infrastructure.taz.TAZ
import beam.router.BeamSkimmer.{BeamSkimmerADT, BeamSkimmerKey, SkimInternal}
import beam.router.Modes.BeamMode
import org.matsim.api.core.v01.Id
import org.scalatest.{BeforeAndAfter, FlatSpec}
import scala.collection.... | colinsheppard/beam | src/test/scala/beam/router/BeamSkimmerSpec.scala | Scala | gpl-3.0 | 2,442 |
import scala.reflect.runtime.universe._
import scala.tools.reflect.Eval
object Test extends dotty.runtime.LegacyApp {
{
var counter = 0
lazy val x = { counter += 1; counter }
lazy val y = { counter += 1; counter }
val code = reify {
def foo = y // ensures that y is the first freevar we find
... | yusuke2255/dotty | tests/disabled/macro/run/reify_newimpl_52.scala | Scala | bsd-3-clause | 433 |
/*
* Copyright (C) 2016-2017 Lightbend Inc. <https://www.lightbend.com>
*/
package com.lightbend.lagom.internal.client
import java.net.{ URI, URLEncoder }
import java.util.Locale
import akka.NotUsed
import akka.stream.Materializer
import akka.stream.scaladsl.{ Sink, Source }
import akka.util.ByteString
import com.l... | edouardKaiser/lagom | service/core/client/src/main/scala/com/lightbend/lagom/internal/client/ClientServiceCallInvoker.scala | Scala | apache-2.0 | 11,708 |
package org.dsa.iot.ignition.spark
import org.apache.spark.sql.DataFrame
import org.dsa.iot.rx.RxMergerN
import org.dsa.iot.scala.Having
import com.ignition.frame.SparkRuntime
import rx.lang.scala.Observable
/**
* Executes an SQL statement against the inputs. Each input is injected as a table
* under the name "in... | IOT-DSA/dslink-scala-ignition | src/main/scala/org/dsa/iot/ignition/spark/SQLQuery.scala | Scala | apache-2.0 | 1,004 |
/**
* 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... | eribeiro/kafka | core/src/main/scala/kafka/server/KafkaConfig.scala | Scala | apache-2.0 | 76,964 |
/* Copyright 2009-2015 - Big Data Technologies S.R.L. All Rights Reserved. */
package org.widok.moment
import scala.scalajs.js
trait Setters[T] extends js.Object {
def add(time: Double, unit: String): T = js.native
def add(millis: Int): T = js.native
def add(duration: Duration): T = js.native
def subtract(t... | aparo/scalajs-supler | supler/js/src/main/org/widok/moment/Setters.scala | Scala | apache-2.0 | 457 |
package com.cloudera.sa.examples.tablestats.model
import scala.collection.mutable
/**
* Created by ted.malaska on 6/29/15.
*/
class FirstPassStatsModel extends Serializable {
var columnStatsMap = new mutable.HashMap[Integer, ColumnStats]
def +=(colIndex: Int, colValue: Any, colCount: Long): Unit = {
column... | tmalaska/Spark.TableStatsExample | src/main/scala/com/cloudera/sa/examples/tablestats/model/FirstPassStatsModel.scala | Scala | apache-2.0 | 797 |
package doodle
package js
import doodle.core._
import doodle.core.transform.Transform
/** Utilities for working with SVG */
object Svg {
def toHSLA(color: Color): String = {
val (h, s, l, a) = (color.hue, color.saturation, color.lightness, color.alpha)
s"hsla(${h.toDegrees}, ${s.toPercentage}, ${l.toPercent... | Angeldude/doodle | js/src/main/scala/doodle/js/Svg.scala | Scala | apache-2.0 | 1,994 |
// scalac: -Xfatal-warnings
//
object Test {
val f1: 1 = f1 // warning: recursive
}
| lrytz/scala | test/files/neg/sip23-uninitialized-1.scala | Scala | apache-2.0 | 88 |
package teststate.data
final case class BeforeAfter[+A](before: A, after: A) {
def map[B](f: A => B): BeforeAfter[B] =
BeforeAfter(f(before), f(after))
def emap[E, B](f: A => E Or B): E Or BeforeAfter[B] =
for {
b <- f(before)
a <- f(after)
} yield BeforeAfter(b, a)
}
object BeforeAfter {... | japgolly/test-state | core/shared/src/main/scala/teststate/data/BeforeAfter.scala | Scala | apache-2.0 | 382 |
package sri.web.router
import sri.core._
trait PathUtils {
def createStaticPath(path: String) = s"/${path.removeForwardSlashes}"
def createDynamicPath(path: String) = s"/${path.removeForwardSlashes}/"
def createStaticModulePath(basename: String, path: String) = if(path.nonEmpty && path != FORWARD_SLASH) s"/... | chandu0101/sri | web/src/main/scala/sri/web/router/PathUtils.scala | Scala | apache-2.0 | 641 |
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.