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 |
|---|---|---|---|---|---|
import java.io.{File, PrintWriter}
import javax.imageio.ImageIO
object WolframCells {
val TEXT_WIDTH = 120
val TEXT_HEIGHT = 50
val BITMAP_WIDTH = 1000
val BITMAP_HEIGHT = 500
val INPUT = ""
val OUTPUT = "-"
val RULE_NO = 118
val RULE_LENGTH = 7
val PIXEL_SIZE = 1
val BACKGROUND = 0
val FOREGROU... | gto76/wolfram-cells | src/main/scala/WolframCells.scala | Scala | mit | 4,030 |
import javax.inject._
import com.google.inject.AbstractModule
import net.codingwell.scalaguice.ScalaModule
import pl.why.common.auth.AuthService
import pl.why.common.resumable.ResumableProjectionManager
import play.api.libs.concurrent.AkkaGuiceSupport
import play.api.{Configuration, Environment}
import v1.post.command... | pieczkus/whyblog | app/Module.scala | Scala | mit | 805 |
package scorex
import scorex.crypto.hash.FastCryptographicHash
package object transaction {
type AssetId = Array[Byte]
val AssetIdLength = FastCryptographicHash.DigestSize
}
| B83YPoj/Waves | src/main/scala/scorex/transaction/package.scala | Scala | apache-2.0 | 182 |
/*
* 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 ... | hhbyyh/spark | sql/core/src/main/scala/org/apache/spark/sql/execution/basicPhysicalOperators.scala | Scala | apache-2.0 | 28,180 |
package scalala {
class G
}
import scala.collection.mutable.ArrayBuffer
import java.util.ArrayList
import scalala.G
class Groups1 {
val b: ArrayBuffer[Int] = null
val c: ArrayList[Int] = null
val d: G = null
}
/*
package scalala {
class G
}
import java.util.ArrayList
import scalala.G
import scala.collect... | jastice/intellij-scala | scala/scala-impl/testdata/optimize/groups/ExactPackage.scala | Scala | apache-2.0 | 448 |
import breeze.stats.distributions._
import breeze.linalg._
import scala.math._
class NeuralNetwork (layers: List[Int]) {
val dist = Gaussian(0, 1)
val biases = for ( n <- layers drop 1) yield
new DenseVector(dist.sample(n).toArray)
val weights = for ((r, c) <- (layers drop 1) zip (layers dropRight 1)) yield
... | lengstrom/scala-nn | src/main/scala/NeuralNetwork.scala | Scala | mit | 1,012 |
package quizleague.data
import java.util
import com.google.auth.oauth2.GoogleCredentials
import quizleague.domain.{Entity, Key, Ref}
import io.circe._
import reflect._
import scala.collection.JavaConverters._
import com.google.cloud.firestore.FirestoreOptions
import com.google.auth.Credentials
import java.util.logg... | gumdrop/quizleague-maintain | jvm/src/main/scala/quizleague/data/Firebase.scala | Scala | mit | 6,015 |
package org.cddcore.example.tennisScore
import org.cddcore.engine.Engine
import org.junit.runner.RunWith
import org.cddcore.engine.tests.CddJunitRunner
object Score {
val love = Score("love")
val s15 = Score("fifteen")
val s30 = Score("thirty")
val s40 = Score("forty")
val deuce = Score("deuce")
val advan... | phil-rice/cddexamples | src/main/scala/org/cddcore/example/tennisScore/TennisScorer1.scala | Scala | bsd-2-clause | 2,826 |
package uk.co.turingatemyhamster.bioparsers.fasta
object FastaTest {
def main(args: Array[String]): Unit = {
println("Test parsing description text")
println(DescriptionParser.Description.parse("foo bar baz"))
println(DescriptionParser.Description.parse("foo bar"))
println(DescriptionParser.Descrip... | drdozer/bioparsers | src/main/scala/uk/co/turingatemyhamster/bioparsers/fasta/FastaTest.scala | Scala | apache-2.0 | 1,953 |
package org.bitcoins.core.api.wallet
import org.bitcoins.core.api.chain.ChainQueryApi
import org.bitcoins.core.api.feeprovider.FeeRateApi
import org.bitcoins.core.api.keymanager.KeyManagerApi
import org.bitcoins.core.api.node.NodeApi
import org.bitcoins.core.api.wallet.db._
import org.bitcoins.core.config.NetworkParam... | bitcoin-s/bitcoin-s | core/src/main/scala/org/bitcoins/core/api/wallet/WalletApi.scala | Scala | mit | 13,547 |
/*
* Part of NDLA learningpath-api.
* Copyright (C) 2016 NDLA
*
* See LICENSE
*
*/
package no.ndla.learningpathapi.model.api
import org.scalatra.swagger.annotations._
import org.scalatra.swagger.runtime.annotations.ApiModelProperty
import scala.annotation.meta.field
// format: off
@ApiModel(description = "Rep... | NDLANO/learningpath-api | src/main/scala/no/ndla/learningpathapi/model/api/EmbedUrl.scala | Scala | gpl-3.0 | 572 |
/*
* 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 | dcct/src/main/scala/phases/ShapeCheckerFamily.scala | Scala | bsd-3-clause | 2,316 |
package com.blockcypher.api.marshallers
import com.blockcypher.api.protocol.{BlockCypherOutput, BlockCypherInput, BlockCypherTransactionImpl, BlockCypherTransaction}
import org.joda.time.DateTime
import org.scalacoin.currency.Satoshis
import org.scalacoin.marshallers.BitcoinAddressProtocol
import spray.json._
import B... | Christewart/blockcypher-api | src/main/scala/com/blockcypher/api/marshallers/BlockCypherTransactionMarshaller.scala | Scala | mit | 4,248 |
package edu.arizona.sista.discourse.rstparser
import java.io.File
import scala.io.Source
import java.util.regex.{Pattern,Matcher}
import scala.collection.mutable.{ListBuffer, ArrayBuffer}
import org.slf4j.LoggerFactory
import edu.arizona.sista.processors.{Document, Processor}
import edu.arizona.sista.struct.MutableNum... | michaelcapizzi/processors | src/main/scala/edu/arizona/sista/discourse/rstparser/Reader.scala | Scala | apache-2.0 | 21,315 |
package org.leebli.common.http
import java.io.FileOutputStream
import org.apache.http.impl.client.DefaultHttpClient
import org.apache.http.client.methods.HttpGet
import java.io.File
import grizzled.slf4j.Logger
import java.io.InputStream
import org.apache.commons.io.IOUtils
import java.io.ByteArrayInputStream
import o... | jonathan-macke/leebli | common/src/main/scala/org/leebli/common/http/FileDownload.scala | Scala | apache-2.0 | 3,786 |
package priv.sp
import java.util.{Locale, MissingResourceException}
import com.badlogic.gdx.Gdx
import com.badlogic.gdx.utils.I18NBundle
object I18n {
val locale = Option(System.getenv("LC_CTYPE")) map lcToLocale getOrElse Locale.getDefault()
val isRussian = locale.getLanguage == "ru"
val usedLocale = if (isR... | illim/freespectrogdx | core/src/main/scala/priv/sp/I18n.scala | Scala | gpl-3.0 | 926 |
/*
* This file is part of Evo2DSim.
*
* Evo2DSim 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 3 of the License, or
* (at your option) any later version.
*
* Evo2DSim is distrib... | vchuravy/Evo2DSim | analyzer/src/main/scala/org/vastness/evo2dsim/analyzer/gui/ComponentDialog.scala | Scala | mit | 1,303 |
package org.emailscript.helpers
import org.xbill.DNS.{Lookup, Type}
/**
* Hide from the rest of the system how we are doing dns queries.
* This let's us change the implementation if we want
*/
class DnsHelper {
private def toType(dnsType: String) = {
dnsType.toLowerCase match {
case "txt" => Type.TXT... | OdysseusLevy/emailscript | src/main/scala/org/emailscript/helpers/DnsHelper.scala | Scala | lgpl-3.0 | 634 |
/*
* 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 ... | practice-vishnoi/dev-spark-1 | mllib/src/main/scala/org/apache/spark/ml/feature/DCT.scala | Scala | apache-2.0 | 2,728 |
/*
* This software is licensed under the GNU Affero General Public License, quoted below.
*
* This file is a part of PowerAPI.
*
* Copyright (C) 2011-2016 Inria, University of Lille 1.
*
* PowerAPI is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public Lice... | Spirals-Team/powerapi | powerapi-core/src/main/scala/org/powerapi/module/cpu/UsageMetricsChannel.scala | Scala | agpl-3.0 | 4,699 |
/*
* 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 ... | andrewor14/iolap | sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveTypeCoercionSuite.scala | Scala | apache-2.0 | 2,402 |
package com.mesosphere.cosmos.error
import com.twitter.util.Duration
import io.circe.Encoder
import io.circe.JsonObject
import io.circe.generic.semiauto.deriveEncoder
import com.mesosphere.cosmos.circe.Encoders._
final case class TimeoutError(
operation: String,
destination: String,
timeout: Duration
) extends... | dcos/cosmos | cosmos-common/src/main/scala/com/mesosphere/cosmos/error/TimeoutError.scala | Scala | apache-2.0 | 613 |
package stackoverflow
import org.scalatest.{FunSuite, BeforeAndAfterAll}
import org.junit.runner.RunWith
import org.scalatest.junit.JUnitRunner
import org.apache.spark.SparkConf
import org.apache.spark.SparkContext
import org.apache.spark.SparkContext._
import org.apache.spark.rdd.RDD
import java.net.URL
import java.n... | dnc1994/FuncScala | scala-spark-big-data/stackoverflow/src/test/scala/stackoverflow/StackOverflowSuite.scala | Scala | mit | 1,129 |
package de.choffmeister.microserviceutils.postgresql
import java.time.Instant
import akka.Done
import akka.actor.ActorSystem
import akka.stream.scaladsl.Sink
import akka.testkit.TestKit
import de.choffmeister.microserviceutils.postgresql.testkit.PostgresqlTest
import org.scalatest.BeforeAndAfterAll
import org.scalate... | choffmeister/microservice-utils | microservice-utils-postgresql-testkit/src/test/scala/de/choffmeister/microserviceutils/postgresql/TopicHandlerTest.scala | Scala | mit | 4,490 |
/*
* Copyright 2011-2017 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... | dvreeze/yaidom | js/src/main/scala/eu/cdevreeze/yaidom/convert/YaidomToJsDomConversions.scala | Scala | apache-2.0 | 6,966 |
package com.twitter.finagle.http.codec
/**
* The HTTP connection manager implements connection management in
* accordance with RFC 2616 § 8. This is just the state machine: the
* codec implementations are in {Server,Client}ConnectionManager.
*/
import org.jboss.netty.handler.codec.http._
class ConnectionManager ... | joshbedo/finagle | finagle-http/src/main/scala/com/twitter/finagle/http/codec/ConnectionManager.scala | Scala | apache-2.0 | 1,432 |
/*
* 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 ... | jongwook/incubator-s2graph | s2core/src/test/scala/org/apache/s2graph/core/EdgeTest.scala | Scala | apache-2.0 | 21,343 |
/**
* Copyright (c) 2015 Basho Technologies, Inc.
*
* This file is provided 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/LICENSE-2.0
*
* Unless ... | basho/spark-riak-connector | connector/src/test/scala/com/basho/riak/spark/rdd/ReadFromRiakRDDTest.scala | Scala | apache-2.0 | 14,023 |
import stainless.lang._
import stainless.annotation._
case class Container[@mutable T](var t: T)
trait FreshCopy2 {
def f() = {
var c = Container(Container(Container(123)))
val fresh = freshCopy(c)
c.t = Container(Container(456))
assert(fresh.t.t.t == 123)
var fresh2 = freshCopy(c.t.t)
c.t... | epfl-lara/stainless | frontends/benchmarks/imperative/valid/FreshCopy2.scala | Scala | apache-2.0 | 686 |
package ohnosequencesbundles.statika
import ohnosequences.statika._, bundles._, instructions._
case object express extends Bundle() {
def install: Results = {
// do someting here
success(s"${bundleName} is installed")
}
}
| ohnosequences-bundles/express | src/main/scala/express.scala | Scala | agpl-3.0 | 239 |
package de.leanovate.swaggercheck.schema.play.model
import play.api.libs.json.Json
case class GeoLocation(
latitude: Option[Double],
longitude: Option[Double]
)
object GeoLocation {
implicit val jsonFormat = Json.format[GeoLocation]
} | leanovate/swagger-check | json-schema-play/src/test/scala/de/leanovate/swaggercheck/schema/play/model/GeoLocation.scala | Scala | mit | 309 |
/*
*************************************************************************************
* Copyright 2011 Normation SAS
*************************************************************************************
*
* This file is part of Rudder.
*
* Rudder is free software: you can redistribute it and/or modify
* it under the... | armeniaca/rudder | rudder-core/src/main/scala/com/normation/rudder/services/policies/DependencyAndDeletionService.scala | Scala | gpl-3.0 | 18,612 |
package dbpedia.dataparsers.util
import scala.collection.mutable.ArrayBuffer
/**
* Used to collect parsing errors.
* Not thread-safe.
*/
private class ParsingErrors
{
private val errors = new ArrayBuffer[String]()
def add(msg : String) = errors += msg
override def toString = if(errors.isEmpty) "Error... | FnOio/dbpedia-parsing-functions-scala | src/main/scala/dbpedia/dataparsers/util/ParsingErrors.scala | Scala | gpl-2.0 | 392 |
import scala.tools.partest.ReplTest
object Test extends ReplTest {
override def extraSettings = "-feature -language:_"
def code = """
:kind Int
:kind scala.Option
:k (Int, Int) => Int
:k -v Either
:k -v scala.collection.SortedMapOps
:kind -v Tuple2
:kind -v Tuple2[Int, Int]
trait Functor[F[_]] {}
:kind -v Functor... | lrytz/scala | test/files/run/repl-kind.scala | Scala | apache-2.0 | 598 |
/* __ *\\
** ________ ___ / / ___ Scala API **
** / __/ __// _ | / / / _ | (c) 2006-2013, LAMP/EPFL **
** __\\ \\/ /__/ __ |/ /__/ __ | http://www.scala-lang.org/ **
** /____/\\___/_/... | felixmulder/scala | src/library/scala/collection/convert/WrapAsScala.scala | Scala | bsd-3-clause | 10,477 |
/*
* 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 ... | SparklineData/spark-druid-olap | src/main/scala/org/apache/spark/sql/sources/druid/AggregateTransform.scala | Scala | apache-2.0 | 22,082 |
package org.scalatra
import org.scalatra.test.scalatest.ScalatraWordSpec
import skinny.micro.SkinnyMicroServlet
class PatchSpec extends ScalatraWordSpec {
addServlet(new SkinnyMicroServlet {
patch("/") {
params.get("name").getOrElse("params are absent")
}
}, "/*")
"Patch requests " should {
"... | xerial/skinny-micro | micro/src/test/scala/org/scalatra/PatchSpec.scala | Scala | bsd-2-clause | 476 |
/***********************************************************************
* Copyright (c) 2013-2022 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... | locationtech/geomesa | geomesa-filter/src/main/scala/org/locationtech/geomesa/filter/GeometryProcessing.scala | Scala | apache-2.0 | 6,708 |
/*
* 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 | core/src/main/scala/org/apache/spark/BarrierTaskInfo.scala | Scala | apache-2.0 | 1,150 |
package eventstore
package core
package operations
import scala.util.{Failure, Try}
import util.uuid.randomUuid
import tcp.PackOut
import operations.{SubscriptionOperation => SO}
import NotHandled.{NotReady, TooBusy}
import OnIncoming._
import TestData.{readEvent, readStreamEvents, readAllEvents, subscribeTo}
import e... | EventStore/EventStore.JVM | core/src/test/scala/eventstore/core/operations/SubscriptionOperationSpec.scala | Scala | bsd-3-clause | 15,692 |
package com.gravity.goose
import images.Image
import junit.framework.Assert._
import com.gravity.goose.extractors.AdditionalDataExtractor
import org.jsoup.nodes.Element
/**
* Created by Jim Plush
* User: jim
* Date: 8/19/11
*/
object TestUtils {
val staticHtmlDir = "/com/gravity/goose/statichtml/"
private v... | njosephef/extractor | src/test/scala/com/gravity/goose/TestUtils.scala | Scala | apache-2.0 | 4,075 |
package io.youi.style
class FontFamily(val value: String) extends AnyVal
object FontFamily extends Stringify[FontFamily] {
val default: FontFamily = new FontFamily("")
def apply(value: String): FontFamily = new FontFamily(value)
override def fromString(value: String): Option[FontFamily] = {
value match {
... | outr/youi | ui/js/src/main/scala/io/youi/style/FontFamily.scala | Scala | mit | 506 |
package uk.ac.ncl.openlab.intake24.services.fooddb.admin
import uk.ac.ncl.openlab.intake24.api.data.AssociatedFood
import uk.ac.ncl.openlab.intake24.api.data.admin.AssociatedFoodWithHeader
import uk.ac.ncl.openlab.intake24.errors.{LocalLookupError, LocaleOrParentError, UnexpectedDatabaseError}
import uk.ac.ncl.openlab... | digitalinteraction/intake24 | FoodDataServices/src/main/scala/uk/ac/ncl/openlab/intake24/services/fooddb/admin/AssociatedFoodsAdminService.scala | Scala | apache-2.0 | 921 |
/**********************************************************************************************************************
* This file is part of Scrupal, a Scalable Reactive Web Application Framework for Content Management *
* ... | scrupal/scrupal | scrupal-storage/src/main/scala/scrupal/storage/api/StorageLayer.scala | Scala | apache-2.0 | 2,026 |
/***********************************************************************
* 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-redis/geomesa-redis-datastore/src/main/scala/org/locationtech/geomesa/redis/data/util/RedisBackedMetadata.scala | Scala | apache-2.0 | 2,643 |
package com.criteo.dev.cluster.copy
import com.criteo.dev.cluster._
import com.criteo.dev.cluster.utils.ddl.CreateTable
/**
* Get the partitions of a table.
*/
class GetPartitionMetadataAction (conf: Map[String, String], node: Node) {
def apply(database : String,
table : String,
ddl: Cr... | szehonCriteo/berilia | src/main/scala/com/criteo/dev/cluster/copy/GetPartitionMetadataAction.scala | Scala | apache-2.0 | 1,262 |
package de.tu_berlin.formic.server
import akka.actor.ActorRef
import de.tu_berlin.formic.common.datastructure.{DataStructureName, ServerDataStructureProvider}
/**
* Cake-pattern trait to be able to initialize a FormicServer with the data structures
* the user wants.
*
* @author Ronny Bräunlich
*/
trait Serv... | rbraeunlich/formic | server/src/main/scala/de/tu_berlin/formic/server/ServerDataStructures.scala | Scala | apache-2.0 | 406 |
package de.fosd.typechef.parser.c
import java.util.Collections
import de.fosd.typechef.featureexpr._
import junit.framework.Assert._
import org.junit.{Assert, Ignore, Test}
import org.kiama.rewriting.Rewriter._
class MiscFileTest extends TestHelper {
def parseFile(fileName: String) {
val inputStream = ge... | mbeddr/TypeChef | CParser/src/test/scala/de/fosd/typechef/parser/c/MiscFileTest.scala | Scala | lgpl-3.0 | 2,305 |
package mesosphere.marathon
package core.flow.impl
import akka.actor._
import akka.testkit.{ TestActorRef, TestProbe }
import mesosphere.AkkaUnitTest
import mesosphere.marathon.core.base.ConstantClock
import mesosphere.marathon.core.event.{ SchedulerRegisteredEvent, SchedulerReregisteredEvent }
import mesosphere.marat... | natemurthy/marathon | src/test/scala/mesosphere/marathon/core/flow/impl/ReviveOffersActorTest.scala | Scala | apache-2.0 | 11,906 |
package gitbucket.core.service
import gitbucket.core.api.JsonFormat
import gitbucket.core.model.{Account, WebHook}
import gitbucket.core.model.Profile._
import gitbucket.core.model.Profile.profile.blockingApi._
import gitbucket.core.plugin.PluginRegistry
import gitbucket.core.service.WebHookService.WebHookPushPayload
i... | mann-ed/gitbucket | src/main/scala/gitbucket/core/service/RepositoryCommitFileService.scala | Scala | apache-2.0 | 7,056 |
package com.github.vitalsoftware.util
import com.github.vitalsoftware.macros.jsonDefaults
import org.specs2.mutable.Specification
import org.specs2.specification.Scope
import play.api.libs.json._
@jsonDefaults case class Primitives(f1: Int, f2: String, f3: Boolean, f4: Option[Int])
object Primitives extends RobustPri... | vital-software/scala-redox | src/test/scala/com/github/vitalsoftware/util/RobustPrimitivesTest.scala | Scala | mit | 3,705 |
/*
* 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/incubator-carbondata | integration/spark2/src/main/scala/org/apache/spark/sql/parser/CarbonSparkSqlParserUtil.scala | Scala | apache-2.0 | 16,721 |
/*******************************************************************************
* (C) Copyright 2015 ADP, 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.... | adplabs/unicorn | shell/src/main/scala/unicorn/shell/Shell.scala | Scala | apache-2.0 | 2,719 |
package org.raisercostin.jedi
import org.raisercostin.jedi.Locations._
import org.scalatest._
import org.junit.runner.RunWith
import org.junit.Assert._
import org.scalatest.junit.JUnitRunner
import scala.util.Try
import java.util.regex.Pattern.Loop
import Locations._
import org.scalatest.Matchers._
import java.io.Fi... | raisercostin/jedi-io | src/test/scala/org/raisercostin/jedi/EmailLocationTest.scala | Scala | apache-2.0 | 636 |
package com.mesosphere.cosmos
import cats.data.Xor
import cats.data.Xor.Right
import com.mesosphere.cosmos.circe.Decoders._
import com.mesosphere.cosmos.http.MediaTypes
import com.mesosphere.cosmos.rpc.v1.circe.Encoders._
import com.mesosphere.cosmos.rpc.v1.model.{DescribeRequest, ListVersionsRequest}
import com.mesos... | movicha/cosmos | cosmos-server/src/it/scala/com/mesosphere/cosmos/PackageDescribeSpec.scala | Scala | apache-2.0 | 6,264 |
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you ... | vjagadish/samza-clone | samza-yarn/src/test/scala/org/apache/samza/job/yarn/TestSamzaAppMasterService.scala | Scala | apache-2.0 | 5,923 |
object Test extends dotty.runtime.LegacyApp {
import collection._
val xs: SeqView[(String, Int), Seq[_]] = List("x").view.zip(Stream.from(0))
println(xs)
val ys = List(1, 2, 3).view map { x => println("mapping "+x); x + 1 }
println("ys defined")
println(ys.head)
println(ys.tail)
println(ys(2))
printl... | densh/dotty | tests/run/viewtest.scala | Scala | bsd-3-clause | 1,540 |
import org.scalacheck._
class SimpleTest extends Properties("Simple")
{
specify("increment scala", (i: Int) => (new a.b.ScalaA).increment(i) == i+1)
specify("increment java", (i: Int) => (new JavaA).inc(i) == i+1)
specify("decrement scala", (i: Int) => (new b.ScalaB).decrement(i) == i+1)
specify("decrement java"... | sbt/sbt-zero-seven | src/sbt-test/project/flatten/test-src/SimpleTest.scala | Scala | bsd-3-clause | 364 |
package com.aergonaut.lifeaquatic
import cofh.api.core.IInitializer
import com.aergonaut.lifeaquatic.block.ModBlocks
import com.aergonaut.lifeaquatic.common.TProxy
import com.aergonaut.lifeaquatic.config.ConfigHandler
import com.aergonaut.lifeaquatic.handler.ModFuelHandler
import com.aergonaut.lifeaquatic.item.ModItem... | aergonaut/LifeAquatic | src/main/scala/com/aergonaut/lifeaquatic/LifeAquatic.scala | Scala | mit | 1,982 |
/*
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this f... | transcendent-ai-labs/DynaML | dynaml-notebook/src/main/scala/io/github/mandar2812/dynaml/jupyter/DynaMLJupyter.scala | Scala | apache-2.0 | 6,259 |
/*
* 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 ... | tophua/spark1.52 | sql/core/src/test/scala/org/apache/spark/sql/DataFrameFunctionsSuite.scala | Scala | apache-2.0 | 18,787 |
/**
*
* Copyright (C) 2017 University of Bamberg, Software Technologies Research Group
* <https://www.uni-bamberg.de/>, <http://www.swt-bamberg.de/>
*
* This file is part of the Data Structure Investigator (DSI) project, which received financial support by the
* German Research Foundation (DFG) under grant no. L... | uniba-swt/DSIsrc | src/event/DsOliBTEvent.scala | Scala | gpl-3.0 | 1,519 |
package io.finch.todo
import cats.effect.IO
import cats.effect.concurrent.Ref
import com.twitter.finagle.http.Status
import io.circe.generic.auto._
import io.finch._
import io.finch.circe._
import io.finch.internal.DummyExecutionContext
import org.scalacheck.{Arbitrary, Gen}
import org.scalatest.flatspec.AnyFlatSpec
i... | finagle/finch | examples/src/test/scala/io/finch/todo/TodoSpec.scala | Scala | apache-2.0 | 2,781 |
/*
* Copyright 2015 Foundational Development
*
* 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 appl... | rssvihla/datastax_work | spark_commons/benchmarks/low_latency_spark/src/main/scala/pro/foundev/messaging/RabbitMQPublisher.scala | Scala | apache-2.0 | 1,166 |
package io.github.reggert.reb4s.prefab
import java.net.{Inet4Address, InetAddress}
import io.github.reggert.reb4s.Group.Capture
import io.github.reggert.reb4s.Implicits.{char2Literal, string2Literal}
import io.github.reggert.reb4s.{Alternation, Sequence}
import io.github.reggert.reb4s.charclass.CharClass.{Perl, range... | reggert/reb4s | src/test/scala/io/github/reggert/reb4s/prefab/DottedDecimalIPv4Address.scala | Scala | lgpl-3.0 | 1,482 |
// Databricks notebook source
// MAGIC %md
// MAGIC # mapPartitionsWithIndex
// MAGIC Return a new RDD by applying a function to each partition of this RDD, while tracking the index of the original partition.
// MAGIC
// MAGIC Let us look at the [legend and overview of the visual RDD Api](/#workspace/scalable-data-sc... | lamastex/scalable-data-science | dbcArchives/2021/xtraResources/visualRDDApi/recall/transformations/mapPartitionsWithIndex.scala | Scala | unlicense | 1,147 |
package models.roles
/**
* Created by Ravis on 23/02/15.
*/
sealed trait ChairRole {
val value: String
override def toString = this.value
}
protected class RoleImpl(val value: String) extends ChairRole
case object Administrator extends RoleImpl("Admin")
case object Teacher extends RoleImpl("teacher")
case objec... | RavisMsk/Design-Tech-Home-Task | app/models/roles/ChairRole.scala | Scala | mit | 357 |
package net.sansa_stack.rdf.flink.qualityassessment.metrics.performance
import net.sansa_stack.rdf.common.qualityassessment.utils.NodeUtils._
import org.apache.flink.api.scala.DataSet
import org.apache.jena.graph.{ Node, Triple }
/**
*
* @author Gezim Sejdiu
*/
object NoHashURIs {
def assessNoHashUris(dataset: ... | SANSA-Stack/Spark-RDF | sansa-rdf-flink/src/main/scala/net/sansa_stack/rdf/flink/qualityassessment/metrics/performance/NoHashURIs.scala | Scala | gpl-3.0 | 833 |
/*
* Licensed to Cloudera, Inc. under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. Cloudera, Inc. licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use thi... | MobinRanjbar/hue | apps/spark/java/livy-repl/src/test/scala/com/cloudera/hue/livy/repl/BaseInterpreterSpec.scala | Scala | apache-2.0 | 1,180 |
/*
* 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 ... | wangmiao1981/spark | resource-managers/kubernetes/core/src/main/scala/org/apache/spark/scheduler/cluster/k8s/ExecutorPodsAllocator.scala | Scala | apache-2.0 | 19,997 |
package com.yetu.oauth2provider.signature.models
import play.api.libs.json.Json
case class YetuPublicKey(key: String)
object YetuPublicKey {
implicit val publicKeyFormat = Json.format[YetuPublicKey]
}
| yetu/oauth2-provider | app/com/yetu/oauth2provider/signature/models/YetuPublicKey.scala | Scala | mit | 206 |
package pump.uno.actor
import akka.actor.Actor
import akka.pattern.pipe
import pump.uno.service.LoginServiceComponent
import pump.uno.service.impl.SprayLoginServiceComponent
import pump.util.{ActorLogging, Loggable}
import spray.http.HttpCookie
object LoginActor {
case object Login
case class Success(cookie: Ht... | gkonst/pump | src/main/scala/pump/uno/actor/LoginActor.scala | Scala | mit | 679 |
object A {
def foo = ""
} | dotty-staging/dotty | sbt-test/source-dependencies/check-recompilations/changes/A.scala | Scala | apache-2.0 | 26 |
package me.mtrupkin.control
import java.lang.Math._
import javafx.scene.control.Label
import javafx.scene.layout._
import javafx.scene.paint.{Paint, Color}
import javafx.scene.text.{Font, FontWeight}
import me.mtrupkin.console.{RGB, Screen, ScreenChar}
import me.mtrupkin.core.{Matrix, Point, Size}
import ... | mtrupkin/flagship | src/main/scala/control/ConsoleFx.scala | Scala | mit | 2,540 |
package com.twitter.finagle.example.redis
import com.twitter.finagle.redis.Client
import com.twitter.finagle.redis.util.RedisCluster
import com.twitter.io.Buf
import com.twitter.util.Await
object RedisClient {
def main(args: Array[String]) {
println("Starting Redis instance...")
RedisCluster.start(1)
... | koshelev/finagle | finagle-example/src/main/scala/com/twitter/finagle/example/redis/RedisClient.scala | Scala | apache-2.0 | 850 |
package lib
import javax.inject.{Inject, Singleton}
import play.api.{Configuration, Logger}
/**
* Wrapper on play config testing for empty strings and standardizing
* error message for required configuration.
*/
@Singleton
class Config @Inject() (
configuration: Configuration
) {
private[this] val logger:... | gheine/apidoc | app/app/lib/Config.scala | Scala | mit | 915 |
/** Copyright 2015 TappingStone, 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 ... | ch33hau/PredictionIO | core/src/main/scala/io/prediction/controller/LAlgorithm.scala | Scala | apache-2.0 | 4,637 |
package lib
import java.nio.charset.Charset
import akka.util.ByteString
import play.api.libs.json.JsValue
sealed trait ProxyRequestBody extends Product with Serializable
object ProxyRequestBody {
val Utf8: Charset = Charset.forName("UTF-8")
case class Bytes(bytes: ByteString) extends ProxyRequestBody
case ... | flowvault/proxy | app/lib/ProxyRequestBody.scala | Scala | mit | 436 |
/*
* 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 ... | dbtsai/spark | sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/FilePartition.scala | Scala | apache-2.0 | 3,715 |
package com.sksamuel.elastic4s.searches.queries
import com.sksamuel.elastic4s.searches.QueryBuilderFn
import org.elasticsearch.index.query.{HasParentQueryBuilder, QueryBuilders}
object HasParentQueryBuilderFn {
def apply(q: HasParentQueryDefinition): HasParentQueryBuilder = {
val builder = QueryBuilders.hasPare... | FabienPennequin/elastic4s | elastic4s-tcp/src/main/scala/com/sksamuel/elastic4s/searches/queries/HasParentQueryBuilderFn.scala | Scala | apache-2.0 | 614 |
/*
* Copyright 2015 Webtrends (http://www.webtrends.com)
*
* See the LICENCE.txt file distributed with this work for additional
* information regarding copyright ownership.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* Yo... | Webtrends/wookiee-socko | src/main/scala/com/webtrends/harness/component/socko/client/Messages.scala | Scala | apache-2.0 | 3,306 |
import scala.compiletime.erasedValue
object Test {
def foo0(a: Int): Int = 3
def foo1(erased a: Int): Int = 3
foo0(erasedValue[Int]) // error
foo1(erasedValue[Int])
}
| som-snytt/dotty | tests/neg-custom-args/erased/erasedValue.scala | Scala | apache-2.0 | 175 |
object Program {
trait A { type T }
type B = A { type T = String }
trait C extends B
}
| yusuke2255/dotty | tests/untried/neg/t0204.scala | Scala | bsd-3-clause | 90 |
/**
* 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... | ajw625/orbeon-forms | src/test/scala/org/orbeon/oxf/xml/SaxonUtilsTest.scala | Scala | lgpl-2.1 | 1,282 |
/**
*
* AndroidImplicitConversions
* Ledger wallet
*
* Created by Pierre Pollastri on 19/01/15.
*
* The MIT License (MIT)
*
* Copyright (c) 2015 Ledger
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to ... | Morveus/ledger-wallet-android | app/src/main/scala/com/ledger/ledgerwallet/utils/AndroidImplicitConversions.scala | Scala | mit | 2,400 |
/*
Copyright 2013 Tomas Tauber & 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,... | sriramkrishnan/scalding | scalding-core/src/test/scala/com/twitter/scalding/mathematics/Matrix2Test.scala | Scala | apache-2.0 | 20,067 |
import scala.beans.BeanProperty;
trait beanpropertytrait {
@BeanProperty var myVariable: Long = -1l;
}
| yusuke2255/dotty | tests/pos/t1070.scala | Scala | bsd-3-clause | 105 |
package org.shapelogic.sc.pixel
import org.shapelogic.sc.image.{ RGBOffsets }
import org.shapelogic.sc.numeric.NumberPromotion
import org.shapelogic.sc.numeric.NumberPromotion
import scala.reflect.ClassTag
/**
* The idea is to have the logic in objects of this type
* The the full operations can just be a runner
*
... | sami-badawi/shapelogic-scala | src/main/scala/org/shapelogic/sc/pixel/PixelHandler.scala | Scala | mit | 1,288 |
package com.harrys.hyppo.worker.actor.queue
import com.harrys.hyppo.worker.api.proto.{ConcurrencyWorkResource, ThrottledWorkResource, WorkResource}
import com.rabbitmq.client.Channel
import scala.collection.mutable.ArrayBuffer
/**
* Created by jpetty on 11/6/15.
*/
final class ResourceLeasing {
def leaseResou... | harrystech/hyppo-worker | worker/src/main/scala/com/harrys/hyppo/worker/actor/queue/ResourceLeasing.scala | Scala | mit | 2,611 |
/**
* Generated by Scrooge
* version: 4.7.0
* rev: d9d56174937f524a1981b38ebd6280eef7eeda4a
* built at: 20160427-121531
*/
package com.komanov.serialization.domain.thriftscala
import com.twitter.scrooge.{
LazyTProtocol,
TFieldBlob, ThriftException, ThriftStruct, ThriftStructCodec3, ThriftStructFieldInfo... | dkomanov/scala-serialization | scala-serialization/src/main/scala/com/komanov/serialization/domain/thriftscala/SiteRevisionSetPb.scala | Scala | mit | 13,494 |
package ui
import game.Disc.{BLUE, Disc, YELLOW}
import game._
import ai.{MinimaxPlayer, RLPlayer}
object ConsoleApp {
def stringifyBoard(board: Board): String = {
"\\t" + ((for (r <- 0 to board.rows; c <- 0 to board.columns) yield (r, c)).reverse map {
case (a, b) if (board.positions map... | akshaykurmi/Connect-4 | src/ui/ConsoleApp.scala | Scala | mit | 1,851 |
package io.youi.util
import io.youi._
import org.scalajs.dom.html
import org.scalajs.dom.html.Canvas
import org.scalajs.dom.raw.CanvasRenderingContext2D
import scala.concurrent.Future
object CanvasPool extends ObjectPool[html.Canvas] {
def apply(width: Double, height: Double, ratio: Double = 1.0): html.Canvas = up... | outr/youi | gui/src/main/scala/io/youi/util/CanvasPool.scala | Scala | mit | 1,274 |
/* SCALA Implementation of Binary Search.
Though the corner cases are covered. But still if you find any additions to it,
please do add a test for it.
Any improvements/tests in the code is highly appreciated.
*/
class BinarySearch {
def binarySearch(targetArray: Array[Int], numberToBeSearched: Int): Int = ... | rohanp/Algorithm-Implementations | Binary_Search/Scala/aayushKumarJarvis/BinarySearch.scala | Scala | mit | 867 |
/*
* Fish Scala:
*
* Quick implementation of Go Fish.
*/
import util.Random
/*
* Configure game details here.
*/
object Global {
val maxCard = 13
val sizeHand = 6
val suits = List("Spades", "Diamonds", "Clubs", "Hearts")
}
/*
* Card represents a playing card, of course.
*/
class Card(v: Int, s: String) ... | jcolag/Fish-Scala | fish.scala | Scala | gpl-3.0 | 4,594 |
package slinky.core
import scala.scalajs.js
import org.scalajs.dom
import slinky.core.facade.{React, ReactElement}
import slinky.web.ReactDOM
import slinky.web.html._
import org.scalatest.funsuite.AnyFunSuite
object ExternalSimple extends ExternalComponentNoProps {
override val component = "div"
}
object Externa... | shadaj/slinky | tests/src/test/scala/slinky/core/ExternalComponentTest.scala | Scala | mit | 3,526 |
/*
* 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/frontend-2.3/src/main/scala/org/neo4j/cypher/internal/frontend/v2_3/ast/functions/Exists.scala | Scala | apache-2.0 | 1,710 |
package juan.ddd.proto.util.config
import scala.collection.JavaConversions._
import org.scalatest.{Matchers, FunSpec}
import com.google.inject.Guice
import com.typesafe.config.{ConfigFactory, Config}
class ConfigModuleSpec extends FunSpec with Matchers
{
def loadConfig(fileName: String) = {
System.setProperty("... | yoskhdia/ddd-proto | src/test/scala/juan/ddd/proto/util/config/ConfigModuleSpec.scala | Scala | mit | 1,689 |
package gkit.mongo
import reactivemongo.bson.{ BSONValue, BSONDocument }
import scalaz._
import scalaz.syntax.either._
trait QueryPicklerInstances {
implicit def EmptyQBSONPickler = new BSONPickler[EmptyQ.type] {
def pickle(emptyQ: EmptyQ.type) = BSONDocument()
def unpickle(v: BSONValue, path: List[String... | kindleit/gkit | mongo/src/main/scala/QueryPicklerInstances.scala | Scala | apache-2.0 | 344 |
/*
* 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 ... | akrabat/openwhisk | common/scala/src/main/scala/org/apache/openwhisk/core/connector/Message.scala | Scala | apache-2.0 | 18,406 |
/*
* 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/services/flowmanagement/pagerouters/businessmatching/updatetype/addflow/NeedMoreInformationPageRouter.scala | Scala | apache-2.0 | 1,351 |
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.