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 sbt
import java.lang.reflect.{Array => _, _}
import java.lang.annotation.Annotation
import xsbti.api
import xsbti.SafeLazy
import SafeLazy.strict
import collection.mutable
object ClassToAPI
{
def apply(c: Seq[Class[_]]): api.SourceAPI =
{
val pkgs = packages(c).map(p => new api.Package(p))
val def... | kuochaoyi/xsbt | compile/api/ClassToAPI.scala | Scala | bsd-3-clause | 11,418 |
import sbt._
object Dependencies {
// Generic
lazy val gson = "com.google.code.gson" % "gson" % "2.3.1"
lazy val jodaTime = "joda-time" % "joda-time" % "2.5"
lazy val postgresql = "org.postgresql" % "postgresql" ... | rtfpessoa/distributed-twitter-crawler | project/Dependencies.scala | Scala | mit | 1,127 |
package com.sksamuel.elastic4s.search
import com.sksamuel.elastic4s.ElasticsearchClientUri
import com.sksamuel.elastic4s.http.{ElasticDsl, HttpClient}
import com.sksamuel.elastic4s.testkit.ElasticSugar
import org.elasticsearch.action.support.WriteRequest.RefreshPolicy
import org.scalatest.{FlatSpec, Matchers}
class I... | aroundus-inc/elastic4s | elastic4s-tests/src/test/scala/com/sksamuel/elastic4s/search/IdQueryTest.scala | Scala | apache-2.0 | 1,311 |
/*
Copyright (c) 2014 by Contributors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, so... | dmlc/xgboost | jvm-packages/xgboost4j-spark/src/test/scala/ml/dmlc/xgboost4j/scala/spark/TrainTestData.scala | Scala | apache-2.0 | 4,490 |
/*
* Copyright (c) 2016, Groupon, 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,
* this list of conditio... | groupon/spark-metrics | src/test/scala/org/apache/spark/groupon/metrics/util/TestMetricsRpcEndpoint.scala | Scala | bsd-3-clause | 2,269 |
package so.blacklight.swarm.smtp.policy
import akka.actor.Actor
class IgnoreLoopback extends Actor {
override def receive: Receive = {
case ProcessEmail(email) =>
email.isLoopback() match {
case true =>
sender() ! PolicyReject("Loopback message")
case false =>
sender() ! PolicyPass(email)
}... | xea/swarm-msg | src/main/scala/so/blacklight/swarm/smtp/policy/IgnoreLoopback.scala | Scala | apache-2.0 | 326 |
/*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distribute... | wvlet/airframe | airframe-parquet/src/test/scala/wvlet/airframe/parquet/ParquetRecordWriterTest.scala | Scala | apache-2.0 | 3,771 |
package com.ctask.data
import org.scalatest.{FlatSpec, Matchers}
import play.api.libs.json.Json
/**
* Spec file for TaskList.
*/
class TaskListSpec extends FlatSpec with Matchers {
behavior of "TaskList Json converters"
it should "convert a TaskList with no tasks" in {
val expectedJson = "{\"nameStr\":\... | modsrm/ctask | common/src/test/scala/com/ctask/data/TaskListSpec.scala | Scala | gpl-3.0 | 1,790 |
package demo
package components
package elementalui
import chandu0101.macros.tojs.GhPagesMacros
import chandu0101.scalajs.react.components.elementalui._
import japgolly.scalajs.react._
import japgolly.scalajs.react.vdom.html_<^._
import scala.scalajs.js
object EuiButtonsDemo {
val code = GhPagesMacros.exampleSourc... | chandu0101/scalajs-react-components | demo/src/main/scala/demo/components/elementalui/EuiButtonsDemo.scala | Scala | apache-2.0 | 3,363 |
/*
* 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 ... | bravo-zhang/spark | sql/core/src/test/scala/org/apache/spark/sql/execution/benchmark/MiscBenchmark.scala | Scala | apache-2.0 | 11,425 |
package org.jetbrains.plugins.scala.worksheet.integration.plain
import org.jetbrains.plugins.scala.WorksheetEvaluationTests
import org.junit.experimental.categories.Category
@Category(Array(classOf[WorksheetEvaluationTests]))
class WorksheetPlainCompileOnServerRunLocallyIntegrationTest extends WorksheetPlainIntegrati... | JetBrains/intellij-scala | scala/worksheet/test/org/jetbrains/plugins/scala/worksheet/integration/plain/WorksheetPlainCompileOnServerRunLocallyIntegrationTest.scala | Scala | apache-2.0 | 425 |
package net.snowflake.spark.snowflake
import java.net.{InetSocketAddress, Proxy}
import java.net.Proxy.Type
import java.util.Properties
import net.snowflake.client.core.SFSessionProperty
import net.snowflake.client.jdbc.internal.amazonaws.ClientConfiguration
import net.snowflake.client.jdbc.internal.microsoft.azure.s... | snowflakedb/spark-snowflake | src/main/scala/net/snowflake/spark/snowflake/ProxyInfo.scala | Scala | apache-2.0 | 3,752 |
package net.al3x.blog
import java.io.File
import scala.collection.{immutable, mutable}
import scala.collection.jcl
import scala.xml.XML
object Blog extends FileHelpers {
def main(args: Array[String]) {
val posts = findPosts(new File(Config.postDir))
val lastTenPosts = posts.reverse.slice(0, 10)
if (arg... | al3x/simple-scala-blog | src/Blog.scala | Scala | mit | 938 |
/* NSC -- new Scala compiler
* Copyright 2005-2013 LAMP/EPFL
* @author Stephane Micheloud
* Adapted from Lex Spoon's sbaz manual
*/
package scala.tools.docutil
// For help on man pages see:
// - http://www.linuxfocus.org/English/November2003/article309.shtml
// - http://www.schweikhardt.net/man_page_howto.html
o... | martijnhoekstra/scala | src/manual/scala/tools/docutil/EmitManPage.scala | Scala | apache-2.0 | 5,510 |
package dpla.ingestion3.utils
import scala.io.Source
import com.fasterxml.jackson.databind.ObjectMapper
import com.fasterxml.jackson.module.scala.DefaultScalaModule
import com.fasterxml.jackson.module.scala.experimental.ScalaObjectMapper
// Get data from files
trait FileLoader {
/**
*
* @return
*/
de... | dpla/ingestion3 | src/main/scala/dpla/ingestion3/utils/FileLoader.scala | Scala | mit | 1,341 |
package nars.language
import nars.storage.Memory
//remove if not needed
import scala.collection.JavaConversions._
object InstanceProperty {
/**
* Try to make a new compound from two components. Called by the inference rules.
* <p>
* A {-] B becomes {A} --> [B]
* @param subject The first compoment
*... | automenta/opennars | nars_scala/src/main/scala/nars/language/InstanceProperty.scala | Scala | gpl-2.0 | 621 |
/* Title: Pure/library.scala
Module: PIDE
Author: Makarius
Basic library.
*/
package isabelle
import scala.collection.mutable
object Library
{
/* user errors */
object ERROR
{
def apply(message: String): Throwable = new RuntimeException(message)
def unapply(exn: Throwable): Op... | MerelyAPseudonym/isabelle | src/Pure/library.scala | Scala | bsd-3-clause | 5,749 |
def functionMonoid[A,B](B: Monoid[B]): Monoid[A => B] =
new Monoid[A => B] {
def op(f: A => B, g: A => B) = a => B.op(f(a), g(a))
val zero: A => B = a => B.zero
} | lucaviolanti/scala-redbook | answerkey/monoids/17.answer.scala | Scala | mit | 178 |
package honor
import models.db.MasterShipBase
import ranking.EvolutionBase
import scalikejdbc._
import scala.collection.mutable
/**
*
* @author ponkotuy
* Date: 15/03/17.
*/
object ShipMaster extends HonorCategory {
import com.ponkotuy.value.ShipIds._
override def category = 1
override def approved(member... | nekoworkshop/MyFleetGirls | server/app/honor/ShipMaster.scala | Scala | mit | 1,405 |
/*
* 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 ... | stanzhai/spark | mllib/src/test/scala/org/apache/spark/ml/tuning/CrossValidatorSuite.scala | Scala | apache-2.0 | 15,149 |
/*
* Copyright (C) 2014 Dennis J. McWherter, Jr.
*
* This software may be modified and distributed under the terms of the MIT License.
*/
package com.deathbytape
import javax.ws.rs.{PathParam, Produces, GET, Path}
import javax.ws.rs.core.{MediaType, Response}
/**
* Servlet to serve a little interactive HelloWorl... | DeathByTape/scalaREST | src/main/scala/com/deathbytape/HelloServlet.scala | Scala | mit | 717 |
/*
* Copyright 2017 WeightWatchers
*
* 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 ... | WW-Digital/reactive-kinesis | src/main/scala/com/weightwatchers/reactive/kinesis/consumer/ConsumerProcessingManager.scala | Scala | apache-2.0 | 6,733 |
package com.factor10.plugins
trait FormattingPlugin {
def name: String
def convert(data: Map[String, Any]): String
}
// class XmlFormatter extends FormattingPlugin {
// def name = "XmlFormatter Plugin"
// def convert(data: Map[String, Any]): String = {
// "<some xml=true />"
// }
// }
| marhel/splug | plugins/xml/src/main/scala/formattingPlugin.scala | Scala | mit | 296 |
package com.github.tminglei.slickpg
import org.scalatest.FunSuite
import scala.concurrent.Await
import scala.concurrent.duration._
class PgInheritsSuite extends FunSuite {
import ExPostgresDriver.api._
val db = Database.forURL(url = dbUrl, driver = "org.postgresql.Driver")
abstract class BaseT[T](tag: Tag, t... | bearrito/slick-pg | src/test/scala/com/github/tminglei/slickpg/PgInheritsSuite.scala | Scala | bsd-2-clause | 2,376 |
/*
* 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/v2/B65.scala | Scala | apache-2.0 | 1,271 |
package controllers
import play.api._
import play.api.mvc._
import models.Paste
import java.util.UUID
import models.PasteMapDAO
import models.PasteElastic4sDAO
object Application extends Controller {
// val dao = PasteMapDAO()
val dao = PasteElastic4sDAO()
def paste = Action {
Ok(views.html.paste())
}
... | scalaftb-dubai/paste | app/controllers/Application.scala | Scala | apache-2.0 | 507 |
package composition.webserviceclients.vrmretentioneligibility
import com.tzavellas.sse.guice.ScalaModule
import org.mockito.Matchers.any
import org.mockito.Mockito.when
import org.scalatest.mock.MockitoSugar
import scala.concurrent.Future
import uk.gov.dvla.vehicles.presentation.common.clientsidesession.TrackingId
imp... | dvla/vrm-retention-online | test/composition/webserviceclients/vrmretentioneligibility/EligibilityWebServiceCallFails.scala | Scala | mit | 999 |
package org.http4s
import cats._
import cats.implicits._
import scala.util.control.{NoStackTrace, NonFatal}
/** Indicates a failure to handle an HTTP [[Message]]. */
trait MessageFailure extends RuntimeException {
/** Provides a message appropriate for logging. */
def message: String
/* Overridden for sensibl... | reactormonk/http4s | core/src/main/scala/org/http4s/MessageFailure.scala | Scala | apache-2.0 | 4,950 |
package org.jetbrains.plugins.scala
package lang.refactoring.rename.inplace
import com.intellij.internal.statistic.UsageTrigger
import com.intellij.openapi.actionSystem.DataContext
import com.intellij.openapi.editor.Editor
import com.intellij.openapi.project.Project
import com.intellij.psi._
import com.intellij.psi.se... | loskutov/intellij-scala | src/org/jetbrains/plugins/scala/lang/refactoring/rename/inplace/ScalaMemberInplaceRenameHandler.scala | Scala | apache-2.0 | 2,441 |
package org.algorithms
import org.scalatest.{BeforeAndAfter, FunSuite, Matchers}
import scala.io.Source._
class DistanceCalcTest extends FunSuite with Matchers with BeforeAndAfter {
var sdc = new DistanceCalc
before {
sdc = new DistanceCalc
}
test("calculate shortest path a -> d") {
... | Alex-Diez/Scala-Algorithms | advent-code/src/test/scala/org/algorithms/DistanceCalcTest.scala | Scala | mit | 1,118 |
/*
* 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-core/src/main/scala/io/gatling/core/scenario/Simulation.scala | Scala | apache-2.0 | 6,730 |
package net.liftmodules.staticsitemap.path
import net.liftweb.common.{Full, Empty}
import net.liftweb.util.Helpers._
trait PathUtils {
/**
* Split the path and query.
* @param url
* @return A tuple of optional path and query strings
*/
def splitPathAndQuery(url: String): (String, String) =
url.sp... | jeffmay/lift-staticsitemap | src/main/scala/net/liftmodules/staticsitemap/path/PathUtils.scala | Scala | apache-2.0 | 1,885 |
/**
* Bolt
* ExpressionValue
*
* Copyright (c) 2017 Osamu Takahashi
*
* This software is released under the MIT License.
* http://opensource.org/licenses/mit-license.php
*
* @author Osamu Takahashi
*/
package com.sopranoworks.bolt.values
/**
*
* @param op operator
* @param left left expressio... | OsamuTakahashi/bolt | src/main/scala/com/sopranoworks/bolt/values/ExpressionValue.scala | Scala | mit | 5,729 |
import org.joda.time.DateTime
package object models {
case class Tag(_id: String, total: Long, accepted: Long, rate: Double, top: Long, updated: DateTime)
object JsonFormats {
import play.api.libs.json.Json
import play.api.data._
import play.api.data.Forms._
implicit val tagFormat = Json.forma... | EugenyLoy/StackOverflowBadge | app/models/package.scala | Scala | mit | 335 |
/*
* Copyright 2016 Coursera 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... | coursera/naptime | naptime/src/main/scala/org/coursera/naptime/path/PathKeyParser.scala | Scala | apache-2.0 | 3,335 |
package providers
import models.JsonHelper._
import models.Location
import play.api.libs.concurrent.Execution.Implicits._
import play.api.libs.ws.{Response, WS}
import scala.concurrent.Future
trait LocationProvider {
def getLocations(address: String): Future[Seq[Location]] = {
WS.url(config("maps.api"))
... | callistaenterprise/async-weather | app/providers/LocationProvider.scala | Scala | mit | 571 |
class OAuthPlainTextCalculator(consumerKey: ConsumerKey, requestToken: RequestToken) extends WSSignatureCalculator with com.ning.http.client.SignatureCalculator {
import com.ning.http.client.{ Request, RequestBuilderBase }
import com.ning.http.util.UTF8UrlEncoder
import com.ning.http.util.Base64
val HEADER_AUT... | techmag/OAuthPlainTextCalculator | OAuthPlainTextCalculator.scala | Scala | apache-2.0 | 3,809 |
package doodle
package core
import doodle.syntax._
import org.scalatest._
import org.scalatest.prop.GeneratorDrivenPropertyChecks
class ColorSpec extends FlatSpec with Matchers with GeneratorDrivenPropertyChecks {
import doodle.arbitrary._
import doodle.syntax.approximatelyEqual._
"Angle" should "have bijectio... | Angeldude/doodle | shared/src/test/scala/doodle/core/ColorSpec.scala | Scala | apache-2.0 | 3,288 |
package scavlink.sbt.mavgen
import java.io.File
import org.fusesource.scalate.{Template, TemplateEngine}
import org.scalatest.{Matchers, WordSpec}
import sbt.Logger
import scala.xml.Elem
class GeneratorFunctionSpec extends WordSpec with Matchers {
val fixture = new Generator {
def generate(xmls: Map[String, E... | nickolasrossi/sbt-mavgen | src/test/scala/scavlink/sbt/mavgen/GeneratorFunctionSpec.scala | Scala | mit | 2,993 |
package net.snowflake.spark.snowflake.streaming
import java.nio.charset.Charset
import java.sql.Connection
import net.snowflake.client.jdbc.internal.apache.commons.logging.{Log, LogFactory}
import net.snowflake.client.jdbc.internal.fasterxml.jackson.databind.ObjectMapper
import net.snowflake.client.jdbc.internal.fast... | snowflakedb/spark-snowflake | src/main/scala/net/snowflake/spark/snowflake/streaming/SnowflakeIngestService.scala | Scala | apache-2.0 | 10,146 |
//
// Scaled - a scalable editor extensible via JVM languages
// http://github.com/scaled/scaled/blob/master/LICENSE
package scaled.impl
import org.junit._
import org.junit.Assert._
import scaled.major.TextMode
class FnBindingsTest {
@Test def testCollectBindings () {
val view = new BufferViewImpl(TestData.e... | swhgoon/scaled | editor/src/test/scala/scaled/impl/FnBindingsTest.scala | Scala | bsd-3-clause | 677 |
package edu.msstate.dasi.csb.workload.spark
import edu.msstate.dasi.csb.workload.Workload
import org.apache.spark.graphx.Graph
import scala.reflect.ClassTag
/**
* Strongly Connected Components algorithm implementation.
*/
class StronglyConnectedComponents(engine: SparkEngine, iterations: Int) extends Workload {
... | msstate-dasi/csb | csb/src/main/scala/edu/msstate/dasi/csb/workload/spark/StronglyConnectedComponents.scala | Scala | gpl-3.0 | 578 |
package com.owlike.genson.ext.scala
import com.owlike.genson.{Context, Converter, Factory}
import java.lang.reflect.Type
import com.owlike.genson.reflect.TypeUtil._
import com.owlike.genson.convert.DefaultConverters.{MapConverterFactory => JavaMapFactory, KeyAdapter}
import com.owlike.genson.stream.{ObjectReader, Obj... | hieuit7/genson | src/main/scala/com/owlike/genson/ext/scala/TraversableConverters.scala | Scala | apache-2.0 | 5,506 |
package org.scalatra
package atmosphere
import java.nio.CharBuffer
import javax.servlet.http.{ HttpServletRequest, HttpSession }
import grizzled.slf4j.Logger
import org.atmosphere.cpr.AtmosphereResource.TRANSPORT._
import org.atmosphere.cpr._
import org.atmosphere.handler.AbstractReflectorAtmosphereHandler
import org... | lightvector/scalatra | atmosphere/src/main/scala/org/scalatra/atmosphere/ScalatraAtmosphereHandler.scala | Scala | bsd-2-clause | 6,604 |
package com.tutorial.sparkcore
import com.tutorial.utils.SparkCommon
/**
* An example to create RDD from different data sources
* Created by ved on 7/1/16.
*/
object CreateRDD {
/**
* Create a Scala Spark Context.
*/
val sc = SparkCommon.sparkContext
def main(args: Array[String]) {
/**... | rklick-solutions/spark-tutorial | src/main/scala/com/tutorial/sparkcore/CreateRDD.scala | Scala | apache-2.0 | 696 |
/**
* Copyright (c) 2015, Cloudera, Inc. All Rights Reserved.
*
* Cloudera, Inc. licenses this file to you 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/LIC... | sunheehnus/spark-timeseries | src/test/scala/com/cloudera/sparkts/TimeSeriesSuite.scala | Scala | apache-2.0 | 2,624 |
package vultura.factor
import org.specs2.matcher.{MatchResult, Expectable, Matcher}
import vultura.factor.inference.{VariableElimination, MarginalI, ParFunI, JunctionTree}
/**
* Matchers for use with FastFactor objects.
* @author Thomas Geier <[email protected]>
*/
trait FactorMatchers {
def haveSameStruct... | ziggystar/vultura-factor | src/test/scala/vultura/factor/FactorMatchers.scala | Scala | mit | 3,827 |
package java.util
trait NavigableSet[E] extends SortedSet[E] {
def lower(e: E): E
def floor(e: E): E
def ceiling(e: E): E
def higher(e: E): E
def pollFirst(): E
def pollLast(): E
def iterator(): Iterator[E]
def descendingSet(): NavigableSet[E]
def descendingIterator(): Iterator[E]
def subSet(fromEl... | mdedetrich/scala-js | javalib/src/main/scala/java/util/NavigableSet.scala | Scala | bsd-3-clause | 684 |
package sclib.z
import sclib.ops.either._
/**
* minimalistic `Either` monad transformer
*
* @example
* {{{
* scala> import sclib.z._
* scala> import sclib.ops.either._
*
* scala> val et = EitherT[Function1[Int, ?], String, Int]{i => if(i < 10) i.right else "BOOM".left}
* et: sclib.z.EitherT[[A]Int =... | j-keck/sclib | src/main/scala/sclib/z/EitherT.scala | Scala | mit | 1,057 |
/*
* 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 ... | Dax1n/spark-core | core/src/main/scala/org/apache/spark/deploy/JsonProtocol.scala | Scala | apache-2.0 | 3,707 |
package lila.swiss
import scala.concurrent.duration._
import lila.common.LightUser
import lila.game.Game
private case class SwissBoard(
gameId: Game.ID,
white: SwissBoard.Player,
black: SwissBoard.Player
)
private object SwissBoard {
case class Player(user: LightUser, rank: Int, rating: Int)
case cl... | luanlv/lila | modules/swiss/src/main/SwissBoard.scala | Scala | mit | 2,326 |
package test
import io.keen.client.scala.EventStore
import java.io.IOException
import scala.collection.concurrent.TrieMap
import scala.collection.mutable.ListBuffer
import org.specs2.mutable.{ BeforeAfter, Specification }
import org.specs2.specification.{ Step, Fragments }
trait BeforeAllAfterAll extends Specifica... | ches/KeenClient-Scala | src/test/scala/EventStoreSpecBase.scala | Scala | mit | 4,197 |
package xyz.ariwaranosai.leancloud
/**
* Created by ariwaranosai on 16/9/8.
*
*/
abstract class RequestMethod(val cmd: String)
object RequestMethod {
case object GET extends RequestMethod("GET")
case object PUT extends RequestMethod("PUT")
case object DELETE extends RequestMethod("DELETE")
case object ... | ariwaranosai/Hikikumari | leancloud/src/main/scala/xyz/ariwaranosai/leancloud/RequestMethod.scala | Scala | mit | 357 |
package net.categoricaldata.category
import net.tqft.toolkit.collections.NonStrictNaturalNumbers
import net.categoricaldata.sets._
/**
* A LocallyFinitelyGeneratedCategory may have infinitely many objects, but each object sits at some integer level,
* and there are only finitely many objects at each level. Otherwis... | JasonGross/categoricaldata | src/main/scala/net/categoricaldata/category/LocallyFinitelyGeneratedCategory.scala | Scala | mit | 15,794 |
/*
* 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 ... | vinodkc/spark | sql/core/src/test/scala/org/apache/spark/sql/StatisticsCollectionSuite.scala | Scala | apache-2.0 | 32,697 |
/***********************************************************************
* Copyright (c) 2013-2017 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... | ronq/geomesa | geomesa-tools/src/main/scala/org/locationtech/geomesa/tools/data/AgeOffCommand.scala | Scala | apache-2.0 | 3,345 |
package slick.compiler
import slick.ast.TypeUtil.:@
import slick.ast._
import slick.util.SlickLogger
/** A standard skeleton for a code generator phase. */
abstract class CodeGen extends Phase {
val name = "codeGen"
override protected[this] lazy val logger = SlickLogger[CodeGen]
def apply(state: CompilerState... | dotta/slick | slick/src/main/scala/slick/compiler/CodeGen.scala | Scala | bsd-2-clause | 1,712 |
/*
* Copyright (c) 2014, Oracle America, 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,
* this list o... | tauprojects/mpp | jmh/jmh-archetypes/jmh-scala-benchmark-archetype/src/main/resources/archetype-resources/src/main/scala/MyBenchmark.scala | Scala | gpl-2.0 | 1,839 |
/*
* 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 ... | jackylk/incubator-carbondata | integration/spark/src/test/scala/org/apache/carbondata/spark/testsuite/dataload/TestLoadDataUseAllDictionary.scala | Scala | apache-2.0 | 1,455 |
/*
* The MIT License
*
* Copyright (c) 2017 Fulcrum Genomics LLC
*
* 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
* to us... | fulcrumgenomics/fgbio | src/main/scala/com/fulcrumgenomics/fastq/DemuxFastqs.scala | Scala | mit | 51,412 |
package scodec
package codecs
import java.security.MessageDigest
import java.util.Arrays
import java.util.zip.{ CRC32, Adler32, Checksum }
import scodec.bits.ByteVector
/**
* Creates checksum implementations of [[SignerFactory]].
* @group checksum
*/
object ChecksumFactory {
/** Creates a `java.security.Digest`... | danielwegener/scodec | src/main/scala/scodec/codecs/ChecksumFactory.scala | Scala | bsd-3-clause | 2,316 |
/*
* 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 ... | GJL/flink | flink-table/flink-table-planner-blink/src/test/scala/org/apache/flink/table/planner/expressions/ArrayTypeTest.scala | Scala | apache-2.0 | 9,186 |
package ops.android.app
import android.app.Activity
import android.content.Context
import android.view.View
trait ActivityOps extends ContextOps {
self: Activity =>
override implicit lazy val context: Context = this
override def _getString(resId: Int, args: AnyRef*): String = getString(resId, arg... | raizu/AndroidOps | src/main/scala/ops/android/app/ActivityOps.scala | Scala | apache-2.0 | 453 |
package org.jetbrains.plugins.scala
package testingSupport
import com.intellij.execution.process.{ProcessHandler, ProcessEvent, ProcessListener}
import com.intellij.openapi.util.Key
import com.intellij.debugger.engine.SuspendContextImpl
import com.intellij.execution.testframework.AbstractTestProxy
/**
* @author Roman... | LPTK/intellij-scala | test/org/jetbrains/plugins/scala/testingSupport/TestResultListener.scala | Scala | apache-2.0 | 1,641 |
package V2
object FWAEDynamicInterp extends App {
sealed abstract class FWAE
case class Num(n: Int) extends FWAE
case class Sub(lhs: FWAE, rhs: FWAE) extends FWAE
case class Add(lhs: FWAE, rhs: FWAE) extends FWAE
case class Let(boundId: Symbol, namedExpr: FWAE, boundBody: FWAE) extends FWAE
case class Id... | Tooa/interpreters | src/V2/FWAEDynamicInterp.scala | Scala | apache-2.0 | 2,601 |
package com.yukihirai0505.sInstagram.utils
import com.typesafe.config.{Config, ConfigFactory}
import scala.util.Properties
/**
* author Yuki Hirai on 2017/04/17.
*/
object Configurations extends ConfigurationDetector {
val config: Config = ConfigFactory.load
lazy val clientId: String = envVarOrConfig("INST... | yukihirai0505/sInstagram | src/main/scala/com/yukihirai0505/sInstagram/utils/Configurations.scala | Scala | mit | 1,159 |
/*
* Copyright (c) <2015-2016>, see CONTRIBUTORS
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list... | amanjpro/languages-a-la-carte | arrooj/src/main/scala/eval/constantfolding.scala | Scala | bsd-3-clause | 4,094 |
package unfiltered.jetty
import java.util.EnumSet
import java.util.concurrent.atomic.AtomicInteger
import javax.servlet.{ Filter, DispatcherType }
import org.eclipse.jetty.servlet.{ FilterHolder, ServletContextHandler }
object BasicFilterHolder {
def apply(filter: Filter) = {
val holder = new FilterHolder(filt... | hamnis/unfiltered | jetty/src/main/scala/filters.scala | Scala | mit | 901 |
/**************************************************************************
Copyright 2014 Allen Institute for Artificial Intelligence Foundation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the Li... | tomkwiat/dependency-graph-similarity-measure | src/main/scala/org/allenai/ari/solvers/graphmatch/models/features/EqualPhraseFeature.scala | Scala | apache-2.0 | 2,188 |
package org.jetbrains.plugins.scala.lang.psi.stubs
import com.intellij.psi.stubs.NamedStub
import org.jetbrains.plugins.scala.lang.psi.api.statements.ScFunction
import org.jetbrains.plugins.scala.lang.psi.stubs.impl.{ScExpressionOwnerStub, ScTypeElementOwnerStub}
/**
* User: Alexander Podkhalyuzin
* Date: 14.10.2... | gtache/intellij-lsp | intellij-lsp-dotty/src/org/jetbrains/plugins/scala/lang/psi/stubs/ScFunctionStub.scala | Scala | apache-2.0 | 606 |
package com.arcusys.learn.models.response.certificates
/**
* Created by Iliya Tryapitsin on 02.06.2014.
*/
case class CertificateWithUserStatusResponse(id: Int,
title: String,
shortDescription: String,
description: String,
logo: String,
isPublished: Boolean,
courseCount: Int,
statementCount: Int,
act... | ViLPy/Valamis | learn-portlet/src/main/scala/com/arcusys/learn/models/response/certificates/CertificateWithUserStatusResponse.scala | Scala | lgpl-3.0 | 430 |
package com.outr.arango
import com.outr.arango.api.model.{PostAPICursor, PostAPICursorOpts}
import com.outr.arango.api.{APICursor, APICursorCursorIdentifier}
import io.circe.Decoder.Result
import io.circe.{Decoder, HCursor, Json}
import io.youi.client.HttpClient
import profig.JsonUtil
import scala.concurrent.duration... | outr/arangodb-scala | driver/src/main/scala/com/outr/arango/QueryBuilder.scala | Scala | mit | 6,011 |
object Test {
trait Leaf[T] {
def collect[U](f: PartialFunction[Leaf[_], U]): List[U]
def leaves: List[Leaf[T]] = collect { case l: Leaf[T] => l }
}
}
| densh/dotty | tests/pos/virtpatmat_exist_uncurry.scala | Scala | bsd-3-clause | 163 |
package ingraph.ire.messages
import java.io.{IOException, ObjectInputStream, ObjectOutputStream}
import akka.actor.ActorRef
import ingraph.ire.datatypes.Tuple
import ingraph.ire.util.AtomicUniqueCounter
import scala.collection.mutable
import scala.concurrent.{Future, Promise}
class Terminator private(terminatorID: ... | FTSRG/ingraph | ire/src/main/scala/ingraph/ire/messages/Terminator.scala | Scala | epl-1.0 | 2,124 |
package slinky.web
import slinky.core.SyntheticEvent
import scala.scalajs.js
import org.scalajs.dom.{TouchEvent, TouchList}
// https://reactjs.org/docs/events.html?#touch-events
@js.native
trait SyntheticTouchEvent[+TargetType] extends SyntheticEvent[TargetType, TouchEvent] {
val altKey: Boolean ... | shadaj/slinky | web/src/main/scala/slinky/web/SyntheticTouchEvent.scala | Scala | mit | 738 |
/*
* 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.tools.nsc
impor... | martijnhoekstra/scala | src/compiler/scala/tools/nsc/PickleExtractor.scala | Scala | apache-2.0 | 4,737 |
package com.github.mitallast.nsq
import java.io.Closeable
import com.typesafe.config.{Config, ConfigFactory}
import io.netty.util.CharsetUtil
import scala.concurrent.Future
import scala.concurrent.duration._
trait OK
trait NSQMessage {
def timestamp: Long
def attempts: Int
def messageId: String
def dat... | mitallast/scala-nsq | src/main/scala/com/github/mitallast/nsq/NSQClient.scala | Scala | mit | 1,459 |
package com.rocketfuel.sdbc.scalaz
import com.rocketfuel.sdbc.base.jdbc._
import scalaz.concurrent.Task
import scalaz.stream._
import me.jeffshaw.scalaz.stream.IteratorConstructors._
object JdbcProcess {
object jdbc {
private def getConnection(pool: Pool) = Task.delay(pool.getConnection())
private def clo... | wdacom/sdbc | jdbc.scalaz/src/main/scala/com/rocketfuel/sdbc/scalaz/JdbcProcess.scala | Scala | bsd-3-clause | 7,654 |
package org.nedervold.grammareditor.models.adapters
import org.nedervold.grammareditor.models.VariableModel
import org.nedervold.grammareditor.models.onEDTWait
import javax.swing.event.DocumentEvent
import javax.swing.event.DocumentListener
import javax.swing.text.DefaultStyledDocument
import javax.swing.text.Documen... | nedervold/GrammarEditor | src/main/scala/org/nedervold/grammareditor/models/adapters/DocumentAdapter.scala | Scala | apache-2.0 | 1,660 |
import language.higherKinds
object Wrap {
implicit class X[X](val a: X)
X[Int](0)
}
class Wrap {
implicit class Y[Y](val a: Y)
Y[Int](0)
implicit class Z[Z[_]](val a: Z[Wrap.this.Z[Z]])
Z[List](List(new Z[List](null)))
}
case class X[X](val a: X)
| AlexSikia/dotty | tests/untried/pos/t7033.scala | Scala | bsd-3-clause | 262 |
/*
* Scala.js (https://www.scala-js.org/)
*
* Copyright EPFL.
*
* Licensed under Apache License 2.0
* (https://www.apache.org/licenses/LICENSE-2.0).
*
* See the NOTICE file distributed with this work for
* additional information regarding copyright ownership.
*/
package scala.tools.nsc
/* Super hacky overri... | scala-js/scala-js | partest/src/main/scala/scala/tools/nsc/MainGenericRunner.scala | Scala | apache-2.0 | 4,142 |
package io.escalante.quickstarts.scaladin.editor
import scala.reflect.BeanProperty
import scala.util.Random
import vaadin.scala._
/**
* Example app with a list of beans, a table to show the beans and a form to edit them.
* Since Vaadin is datasource-agnostic, anything that returns a collection of beans can be used.... | escalante/escalante-quickstart | editor-scaladin/src/main/scala/io/escalante/quickstarts/scaladin/editor/EditorApp.scala | Scala | apache-2.0 | 3,873 |
package org.jetbrains.plugins.scala
package lang
import com.intellij.psi.codeStyle.arrangement.std.{ArrangementSettingsToken, StdArrangementSettingsToken, StdArrangementTokenType, StdArrangementTokens}
import com.intellij.psi.codeStyle.arrangement.std.StdArrangementTokens.EntryType._
import com.intellij.psi.codeStyle.... | triggerNZ/intellij-scala | src/org/jetbrains/plugins/scala/lang/rearranger/package.scala | Scala | apache-2.0 | 6,611 |
/*
* Copyright 2014 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 | client/shared/src/main/scala/org/http4s/client/middleware/DestinationAttribute.scala | Scala | apache-2.0 | 1,464 |
package metamorphic.generator.spray
import metamorphic.dsl.application._
import metamorphic.dsl.generator._
import metamorphic.dsl.util.StringImplicits._
import scala.reflect.macros.blackbox.Context
object SprayRouteGenerator {
def generate(service: Service)(implicit c: Context): c.Tree = {
import c.universe.... | frroliveira/metamorphic | metamorphic-spray/src/main/scala/metamorphic/generator/spray/SprayRouteGenerator.scala | Scala | mit | 3,389 |
/*
* 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/execution/command/table/CarbonShowTablesCommand.scala | Scala | apache-2.0 | 2,928 |
/***
* Copyright 2014 Rackspace US, 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 applica... | wdschei/api-checker | core/src/main/scala/com/rackspace/com/papi/components/checker/step/StepHandler.scala | Scala | apache-2.0 | 44,584 |
package TAPLcomp.fullrecon
import scala.text.Document
// outer means that the term is the top-level term
object FullReconPrinter {
import TAPLcomp.Print._
def ptyType(outer: Boolean, ty: Ty): Document = ty match {
case ty => ptyArrowType(outer, ty)
}
def ptyArrowType(outer: Boolean, tyT: Ty): Document ... | hy-zhang/parser | Scala/Parser/src/TAPLcomp/fullrecon/syntax.scala | Scala | bsd-3-clause | 2,331 |
package com.github.gigurra.glasciia
import com.badlogic.gdx.Gdx
import com.badlogic.gdx.Input.Keys
import com.github.gigurra.math.Vec2
/**
* Created by johan on 2016-10-03.
*/
case class Pov4W(left: Int = Keys.LEFT,
right: Int = Keys.RIGHT,
up: Int = Keys.UP,
dow... | GiGurra/glasciia | glasciia-core/src/main/scala/com/github/gigurra/glasciia/Pov4W.scala | Scala | mit | 574 |
/*
* 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-core/src/test/scala/io/gatling/core/check/xpath/XPathExtractorSpec.scala | Scala | apache-2.0 | 4,136 |
package skuber.api.watch
import akka.NotUsed
import akka.actor.ActorSystem
import akka.http.scaladsl.model._
import akka.stream.scaladsl.{Broadcast, Flow, GraphDSL, Merge, Source}
import akka.stream.SourceShape
import play.api.libs.json.Format
import skuber.api.client._
import skuber.api.client.impl.KubernetesClientIm... | doriordan/skuber | client/src/main/scala/skuber/api/watch/WatchSource.scala | Scala | apache-2.0 | 4,991 |
package be.objectify.deadbolt.scala.test.dao
import be.objectify.deadbolt.scala.models.Subject
import be.objectify.deadbolt.scala.test.models.{SecurityPermission, SecurityRole, SecuritySubject}
class TestSubjectDao extends SubjectDao {
val subjects: Map[String, Subject] = Map("greet" -> new SecuritySubject("greet"... | schaloner/deadbolt-2-scala | test-app/test/be/objectify/deadbolt/scala/test/dao/TestSubjectDao.scala | Scala | apache-2.0 | 2,183 |
package org.scalajs.openui5.sap.ui.core
import scala.scalajs.js
import scala.scalajs.js.annotation.JSName
package object mvc {
type ViewType = String
}
| lastsys/scalajs-openui5 | src/main/scala/org/scalajs/openui5/sap/ui/core/mvc/package.scala | Scala | mit | 156 |
/*
* Copyright (c) 2002-2018 "Neo Technology,"
* Network Engine for Objects in Lund AB [http://neotechnology.com]
*
* This file is part of Neo4j.
*
* Neo4j 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 Foundatio... | HuangLS/neo4j | community/cypher/cypher-compiler-2.3/src/main/scala/org/neo4j/cypher/internal/compiler/v2_3/pipes/matching/PatternMatchingBuilder.scala | Scala | apache-2.0 | 6,050 |
///////////////////////////////////////////////////////////////
// © ООО «Праймтолк», 2011-2013 //
// Все права принадлежат компании ООО «Праймтолк». //
///////////////////////////////////////////////////////////////
/**
* SynapseGrid
* © Primetalk Ltd., 2013.
* All rights res... | GitOutATown/SynapseGrid | synapse-grid-examples/src/test/scala/ru/primetalk/synapse/examples/Examples2Test.scala | Scala | bsd-2-clause | 987 |
/*
* Copyright (c) 2014-2021 by The Monix Project Developers.
* See the project homepage at: https://monix.io
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache... | monifu/monix | monix-tail/shared/src/test/scala/monix/tail/IterantFromReactivePublisherSuite.scala | Scala | apache-2.0 | 6,385 |
/*
* Copyright (c) 2011-16 Miles Sabin
*
* 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... | liff/shapeless | core/src/main/scala/shapeless/hlists.scala | Scala | apache-2.0 | 8,263 |
package org.rebeam.boxes.swing.views
import org.rebeam.boxes.core.util._
import org.rebeam.boxes.core._
import org.rebeam.boxes.swing._
import java.awt.Dimension
import javax.swing.JTextField
import java.awt.event.ActionListener
import java.awt.event.ActionEvent
import java.awt.event.FocusListener
import java.awt.even... | trepidacious/boxes-swing | src/main/scala/org/rebeam/boxes/swing/views/BooleanView.scala | Scala | gpl-2.0 | 4,425 |
/*
* 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 ... | jlopezmalla/spark | resource-managers/mesos/src/main/scala/org/apache/spark/deploy/mesos/ui/DriverPage.scala | Scala | apache-2.0 | 6,743 |
package chrome.runtime
import scala.scalajs.js
import scala.scalajs.js.annotation.JSGlobal
@js.native
@JSGlobal("chrome.runtime")
private[runtime] object Impl extends js.Any {
def openOptionsPage(callback: js.Function0[_]): Unit = js.native
def getManifest(): js.Dictionary[js.Any] = js.native
def getURL(path: S... | erdavila/auto-steamgifts | src/main/scala/chrome/runtime/Impl.scala | Scala | mit | 1,130 |
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.