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.tritondigital.consul.http
import com.ning.http.client.AsyncHttpClient
import scala.language.implicitConversions
package object client {
implicit def BoundRequestBuilderToConsulRequestBuilder(value: AsyncHttpClient#BoundRequestBuilder) = new ConsulRequestBuilder(value)
}
| tritondigital/ConsulHttpClient | src/main/scala/com/tritondigital/consul/http/client/package.scala | Scala | mit | 290 |
/*
* Copyright (C) 2015-2016 Paulo Angelo Alves Resende <pa@pauloangelo.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License Version 2 as
* published by the Free Software Foundation. You may not use, modify or
* distribute this program und... | pauloangelo/hogzilla | src/HogzillaStream.scala | Scala | gpl-2.0 | 2,426 |
package mr.merc.unit
import org.scalatest.funsuite.AnyFunSuite
import mr.merc.players.Player
import mr.merc.map.terrain.TerrainType._
import mr.merc.map.hex.TerrainHex
import mr.merc.unit.AttackAttribute._
class DrainAttributeTest extends AnyFunSuite {
import TestUtil._
val attackerHex = new TerrainHex(0, 0, Dese... | RenualdMarch/merc | src/test/scala/mr/merc/unit/DrainAttributeTest.scala | Scala | gpl-3.0 | 3,692 |
/*
* Copyright (C) 2009-2017 Lightbend Inc. <https://www.lightbend.com>
*/
package play.core.server
import java.io._
import java.nio.file.{ FileAlreadyExistsException, Files, StandardOpenOption }
import play.api._
import scala.util.control.NonFatal
/**
* Used to start servers in 'prod' mode, the mode that is
* ... | Shruti9520/playframework | framework/src/play-server/src/main/scala/play/core/server/ProdServerStart.scala | Scala | apache-2.0 | 4,841 |
package wom.types
import spray.json.{JsBoolean, JsString}
import wom.values.WomBoolean
import scala.util.{Success, Try}
case object WomBooleanType extends WomPrimitiveType {
val toDisplayString: String = "Boolean"
override protected def coercion = {
case b: Boolean => WomBoolean(b)
case s: String if s.e... | ohsu-comp-bio/cromwell | wom/src/main/scala/wom/types/WomBooleanType.scala | Scala | bsd-3-clause | 1,405 |
package reswing
import javax.swing.Icon
import scala.swing.{Action, Alignment, Button, Color, Dimension, Font}
class ReButton(
text: ReSwingValue[String] = (),
action: Action = null,
selected: ReSwingValue[Boolean] = (),
horizontalAlignment: ReSwingValue[Alignment.Value] = (),
verticalAlignment: ... | guidosalva/REScala | Code/Extensions/RESwing/src/main/scala/reswing/ReButton.scala | Scala | apache-2.0 | 1,763 |
package models.daos
import java.util.UUID
import javax.inject.Inject
import com.mohiva.play.silhouette.api.LoginInfo
import models.daos.drivers.Neo4J
import models.User
import play.api.libs.json.{JsString, JsObject, JsUndefined, Json}
import play.api.libs.ws._
import scala.concurrent.ExecutionContext.Implicits.globa... | ajaygeorge91/play-silhouette-neo4j-angular-seed | app/models/daos/UserDAOImpl.scala | Scala | apache-2.0 | 2,552 |
//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
/** @author John Miller
* @version 1.3
* @date Mon Sep 7 15:05:06 EDT 2009
* @see LICENSE (MIT style license file).
*/
package scalation.process
import java.util.concurrent.ConcurrentLinkedQueue
import scala.collection... | scalation/fda | scalation_1.3/scalation_modeling/src/main/scala/scalation/process/Source.scala | Scala | mit | 7,009 |
package com.twitter.finagle.http.util
import org.scalatest.FunSuite
class StringUtilTest extends FunSuite {
test("toSomeShort") {
assert(StringUtil.toSomeShort("0") == 0)
assert(StringUtil.toSomeShort("blarg") == 0)
assert(StringUtil.toSomeShort("1000000000000") == 0)
}
test("toSomeInt") {
ass... | mkhq/finagle | finagle-base-http/src/test/scala/com/twitter/finagle/http/util/StringUtilTest.scala | Scala | apache-2.0 | 1,790 |
/*
* Licensed to Elasticsearch under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this fi... | takezoe/elasticsearch-hadoop | spark/core/main/scala/org/elasticsearch/spark/rdd/JavaEsRDD.scala | Scala | apache-2.0 | 2,179 |
/*
* Test.scala
* Test runner for com.cra.figaro.test.language.
*
* Created By: Avi Pfeffer (apfeffer@cra.com)
* Creation Date: Jan 1, 2009
*
* Copyright 2013 Avrom J. Pfeffer and Charles River Analytics, Inc.
* See http://www.cra.com or email figaro@cra.com for information.
*
* See http://www.g... | jyuhuan/figaro | Figaro/src/test/scala/com/cra/figaro/test/language/Test.scala | Scala | bsd-3-clause | 585 |
package xyz.jmullin.drifter
import com.badlogic.gdx.Gdx
import com.badlogic.gdx.graphics.g2d._
import com.badlogic.gdx.graphics.glutils.{ShaderProgram, ShapeRenderer}
import com.badlogic.gdx.graphics.{GL20, Texture}
import com.badlogic.gdx.utils.Align
import xyz.jmullin.drifter.enrich.RichGeometry._
import xyz.jmullin... | JustinMullin/drifter | src/main/scala/xyz/jmullin/drifter/Draw.scala | Scala | mit | 3,340 |
/***********************************************************************
* Copyright (c) 2013-2020 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... | aheyne/geomesa | geomesa-utils/src/main/scala/org/locationtech/geomesa/utils/io/HadoopUtils.scala | Scala | apache-2.0 | 3,555 |
/*
* 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/supervision/SupervisionEndReasonsController.scala | Scala | apache-2.0 | 3,751 |
package com.gmadorell.youtube_sync.module.synchronize.domain.model
final case class Video(id: VideoId, name: VideoName)
final case class VideoId(id: String) extends AnyVal
final case class VideoName(name: String) extends AnyVal
| GMadorell/youtube_sync | src/main/scala/com/gmadorell/youtube_sync/module/synchronize/domain/model/Video.scala | Scala | mit | 231 |
/*
* 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 n... | Chasego/kafka | core/src/test/scala/unit/kafka/coordinator/transaction/TransactionStateManagerTest.scala | Scala | apache-2.0 | 42,285 |
package collins.provisioning
import collins.validation.File
import com.tumblr.play.interop.{JProfile, ProvisionerProfileHelper}
import play.api.Logger
import com.google.common.cache.CacheLoader
import scala.collection.immutable.SortedSet
import java.io.{File => IoFile}
case class ProfileLoader(profiles: Set[Provisio... | Shopify/collins | app/collins/provisioning/ProfileLoader.scala | Scala | apache-2.0 | 3,044 |
package spatutorial.client.components
import scalacss.Defaults._
import scalacss.mutable
import spatutorial.client.components.Bootstrap.CommonStyle._
class BootstrapStyles(implicit r: mutable.Register) extends StyleSheet.Inline()(r) {
import dsl._
val csDomain = Domain.ofValues(default, primary, success, info, ... | japgolly/scalajs-spa-tutorial | client/src/main/scala/spatutorial/client/components/BootstrapStyles.scala | Scala | apache-2.0 | 1,926 |
/*
* 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 ... | shuangshuangwang/spark | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/higherOrderFunctions.scala | Scala | apache-2.0 | 7,082 |
/**
* Copyright (c) 2016 Intel Corporation
*
* 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 applicabl... | dmsuehir/spark-tk | sparktk-core/src/test/scala/org/trustedanalytics/sparktk/frame/internal/ops/join/JoinBroadcastVariableITest.scala | Scala | apache-2.0 | 3,404 |
package org.libss.util.helpers
/**
* date: 02.06.2016 22:44
* author: Kaa
*
* Generic builder trait that helps builders usage
*/
trait GenericBuilder[T <: GenericBuilder[T]] {
self: T =>
private def noTransform(t: T): T = this
def extend(transform: T => T): T = transform(this)
def extendIf(conditi... | kanischev/libss | libss-utils/src/main/scala/org/libss/util/helpers/GenericBuilder.scala | Scala | apache-2.0 | 664 |
object Test extends App {
// A variation of SI-6011, which eluded the fix
// in 2.10.0.
//
// duplicate keys in SWITCH, can't pick arbitrarily one of them to evict, see SI-6011.
// at scala.reflect.internal.SymbolTable.abort(SymbolTable.scala:50)
// at scala.tools.nsc.Global.abort(Global.scala:249)
// at ... | lampepfl/dotty | tests/run/t6011c.scala | Scala | apache-2.0 | 487 |
/*
* Copyright (C) 2015 Stratio (http://stratio.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by app... | Stratio/crossdata | core/src/test/scala/org/apache/spark/sql/crossdata/catalog/persistent/ZookeeperCatalogIT.scala | Scala | apache-2.0 | 2,039 |
/*
* 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 ... | dotunolafunmiloye/spark | core/src/main/scala/org/apache/spark/storage/BlockFetchTracker.scala | Scala | apache-2.0 | 1,040 |
package org.scaladebugger
import java.io.FileNotFoundException
import sbt._
import sbt.Keys._
import scala.sys.process._
import scala.util.Try
/**
* Represents the main plugin to add tooling settings to projects using
* libraries from the Scala Debugger project.
*/
object SbtJdiTools extends AutoPlugin {
over... | chipsenkbeil/sbt-jdi-tools | src/main/scala/org/scaladebugger/SbtJdiTools.scala | Scala | apache-2.0 | 1,720 |
/*
* Copyright 2016 http4s.org
*
* 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... | http4s/http4s | testing/jvm/src/test/scala/org/http4s/Http4sSuitePlatform.scala | Scala | apache-2.0 | 946 |
package net.bhardy.braintree.scala.gw
import net.bhardy.braintree.scala.exceptions.NotFoundException
import net.bhardy.braintree.scala.util.Http
import java.text.SimpleDateFormat
import java.util.Calendar
import java.util.TimeZone
import net.bhardy.braintree.scala._
import search.IdsSearchRequest
/**
* Provides meth... | benhardy/braintree-scala | src/main/scala/gw/CreditCardGateway.scala | Scala | mit | 4,275 |
/**
* 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... | evlist/orbeon-forms | src/main/scala/org/orbeon/oxf/portlet/liferay/FormRunnerRequestFilter.scala | Scala | lgpl-2.1 | 4,336 |
package com.github.m50d.tailchase
import cats.Functor
import shapeless._
/**
* Ensure that we aren't merely "unfixing" in the trivial way Unfix[F, A] = F.
* Arguably it would be more correct to treat HNil/CNil as nontrivial
* in the sense that traversing them is likely to have the expected result
*/
sealed trait ... | m50d/tailchase | src/main/scala/com/github/m50d/tailchase/Unfix.scala | Scala | apache-2.0 | 3,576 |
/*
* Copyright 2012-2020 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 ap... | planet42/Laika | io/src/main/scala/laika/helium/builder/HeliumTreeProcessor.scala | Scala | apache-2.0 | 2,152 |
package weeks.second
/*
* Implementation of algorithm that finds
* fixed point of a current function.
* Implementation sqrt function based on fixed point.
* */
object FixedPoint {
val PRECISION = 0.001
def fixedPoint(f: Double => Double)(firstGuess: Double): Double = {
def isCloseEnough(x: Double, y: Double):... | unbowed/progfun | src/main/scala/weeks/second/FixedPoint.scala | Scala | mit | 816 |
package views.html.relation
import lila.api.Context
import lila.app.templating.Environment._
import lila.app.ui.ScalatagsTemplate._
import controllers.routes
object mini {
def apply(
userId: lila.user.User.ID,
blocked: Boolean,
followable: Boolean,
relation: Option[lila.relation.Relation] ... | luanlv/lila | app/views/relation/mini.scala | Scala | mit | 1,144 |
/**
* Copyright 2013 Gianluca Amato
*
* This file is part of JANDOM: JVM-based Analyzer for Numerical DOMains
* JANDOM 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... | rubino22/JDBeta | core/src/test/scala/it/unich/jandom/utils/numberextensions/GenericNumberExtSuite.scala | Scala | lgpl-3.0 | 2,289 |
/*
* 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/catalyst/src/test/scala/org/apache/spark/sql/catalyst/optimizer/StarJoinReorderSuite.scala | Scala | apache-2.0 | 21,779 |
package net.fwbrasil.activate.statement.query
import java.util.Date
import net.fwbrasil.activate.util.RichList.toRichList
import net.fwbrasil.activate.ActivateTest
import org.junit.runner.RunWith
import org.specs2.runner.JUnitRunner
import net.fwbrasil.activate.util.ManifestUtil._
import net.fwbrasil.activate.mongoCon... | avramirez/activate | activate-test/src/test/scala/net/fwbrasil/activate/statement/query/QuerySpecs.scala | Scala | lgpl-2.1 | 32,720 |
package com.twitter.finagle.thrift.exp.partitioning
import com.twitter.finagle.Stack
import com.twitter.finagle.Thrift.param
import com.twitter.finagle.thrift.{RichClientParam, ThriftClientRequest}
import com.twitter.scrooge.{TReusableBuffer, ThriftStruct, ThriftStructIface}
import java.util
import org.apache.thrift.T... | twitter/finagle | finagle-thrift/src/main/scala/com/twitter/finagle/thrift/exp/partitioning/ThriftRequestSerializer.scala | Scala | apache-2.0 | 2,194 |
package ignition.jobs.setups
import ignition.core.jobs.CoreJobRunner.RunnerContext
object PermutationsSetup {
val usersList: Seq[String] =
"""roseboro
|bororose
|howlet
|telwoh
|aless
|sales
|xyz""".stripMargin.split("\\n")
def run(runnerContext: RunnerContext) {
v... | chaordic/ignition-template | src/main/scala/ignition/jobs/setups/PermutationsSetup.scala | Scala | mit | 742 |
package mathParser
package algebra
import spire.algebra.{Field, NRoot, Trig}
import scala.util.Try
object SpireLanguage {
import syntax._
def apply[A: Field : NRoot : Trig]: SpireLanguage[A, Nothing] =
Language.emptyLanguage
.withConstants[A](List("e" -> Trig[A].e, "pi" -> Trig[A].pi))
.wit... | gregor-i/mathParser | math-parser/src/main/scala/mathParser/algebra/SpireLanguage.scala | Scala | mit | 6,879 |
package selfassembly.examples
import scala.language.experimental.macros
import scala.reflect.runtime.{universe => ru}
import ru._
package object pickling {
implicit class PickleOps[T](picklee: T) {
def pickle(implicit format: PickleFormat): format.PickleType = macro Compat.PickleMacros_pickle[T]
def pickl... | phaller/selfassembly | src/main/scala/selfassembly/examples/pickling/package.scala | Scala | bsd-3-clause | 512 |
package uk.gov.dvla.auditing
object AttributeType extends Enumeration {
val RecordType, StatusCode, RestrictionKey, StopMarker = Value
}
| dvla/sdl-opensource | audit-core/src/main/scala/uk/gov/dvla/auditing/AttributeType.scala | Scala | mit | 140 |
package com.github.juanrh.spark_kafka
import scala.collection.JavaConversions.asScalaBuffer
import scala.collection.JavaConversions.seqAsJavaList
import org.apache.spark.streaming.StreamingContext
import org.apache.spark.streaming.dstream.InputDStream
import org.apache.spark.streaming.kafka.KafkaUtils
import kafka.a... | juanrh/data42 | spark13_playground/src/main/scala/com/github/juanrh/spark_kafka/KafkaDirectGetOffsetBadExample.scala | Scala | apache-2.0 | 4,645 |
// scalac: -Xelide-below WARNING -Xsource:2.13
//
import annotation._, elidable._
abstract class C {
@elidable(INFO) val i: Int = 42
@elidable(INFO) lazy val j: Int = 42
@elidable(INFO) var k: Int = 42
@elidable(INFO) def f: Int
}
@elidable(INFO) class D
| scala/scala | test/files/neg/t10068.scala | Scala | apache-2.0 | 264 |
/*
* Copyright 2011-2022 GatlingCorp (https://gatling.io)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by appli... | gatling/gatling | gatling-jms/src/main/scala/io/gatling/jms/action/Send.scala | Scala | apache-2.0 | 2,072 |
package cakesolutions.api
import cakesolutions.logging.Logging
import spray.http.StatusCodes._
import spray.routing._
class RestService(route: Route) extends HttpServiceActor with Logging {
implicit val rejectionHandler: RejectionHandler = RejectionHandler {
case AuthenticationFailedRejection(_, _) :: _ =>
... | carlpulley/coreos-example-application | lib/api/src/main/scala/cakesolutions/api/RestService.scala | Scala | apache-2.0 | 577 |
/*
* 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 ... | actuaryzhang/spark | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/subquery.scala | Scala | apache-2.0 | 25,168 |
object Solution {
def main(args: Array[String]) {
val (_, nums) = (readLine, readLine.split(" ").map(_.toInt))
val lonelyNumber = nums.foldLeft(0) { case (x, y) => x ^ y }
println(lonelyNumber)
}
}
| advancedxy/hackerrank | algorithms/warmup/LonelyInteger.scala | Scala | mit | 215 |
package org.apache.datacommons.prepbuddy.imputations
import org.apache.datacommons.prepbuddy.clusterers.TextFacets
import org.apache.datacommons.prepbuddy.rdds.TransformableRDD
import org.apache.datacommons.prepbuddy.utils.{NumberMap, PivotTable, Probability, RowRecord}
/**
* An imputation strategy that is based on... | blpabhishek/prep-buddy | src/main/scala/org/apache/datacommons/prepbuddy/imputations/NaiveBayesSubstitution.scala | Scala | apache-2.0 | 2,554 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | chenc10/Spark-PAF | core/src/main/scala/org/apache/spark/SecurityManager.scala | Scala | apache-2.0 | 23,468 |
/*
* Copyright (C) 2016 Nikos Katzouris
*
* 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 program is d... | nkatzz/OLED | src/main/scala/woled/Learner.scala | Scala | gpl-3.0 | 8,763 |
/*
* Copyright (c) 2013 Geoff Ballinger. 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 required ... | geoffballinger/simple-sharder | src/main/scala/uk/co/geoffballinger/simplesharder/Sharder.scala | Scala | apache-2.0 | 3,010 |
package info.mukel.telegrambot4s.models
/** This object represent a user's profile pictures.
*
* @param totalCount Total number of profile pictures the target user has
* @param photos Requested profile pictures (in up to 4 sizes each)
*/
case class UserProfilePhotos(
totalCo... | hugemane/telegrambot4s | src/main/scala/info/mukel/telegrambot4s/models/UserProfilePhotos.scala | Scala | apache-2.0 | 424 |
package org.http4s
package booPickle
import boopickle.Default._
import cats.effect.IO
import cats.implicits._
import cats.Eq
import cats.effect.laws.util.TestContext
import cats.effect.laws.util.TestInstances._
import org.http4s.headers.`Content-Type`
import org.http4s.laws.discipline.EntityCodecTests
import org.http4... | ChristopherDavenport/http4s | boopickle/src/test/scala/org/http4s/booPickle/BoopickleSpec.scala | Scala | apache-2.0 | 2,040 |
package com.giyeok.jparser.tests.metalang
import com.giyeok.jparser.examples.metalang.MetaLangGrammar
import com.giyeok.jparser.examples.{GrammarWithExamples, StringExamples}
import com.giyeok.jparser.metalang.MetaGrammar
import com.giyeok.jparser.nparser.{NaiveParser, ParseTreeConstructor}
import com.giyeok.jparser.{... | Joonsoo/moon-parser | metalang/src/test/scala/com/giyeok/jparser/tests/metalang/MetaGrammarTests.scala | Scala | mit | 3,345 |
/*
* Copyright 2014-2022 Netflix, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agr... | Netflix/atlas | atlas-eval/src/main/scala/com/netflix/atlas/eval/stream/FillRemovedKeysWith.scala | Scala | apache-2.0 | 2,326 |
import scala.reflect.runtime.universe._
object test extends App {
val a = TermName("a")
val t = TypeName("t")
q"def $a f"
q"$a("
q"class $t { def foo = $a"
q"import $t $t"
q"package p"
q"foo@$a"
q"case class A"
tq"$t => $t $t]"
cq"pattern => body ; case pattern2 =>"
pq"$a(bar"
q"def foo(x)"
... | folone/dotty | tests/untried/neg/quasiquotes-syntax-error-position.scala | Scala | bsd-3-clause | 413 |
package io.buoyant.namer
import com.twitter.finagle._
import com.twitter.finagle.naming.NameInterpreter
import io.buoyant.config.Parser
import org.scalatest.FunSuite
class NamerInitializersTest extends FunSuite {
def interpreter(config: String): NameInterpreter = {
val mapper = Parser.objectMapper(config, Iter... | denverwilliams/linkerd | namer/core/src/test/scala/io/buoyant/namer/NamerInitializersTest.scala | Scala | apache-2.0 | 1,433 |
/*
* 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 ... | minixalpha/spark | sql/hive/src/test/scala/org/apache/spark/sql/hive/MultiDatabaseSuite.scala | Scala | apache-2.0 | 9,904 |
/*
* Copyright (c) 2013, Scodec
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions a... | scodec/scodec | jvm/src/main/scala/scodec/Platform.scala | Scala | bsd-3-clause | 1,762 |
/*******************************************************************************
Copyright (c) 2012-2014, S-Core, KAIST.
All rights reserved.
Use is subject to license terms.
This distribution may include materials developed by third parties.
**********************************************************... | darkrsw/safe | src/main/scala/kr/ac/kaist/jsaf/analysis/typing/models/BuiltinModel.scala | Scala | bsd-3-clause | 4,569 |
/*
* 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 ... | zzcclp/carbondata | integration/spark/src/main/scala/org/apache/spark/sql/secondaryindex/util/InternalKeyVal.scala | Scala | apache-2.0 | 1,161 |
package com.github.izmailoff.mongo.connection
import net.liftweb.mongodb.MongoIdentifier
import net.liftweb.util.StringHelpers
/**
* Provides database name to be used in MetaRecords.
* This will usually initialize before MetaRecords do.
*/
trait DbConnectionIdentifier {
implicit def currentMongoId: MongoIdentif... | izmailoff/Spray-mongo-record | mongoconnect/src/main/scala/com/github/izmailoff/mongo/connection/DbConnectionIdentifier.scala | Scala | mit | 862 |
class Contravariant[-T]
new Contravariant[/*caret*/]
//-T | triggerNZ/intellij-scala | testdata/parameterInfo/typeParameterInfo/SimpleTests/Contravariant.scala | Scala | apache-2.0 | 58 |
package breeze.linalg
import breeze.generic.UFunc
import breeze.linalg.support.{CanMapKeyValuePairs, CanTraverseKeyValuePairs}
import breeze.math.Semiring
import scala.collection.mutable.ArrayBuffer
import breeze.linalg.support.CanTraverseKeyValuePairs.KeyValuePairsVisitor
/**
* `where(a)` returns those indices that... | wavelets/breeze | src/main/scala/breeze/linalg/where.scala | Scala | apache-2.0 | 1,508 |
// Generated by the Scala Plugin for the Protocol Buffer Compiler.
// Do not edit!
//
// Protofile syntax: PROTO3
package com.google.protobuf.wrappers
/** Wrapper message for `bool`.
*
* The JSON representation for `BoolValue` is JSON `true` and `false`.
*
* @param value
* The bool value.
*/
@SerialVers... | trueaccord/ScalaPB | scalapb-runtime/src/main/scalajvm/com/google/protobuf/wrappers/BoolValue.scala | Scala | apache-2.0 | 6,208 |
import sbt._
import Keys._
import complete.DefaultParsers._
import Util._
object Benchmark {
// http://www.scala-sbt.org/0.13/docs/Input-Tasks.html
def benchTask(benchClass: String, config: Traversable[Int]) = Def.inputTask {
val args: Seq[String] = spaceDelimited("<arg>").parsed
val wrappedProjectCP = (de... | phaller/pickling | project/Benchmark.scala | Scala | bsd-3-clause | 5,082 |
package nyaya.gen
import cats.data.{NonEmptyList, State}
import cats.evidence.===
import cats.syntax.foldable._
import cats.{Eval, Foldable, Monoid, Traverse}
import japgolly.microlibs.multimap.{MultiValues, Multimap}
import monocle._
import nyaya.gen.Distinct.{Fixer, foldableList}
import nyaya.gen.SetLike.Implicits._... | japgolly/nyaya | gen/shared/src/main/scala/nyaya/gen/Distinct.scala | Scala | lgpl-2.1 | 7,324 |
package main.scala
/**
* @author terry
*/
object State extends Enumeration {
type State =Value
val BEFORESTARTOFBLOCK,
INBLOCKKEY,
INLINE,
INFIELDKEY,
INFIELDVALUE,
INVALUE = Value
} | adeagbot/Swift-MT-Parser | src/main/scala/State.scala | Scala | gpl-3.0 | 219 |
package autolift.cats
import cats.implicits._
import autolift.cats.functor._
class LiftMapTest extends BaseSpec{
"liftMap on an Option[List]" should "work" in{
val in = Option(List(1))
val out = in liftMap intF
same[Option[List[Int]]](out, Option(List(2)))
}
"liftMap on an Option[List]" should "wo... | wheaties/AutoLifts | autolift-cats/src/test/scala/autolift/cats/LiftMapTest.scala | Scala | apache-2.0 | 1,817 |
import leon.lang._
object Overflow12 {
def foo12(x: Int): Int = {
-x
}
}
| epfl-lara/leon | src/test/resources/regression/verification/overflow/invalid/Overflow12.scala | Scala | gpl-3.0 | 84 |
package org.jetbrains.plugins.scala.annotator.usageTracker
import com.intellij.psi.PsiElement
import com.intellij.psi.util.PsiTreeUtil
import org.jetbrains.plugins.scala.lang.psi.ScalaPsiUtil
import org.jetbrains.plugins.scala.lang.psi.api.ScalaFile
import org.jetbrains.plugins.scala.lang.psi.api.expr.ScReferenceExpre... | jastice/intellij-scala | scala/scala-impl/src/org/jetbrains/plugins/scala/annotator/usageTracker/UsageTracker.scala | Scala | apache-2.0 | 3,257 |
package dao.helper
import java.sql.Timestamp
import java.util.UUID
import database.UniqueTable
import models.{UniqueDbEntity, UniqueEntity}
import slick.jdbc.PostgresProfile.api._
import slick.lifted.Rep
import scala.collection.Seq
import scala.concurrent.Future
trait Retrieved[T <: Table[DbModel] with UniqueTable,... | THK-ADV/lwm-reloaded | app/dao/helper/Retrieved.scala | Scala | mit | 4,521 |
package com.wixpress.petri.petri
import com.wixpress.petri.experiments.domain.{Experiment, ExperimentSnapshot}
import org.joda.time.DateTime
/**
* @author dmitryk
* @since 17-Sep-2015
*/
trait ExperimentsDao {
def fetch(): Seq[Experiment]
def add(experimentSpec: ExperimentSnapshot): Experiment
def getHist... | wix/petri | petri-server-core/src/main/java/com/wixpress/petri/petri/ExperimentsDao.scala | Scala | bsd-3-clause | 874 |
package org.jetbrains.plugins.scala.lang.scaladoc.psi.impl
import com.intellij.lang.ASTNode
import org.jetbrains.plugins.scala.lang.psi.impl.ScalaPsiElementImpl
import org.jetbrains.plugins.scala.lang.scaladoc.lexer.ScalaDocTokenType
import org.jetbrains.plugins.scala.lang.scaladoc.psi.api.{ScDocList, ScDocListItem}
... | JetBrains/intellij-scala | scala/scala-impl/src/org/jetbrains/plugins/scala/lang/scaladoc/psi/impl/ScDocListImpl.scala | Scala | apache-2.0 | 551 |
import edu.depauw.reactive._
import edu.depauw.reactive.Predef._
runScript {
val scrollbar = Scrollbar(100)
val label = Label("The value is: " + scrollbar.value)
Frame(label ^ scrollbar)
}
| bhoward/EscalatorOld | Escalator/examples/reactive/SimpleScrollbar.scala | Scala | apache-2.0 | 196 |
package com.twitter.hello
import com.twitter.finagle.httpx.Request
import com.twitter.finatra.http.Controller
class HelloWorldController extends Controller {
get("/hi") { request: Request =>
info("hi")
"Hello " + request.params.getOrElse("name", "unnamed")
}
}
| deanh/finatra | examples/hello-world-heroku/src/main/scala/com/twitter/hello/HelloWorldController.scala | Scala | apache-2.0 | 276 |
package es.weso.collection
import scala.collection.SortedMap
case class BagSortedMap[A: Ordering](smap: SortedMap[A, Int])
extends Bag[A] {
def contains(elem: A): Boolean = smap.contains(elem)
def insert(elem: A): BagSortedMap[A] =
if (smap.contains(elem))
BagSortedMap(smap + (elem -> (smap(elem) ... | labra/rbe | src/main/scala/es/weso/collection/BagSortedMap.scala | Scala | mit | 1,254 |
class A {
private val x = List(1,2)
val elem = x.head
}
class B extends A {
val a: Int = elem
// Without `checkNoPrivateLeaks`, we get:
// found: B.this.x.scala$collection$immutable$List$$A(B.this.elem)
// required: Int
}
| som-snytt/dotty | tests/pos/leak-inferred.scala | Scala | apache-2.0 | 245 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | u2009cf/spark-radar | external/kafka-0-10/src/main/scala/org/apache/spark/streaming/kafka010/DirectKafkaInputDStream.scala | Scala | apache-2.0 | 12,594 |
package models
case class User(id: Option[Long], name: String, mail: String)
| tarugo07/play-anorm-sample | app/models/User.scala | Scala | mit | 78 |
package im.mange.little.clock
import org.joda.time.{DateTime, LocalDate}
trait Clock {
def date: LocalDate
def dateTime: DateTime
} | alltonp/little | src/main/scala/im/mange/little/clock/Clock.scala | Scala | apache-2.0 | 137 |
package chrome.tabs.bindings
import scala.scalajs.js
object CodeInjectionOptions {
type ExeutionTime = String
val DOCUMENT_START: ExeutionTime = "document_start"
val DOCUMENT_END: ExeutionTime = "document_end"
val DOCUMENT_IDLE: ExeutionTime = "document_idle"
def apply(code: js.UndefOr[String] = js.unde... | amsayk/scala-js-chrome | bindings/src/main/scala/chrome/tabs/bindings/CodeInjectionOptions.scala | Scala | mit | 1,072 |
/*
* Licensed to Elasticsearch under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this fi... | takezoe/elasticsearch-hadoop | spark/sql-13/src/main/scala/org/elasticsearch/spark/sql/SchemaUtils.scala | Scala | apache-2.0 | 14,638 |
package scalan.meta
import scalan.util.StringUtil._
case class ImportItem(packageName: String, importedNames: List[String])
case class SSymName(packageName: String, name: String) {
import SSymName._
def this(name: String) = this("", name)
def mkFullName = fullNameString(packageName, name)
def isImportedBy(it... | ScorexFoundation/sigmastate-interpreter | common/src/main/scala/scalan/meta/SSymName.scala | Scala | mit | 767 |
package scala.scalajs.tools.io
import scala.annotation.tailrec
import java.io._
/** A [[VirtualFile]] implemented by an actual file on the file system. */
class FileVirtualFile(val file: File) extends VirtualFile {
import FileVirtualFile._
override def path = file.getPath
override def name = file.getName
... | swhgoon/scala-js | tools/src/main/scala/scala/scalajs/tools/io/FileVirtualFiles.scala | Scala | bsd-3-clause | 3,794 |
package spire
package benchmark
/*
import scala.util.Random
import spire.math._
import spire.implicits._
import com.google.caliper.Param
import java.lang.Math
object NaturalBenchmarks extends MyRunner(classOf[NaturalBenchmarks])
class NaturalBenchmarks extends MyBenchmark {
import spire.math.SafeLong.SafeLongAl... | non/spire | benchmark/src/main/scala/spire/benchmark/NaturalBenchmark.scala | Scala | mit | 1,954 |
/*
* Copyright 2012 Comcast Cable Communications Management, 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 require... | Comcast/money | money-wire/src/test/scala/com/comcast/money/wire/AvroConversionSpec.scala | Scala | apache-2.0 | 2,243 |
/***********************************************************************
* 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-accumulo/geomesa-accumulo-datastore/src/main/scala/org/locationtech/geomesa/accumulo/index/QueryPlanners.scala | Scala | apache-2.0 | 22,469 |
package shared.model
object TestStatus extends Enumeration {
type TestStatus = Value
val Passed, FailedByTest, FailedByCompilation = Value
} | DmytroOrlov/devgym | shared/src/main/scala/shared/model/TestStatus.scala | Scala | apache-2.0 | 146 |
/*
* (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/cogmath/hypergraph/acyclic/DAGNodeSpec.scala | Scala | apache-2.0 | 3,108 |
/*
* scala-swing (https://www.scala-lang.org)
*
* Copyright EPFL, Lightbend, Inc., contributors
*
* 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... | scala/scala-swing | src/main/scala/scala/swing/event/KeyEvent.scala | Scala | apache-2.0 | 1,708 |
package io.circe.jackson
import com.fasterxml.jackson.core.Version
import com.fasterxml.jackson.databind.{
BeanDescription,
DeserializationConfig,
JavaType,
JsonSerializer,
SerializationConfig
}
import com.fasterxml.jackson.databind.Module.SetupContext
import com.fasterxml.jackson.databind.deser.Deserializer... | circe/circe-jackson | shared/src/main/scala/io/circe/jackson/CirceJsonModule.scala | Scala | apache-2.0 | 1,533 |
package com.stefansavev.randomprojections.file
import scala.io.Source
import scala.util.matching.Regex
case class CSVFileOptions(sep: String = ",",
hasHeader: Boolean = true,
quote: Option[String] = None,
onlyTopRecords: Option[Int] = None)... | codeaudit/random-projections-at-berlinbuzzwords | src/main/scala/com/stefansavev/randomprojections/file/CSVFile.scala | Scala | apache-2.0 | 1,350 |
package effectful.examples.effects.sql
import effectful.free.Free
package object free {
type FreeSqlDriverCmd[A] = Free[SqlDriverCmd,A]
}
| S-Mach/effectful | src/test/scala/effectful/examples/effects/sql/free/package.scala | Scala | mit | 142 |
package org.jetbrains.plugins.scala
package lang
package psi
package impl
package toplevel
package templates
import types._
import result.TypingContext
import stubs.ScTemplateParentsStub
import com.intellij.lang.ASTNode
import org.jetbrains.plugins.scala.lang.psi.api.toplevel.templates._
import api.base.types.ScTypeEl... | consulo/consulo-scala | src/org/jetbrains/plugins/scala/lang/psi/impl/toplevel/templates/ScTraitParentsImpl.scala | Scala | apache-2.0 | 1,158 |
package play.api.libs.json
import play.api.data.validation.ValidationError
/**
* A value representing the value at a particular JSON path, either an actual JSON node or undefined.
*/
case class JsLookup(result: JsLookupResult) extends AnyVal {
/**
* Access the head of this array.
*/
def head: JsLookupRes... | jeantil/play-json-extra | play-json-extra/js/src/main/scala/play/api/libs/json/JsLookup.scala | Scala | apache-2.0 | 4,531 |
import org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jGraph
import gremlin.scala._
import org.scalatest._
class SimpleSpec extends FlatSpec with Matchers {
"Gremlin-Scala" should "create some vertices with properties" in {
val dbPath = "target/simplespec"
FileUtils.removeAll(dbPath)
val graph = Neo4j... | mpollmeier/gremlin-scala-examples | neo4j/src/test/scala/SimpleSpec.scala | Scala | apache-2.0 | 619 |
// Use foldLeft to compute the total size of a list of strings.
val stringList = List("hello", "world")
println(stringList.foldLeft(0)((sum, string) => sum + string.size))
// Write a Censor trait with a method that will replace the curse words Shoot and Darn with Pucky and Beans alternatives. Use a map to store the cu... | hemslo/seven-in-seven | scala/day2/day2.scala | Scala | mit | 909 |
package gitbucket.core.util
import gitbucket.core.service.RepositoryService
import org.eclipse.jgit.api.Git
import Directory._
import StringUtil._
import SyntaxSugars._
import scala.annotation.tailrec
import scala.collection.JavaConverters._
import org.eclipse.jgit.lib._
import org.eclipse.jgit.revwalk._
import org.e... | nus/gitbucket | src/main/scala/gitbucket/core/util/JGitUtil.scala | Scala | apache-2.0 | 39,240 |
package com.catinthedark.sszb.units
import com.catinthedark.sszb.{Assets, Shared}
import com.catinthedark.sszb.common.Const
import com.catinthedark.lib.SimpleUnit
/**
* Created by over on 19.04.15.
*/
class LooseControl(shared: Shared) extends SimpleUnit {
override def run(delta: Float): Unit = {
val missed =... | cat-in-the-dark/old48_32_game | src/main/scala/com/catinthedark/sszb/units/LooseControl.scala | Scala | apache-2.0 | 733 |
package dotty.tools.dotc
package transform
import core._
import Symbols._, Types._, Contexts._, Names._, StdNames._, Constants._, SymUtils._
import scala.collection.{ mutable, immutable }
import Flags._
import TreeTransforms._
import DenotTransformers._
import ast.Trees._
import ast.untpd
import Decorators._
import Va... | yusuke2255/dotty | src/dotty/tools/dotc/transform/SyntheticMethods.scala | Scala | bsd-3-clause | 7,799 |
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.