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.rasterfoundry.common
import geotrellis.store.LayerId
import io.circe._
import io.circe.generic.JsonCodec
@JsonCodec
final case class LayerAttribute(layerName: String,
zoom: Int,
name: String,
value: Json) {
d... | raster-foundry/raster-foundry | app-backend/common/src/main/scala/LayerAttribute.scala | Scala | apache-2.0 | 482 |
/*
* 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 ... | wwjiang007/flink | flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/planner/plan/rules/physical/stream/StreamPhysicalSinkRule.scala | Scala | apache-2.0 | 4,646 |
/*
* (c) Copyright 2019 EntIT Software LLC, a Micro Focus company, L.P.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Apache License v2.0 which accompany this distribution.
*
* The Apache License is available at
* http://www.apache.org/licenses/LICE... | CloudSlang/cs-actions | cs-google/src/test/scala/io/cloudslang/content/google/utils/action/InputUtilsTest.scala | Scala | apache-2.0 | 1,209 |
package com.ajjpj.adiagram_.render.shapes.lineend
import javafx.scene.canvas.GraphicsContext
import com.ajjpj.adiagram_.geometry.{Angle, APoint}
import com.ajjpj.adiagram_.render.base.LineStyle
import com.ajjpj.adiagram_.geometry.transform.Translation
import com.ajjpj.adiagram_.ui.Zoom
/**
* @author arno
*/
class N... | arnohaase/a-diagram | src/main/scala-old/com/ajjpj/adiagram_/render/shapes/lineend/NullLineEnd.scala | Scala | apache-2.0 | 590 |
package com.github.takezoe.solr.scala
import org.apache.solr.client.solrj.response.UpdateResponse
import org.apache.solr.client.solrj.{SolrClient => ApacheSolrClient}
import org.apache.solr.common.SolrInputDocument
class BatchRegister(server: ApacheSolrClient, collection: Option[String], docs: Map[String, Any]*) {
... | takezoe/solr-scala-client | src/main/scala/com/github/takezoe/solr/scala/BatchRegister.scala | Scala | apache-2.0 | 883 |
import java.io.File
import org.apache.log4j.Logger
import org.apache.spark.SparkContext
import org.apache.spark.SparkContext._
import org.apache.spark.SparkConf
import org.apache.spark.storage.StorageLevel
import scala.collection.mutable.HashSet
import scala.io.Source
case class Config(
inputFacts: String = "", inp... | yang-chen/Ontological-Pathfinding | src/main/scala/Main.scala | Scala | bsd-2-clause | 9,543 |
package skinny.micro.contrib.flash
import java.util.concurrent.{ ConcurrentHashMap, ConcurrentSkipListSet }
import skinny.micro.contrib.FlashMapSupport
import skinny.micro.data.MutableMapWithIndifferentAccess
import scala.collection.JavaConverters._
/**
* A FlashMap is the data structure used by [[FlashMapSupport]]
... | xerial/skinny-micro | micro/src/main/scala/skinny/micro/contrib/flash/FlashMap.scala | Scala | bsd-2-clause | 2,672 |
package es.upm.oeg.pnk.actions
import es.upm.oeg.pnk.Analyze
import org.apache.log4j.{Level, Logger}
import org.apache.spark.{SparkConf, SparkContext}
/**
* Created by cbadenes on 04/08/15.
*/
object EntityRecognizerDistinctExample {
def main(args: Array[String]): Unit = {
// Spark Configuration
val con... | cbadenes/pnk | src/test/scala/es/upm/oeg/pnk/actions/EntityRecognizerDistinctExample.scala | Scala | gpl-2.0 | 1,018 |
package io.kaitai.struct.languages.components
import io.kaitai.struct.ClassTypeProvider
import io.kaitai.struct.datatype.DataType
import io.kaitai.struct.datatype.DataType.SwitchType
import io.kaitai.struct.exprlang.Ast
import io.kaitai.struct.format.Identifier
import io.kaitai.struct.translators.BaseTranslator
/**
... | kaitai-io/kaitai_struct_compiler | shared/src/main/scala/io/kaitai/struct/languages/components/SwitchIfOps.scala | Scala | gpl-3.0 | 4,050 |
/** *****************************************************************************
* This is part of ltlfo2mon (https://github.com/jckuester/ltlfo2mon).
*
* Copyright (c) 2013 by Jan-Christoph Kuester <kuester@sdf.org>
*
* Ltlfo2mon is free software: you can redistribute it and/or modify
* it under the terms... | jckuester/ltlfo2mon | src/main/scala/ltlfo2mon/cli/Ltlfo2mon.scala | Scala | gpl-3.0 | 6,082 |
package au.id.cxd.math.model.evaluation
import au.id.cxd.math.function.moments.Mean
/**
* calculate R-squared metric for distance as the correlation coefficient.
*
* Note howevber R^2 has the shortcoming of being influenced by extreme values
* in variation given its use of the squared error.
*
*
*/
clas... | cxd/scala-au.id.cxd.math | math/src/main/scala/au/id/cxd/math/model/evaluation/RSquared.scala | Scala | mit | 1,031 |
import scala.util.parsing.combinator._
object DictTxtToXml4 extends RegexParsers {
def dict = rep(entry) ^^ { entries => <dict>{ entries }</dict>}
def entry = partOfSpeech into { part => translations(part) }
def partOfSpeech = "["~>("noun"|"verb")<~"]"
def translations(part: String) = enTranslation~"-"~frTransl... | grzegorzbalcerek/scala-book-examples | examples/DictTxtToXml4.scala | Scala | mit | 753 |
package com.seanshubin.schulze.server
import com.seanshubin.server._
import com.seanshubin.schulze.server.data_transfer._
import com.seanshubin.schulze._
import com.seanshubin.schulze.persistence.{PersistenceSnapshotApi, PersistenceApi}
import com.seanshubin.schulze.server.data_transfer.Candidate
import com.seanshubin... | SeanShubin/schulze | server/src/main/scala/com/seanshubin/schulze/server/SchulzeHandler.scala | Scala | unlicense | 11,454 |
package ru.listok.test
import _root_.ru.listok._
import org.scalatest.FunSuite
class EnvTest extends FunSuite with Helper {
// def listok = new Listok
test("def") {
expect(Lint(42)){listok.eval("(def a 42) a")}
expect(Lint(43)){listok.eval(
"""
(def a 42)
((lambda () (setf a (+ a 1))))... | kolyvan/listok | src/test/scala/env-test.scala | Scala | lgpl-3.0 | 4,398 |
import stainless.lang._
object InnerClasses2 {
abstract class Test {
def something: BigInt
}
def foo(x: Boolean, l: BigInt): Test = {
require(l > 1)
def bar(y: Boolean, m: BigInt): Test = {
require(m > 2)
def baz(z: Boolean, o: BigInt): Test = {
require(o > 3)
case class... | epfl-lara/stainless | frontends/benchmarks/verification/valid/InnerClasses2.scala | Scala | apache-2.0 | 605 |
/*
* Copyright 2013 - 2020 Outworkers 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
*
* Unless required by applicable law or... | outworkers/phantom | phantom-dsl/src/test/scala/com/outworkers/phantom/builder/query/db/crud/InsertCasTest.scala | Scala | apache-2.0 | 2,608 |
/**
* Tries to load a symbol for the `Foo$class` using Scala reflection.
* Since trait implementation classes do not get pickling information
* symbol for them should be created using fallback mechanism
* that exposes Java reflection information dressed up in
* a Scala symbol.
*/
object Test extends App with Oute... | som-snytt/dotty | tests/disabled/reflect/run/reflection-implClass.scala | Scala | apache-2.0 | 1,249 |
package edu.arizona.sista.discourse.rstparser
import org.slf4j.LoggerFactory
import edu.arizona.sista.utils.{Files, StringUtils}
import edu.arizona.sista.processors.Document
import scala.collection.mutable.ListBuffer
import scala.collection.mutable
import EDUClassifier._
import edu.arizona.sista.struct.Counter
import ... | capdevc/processors | src/main/scala/edu/arizona/sista/discourse/rstparser/EDUClassifier.scala | Scala | apache-2.0 | 12,575 |
package com.programmaticallyspeaking.ncd.nashorn
import com.programmaticallyspeaking.ncd.host._
import com.programmaticallyspeaking.ncd.host.types.{ExceptionData, Undefined}
import org.scalatest.prop.TableDrivenPropertyChecks
import scala.concurrent.Promise
import scala.util.{Failure, Success, Try}
class CallFunctio... | provegard/ncdbg | src/test/scala/com/programmaticallyspeaking/ncd/nashorn/CallFunctionOnTest.scala | Scala | bsd-3-clause | 2,532 |
package teleporter.integration.component.hdfs
import java.util.Properties
import com.google.common.io.Resources
import io.leopard.javahost.JavaHost
import org.apache.commons.io.IOUtils
import org.apache.hadoop.conf.Configuration
import org.apache.hadoop.fs.{FileSystem, Path}
import org.scalatest.FunSuite
/**
* Cre... | huanwuji/teleporter | src/test/scala/teleporter/integration/component/hdfs/Hdfs$Test.scala | Scala | agpl-3.0 | 1,387 |
package com.sksamuel.avro4s.schema
import java.util.UUID
import com.sksamuel.avro4s.AvroSchema
import org.scalatest.{Matchers, WordSpec}
class UUIDSchemaTest extends WordSpec with Matchers {
case class UUIDTest(uuid: UUID)
case class UUIDSeq(uuids: Seq[UUID])
case class UUIDDefault(uuid: UUID = UUID.fromStrin... | 51zero/avro4s | avro4s-core/src/test/scala/com/sksamuel/avro4s/schema/UUIDSchemaTest.scala | Scala | mit | 1,382 |
/** soar
*
* Copyright (c) 2017 Hugo Firth
* Email: <me@hugofirth.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
*
... | NewcastleComputingScience/student-outcome-accelerator | glance-core/jvm/src/main/scala/uk/ac/ncl/la/soar/glance/eval/db/CollectionRepository.scala | Scala | apache-2.0 | 5,256 |
package com.kjetland.jackson.jsonSchema
import java.time.{LocalDate, LocalDateTime, OffsetDateTime}
import java.util
import java.util.{Collections, Optional, TimeZone}
import com.fasterxml.jackson.databind.module.SimpleModule
import com.fasterxml.jackson.databind.node.{ArrayNode, MissingNode, ObjectNode}
import com.f... | mbknor/mbknor-jackson-jsonSchema | src/test/scala/com/kjetland/jackson/jsonSchema/JsonSchemaGeneratorTest.scala | Scala | mit | 90,750 |
package org.scaladebugger.test
import scala.language.reflectiveCalls
object Main extends App {
val x = 3
var y = 4
val x123 = "huh?"
def runMe(x: Int = 3) = println(x)
val myClass = new MyClass((x) => (z) => x + z) {
def anotherMethod = {
val something = 1
something + "asdf"
}
}
w... | ensime/scala-debugger | scala-debugger-test/src/main/scala/org/scaladebugger/test/Main.scala | Scala | apache-2.0 | 694 |
/*
* 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 ... | maropu/spark | sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/text/TextTable.scala | Scala | apache-2.0 | 2,207 |
package oxalis.security
import com.scalableminds.util.enumeration.ExtendedEnumeration
object TokenType extends ExtendedEnumeration {
type TokenType = Value
val Authentication, DataStore, ResetPassword = Value
}
| scalableminds/webknossos | app/oxalis/security/TokenType.scala | Scala | agpl-3.0 | 217 |
package mesosphere.marathon
package api.v2
import javax.inject.Inject
import javax.servlet.http.HttpServletRequest
import javax.ws.rs._
import javax.ws.rs.container.{AsyncResponse, Suspended}
import javax.ws.rs.core.{Context, MediaType}
import mesosphere.marathon.api._
import mesosphere.marathon.core.appinfo.EnrichedT... | mesosphere/marathon | src/main/scala/mesosphere/marathon/api/v2/AppTasksResource.scala | Scala | apache-2.0 | 6,795 |
package org.sisioh.aws4s.s3.model
import com.amazonaws.services.s3.model.{ MultipartUpload, MultipartUploadListing }
import org.sisioh.aws4s.PimpedType
import scala.collection.JavaConverters._
object MultipartUploadListingFactory {
def create(): MultipartUploadListing = new MultipartUploadListing()
}
class Rich... | sisioh/aws4s | aws4s-s3/src/main/scala/org/sisioh/aws4s/s3/model/RichMultipartUploadListing.scala | Scala | mit | 2,724 |
package org.loom.geometry
/**
* PolygonType
* either straight line based or spline based
* @author brogan
*
*/
object PolygonType {
val Line_Polygon: Int = 0
val Spline_Polygon: Int = 1
}
| brogan/Loom | src/org/loom/geometry/PolygonType.scala | Scala | gpl-3.0 | 200 |
package fakeapi.http
import akka.actor._
import akka.agent._
import akka.event.Logging
import fakeapi.common._
import com.typesafe.config.ConfigFactory
import scala.collection.JavaConverters._
import scala.concurrent.duration._
import scala.concurrent.ExecutionContext.Implicits.global
import scala.math._
import sca... | cicika/fake-api | src/main/scala/fake-api/http/Latency.scala | Scala | gpl-2.0 | 2,140 |
package is.hail.backend
import is.hail.backend.spark.SparkBackend
import is.hail.expr.ir.{ExecuteContext, IR, SortField}
import is.hail.expr.ir.lowering.{TableStage, TableStageDependency}
import is.hail.linalg.BlockMatrix
import is.hail.types.BlockMatrixType
import is.hail.types.virtual.Type
import is.hail.utils._
im... | danking/hail | hail/src/main/scala/is/hail/backend/Backend.scala | Scala | mit | 1,526 |
package leibniz
import leibniz.inhabitance.{Inhabited, Proposition}
import leibniz.internal.Unsafe
/**
* The data type `Is` is the encoding of Leibnitz’ law which states that
* if `a` and `b` are identical then they must have identical properties.
* Leibnitz’ original definition reads as follows:
* a ≡ b = ... | alexknvl/leibniz | src/main/scala/leibniz/Is.scala | Scala | mit | 6,594 |
package com.plasmaconduit.framework.string
import scala.util.matching.Regex
sealed trait StringMatcher {
def matches(n: String): Boolean
}
object StringMatcher {
import scala.language.implicitConversions
implicit def toLiteralStringMatcher(s: String): StringMatcher = {
StringLiteralMatcher(s)
}
impl... | plasmaconduit/plasmaconduit-framework | src/main/scala/com/plasmaconduit/framework/string/StringMatcher.scala | Scala | mit | 653 |
/*
* Copyright 2001-2014 Artima, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agre... | scalatest/scalatest | jvm/scalactic-test/src/test/scala/org/scalactic/anyvals/NegZIntSpec.scala | Scala | apache-2.0 | 14,090 |
/*
* Copyright 2011-2014 Chris de Vreeze
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agree... | EBPI/yaidom | src/test/scala/nl/ebpi/yaidom/queryapitests/scalaxml/XbrlInstanceQueryTest.scala | Scala | apache-2.0 | 1,741 |
package org.lolczak.dcg.parser.language
import org.lolczak.dcg.model.Grammar
import scalaz.\\/
trait Completer {
def complete(chart: Chart)(edge: Passive): Set[Active \\/ PassiveCandidate]
def completeEmpty(grammar: Grammar)(edge: Active): Set[Active \\/ PassiveCandidate]
}
| lolczak/dcg | src/main/scala/org/lolczak/dcg/parser/language/Completer.scala | Scala | apache-2.0 | 282 |
/*
* Copyright (c) 2021 Couchbase, 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... | couchbaselabs/couchbase-spark-connector | src/main/scala/com/couchbase/spark/kv/LookupInRDD.scala | Scala | apache-2.0 | 3,049 |
/*
* Copyright 2012 Sanjin Sehic
*
* 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... | tuwiendsg/CAPA | core/src/scala/util/Logging.scala | Scala | apache-2.0 | 1,208 |
package bignum.benchmark
import com.google.caliper.Param
import com.google.caliper.{Runner => CaliperRunner}
import bignum.BigInt2
object ShiftBenchmark {
def main(args: Array[String]) {
CaliperRunner.main(classOf[ShiftBenchmark], args: _*)
}
}
class ShiftBenchmark extends SimpleScalaBenchmark {
@Param(Ar... | techaddict/bignum | benchmark/src/main/scala/benchmark/ShiftLeft.scala | Scala | mit | 1,339 |
/*
* Copyright (C) 2015 Romain Reuillon
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This progra... | openmole/openmole | openmole/third-parties/org.openmole.tool.types/src/main/scala/org/openmole/tool/types/package.scala | Scala | agpl-3.0 | 933 |
def foo(x: Int*) = 1
/*start*/foo _/*end*/
//(Seq[Int]) => Int | ilinum/intellij-scala | testdata/typeInference/bugs5/SCL3213.scala | Scala | apache-2.0 | 62 |
package com.github.tarao
package slickjdbc
package interpolation
import interpolation.{Literal => LiteralParameter}
import scala.reflect.macros.blackbox.Context
private[interpolation] class MacroTreeBuilder(val c: Context) {
import c.universe._
import scala.collection.mutable.ListBuffer
import slick.jdbc.SQLAct... | tarao/slick-jdbc-extension-scala | src/main/scala/com/github/tarao/slickjdbc/interpolation/MacroTreeBuilder.scala | Scala | mit | 6,862 |
package jp.co.bizreach.ses
import scala.concurrent.Future
import scala.collection.JavaConverters._
import com.amazonaws.auth._
import com.amazonaws.client.builder.ExecutorFactory
import com.amazonaws.handlers.AsyncHandler
import com.amazonaws.regions.Regions
import com.amazonaws.services.simpleemail._
import com.ama... | bizreach/aws-ses-scala | src/main/scala/jp/co/bizreach/ses/SESClient.scala | Scala | apache-2.0 | 3,372 |
package akka
import akka.QuizProtocol.{AlreadyCreated, CreatePlayer, UserCreated}
import akka.actor.{ActorLogging, ActorRef, Props}
import akka.backpressure.MasterWorkerProtocol.WorkComplete
object CreatePlayerExecutor {
def props(): Props = Props(classOf[CreatePlayerExecutor])
}
class CreatePlayerExecutor extend... | djoudjou/Quiz | app/akka/CreatePlayerExecutor.scala | Scala | cc0-1.0 | 1,072 |
package de.htwg.zeta.server.controller
import java.net.URLDecoder
import java.util.UUID
import javax.inject.Inject
import scala.concurrent.ExecutionContext
import scala.concurrent.Future
import com.mohiva.play.silhouette.api.LoginInfo
import com.mohiva.play.silhouette.impl.providers.CredentialsProvider
import de.htw... | Zeta-Project/zeta | api/server/app/de/htwg/zeta/server/controller/ActivateAccountController.scala | Scala | bsd-2-clause | 2,854 |
package org.scalatra
import javax.servlet.http.{ HttpServletRequest, HttpServletResponse }
import scala.util.DynamicVariable
trait RequestResponseScope {
/**
* The currently scoped request. Valid only inside the `handle` method.
*/
implicit def request: HttpServletRequest
/**
* The currently scoped ... | lightvector/scalatra | core/src/main/scala/org/scalatra/DynamicScope.scala | Scala | bsd-2-clause | 2,669 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | michalsenkyr/spark | sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/ProgressReporter.scala | Scala | apache-2.0 | 15,134 |
package models
import java.util.Date
import org.bson.types.ObjectId
import org.specs2.mutable.Specification
import play.api.test.Helpers.running
import play.api.test.FakeApplication
/**
* Requires mongod running
*/
class ClientIntegrationSpec extends Specification {
"Client model" should {
"be insertable"... | lukaszbudnik/geo-layers | test/models/ClientIntegrationSpec.scala | Scala | apache-2.0 | 1,764 |
package org.keycloak.performance
object AdminConsole extends AdminConsole {
}
trait AdminConsole extends Admin {
import AdminConsole._
// TODO Existing tests from keycloak.AdminConsole* will be moved here.
}
| keycloak/keycloak | testsuite/performance/tests/src/test/scala/org/keycloak/performance/AdminConsole.scala | Scala | apache-2.0 | 223 |
package tutorial.webapp
import scala.scalajs.js.annotation.JSExport
import org.scalajs.dom
import org.scalajs.dom.html
import scala.util.Random
case class Point(x: Int, y: Int){
def +(p: Point) = Point(x + p.x, y + p.y)
def /(d: Int) = Point(x / d, y / d)
}
@JSExport
object ScalaJSExample {
@JSExport
def mai... | CraigGiles/mynab | scalajs/src/main/scala/tutorial/webapp/ScalaJSExample.scala | Scala | mit | 1,064 |
package com.artclod.slick
import play.api.db.slick.Config.driver.simple._
/**
* Most of the aggregation functions in the DB do not work on db booleans.
* It can be useful to have a boolean treated as a number in the db so max and min for example
* can be used to determine if there are any of the values are true or... | kristiankime/web-education-games | app/com/artclod/slick/NumericBoolean.scala | Scala | mit | 1,030 |
/*
* Copyright 2014 SEEBURGER AG
*
* 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... | AndreasPetter/storehaus-cassandra | storehaus-cassandra/src/main/scala/com/twitter/storehaus/cassandra/CassandraCompositeStore.scala | Scala | apache-2.0 | 7,355 |
/*
* 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 ... | Swrrt/Samza | samza-core/src/main/scala/org/apache/samza/container/TaskInstance.scala | Scala | apache-2.0 | 14,047 |
package com.mogproject.mogami.core
import org.scalacheck.Gen
/**
* Square generator for scalacheck
*/
object SquareGen {
val squares: Gen[Square] = Gen.oneOf(Square.all)
def squaresOnBoardExcept(except: Seq[Square]): Gen[Square] = Gen.oneOf((Square.all.toSet -- except).toSeq)
}
/**
* Constant values
*/... | mogproject/mog-core-scala | shared/src/test/scala/com/mogproject/mogami/core/SquareGen.scala | Scala | apache-2.0 | 2,372 |
trait X {
trait A { type T >: Int <: Int }
val x : A
var n : x.T = 3
}
trait Y extends X {
trait B { type T >: String <: String }
lazy val x : A with B = {println(""); x}
n = "foo"
}
object Test extends App {
new Y {}
}
| yusuke2255/dotty | tests/untried/neg/override.scala | Scala | bsd-3-clause | 236 |
package org.monkeynuthead.monkeybarrel.web
import akka.actor.ActorSystem
import akka.stream.ActorMaterializer
import akka.stream.scaladsl.Source
import akka.testkit.{TestKit, TestActorRef}
import org.junit.runner.RunWith
import org.scalatest.{BeforeAndAfterAll, MustMatchers, WordSpec}
import org.scalatest.juni... | georgenicoll/monkey-barrel | web/src/test/scala/org/monkeynuthead/monkeybarrel/web/ToUppercaseActorSpec.scala | Scala | gpl-2.0 | 1,459 |
object Test {
class Foo[T]
type C[T] = Foo[_ <: T]
val a: C[AnyRef] = new Foo[AnyRef]
}
| loskutov/intellij-scala | testdata/scalacTests/pos/t0654.scala | Scala | apache-2.0 | 94 |
package dnmar;
import scalala.scalar._;
import scalala.tensor.::;
import scalala.tensor.mutable._;
import scalala.tensor.dense._;
import scalala.tensor.sparse._;
import scalala.library.Library._;
import scalala.library.Numerics._;
import scalala.library.LinearAlgebra._;
import scalala.library.Statistics._;
import scal... | aritter/dnmar | scala/src/main/scala/DNMAR.scala | Scala | gpl-3.0 | 28,632 |
package com.codacy.client.bitbucket.v1.service
import com.codacy.client.bitbucket.client.{BitbucketClient, Request, RequestResponse}
import play.api.libs.json.{JsNull, JsObject}
class UrlServices(client: BitbucketClient) {
/*
* Post to a api url
*/
def post(url: String): RequestResponse[JsObject] = {
c... | codacy/bitbucket-scala-client | src/main/scala/com/codacy/client/bitbucket/v1/service/UrlServices.scala | Scala | apache-2.0 | 383 |
/*
* Copyright 2001-2013 Artima, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agre... | dotty-staging/scalatest | scalatest-test/src/test/scala/org/scalatest/TestColonEscapeProp.scala | Scala | apache-2.0 | 16,447 |
package com.larroy
/**
* @author piotr 17.11.14
*/
case class Path(path: Seq[Long], length_m: Double)
| larroy/astar_scala | src/main/scala/Path.scala | Scala | mit | 105 |
package io.druid.cli.spark
import com.google.common.base.Joiner
import com.google.common.collect.Lists
import com.google.inject.Inject
import com.metamx.common.logger.Logger
import io.airlift.airline.Arguments
import io.airlift.airline.Command
import io.airlift.airline.Option
import io.druid.cli.Main
import io.druid.g... | SparklineData/spark-druid-indexer | src/main/scala/io/druid/cli/spark/CliSparkIndexer.scala | Scala | apache-2.0 | 4,291 |
package net.yoshinorin.gitbucket.monitoring.controllers
import scala.jdk.CollectionConverters._
import scala.util.{Failure, Success}
import gitbucket.core.controller.ControllerBase
import gitbucket.core.util.AdminAuthenticator
import net.yoshinorin.gitbucket.monitoring.services._
import net.yoshinorin.gitbucket.monito... | YoshinoriN/gitbucket-monitoring-plugin | src/main/scala/net/yoshinorin/gitbucket/monitoring/controllers/MonitoringController.scala | Scala | apache-2.0 | 3,315 |
/* Title: Pure/Admin/afp.scala
Author: Makarius
Administrative support for the Archive of Formal Proofs.
*/
package isabelle
import java.time.LocalDate
import scala.collection.immutable.SortedMap
object AFP
{
val repos_source = "https://isabelle.sketis.net/repos/afp-devel"
val groups: Map[Strin... | larsrh/libisabelle | modules/pide/2019-RC4/src/main/scala/Admin/afp.scala | Scala | apache-2.0 | 7,216 |
/*
* Copyright (c) 2015 Alpine Data Labs
* All rights reserved.
*/
package com.alpine.model.pack.multiple
import com.alpine.features.FeatureDesc
import com.alpine.json.JsonTestUtil
import com.alpine.model.pack.ml.LinearRegressionModel
import com.alpine.model.{MLModel, RowModel}
import com.alpine.model.pack.preproce... | holdenk/PluginSDK | alpine-model-pack/src/test/scala/com/alpine/model/pack/multiple/PipelineRowModelTest.scala | Scala | apache-2.0 | 1,780 |
package com.github.mdr.ascii.diagram.parser
class DiagramParserException(message: String) extends RuntimeException(message)
| mdr/ascii-graphs | src/main/scala/com/github/mdr/ascii/diagram/parser/DiagramParserException.scala | Scala | mit | 126 |
import com.raquo.domtypes.generic.keys
import outwatch.helpers.BasicStyleBuilder
package object outwatch extends ManagedSubscriptions {
type EmitterBuilder[+O, +R] = EmitterBuilderExecution[O, R, EmitterBuilder.Execution]
//TODO: invent typeclass CanBuildStyle[F[_]]
@inline implicit def StyleIsBuilder[T](style:... | OutWatch/outwatch | outwatch/src/main/scala/outwatch/package.scala | Scala | apache-2.0 | 402 |
package metal
package mutable
import scala.reflect.{classTag, ClassTag}
import spire.algebra.Order
import spire.math.QuickSort
import spire.syntax.cfor._
import util.Dummy
final class Buffer[@specialized V](var array: Array[V], var length: Int)(implicit val V: MetalTag[V], val ctV: ClassTag[V]) extends generic.Buffer... | denisrosset/ptrcoll | library/src/main/scala/metal/mutable/Buffer.scala | Scala | mit | 3,121 |
package org.jetbrains.plugins.scala
package conversion
import com.intellij.codeInsight.AnnotationUtil
import com.intellij.codeInsight.editorActions.ReferenceData
import com.intellij.lang.java.JavaLanguage
import com.intellij.openapi.util.TextRange
import com.intellij.psi._
import com.intellij.psi.search.LocalSearchSc... | whorbowicz/intellij-scala | src/org/jetbrains/plugins/scala/conversion/JavaToScala.scala | Scala | apache-2.0 | 43,598 |
package org.machine.engine.flow
import scala.concurrent.{ExecutionContext, Future}
import akka.NotUsed
import akka.actor.ActorSystem
import akka.http.scaladsl.model.ws.{Message, BinaryMessage, TextMessage}
import akka.stream.{ActorMaterializer, FlowShape, Inlet, Outlet, SourceShape}
import akka.stream.scaladsl.{Broad... | sholloway/graph-engine | src/main/scala/org/machine/engine/flow/WebSocketFlow.scala | Scala | mit | 2,016 |
/*
* 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 | resource-managers/kubernetes/core/src/test/scala/org/apache/spark/deploy/k8s/features/DriverCommandFeatureStepSuite.scala | Scala | apache-2.0 | 4,745 |
/**
* This file is part of nMix.
* Copyright (C) 2015-2016-2017 Agora Voting SL <agora@agoravoting.com>
* nMix is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License.
*... | nVotesOrg/nMix | src/main/scala/Models.scala | Scala | agpl-3.0 | 2,465 |
package tshrdlu.util.index
/**
* Copyright 2013 Nick Wilson
*
* 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... | utcompling/tshrdlu | src/main/scala/tshrdlu/util/index/Common.scala | Scala | apache-2.0 | 5,470 |
package parser.px.analyzers.structured
import scala.collection.mutable.HashMap
/**
* Utility class for referencing a field by it's full path.
* The class keeps track of all intermediary objects.
*/
protected class Binder(val parent:Binder, val fld:Field) {
def ->>(name:String) = Binder(this,name,0)
... | Y-P-/data-processing-binding | Parser/src/parser/px/analyzers/structured/Binder.scala | Scala | gpl-3.0 | 1,728 |
class DummyTest | matheshar/simple-build-tool | src/sbt-test/tests/scalacheck-a/src/test/scala/DummyTest.scala | Scala | bsd-3-clause | 17 |
package breeze
import java.util.zip._
import java.io._
import scala.collection.generic._
import scala.collection.mutable
import java.util.BitSet
/**
*
* @author dlwh
*/
package object util {
/**
* Deserializes an object using java serialization
*/
def readObject[T](loc: File): T = readObject(loc, false)... | wstcpyt/breeze | math/src/main/scala/breeze/util/package.scala | Scala | apache-2.0 | 7,520 |
package uk.org.lidalia.lang.collection
import org.scalatest.PropSpec
import org.scalatest.prop.TableDrivenPropertyChecks
import org.junit.runner.RunWith
import org.scalatest.junit.JUnitRunner
@RunWith(classOf[JUnitRunner])
class FlatMapZeroToZeroAsOptionTests extends PropSpec with TableDrivenPropertyChecks {
val z... | Mahoney/collections | src/test/scala/uk/org/lidalia/lang/collection/FlatMapZeroToZeroAsOptionTests.scala | Scala | mit | 1,387 |
package demesne.module
import akka.cluster.sharding.ShardRegion
import demesne.{ AggregateRootType, DomainModel }
/**
* Created by rolfsd on 8/31/16.
*/
sealed trait AggregateEnvironment
object AggregateEnvironment {
trait Resolver extends (DomainModel => AggregateEnvironment )
object Resolver {
val loc... | dmrolfs/demesne | core/src/main/scala/demesne/module/AggregateEnvironment.scala | Scala | apache-2.0 | 968 |
package dao
import play.api.libs.concurrent.Execution.Implicits.defaultContext
import javax.inject.Inject
import play.api.db.slick.DatabaseConfigProvider
import play.api.db.slick.HasDatabaseConfigProvider
import slick.driver.JdbcProfile
import models._
import scala.concurrent.Future
import org.joda.time.DateTime
impor... | timonag/ya-money-bot | app/dao/UpdatesDAO.scala | Scala | mit | 2,476 |
object CallbackTo {
extension [A](self: CallbackTo[Option[A]]) {
inline def asOption: Option[A] =
self.toScalaFn()
}
}
final class CallbackTo[A] (val x: List[A]) {
inline def runNow(): A =
x.head
inline def toScalaFn: () => A =
() => runNow()
def map[B](f: A => B): CallbackTo[B] =
??... | lampepfl/dotty | tests/pos/i11894b.scala | Scala | apache-2.0 | 485 |
package jgo.tools.compiler.parser.combinatorExten
import scala.util.parsing.combinator.Parsers
trait TracePrintingParsers extends FancyParsers {
override def nameize[T](p: Parser[T], name: String) =
log(super.nameize(p, name))(name)
override def log[T](p: => Parser[T])(name: String): Parser[T] = Parser{ in... | thomasmodeneis/jgo | src/src/main/scala/jgo/tools/compiler/parser/combinatorExten/TracePrintingParsers.scala | Scala | gpl-3.0 | 489 |
package mist.api
import mist.api.internal.{ArgCombiner, FnForTuple}
import mist.api.data.JsMap
import scala.util._
trait ArgDef[A] { self =>
def extract(ctx: FnContext): Extraction[A]
def describe(): Seq[ArgInfo]
private[api] def validate(params: JsMap): Extraction[Unit]
final def combine[B](other: ArgDef[... | Hydrospheredata/mist | mist-lib/src/main/scala/mist/api/ArgDef.scala | Scala | apache-2.0 | 1,651 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | manishgupta88/carbondata | integration/spark2/src/main/scala/org/apache/spark/sql/parser/CarbonSpark2SqlParser.scala | Scala | apache-2.0 | 28,245 |
package be.mygod.text
import org.xml.sax.SAXException
/**
* @author Mygod
*/
final class AttributeMissingException(attributeNames: String) extends SAXException(attributeNames + " required.") { }
| Mygod/MygodSpeechSynthesizer-android | src/main/scala/be/mygod/text/AttributeMissingException.scala | Scala | gpl-3.0 | 199 |
package nest.sparkle.loader.kafka
import kafka.message.MessageAndMetadata
import org.scalatest.{ FunSuite, Matchers }
import org.scalatest.prop.PropertyChecks
import nest.sparkle.loader.kafka.KafkaTestUtil.{ withTestEncodedTopic, withTestReader }
class TestEncodedKafka extends FunSuite with Matchers with PropertyChe... | mighdoll/sparkle | kafka/src/it/scala/nest/sparkle/loader/kafka/TestEncodedKafka.scala | Scala | apache-2.0 | 1,108 |
package com.twitter.finagle.util
import com.twitter.finagle.benchmark.StdBenchAnnotations
import com.twitter.finagle.core.util.InetAddressUtil
import java.net.InetAddress
import org.openjdk.jmh.annotations._
@State(Scope.Benchmark)
@Threads(1)
class InetAddressUtilBench extends StdBenchAnnotations {
val ip = "69.55... | twitter/finagle | finagle-benchmark/src/main/scala/com/twitter/finagle/util/InetAddressUtilBench.scala | Scala | apache-2.0 | 538 |
package firesoft.util
import java.nio.file.{Paths, Files}
import java.nio.charset.StandardCharsets
object FileWriter
{
def write(data : String, path : String)= {
Files.write(Paths.get(path), data.getBytes(StandardCharsets.UTF_8))
}
} | firephil/scala-math-problems | src/firesoft/util/FileWriter.scala | Scala | mit | 244 |
/*
* Copyright 2022 HM Revenue & Customs
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or a... | hmrc/vat-registration-frontend | test/connectors/mocks/AuthMock.scala | Scala | apache-2.0 | 3,849 |
/*
* Copyright (c) 2021, salesforce.com, inc.
* All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
*/
package com.krux.hyperion.precondition
import com.krux.hyperion.action.Action
import com.k... | realstraw/hyperion | core/src/main/scala/com/krux/hyperion/precondition/Precondition.scala | Scala | bsd-3-clause | 2,651 |
package edu.rice.habanero.benchmarks.bitonicsort
import edu.rice.habanero.actors.{JumiActor, JumiActorState, JumiPool}
import edu.rice.habanero.benchmarks.philosopher.PhilosopherAkkaActorBenchmark.ExitMessage
import edu.rice.habanero.benchmarks.{Benchmark, BenchmarkRunner, PseudoRandom}
import scala.collection.mutabl... | shamsmahmood/savina | src/main/scala/edu/rice/habanero/benchmarks/bitonicsort/BitonicSortJumiActorBenchmark.scala | Scala | gpl-2.0 | 16,519 |
package io.muvr.exercise
import akka.actor.{ActorLogging, Props}
import akka.contrib.pattern.ShardRegion
import akka.persistence.PersistentActor
import io.muvr.{UserId, UserMessage}
import scalaz.\\/
/**
* Companion for the ``UserExerciseProcessor`` actor. Defines the fields and messages.
*/
object UserExercisePro... | boonhero/muvr-server | exercise/src/main/scala/io/muvr/exercise/UserExerciseProcessor.scala | Scala | bsd-3-clause | 2,052 |
package com.wavesplatform.lagonaki.unit
import java.io.File
import java.nio.file.Files
import cats.syntax.option._
import com.wavesplatform.common.state.ByteStr
import com.wavesplatform.settings.WalletSettings
import com.wavesplatform.test.FunSuite
import com.wavesplatform.wallet.Wallet
class WalletSpecification ext... | wavesplatform/Waves | node/src/test/scala/com/wavesplatform/lagonaki/unit/WalletSpecification.scala | Scala | mit | 2,903 |
package reactivemongo.api.commands.bson
import scala.util.{ Failure, Success }
import reactivemongo.api.commands._
import reactivemongo.bson._
import reactivemongo.core.errors.GenericDriverException
object BSONDropDatabaseImplicits {
implicit object DropDatabaseWriter
extends BSONDocumentWriter[DropDatabase... | charleskubicek/ReactiveMongo | driver/src/main/scala/api/commands/bson/instanceadministration.scala | Scala | apache-2.0 | 14,572 |
package uk.gov.gds.common.mongo.migration
import uk.gov.gds.common.mongo.repository.IdentityBasedMongoRepository
import uk.gov.gds.common.logging.Logging
import uk.gov.gds.common.mongo.MongoDatabaseManager
abstract class ChangeLogRepository(databaseManager: MongoDatabaseManager)
extends IdentityBasedMongoRepository... | alphagov/gds-scala-common | mongo-utils/src/main/scala/uk/gov/gds/common/mongo/migration/ChangeLogRepository.scala | Scala | mit | 1,856 |
package io.github.databob.generators
import io.github.databob.{Databob, Generator, GeneratorType}
import org.json4s.reflect.TypeInfo
class TypeMatchingGenerator[A: Manifest](mk: Databob => A) extends Generator[A] {
val Class = implicitly[Manifest[A]].runtimeClass
def pf(databob: Databob): PartialFunction[Gener... | daviddenton/databob.scala | src/main/scala/io/github/databob/generators/TypeMatchingGenerator.scala | Scala | apache-2.0 | 410 |
/*
* Copyright (c) 2015 Goldman Sachs.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* and Eclipse Distribution License v. 1.0 which accompany this distribution.
* The Eclipse Public License is available at http://www.ecli... | g-votte/eclipse-collections | scala-unit-tests/src/test/scala/org/eclipse/collections/impl/ListIterableTestTrait.scala | Scala | bsd-3-clause | 2,023 |
package com.jakway.gnucash.io
import autogen.buildinfo.BuildInfo
import com.jakway.gnucash.error.ValidationError
import com.jakway.util.StackTraceString
object ErrorPrinter {
def format(validationError: ValidationError, includeIssueTrackerMessage: Boolean = true): String = {
val suppressedExceptions = {
v... | tjakway/Gnucash-Regex-Importer | src/main/scala/com/jakway/gnucash/io/ErrorPrinter.scala | Scala | gpl-2.0 | 1,241 |
/*
* 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... | monix/monix | monix-reactive/shared/src/test/scala/monix/reactive/internal/operators/EndWithErrorSuite.scala | Scala | apache-2.0 | 2,257 |
/*
Copyright 2012 Twitter, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distr... | sriramkrishnan/scalding | scalding-core/src/test/scala/com/twitter/scalding/TupleTest.scala | Scala | apache-2.0 | 3,466 |
/**
* A person has a name and an age.
*/
case class Person(name: String, age: Int)
abstract class Vertical extends CaseJeu
case class Haut(a: Int) extends Vertical
case class Bas(name: String, b: Double) extends Vertical
sealed trait Ior[+A, +B]
case class Left[A](a: A) extends Ior[A, Nothing]
case class Right[B](b... | SoftwareHeritage/swh-web-ui | swh/web/tests/resources/contents/code/extensions/test.scala | Scala | agpl-3.0 | 1,227 |
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.