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 typeclass.instances
import typeclass.MonoidLaws
import typeclass.instances.string._
import scalaprops.{Gen, Scalaprops}
object StringTest extends Scalaprops {
implicit val genString: Gen[String] = Gen.asciiString
val monoid = MonoidLaws[String].all
}
| julien-truffaut/Typeclass | answer/src/test/scala/typeclass/instances/StringTest.scala | Scala | mit | 269 |
/**
* Copyright (C) 2015 Stratio (http://stratio.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by ap... | darroyocazorla/spark-mongodb | spark-mongodb/src/main/scala/com/stratio/datasource/mongodb/MongodbContext.scala | Scala | apache-2.0 | 1,287 |
package extruder.circe
import extruder.core.Decode
import extruder.data.Validation
import io.circe.Json
trait CirceDecoder extends Decode { self: CirceDataSource =>
override type InputData = Json
override type DecodeData = Json
override type DecodeDefault[A] = Validation[A]
}
| janstenpickle/extruder | circe/src/main/scala/extruder/circe/CirceDecoder.scala | Scala | mit | 285 |
/*
* 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 | core/src/test/scala/org/apache/spark/deploy/rest/SubmitRestProtocolSuite.scala | Scala | apache-2.0 | 14,195 |
package at.iem.sysson
import de.sciss.synth
import synth._
import ugen._
object MySession extends SessionLike {
def run(): Unit = {
import Ops._
val x = play {
FreeSelf.kr(MouseButton.kr)
WhiteNoise.ar(SinOsc.ar(MouseX.kr.linExp(0, 1, 1, 1000)) * 0.5)
}
println(x)
x.onEnd { quit() }... | iem-projects/sysson | src/test/scala/at/iem/sysson/MySession.scala | Scala | gpl-3.0 | 326 |
/*
* 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/fset-faststream | test/model/Phase1TestProfileExamples.scala | Scala | apache-2.0 | 835 |
/*
* Copyright 2017-2018 Iaroslav Zeigerman
*
* 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 ... | akkeeper-project/akkeeper | akkeeper/src/test/scala/akkeeper/master/service/MemberAutoDownServiceSpec.scala | Scala | apache-2.0 | 5,309 |
package i.g.f.s
import java.net.InetSocketAddress
import java.util.concurrent.TimeUnit
import com.twitter.finagle.{Client, Server, Service, ThriftMux}
import com.twitter.util.{Closable, Await, Future}
import org.openjdk.jmh.annotations._
/**
* run -i 10 -wi 7 -f 2 -t 1 i.g.f.s.RoundTripThriftSmallBenchmark
*/
@Sta... | travisbrown/finagle-serial | benchmark/src/main/scala/i.g.f.s/RoundTripThriftSmallBenchmark.scala | Scala | apache-2.0 | 1,087 |
package org.broadinstitute.clio.client
import akka.actor.ActorSystem
import akka.stream.scaladsl.{Sink, Source}
import akka.stream.{ActorMaterializer, Materializer}
import akka.{Done, NotUsed}
import caseapp.core.help.{Help, WithHelp}
import caseapp.core.parser.Parser
import caseapp.core.{Error, RemainingArgs}
import ... | broadinstitute/clio | clio-client/src/main/scala/org/broadinstitute/clio/client/ClioClient.scala | Scala | bsd-3-clause | 9,509 |
package no.uio.musit.functional
import scala.annotation.implicitNotFound
import scala.concurrent.{ExecutionContext, Future}
object Implicits {
/**
* Implicit converter to wrap a {{{no.uio.musit.functional.Monad}}} around a
* {{{scala.concurrent.Future}}}. This allows for composition of Monads using
* Mona... | MUSIT-Norway/musit | musit-models/src/main/scala/no/uio/musit/functional/Implicits.scala | Scala | gpl-2.0 | 1,116 |
package collins.controllers.actions
import play.api.mvc.AnyContent
import play.api.mvc.AnyContentAsEmpty
import play.api.mvc.Headers
import play.api.mvc.Request
object ActionHelper {
val DummyRequest = new Request[AnyContent] {
def id: Long = 1L
def tags: Map[String,String] = Map()
def version: String =... | byxorna/collins | app/collins/controllers/actions/ActionHelper.scala | Scala | apache-2.0 | 1,108 |
/*
* Copyright 2015 Netflix, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed t... | rspieldenner/atlas | atlas-core/src/main/scala/com/netflix/atlas/core/model/TaggedItem.scala | Scala | apache-2.0 | 5,111 |
package spotlight
import java.util.Collections
import java.util.concurrent.{ TimeUnit, AbstractExecutorService }
import scala.concurrent.{ ExecutionContextExecutorService, ExecutionContext }
/**
* Created by rolfsd on 1/23/16.
*/
package object train {
def executionContextToService( ec: ExecutionContext ): Exe... | dmrolfs/lineup | sandbox/src/main/scala/spotlight/train/package.scala | Scala | mit | 1,051 |
package flockMortalityExample
import java.nio.file.{Files, Paths}
import com.typesafe.config.ConfigFactory
import play.api.libs.json.Json
import sampler._
import sampler.abc._
import sampler.distribution.Distribution
import sampler.example.abc.flockMortality.util.{Model, _}
import sampler.maths.Random
object Main ex... | tearne/Sampler | sampler-examples/src/main/scala/sampler/example/abc/flockMortality/Main.scala | Scala | apache-2.0 | 4,254 |
/*
* Copyright 2011 Delving B.V.
*
* 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... | delving/dos | app/controllers/dos/ui/MCP.scala | Scala | apache-2.0 | 1,761 |
/* Copyright (C) 2008-2010 Univ of Massachusetts Amherst, Computer Science Dept
This file is part of "FACTORIE" (Factor graphs, Imperative, Extensible)
http://factorie.cs.umass.edu, http://code.google.com/p/factorie/
This software is provided under the terms of the Eclipse Public License 1.0
as published by... | andrewmilkowski/factorie | src/main/scala/cc/factorie/SamplerSuite.scala | Scala | epl-1.0 | 2,952 |
package com.artclod.mathml
import com.artclod.mathml.scalar._
import com.artclod.mathml.scalar.apply._
import com.artclod.mathml.scalar.apply.trig._
import com.artclod.mathml.scalar.concept.Constant
import scala.util._
import scala.xml._
object MathML {
val h = <hack/> // This is a hack so we can get default XML me... | kristiankime/calc-tutor | app/com/artclod/mathml/MathML.scala | Scala | mit | 3,339 |
package com.twitter.util.validation.internal.validators
import com.twitter.util.validation.constraints.CountryCode
import com.twitter.util.validation.constraintvalidation.TwitterConstraintValidatorContext
import jakarta.validation.{ConstraintValidator, ConstraintValidatorContext}
import java.util.Locale
private objec... | twitter/util | util-validator/src/main/scala/com/twitter/util/validation/internal/validators/ISO3166CountryCodeConstraintValidator.scala | Scala | apache-2.0 | 2,136 |
package at.forsyte.apalache.tla.bmcmt.analyses
import at.forsyte.apalache.tla.lir.UID
import com.google.inject.Singleton
import scala.collection.mutable
@Singleton
class ExprGradeStoreImpl extends ExprGradeStore with Serializable {
var store: mutable.Map[UID, ExprGrade.Value] = mutable.HashMap[UID, ExprGrade.Value... | konnov/apalache | tla-bmcmt/src/main/scala/at/forsyte/apalache/tla/bmcmt/analyses/ExprGradeStoreImpl.scala | Scala | apache-2.0 | 408 |
package org.scalatest.events
import org.scalatest.junit.JUnit3Suite
import org.scalatest._
class LocationSuiteProp extends SuiteProp
{
test("All suite types should have correct location in SuiteStarting, SuiteCompleted, SuiteAborted and TestFailed event.") {
forAll(examples) { suite =>
val reporter = new E... | svn2github/scalatest | src/test/scala/org/scalatest/events/LocationSuiteProp.scala | Scala | apache-2.0 | 27,445 |
/*
* Copyright 2013 Commonwealth Computer Research, 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... | anthonyccri/geomesa | geomesa-core/src/main/scala/geomesa/core/iterators/ColumnQualifierAggregator.scala | Scala | apache-2.0 | 1,922 |
/*
* Copyright (C) 2009-2017 Lightbend Inc. <https://www.lightbend.com>
*/
package scalaguide.advanced.filters.essential
// #essential-filter-example
import javax.inject.Inject
import akka.util.ByteString
import play.api.Logger
import play.api.libs.streams.Accumulator
import play.api.mvc._
import scala.concurrent.Ex... | wsargent/playframework | documentation/manual/working/scalaGuide/main/application/code/EssentialFilter.scala | Scala | apache-2.0 | 1,044 |
package drt.client.components
import japgolly.scalajs.react.ReactNode
import japgolly.scalajs.react.vdom.prefix_<^._
/**
* Provides type-safe access to Font Awesome icons
*/
object Icon {
type Icon = ReactNode
def apply(name: String): Icon = <.i(^.className := s"fa fa-$name")
def adjust = apply("adjust")
d... | somanythings/drt-scalajs-spa-exploration | client/src/main/scala/spatutorial/client/components/Icon.scala | Scala | apache-2.0 | 21,471 |
object Hello extends App {
println("hello" + args.toList.toString)
}
| som-snytt/xsbt | sbt/src/sbt-test/actions/input-task/Hello.scala | Scala | bsd-3-clause | 71 |
package cz.vse.easyminer.miner
case class MinerTask(
antecedent: BoolExpression[Attribute],
interestMeasures: Set[InterestMeasure],
consequent: BoolExpression[Attribute]
)
trait MinerTaskValidator {
def validate(mt: MinerTask): Unit
}
| KIZI/EasyMiner-Apriori-R | src/main/scala/cz/vse/easyminer/miner/MinerTask.scala | Scala | bsd-3-clause | 246 |
/*
* 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... | SRGOM/scalatest | scalactic-test/src/test/scala/org/scalactic/TimesOnIntSpec.scala | Scala | apache-2.0 | 1,544 |
/*
* Copyright (c) 2013, Hidekatsu Hirose
* Copyright (c) 2013, Hirose-Zouen
* This file is subject to the terms and conditions defined in
* This file is subject to the terms and conditions defined in
* file 'LICENSE.txt', which is part of this source code package.
*/
package org.hirosezouen.hznet
imp... | chokopapashi/HZUtils1.6.x_Scala2.10.5 | src/main/scala/org/hirosezouen/hznet/HZHTTTP_Digest_Authentication.scala | Scala | bsd-3-clause | 3,397 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | h2oai/sparkling-water | benchmarks/src/main/scala/ai/h2o/sparkling/benchmarks/DataFrameToH2OFrameConversionBenchmark.scala | Scala | apache-2.0 | 1,356 |
package org.http4s
package servlet
import java.util.concurrent.ExecutorService
import org.http4s.headers.`Transfer-Encoding`
import server._
import javax.servlet.http.{HttpServletResponse, HttpServletRequest, HttpServlet}
import java.net.{InetSocketAddress, InetAddress}
import scala.collection.JavaConverters._
impor... | m4dc4p/http4s | servlet/src/main/scala/org/http4s/servlet/Http4sServlet.scala | Scala | apache-2.0 | 6,940 |
package forms
import play.api.data.Form
import play.api.data.Forms._
/**
* Represents the sign in form and its data.
*/
object SignInForm {
/**
* A play framework form.
*/
val form = Form(
mapping(
"email" -> email,
"password" -> nonEmptyText
)(SignInData.apply)(SignInData.unapply... | mb720/cvs | app/forms/SignInForm.scala | Scala | bsd-2-clause | 518 |
package com.giyeok.jparser.study.parsergen
import com.giyeok.jparser.{NGrammar, Symbols}
import com.giyeok.jparser.metalang.MetaGrammar
import com.giyeok.jparser.parsergen.deprecated.{AKernel, GrammarAnalyzer}
import com.giyeok.jparser.utils.TermGrouper
import com.giyeok.jparser.visualize.FigureGenerator.Spacing
impor... | Joonsoo/moon-parser | study/src/main/scala/com/giyeok/jparser/study/parsergen/AllPathsPrinter.scala | Scala | mit | 2,612 |
package edu.berkeley.nlp.coref
import scala.collection.mutable.HashMap
import scala.collection.JavaConverters._
import scala.collection.mutable.ArrayBuffer
class OrderedClustering(val clusters: Seq[Seq[Int]]) {
// Elements must be consecutive integers from 0 up to n
private val allIndicesSorted = clusters.foldLeft... | nate331/jbt-berkeley-coref-resolution | src/main/java/edu/berkeley/nlp/coref/OrderedClustering.scala | Scala | gpl-3.0 | 3,263 |
package rpgboss.model
import java.io._
import au.com.bytecode.opencsv.{ CSVReader, CSVWriter }
import org.json4s.native.Serialization
import org.json4s.ShortTypeHints
import rpgboss.lib._
import rpgboss.model._
import rpgboss.model.event._
import rpgboss.lib.FileHelper._
import rpgboss.model.resource.RpgMap
import sca... | DrDub/rpgboss | core/src/main/scala/rpgboss/model/RpgMapData.scala | Scala | agpl-3.0 | 5,728 |
/*
* 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 ... | esi-mineset/spark | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/predicates.scala | Scala | apache-2.0 | 25,205 |
package com.wix.fax.interfax.sl
import com.google.api.client.http.HttpRequestFactory
import com.wix.fax.FaxErrorException
import com.wix.fax.interfax.sl.model.StatusCode
import com.wix.fax.model.{Fax, Status}
import scala.concurrent.duration.Duration
import scala.util.{Failure, Success, Try}
object Endpoin... | wix/libfax | libfax-interfaxsl/src/main/scala/com/wix/fax/interfax/sl/InterfaxslFax.scala | Scala | apache-2.0 | 2,903 |
package org.helianto.ingress.controller
import org.springframework.web.bind.annotation.{RequestMapping, RestController}
/**
* Lead controller.
*/
@RestController
@RequestMapping(Array("/lead"))
class LeadController {
}
| iservport/helianto-spring | src/main/scala/org/helianto/ingress/controller/LeadController.scala | Scala | apache-2.0 | 226 |
package sai.bytecode
import bytecode._
import ea._
import org.apache.bcel.generic.{ConstantPoolGen, InstructionHandle, InstructionList, Type}
import sai.bytecode.instruction.{EntryPoint, ExitPoint, Instruction}
import sai.vm.Reference
import vm.Frame
class Method(bcelMethod: org.apache.bcel.classfile.Method,
... | oliverhaase/sai | src/sai/bytecode/Method.scala | Scala | mit | 3,932 |
package com.twitter.finatra.json.tests
import com.google.inject.spi.Message
import com.google.inject.{ConfigurationException, Injector, Key}
import com.twitter.finatra.json.FinatraObjectMapper
import com.twitter.finatra.json.internal.caseclass.exceptions.JsonInjectException
import com.twitter.finatra.json.tests.intern... | syamantm/finatra | jackson/src/test/scala/com/twitter/finatra/json/tests/GuiceInjectableValuesFinatraObjectMapperTest.scala | Scala | apache-2.0 | 2,939 |
/*
* Copyright 2001-2011 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... | hubertp/scalatest | src/test/scala/org/scalatest/suiteprop/SuiteExamples.scala | Scala | apache-2.0 | 6,240 |
import scala.reflect.runtime.universe._
import scala.reflect.ClassManifest
object Test extends App {
def typeTagIsnotClassManifest[T: TypeTag] = {
println(implicitly[ClassManifest[T]])
}
typeTagIsnotClassManifest[Int]
typeTagIsnotClassManifest[String]
typeTagIsnotClassManifest[Array[Int]]
}
| scala/scala | test/files/neg/interop_typetags_arenot_classmanifests.scala | Scala | apache-2.0 | 308 |
/*
Copyright (c) 2016, Rice University
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2.... | agrippa/spark-swat | swat/src/test/scala/org/apache/spark/rdd/cl/tests/SparseVectorInputTest.scala | Scala | bsd-3-clause | 3,599 |
package cc.emberwalker.artemis
import org.apache.logging.log4j.LogManager
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent
import net.minecraftforge.fml.common.Mod
import net.minecraftforge.fml.common.Mod.EventHandler
import cc.emberwalker.artemis.lib.Config
import cc.emberwalker.artemis.compat.C... | Emberwalker/Artemis | src/main/scala/cc/emberwalker/artemis/Artemis.scala | Scala | mit | 1,532 |
package be.objectify.batch.concurrent
import akka.actor._
import scala.concurrent.Future
/**
*
* @param master
*/
abstract class Consumer(master: ActorSelection) extends Actor with ActorLogging {
import Protocol._
import context._
def doWork(eventListener: ActorRef, key: Any, work: Any): Future[WorkComplet... | schaloner/akka-batch | src/main/scala/be/objectify/batch/concurrent/Consumer.scala | Scala | apache-2.0 | 1,824 |
/*
* 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 ... | hvanhovell/spark | core/src/main/scala/org/apache/spark/metrics/sink/MetricsServlet.scala | Scala | apache-2.0 | 2,230 |
/*
* 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 ... | jeremiaswerner/openwhisk | core/invoker/src/main/scala/org/apache/openwhisk/core/invoker/LogStoreCollector.scala | Scala | apache-2.0 | 1,753 |
/*
* 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/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/v2Commands.scala | Scala | apache-2.0 | 18,343 |
/*
* 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 ... | Lewuathe/neurallib | src/main/scala/com/lewuathe/dllib/Instance.scala | Scala | mit | 1,196 |
package de.mineformers.core.client.ui.view.inventory
import de.mineformers.core.client.ui.view.container.Panel
import de.mineformers.core.client.util.RenderUtils
import de.mineformers.core.inventory.Inventory
import de.mineformers.core.util.math.shape2d.Point
/**
* PlayerInventory
*
* @author PaleoCrafter
*/
clas... | MineFormers/MFCore | src/main/scala/de/mineformers/core/client/ui/view/inventory/PlayerInventory.scala | Scala | mit | 562 |
/**
* Copyright 2017 Alessandro Simi
*
* 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 ... | alessandrosimi/aws-dynamodb-nio | dynamodb/src/test/scala/io/exemplary/aws/AmazonDynamoDBNioGzipTest.scala | Scala | apache-2.0 | 1,881 |
// Copyright: 2010 - 2018 https://github.com/ensime/ensime-server/graphs
// License: http://www.gnu.org/licenses/gpl-3.0.en.html
package org.ensime.core
import akka.actor._
import java.io.{ File, IOException }
import java.util.jar.JarFile
import org.ensime.api._
import org.ensime.config.richconfig._
import org.ensime.... | yyadavalli/ensime-server | core/src/main/scala/org/ensime/core/DocResolver.scala | Scala | gpl-3.0 | 6,426 |
import io.prediction.controller.P2LAlgorithm
import io.prediction.controller.Params
import org.apache.spark.SparkContext
import org.apache.spark.mllib.classification.NaiveBayes
import org.apache.spark.mllib.classification.NaiveBayesModel
import org.apache.spark.mllib.linalg.Vector
import com.github.fommil.netlib.F2jB... | gongsy945/pio-engine-text-classification-heroku | src/main/scala/NBAlgorithm.scala | Scala | apache-2.0 | 2,400 |
package com.atomist.source
import org.scalatest.{FlatSpec, Matchers}
class ByteArrayFileArtifactTest extends FlatSpec with Matchers {
"ByteArrayFileArtifact" should "correctly parse full constructor" in {
val name = "filename"
val pathElements = Seq("com", "atomist")
val content = "".getBytes
val m... | atomist/artifact-source | src/test/scala/com/atomist/source/ByteArrayFileArtifactTest.scala | Scala | gpl-3.0 | 3,318 |
package io.youi.material.impl
import scala.scalajs.js
@js.native
trait MDCTextFieldImplementation extends js.Object {
def getLabelAdapterMethods_(): MDCLabelAdapter
}
| outr/youi | gui/src/main/scala/io/youi/material/impl/MDCTextFieldImplementation.scala | Scala | mit | 171 |
/*
* Copyright 2017 Ahmad Mozafarnia
*
* 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... | ahmadmo/bama-api-demo | app/ir/bama/services/BaseService.scala | Scala | apache-2.0 | 1,199 |
/*
* 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 ... | ArvinDevel/onlineAggregationOnSparkV2 | core/src/main/scala/org/apache/spark/scheduler/AccumulableInfo.scala | Scala | apache-2.0 | 1,798 |
def f(implicit i: Int) = {}
implicit var v: Int = 1
println(/* offset: 4 */ f) | ilinum/intellij-scala | testdata/resolve2/function/implicit/VariableImplicit.scala | Scala | apache-2.0 | 80 |
package org.shapelogic.sc.imageprocessing
import org.shapelogic.sc.util.Constants.DOWN
import org.shapelogic.sc.util.Constants.LEFT
import org.shapelogic.sc.util.Constants.RIGHT
import org.shapelogic.sc.util.Constants.UP
import org.shapelogic.sc.polygon.CPointInt
import org.shapelogic.sc.polygon.Polygon
import org.sh... | sami-badawi/shapelogic-scala | src/main/scala/org/shapelogic/sc/imageprocessing/EdgeTracerColor.scala | Scala | mit | 7,090 |
/* Copyright 2009-2016 EPFL, Lausanne */
package leon.solvers
class CantResetException(s: Solver) extends Exception(s"Unable to reset solver $s")
| epfl-lara/leon | src/main/scala/leon/solvers/CantResetException.scala | Scala | gpl-3.0 | 148 |
package controllers
import play.api.mvc._
object Application extends Controller {
def index = TODO
}
| peoplepattern/LeVar | levar-web/app/controllers/Application.scala | Scala | apache-2.0 | 105 |
package ch.descabato.utils
import java.io._
import java.nio.ByteBuffer
import java.nio.file.Files
import java.security.MessageDigest
import java.text.DecimalFormat
import java.util
import javax.xml.bind.DatatypeConverter
import ch.descabato.CustomByteArrayOutputStream
import com.typesafe.scalalogging.{LazyLogging, Lo... | Stivo/DeScaBaTo | core/src/main/scala/ch/descabato/utils/Utils.scala | Scala | gpl-3.0 | 8,307 |
package scalaz.stream.actor
import java.util.concurrent.atomic.AtomicBoolean
import scala._
import scala.annotation.tailrec
import scalaz._
import scalaz.concurrent.{Strategy, Actor, Task}
import scalaz.stream.Process._
import scalaz.stream.Step
import scalaz.stream.wye.{AwaitBoth, AwaitR, AwaitL}
import scalaz.stream... | aindlq/scalaz-stream | src/main/scala/scalaz/stream/actor/WyeActor.scala | Scala | mit | 7,862 |
/* Copyright (C) 2008-2014 University of Massachusetts Amherst.
This file is part of "FACTORIE" (Factor graphs, Imperative, Extensible)
http://factorie.cs.umass.edu, http://github.com/factorie
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with... | zxsted/factorie | src/main/scala/cc/factorie/app/nlp/load/LoadConll2000.scala | Scala | apache-2.0 | 6,384 |
package au.com.dius.pact.matchers.util
import scala.collection.JavaConversions
object CollectionUtils {
def toOptionalList(list: java.util.List[String]): Option[List[String]] = {
if (list == null) {
None
} else {
Some(JavaConversions.collectionAsScalaIterable(list).toList)
}
}
}
| algra/pact-jvm | pact-jvm-matchers/src/main/scala/au/com/dius/pact/matchers/util/CollectionUtils.scala | Scala | apache-2.0 | 311 |
package breeze.linalg
import scala.reflect.ClassTag
class SliceMatrix[@specialized(Int) K1,
@specialized(Int) K2,
@specialized(Int, Double, Float) V](val tensor: QuasiTensor[(K1, K2),V],
val slice1: IndexedSeq[K1], val slice2: I... | ktakagaki/breeze | src/main/scala/breeze/linalg/SliceMatrix.scala | Scala | apache-2.0 | 1,128 |
/*
* 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 ... | apache/flink | flink-table/flink-table-planner/src/test/scala/org/apache/flink/table/planner/plan/rules/logical/FlinkPruneEmptyRulesTest.scala | Scala | apache-2.0 | 2,583 |
/**
* **************************************************************************
* *
* (C) Copyright 2014 by Peter L Jones *
* pljones@users.sf.net *
... | pljones/jTrapKATEditor | src/main/scala/info/drealm/scala/pnPads.scala | Scala | gpl-3.0 | 3,119 |
package com.joescii.omniprop
package providers
import net.liftweb.util.Props
object LiftPropsProvider extends PropertyProvider {
def get(key:String) = Props.get(key)
}
| joescii/omniprop | src/main/scala/com/joescii/omniprop/providers/LiftPropsProvider.scala | Scala | apache-2.0 | 172 |
package sw.ds
import org.apache.spark._
import org.apache.spark.sql.SQLContext
import org.apache.spark.sql.functions._
import org.apache.spark.sql.expressions._
import sw.air._
object Datasets extends App {
val sparkConf = new SparkConf()
.setAppName(this.getClass.getName)
.setMaster("local[*]")
val sc ... | rabbitonweb/spark-workshop | src/main/scala/sw/ds/DataSets.scala | Scala | apache-2.0 | 552 |
package org.meritocracy.snippet
import scala.xml._
import net.liftweb._
import common._
import http.{DispatchSnippet, S, SHtml, StatefulSnippet}
import http.js.JsCmd
import http.js.JsCmds._
import util._
import Helpers._
import net.liftmodules.mongoauth.model.ExtSession
import org.meritocracy.model._
import org.merito... | Rmanolis/meritocracy | src/main/scala/org/meritocracy/snippet/UserSnips.scala | Scala | apache-2.0 | 4,540 |
package redis.commands
import redis.api.hyperloglog._
import redis.{ByteStringSerializer, Request}
import scala.concurrent.Future
trait HyperLogLog extends Request {
def pfadd[V: ByteStringSerializer](key: String, values: V*): Future[Long] =
send(Pfadd(key, values))
def pfcount(keys: String*): Future[Long] ... | mspielberg/rediscala | src/main/scala/redis/commands/HyperLogLog.scala | Scala | apache-2.0 | 459 |
package iosr.worker
import akka.actor.{ActorPath, ActorSystem, Props}
import com.typesafe.config.ConfigFactory
import iosr.worker.WorkerActor.Startup
object WorkerApp extends App {
val config = ConfigFactory.load()
val system = ActorSystem("WorkerApp", config)
val workerActor = system.actorOf(Props[WorkerActor]... | salceson/iosr-cloud-load-balancing | worker/src/main/scala/iosr/worker/WorkerApp.scala | Scala | mit | 524 |
import java.net.{HttpURLConnection, URL}
import java.util.concurrent.TimeoutException
import sbt._
import sbt.Keys._
import sbt.Tests
import scala.concurrent._
import scala.concurrent.duration._
import scala.util.control.NonFatal
/**
* This class is responsible for running integration tests.
* @author Dmitriy Ye... | dmitriy-yefremov/play-functional-testing | project/IntegrationTestSettings.scala | Scala | apache-2.0 | 3,840 |
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2015-2021 Andre White.
*
* 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
*
* https://www.apache.org/licenses/LICENSE... | adarro/ddo-calc | subprojects/common/ddo-core/src/main/scala/io/truthencode/ddo/model/spells/SpellRange.scala | Scala | apache-2.0 | 2,526 |
package org.crudible.core.binding.model
import org.crudible.core.binding.FormInline
import org.crudible.core.binding.traits.HasMax
class InlineComponent extends HasMax {
def form(form: FormInline): this.type = {
this.decorateWith(form)
}
def form() = {
this
.getDecorator[FormInline]
.getOr... | rehei/crudible | crudible-core/src/main/scala/org/crudible/core/binding/model/InlineComponent.scala | Scala | apache-2.0 | 404 |
/*
* AriaProcessor.scala
*
* Copyright (c) 2014 Ronald Kurniawan. All rights reserved.
*
* This library 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 (a... | fluxodesign/DownloadDaemon | src/main/scala/net/fluxo/dd/AriaProcessor.scala | Scala | gpl-2.0 | 11,815 |
package com.github.challenge
class TestTester extends ProblemTester[AddProblem] {
def makeDefaultProblems = {
implicit val numGen = problem.NumGenerator.buildNumGenerator
List(
(AddProblem(1, 1), "2"),
(AddProblem(2, 2), "4"),
(AddProblem(1, 2), "3"),
(AddProblem(123, 456), "579"),
... | challenge-helper/challenge-helper | src/test/scala/com/github/challenge/TestTester.scala | Scala | apache-2.0 | 641 |
package scala.models.play
import cats.implicits._
import io.apibuilder.generator.v0.models.{File, InvocationForm}
import lib.generator.CodeGenerator
object Play26Generator extends CodeGenerator {
def prependHeader(contents: String, form: InvocationForm, formatHeader: scala.models.ApidocComments => String): String ... | gheine/apidoc-generator | scala-generator/src/main/scala/models/play/Play26Generator.scala | Scala | mit | 2,159 |
/*
* VEGraph.scala
* Induced graph for variable elimination.
*
* Created By: Avi Pfeffer (apfeffer@cra.com)
* Creation Date: Jan 1, 2009
*
* Copyright 2013 Avrom J. Pfeffer and Charles River Analytics, Inc.
* See http://www.cra.com or email figaro@cra.com for information.
*
* See http://www.github.c... | bruttenberg/figaro | Figaro/src/main/scala/com/cra/figaro/algorithm/factored/VEGraph.scala | Scala | bsd-3-clause | 4,619 |
package com.outr.arango.api.model
import io.circe.Json
case class GraphEdgeDefinition(collection: Option[String] = None,
from: Option[List[String]] = None,
to: Option[List[String]] = None) | outr/arangodb-scala | api/src/main/scala/com/outr/arango/api/model/GraphEdgeDefinition.scala | Scala | mit | 253 |
package scdbpf
import org.scalatest.{WordSpec, Matchers}
import Experimental._
class ExperimentalSpec extends WordSpec with Matchers {
"PreviewEffect" should {
"be constructible from resource" in {
val eff = PreviewEffect(0x12345678, "road_puzzlepiece002")
import rapture.core.strategy.throwExceptio... | memo33/scdbpf | src/test/scala/scdbpf/ExperimentalSpec.scala | Scala | mit | 418 |
package skarn.push
import skarn.push.PushRequestHandleActorProtocol.Ex
import org.scalatest.{MustMatchers, WordSpecLike}
/**
* Created by yusuke on 15/07/10.
*/
class GCMJsonTest extends WordSpecLike
with MustMatchers {
"GCMentity" must {
"JSONシリアライズできる" in {
import spray.json._
import GCMProtoc... | trifort/skarn | src/test/scala/skarn/push/GCMJsonTest.scala | Scala | mit | 1,419 |
package com.twitter.finatra.thrift
import com.twitter.finagle.ThriftMux
import com.twitter.finagle.stats.NullStatsReceiver
import com.twitter.finagle.thrift.ClientId
import com.twitter.finagle.thrift.service.Filterable
import com.twitter.finagle.thrift.service.MethodPerEndpointBuilder
import com.twitter.finagle.thrift... | twitter/finatra | thrift/src/test/scala/com/twitter/finatra/thrift/ThriftClient.scala | Scala | apache-2.0 | 8,886 |
package org.scalameta
package build
import java.lang.ProcessBuilder._
import java.nio.file._
import java.nio.file.Files._
import scala.collection.JavaConverters._
import sbt._
import sbt.Keys._
import sbt.plugins._
object Build extends AutoPlugin {
override def requires: Plugins = JvmPlugin
override def trigger: ... | olafurpg/scalameta | project/Build.scala | Scala | bsd-3-clause | 2,321 |
package com.github.andyglow.relaxed
import argonaut._
import Argonaut._
case class ArgonautSupport(json: Json) extends Reader with ReaderSupport[Json] {
def isNull: (Json) => Boolean = _.isNull
def ctor: (Json) => ArgonautSupport = ArgonautSupport.apply
def get(field: String): Option[Json] = json.field(field)
... | andyglow/relaxed-json-update | argonaut/src/main/scala-2.11/com/github/andyglow/relaxed/ArgonautSupport.scala | Scala | lgpl-3.0 | 903 |
package org.jetbrains.plugins.scala.failed.resolve
import org.jetbrains.plugins.scala.PerfCycleTests
import org.junit.experimental.categories.Category
/**
* @author Nikolay.Tropin
*/
@Category(Array(classOf[PerfCycleTests]))
class JavaFieldResolveTest extends FailedResolveTest("javaField") {
def testScl6925() =... | jastice/intellij-scala | scala/scala-impl/test/org/jetbrains/plugins/scala/failed/resolve/JavaFieldResolveTest.scala | Scala | apache-2.0 | 396 |
/**
* This file is part of mycollab-web.
*
* mycollab-web is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* mycollab-web is d... | uniteddiversity/mycollab | mycollab-web/src/main/scala/com/esofthead/mycollab/module/project/view/message/MessageUrlResolver.scala | Scala | agpl-3.0 | 2,622 |
/**
* This code is generated using [[http://www.scala-sbt.org/contraband/ sbt-contraband]].
*/
// DO NOT EDIT MANUALLY
package sbt.protocol.testing
final class TestStringEvent private (
val value: String) extends sbt.protocol.testing.TestMessage() with Serializable {
override def equals(o: Any): Boolean... | Duhemm/sbt | testing/src/main/contraband-scala/sbt/protocol/testing/TestStringEvent.scala | Scala | bsd-3-clause | 845 |
package com.gmail.at.pukanito.view.metadata.attributedefinition
class UpdateAttributeDefinition {
}
| pukanito/bigdatanalysis | src/main/scala/com/gmail/at/pukanito/view/metadata/attributedefinition/UpdateAttributeDefinition.scala | Scala | gpl-3.0 | 102 |
// Project: angulate2 (https://github.com/jokade/angulate2)
// Description:
// Copyright (c) 2017 Johannes.Kastner <jokade@karchedon.de>
// Distributed under the MIT License (see included LICENSE file)
package angulate2.router
import de.surfice.smacrotools.createJS
import rxjs.ValOrObs
@createJS
tr... | jokade/angulate2 | bindings/src/main/scala/angulate2/router/interfaces.scala | Scala | mit | 425 |
/*
* Copyright 2016 The BigDL Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agr... | yiheng/BigDL | spark/dl/src/test/scala/com/intel/analytics/bigdl/nn/SpatialCrossMapLRNSpec.scala | Scala | apache-2.0 | 6,119 |
package com.twitter.finagle.serverset2
import com.twitter.finagle.common.io.JsonCodec
import com.twitter.finagle.common.zookeeper.ServerSets
import com.twitter.conversions.DurationOps._
import com.twitter.finagle.serverset2.ServiceDiscoverer.ClientHealth
import com.twitter.finagle.serverset2.ZkOp.{GetData, GetChildren... | luciferous/finagle | finagle-serversets/src/test/scala/com/twitter/finagle/serverset2/ServiceDiscovererTest.scala | Scala | apache-2.0 | 15,603 |
Here are a few properties:
* The sum of the empty list is 0
* The sum of a list whose elements are all equal to `x` is just the list's length multiplied by `x`. We might express this as: `sum(List.fill(n)(x)) == n*x`
* For any list, `l`, `sum(l) == sum(l.reverse)`, since addition is commutative
* Given a list, `List(x... | galarragas/FpInScala | answerkey/testing/1.answer.scala | Scala | mit | 574 |
package dao.generic
import generated.Tables.profile.api._
import play.api.db.slick._
import slick.jdbc.JdbcProfile
import slick.lifted.CanBeQueryCondition
import scala.concurrent._
/**
* Generic DAO definition
*/
trait GenericDao[T <: Table[E] with IdentifyableTable[PK], E <: Entity[PK], PK] extends HasDatabaseC... | bravegag/play-authenticate-usage-scala | app/dao/generic/GenericDao.scala | Scala | apache-2.0 | 2,734 |
/**
* Copyright 2012-2013 StackMob
*
* 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... | megamsys/newman | src/main/scala/com/stackmob/newman/serialization/common/URLSerialization.scala | Scala | apache-2.0 | 1,198 |
/*
Copyright 2013 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... | zirpins/summingbird | summingbird-online/src/main/scala/com/twitter/summingbird/online/executor/AsyncBase.scala | Scala | apache-2.0 | 4,046 |
package com.twitter.finatra.http.tests.integration.doeverything.main.jsonpatch
case class Level0CaseClass(level0: Level1CaseClass)
case class Level1CaseClass(level1: Level2CaseClass)
case class Level2CaseClass(level2: ExampleCaseClass)
case class ExampleCaseClass(hello: String)
case class RootCaseClass(root: DuoCaseCl... | twitter/finatra | http-server/src/test/scala/com/twitter/finatra/http/tests/integration/doeverything/main/jsonpatch/ExampleCaseClass.scala | Scala | apache-2.0 | 635 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | shuangshuangwang/spark | sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/parser/DDLParserSuite.scala | Scala | apache-2.0 | 82,598 |
package common
import akka.serialization._
import org.json4s.jackson.Serialization.{ read, write }
import org.json4s.{ DefaultFormats, Formats, jackson, Serialization }
abstract class JsonSerializer extends Serializer {
implicit val serialization = jackson.Serialization
implicit def formats: Formats
def includ... | enpassant/rapids | modules/common/src/main/scala/common/JsonSerializer.scala | Scala | apache-2.0 | 709 |
package org.scalajs.junit
import com.novocode.junit.{Ansi, RichLogger}
import Ansi._
import sbt.testing._
import org.scalajs.testinterface.TestUtils
import scala.util.{Try, Success, Failure}
final class JUnitTask(val taskDef: TaskDef, runner: JUnitBaseRunner)
extends sbt.testing.Task {
def tags: Array[String] ... | nicolasstucki/scala-js-junit | runtime/src/main/scala/org/scalajs/junit/JUnitTask.scala | Scala | bsd-3-clause | 2,694 |
/**
* Copyright (c) 2013 Saddle Development Team
*
* 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 ... | jyt109/saddle | saddle-core/src/main/scala/org/saddle/index/IndexMaker.scala | Scala | apache-2.0 | 4,425 |
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.