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 colossus.testkit
import colossus.service.Callback
import scala.concurrent.{ExecutionContext, Future}
import scala.concurrent.duration._
import ExecutionContext.Implicits.global
class FakeIOSystemSpec extends ColossusSpec with CallbackMatchers {
"TestExecutor" must {
"execute" in {
implicit val e... | tumblr/colossus | colossus-testkit/src/test/scala/colossus.testkit/FakeIOSystemSpec.scala | Scala | apache-2.0 | 804 |
package com.pointr.tcp.rexec
import java.util.concurrent.atomic.AtomicInteger
import com.pointr.tcp.rpc._
import com.pointr.tcp.util.Logger._
import com.pointr.tcp.util.{ExecParams, ExecResult, ProcessUtils}
class RexecServerIf(conf: ServerIfConf) extends ServerIf("RexecServerIf", Option(conf)) {
// val rexecIf = ... | OpenChaiSpark/OCspark | tcpclient/src/main/scala/com/pointr/tcp/rexec/Rexec.scala | Scala | apache-2.0 | 1,434 |
/*
* 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/analysis/AnalysisSuite.scala | Scala | apache-2.0 | 38,471 |
/*
* Copyright (c) 2014-2020 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... | alexandru/monifu | monix-reactive/shared/src/main/scala/monix/reactive/internal/operators/CollectWhileOperator.scala | Scala | apache-2.0 | 2,619 |
import com.julianpeeters.toolbox.provider._
import models.{ ClassData, FieldData }
import com.novus.salat._
import com.novus.salat.global._
import com.mongodb.casbah.Imports._
import org.specs2._
import mutable._
import specification._
class AnyAnySpec extends mutable.Specification {
val valueMembers: List[Field... | julianpeeters/toolbox-type-provider | src/test/scala/doubleField/AnyAnySpec.scala | Scala | apache-2.0 | 957 |
package actors.execution
import java.util.Locale
import akka.actor.{ActorRef, Props}
import play.api.Logger
import play.api.i18n.Lang
import plm.core.model.lesson.ExecutionProgress.outcomeKind
import plm.core.model.lesson.Exercise.WorldKind
import plm.core.model.lesson.{ExecutionProgress, ExerciseRunner}
import spies... | BuggleInc/webPLM | app/actors/execution/LocalExecutionActor.scala | Scala | agpl-3.0 | 1,746 |
package org.jetbrains.plugins.scala
package lang
package psi
package stubs
package impl
import api.statements.params.ScParameters
import com.intellij.psi.PsiElement
import com.intellij.psi.stubs.{StubElement, IStubElementType}
/**
* User: Alexander Podkhalyuzin
* Date: 19.10.2008
*/
class ScParamClausesStubImpl[P... | consulo/consulo-scala | src/org/jetbrains/plugins/scala/lang/psi/stubs/impl/ScParamClausesStubImpl.scala | Scala | apache-2.0 | 585 |
package daos
import models.User
import java.lang.Long
import org.hibernate.Session
import org.hibernate.criterion.Restrictions
class UserDAO extends BaseDAO[User, Long] {
def findByEmail(email: String)(implicit session: Session): Option[User] = {
val c = session.createCriteria(classOf[User])
c.add(Restricti... | Bhashit/play-commerce | app/daos/UserDAO.scala | Scala | mit | 400 |
package demo
trait Api {
def ping(): String
}
| mscharley/scalajs-electron-demo | src/main/scala/demo/Api.scala | Scala | mit | 49 |
package com.twitter.finagle
package object util {
val DefaultLogger = java.util.logging.Logger.getLogger("com.twitter.finagle")
}
| Krasnyanskiy/finagle | finagle-core/src/main/scala/com/twitter/finagle/util/package.scala | Scala | apache-2.0 | 133 |
/**
* Uma package pode conter classes, objetos e traits, mas
* não a definição de funções e variáveis. Esta é uma
* infeliz limitação da Java virtual machine.
* Faria mais sentido adicionar funções utilitárias ou
* constantes para uma package ao invés de algum objeto Utils.
* Objetos package resolvem essa limit... | celioeduardo/scala-impatient | src/test/scala/capitulo07/ObjetosPackage.scala | Scala | mit | 949 |
/*
* 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/forms/StoringGoodsFormSpec.scala | Scala | apache-2.0 | 1,573 |
package mechanics
/*
* The Game class requires an announcementFeed object in the GUI,
* which has the announce() methods. Consequently, the mechanics
* of the game must be allowed this one active connection to
* communicate with the GUI.
* Therefore, this feed is requested as a parameter and the feed
* with the ... | Berthur/AgeOfLords | src/mechanics/Game.scala | Scala | gpl-3.0 | 3,393 |
/*
* Copyright (c) 2016 SnappyData, Inc. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you
* may not use this file except in compliance with the License. You
* may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by ap... | vjr/snappydata | cluster/src/test/scala/io/snappydata/filodb/FiloDb_SnappyJob.scala | Scala | apache-2.0 | 4,807 |
/*
* Copyright 2014–2020 SlamData 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... | slamdata/quasar | impl/src/main/scala/quasar/impl/storage/ConcurrentMapIndexedStore.scala | Scala | apache-2.0 | 2,534 |
/**
* Copyright (c) 2013, The National Archives <digitalpreservation@nationalarchives.gov.uk>
* https://www.nationalarchives.gov.uk
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://moz... | adamretter/csv-validator | csv-validator-core/src/test/scala/uk/gov/nationalarchives/csv/validator/schema/v1_1/AnyRuleSpec.scala | Scala | mpl-2.0 | 2,273 |
package org.jetbrains.plugins.scala
package editor
package typedHandler
import com.intellij.openapi.editor.{Document, Editor}
import com.intellij.openapi.project.Project
import com.intellij.psi.PsiElement
import com.intellij.psi.codeStyle.CodeStyleManager
import extensions._
import org.jetbrains.plugins.scala.editor.t... | JetBrains/intellij-scala | scala/scala-impl/src/org/jetbrains/plugins/scala/editor/typedHandler/IndentAdjustor.scala | Scala | apache-2.0 | 2,491 |
import scala.util.control.Exception._
/*start*/handling(classOf[Exception]).by((Exception) => 1L)/*end*/
//Exception.Catch[Long] | triggerNZ/intellij-scala | testdata/typeInference/bugs5/SCL3426.scala | Scala | apache-2.0 | 129 |
package tryp
package state
@exportTypes(Transitions)
trait Types
@export
trait Exports
extends Types
@integrate(tryp.state.core)
object `package`
{
type Transitions = PartialFunction[Message, PartialFunction[CState, Any]]
}
| tek/pulsar | state-reflect-core/src/package.scala | Scala | mit | 229 |
package ch14
object ex06 {
sealed abstract class BinaryTree
case class Leaf(value: Int) extends BinaryTree
case class Node(left: BinaryTree, right: BinaryTree) extends BinaryTree
def treeSum(n: BinaryTree): Int = {
n match {
case Leaf(x) => x
case Node(x, y) => treeSum(x) + treeSum(y)
}
... | tuxdna/scala-for-the-impatient-exercises | src/main/scala/ch14/ex06.scala | Scala | apache-2.0 | 466 |
package org.elastic.rest.scala.driver.utils
import org.elastic.rest.scala.driver.RestBase._
import org.elastic.rest.scala.driver.RestBaseImplicits.{CustomTypedToString, _}
import org.elastic.rest.scala.driver.RestResources._
import scala.annotation.StaticAnnotation
import scala.language.experimental.macros
... | Alex-At-Home/rest_client_library | rest_scala_core/shared/src/main/scala/org/elastic/rest/scala/driver/utils/NoJsonHelpers.scala | Scala | apache-2.0 | 23,879 |
package org.scalafmt.sysops
import java.io.File
import java.net.URI
import java.nio.file.attribute.BasicFileAttributes
import java.nio.file.{Files, Path}
import scala.io.Codec
/** Wrapper around java.io.File with an absolute path. */
final class AbsoluteFile(val path: Path) extends AnyVal {
def exists: Boolean = F... | scalameta/scalafmt | scalafmt-sysops/shared/src/main/scala/org/scalafmt/sysops/AbsoluteFile.scala | Scala | apache-2.0 | 2,004 |
/* Copyright 2009-2011 Jay Conrod
*
* This file is part of Tungsten.
*
* Tungsten 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 of
* the License, or (at your option) any late... | jayconrod/tungsten | llvm/src/main/scala/tungsten/llvm/Function.scala | Scala | gpl-2.0 | 4,008 |
/*
* Copyright 2010 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 t... | taihsun/Gitest | src/test/scala/com/twitter/naggati/CodecSpec.scala | Scala | apache-2.0 | 3,676 |
package biformat
import biformat.BlockIterator.{GenBlockIterator, MergedIterator}
import biformat.MafIterator.MafUnit
import scala.collection.mutable.ListBuffer
import alignment.Base
import scala.io.Source
/**
* provides some method for manage Maf format files.
* */
abstract class MafIterator extends BlockIterat... | izziiyt/biutil | src/main/scala/biformat/MafIterator.scala | Scala | mit | 5,032 |
package io.continuum.bokeh
package sampledata
package webbrowsers
import scalax.io.JavaConverters._
import javax.xml.bind.DatatypeConverter
object WebBrowsers extends CSVSampleData {
val Version = """^(.+)\\s+([^\\s]+)$""".r
def load(fileName: String): WebBrowsersData = {
val List(browser_version, sh... | bokeh/bokeh-scala | sampledata/src/main/scala/WebBrowsers.scala | Scala | mit | 1,185 |
/**
* Copyright (C) 2010-2011 LShift 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 appli... | aprescott/diffa | agent/src/main/scala/net/lshift/diffa/agent/rest/ReportsResource.scala | Scala | apache-2.0 | 2,343 |
package pl.edu.agh.iosr.iosr2015.data.streaming.twitter.client
import akka.actor._
import akka.io.IO
import com.typesafe.config.ConfigFactory
import net.ceedubs.ficus.Ficus._
import spray.can.Http
import spray.routing._
object Server extends App with Backend with WebApi {
val serviceActorProps = Props(new HttpServ... | IOSR-Streaming-data/IOSR2015-twitter-streaming-data-client | src/main/scala/pl/edu/agh/iosr/iosr2015/data/streaming/twitter/client/Server.scala | Scala | apache-2.0 | 577 |
/*
* Copyright 2010-2020 WorldWide Conferencing, LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applica... | lift/framework | persistence/mongodb-record/src/test/scala/net/liftweb/mongodb/record/MongoRecordSpec.scala | Scala | apache-2.0 | 33,007 |
/**
* Copyright (C) 2010 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... | wesley1001/orbeon-forms | src/main/scala/org/orbeon/oxf/xforms/function/XFormsAttribute.scala | Scala | lgpl-2.1 | 1,249 |
package colossus.extensions.util.bson.reader
import java.nio.ByteBuffer
import colossus.extensions.util.bson.element.BsonObject
case class BsonObjectReader(buffer: ByteBuffer) extends Reader[BsonObject] {
def read: Option[BsonObject] = {
val name = readCString()
BsonDocumentReader(buffer).read.map(BsonObj... | fehmicansaglam/colossus-extensions | mongo/src/main/scala/colossus/extensions/util/bson/reader/BsonObjectReader.scala | Scala | apache-2.0 | 340 |
/*
* Copyright 2013-2015 Websudos, Limited.
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* - Redistributions of source code must retain the above copyright notice,
* this list of c... | dan-mi-sun/phantom | phantom-dsl/src/main/scala/com/websudos/phantom/builder/query/CassandraOperations.scala | Scala | bsd-2-clause | 3,821 |
package org.tribbloid.spookystuff.example.forum
import org.tribbloid.spookystuff.SpookyContext
import org.tribbloid.spookystuff.actions._
import org.tribbloid.spookystuff.dsl._
import org.tribbloid.spookystuff.example.QueryCore
/**
* Created by peng on 04/07/14.
*/
object Youtube extends QueryCore{
override def ... | chenUT/spookystuff | example/src/main/scala/org/tribbloid/spookystuff/example/forum/Youtube.scala | Scala | apache-2.0 | 1,960 |
/*
* Copyright 2011-2013 Christos KK Loverdos
*
* 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 o... | loverdos/kernie | src/main/scala/com/ckkloverdos/kernie/internal/InjectionInfo.scala | Scala | apache-2.0 | 1,110 |
package dsmoq.exceptions
/**
* 内部チェックに違反した場合に送出する例外
*
* @param message エラーメッセージ
*/
class BadRequestException(message: String) extends RuntimeException(message)
| nkawa/dsmoq | server/apiServer/src/main/scala/dsmoq/exceptions/BadRequestException.scala | Scala | apache-2.0 | 221 |
/*
* Copyright 2015 Hartmut Jürgens
*
* 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... | hjuergens/date-parser | date-rule-combinators/src/test/scala/de/juergens/time/JulianDate$Test.scala | Scala | apache-2.0 | 1,427 |
package de.unihamburg.vsis.sddf.preprocessing
import de.unihamburg.vsis.sddf.reading.Tuple
import de.unihamburg.vsis.sddf.visualisation.model.BasicAnalysable
class PipePreprocessorToLower(featureId: Int*) extends TraitPipePreprocessor with Serializable {
def clean(tuple: Tuple): Tuple = {
featureId.foreach(fId... | numbnut/sddf | src/main/scala/de/unihamburg/vsis/sddf/preprocessing/PipePreprocessorToLower.scala | Scala | gpl-3.0 | 550 |
package com.advancedspark.serving.prediction.java
import scala.collection.JavaConversions._
import scala.collection.JavaConverters.asScalaBufferConverter
import scala.collection.JavaConverters.mapAsJavaMapConverter
import com.netflix.hystrix.HystrixCommand
import com.netflix.hystrix.HystrixCommandGroupKey
import com.... | Resly/pipeline | prediction.ml/java/src/main/scala/com/advancedspark/serving/prediction/java/JavaSourceCodeEvaluationCommand.scala | Scala | apache-2.0 | 2,105 |
/*
* 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/kylin | kylin-spark-project/kylin-spark-query/src/main/scala/org/apache/kylin/query/runtime/plans/ValuesPlan.scala | Scala | apache-2.0 | 1,684 |
package doobie.enum
import doobie.util.invariant._
import doobie.util.atom._
import doobie.util.meta.Meta
import java.sql.ResultSet._
import java.sql.Types._
import scalaz.Order
import scalaz.std.anyVal.intInstance
object jdbctype {
/** @group Implementation */
sealed abstract class JdbcType(val toInt: Int) ex... | jamescway/doobie | core/src/main/scala/doobie/enum/jdbctype.scala | Scala | mit | 5,621 |
package dotty.tools
package dotc
package core
import util.common._
import Symbols._
import Flags._
import Names._
import StdNames._, NameOps._
import Scopes._
import Constants._
import Contexts._
import Annotations._
import SymDenotations._
import Decorators._
import Denotations._
import Periods._
import util.Position... | VladimirNik/dotty | src/dotty/tools/dotc/core/Types.scala | Scala | bsd-3-clause | 129,722 |
package com.twitter.finagle
import com.twitter.finagle.stats.DefaultStatsReceiver
import com.twitter.finagle.toggle.{StandardToggleMap, ToggleMap}
/**
* Package netty4 implements the bottom finagle primitives:
* [[com.twitter.finagle.Server]] and a client transport in terms of
* the netty4 event loop.
*/
package ... | koshelev/finagle | finagle-netty4/src/main/scala/com/twitter/finagle/netty4/package.scala | Scala | apache-2.0 | 2,737 |
package com.artclod.mathml.scalar
import com.artclod.mathml._
import com.artclod.mathml.scalar.concept.Constant
import scala.util.{Success, _}
import scala.xml._
case class Logbase(val value: Constant)
extends MathMLElem(MathML.h.prefix, "logbase", MathML.h.attributes, MathML.h.scope, false, Seq(value): _*) {
def... | kristiankime/web-education-games | app/com/artclod/mathml/scalar/Logbase.scala | Scala | mit | 1,261 |
import org.scalatest.{ Matchers, FlatSpec }
import binary_search._
class binary_search_test extends FlatSpec with Matchers {
val values = Array(1, 3, 5, 9, 17)
val expectedPosition = 3
val target = 9
"Binary Search" should "find a value and return the position" in {
val pos = search(values, target)
po... | warreee/Algorithm-Implementations | Binary_Search/Scala/lichtsprung/binary_search_test.scala | Scala | mit | 461 |
/*
* Copyright (c) 2014 Contributor. All rights reserved.
*/
package org.scalaide.debug.internal.ui
import scala.collection.JavaConverters.asScalaBufferConverter
import org.eclipse.debug.core.DebugException
import org.eclipse.debug.internal.ui.DebugPluginImages
import org.eclipse.debug.internal.ui.IInternalDebugUIC... | dragos/scala-ide | org.scala-ide.sdt.debug.expression/src/org/scalaide/debug/internal/ui/ExpressionResultTreeView.scala | Scala | bsd-3-clause | 24,428 |
package latis.data.value
import latis.data.NumberData
import java.nio.ByteBuffer
/**
* Data implementation for a single Long value.
*/
case class LongValue(val value: Long) extends AnyVal with NumberData {
def size: Int = 8
def intValue: Int = value.toInt
def longValue: Long = value
def floatValue: Float ... | dlindhol/LaTiS | src/main/scala/latis/data/value/LongValue.scala | Scala | epl-1.0 | 489 |
package filodb.downsampler
import java.io.File
import java.time.Instant
import java.util.concurrent.atomic.AtomicLong
import scala.concurrent.Await
import scala.concurrent.duration._
import com.typesafe.config.{ConfigException, ConfigFactory}
import monix.execution.Scheduler
import monix.reactive.Observable
import o... | filodb/FiloDB | spark-jobs/src/test/scala/filodb/downsampler/DownsamplerMainSpec.scala | Scala | apache-2.0 | 51,036 |
package controllers
import javax.inject.Inject
import controllers.Common._
import models.db
import models.req.FavPut
import play.api.mvc.Controller
import scalikejdbc._
import scala.concurrent.ExecutionContext
import scala.util.Try
/**
* Date: 14/11/07.
*/
class Fav @Inject()(implicit val ec: ExecutionContext) ex... | kxbmap/MyFleetGirls | server/app/controllers/Fav.scala | Scala | mit | 1,897 |
package breeze.stats.distributions
/*
Copyright 2009 David Hall, Daniel Ramage
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... | wstcpyt/breeze | math/src/test/scala/breeze/stats/distributions/LogarthmicTest.scala | Scala | apache-2.0 | 1,539 |
/*
* 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 | core/src/main/scala/org/apache/spark/util/collection/PrimitiveKeyOpenHashMap.scala | Scala | apache-2.0 | 5,475 |
/*
* Copyright (c) 2013-16 Miles Sabin
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agr... | lambdista/shapeless | core/src/main/scala/shapeless/lazy.scala | Scala | apache-2.0 | 19,805 |
/**
* Play HTML Compressor
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.md.
* It is also available through the world-wide-web at this URL:
* https://github.com/mohiva/play-html-compressor/blob/master/LICENSE.md
*/
package com.mohiva.... | akkie/play-html-compressor | test/com/mohiva/play/htmlcompressor/HTMLCompressorFilterSpec.scala | Scala | bsd-3-clause | 6,962 |
/*
* Copyright (C) 2016-2019 Lightbend Inc. <https://www.lightbend.com>
*/
package com.lightbend.lagom.javadsl.persistence.cassandra
import java.util.concurrent.CompletableFuture
import java.util.concurrent.CompletionStage
import java.util.function.BiFunction
import java.util.Collections
import java.util.Optional
i... | rcavalcanti/lagom | persistence-cassandra/javadsl/src/main/scala/com/lightbend/lagom/javadsl/persistence/cassandra/CassandraReadSideProcessor.scala | Scala | apache-2.0 | 4,379 |
package io.getquill.util
import com.typesafe.config.ConfigFactory
object LoadConfig {
def apply(configPrefix: String) = {
val factory = ConfigFactory.load(getClass.getClassLoader)
if (factory.hasPath(configPrefix))
factory.getConfig(configPrefix)
else
ConfigFactory.empty
}
}
| mentegy/quill | quill-core/src/main/scala/io/getquill/util/LoadConfig.scala | Scala | apache-2.0 | 307 |
package org.http4s.parser
import cats.implicits._
import java.nio.charset.{StandardCharsets, Charset => NioCharset}
import org.http4s._
import org.http4s.Uri._
import org.http4s.internal.parboiled2._
class IpParserImpl(val input: ParserInput, val charset: NioCharset) extends Parser with IpParser {
def CaptureIPv6: ... | reactormonk/http4s | tests/src/test/scala/org/http4s/parser/UriParserSpec.scala | Scala | apache-2.0 | 9,228 |
package com.twitter.scalding.hraven.reducer_estimation
import java.io.IOException
import cascading.flow.FlowStep
import com.twitter.hraven.{ Flow, JobDetails }
import com.twitter.hraven.rest.client.HRavenRestClient
import com.twitter.scalding.reducer_estimation._
import org.apache.hadoop.mapred.JobConf
import org.slf... | soundcloud/scalding | scalding-hraven/src/main/scala/com/twitter/scalding/hraven/reducer_estimation/HRavenHistoryService.scala | Scala | apache-2.0 | 7,063 |
package org.jetbrains.plugins.dotty.lang.parser.parsing.patterns
import org.jetbrains.plugins.dotty.lang.parser.parsing.expressions.Literal
/**
* @author adkozlov
*/
object SimplePattern extends org.jetbrains.plugins.scala.lang.parser.parsing.patterns.SimplePattern {
override protected def literal = Literal
o... | ilinum/intellij-scala | src/org/jetbrains/plugins/dotty/lang/parser/parsing/patterns/SimplePattern.scala | Scala | apache-2.0 | 476 |
package io.scalajs.nodejs
import io.scalajs.nodejs.buffer.Buffer
import org.scalatest.FunSpec
/**
* StringDecoder Tests
* @author lawrence.daniels@gmail.com
*/
class StringDecoderTest extends FunSpec {
describe("StringDecoder") {
it("should decode strings or buffer") {
val decoder = new StringDeco... | scalajs-io/nodejs | app/common/src/test/scala/io/scalajs/nodejs/StringDecoderTest.scala | Scala | apache-2.0 | 486 |
package com.ldaniels528.audioplayer
import java.io.{File, FileInputStream}
/**
* Represents a continuous audio sample
* @author lawrence.daniels@gmail.com
*/
class ContinuousAudioSample(file: File, isAlive: => Boolean) extends AudioSample {
private val sample = loadAudioSample(new FileInputStream(file))
/**
... | ldaniels528/ricochet | src/main/scala/com/ldaniels528/audioplayer/ContinuousAudioSample.scala | Scala | apache-2.0 | 902 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | bravo-zhang/spark | resource-managers/mesos/src/main/scala/org/apache/spark/scheduler/cluster/mesos/MesosClusterPersistenceEngine.scala | Scala | apache-2.0 | 4,643 |
package concrete.constraint.extension
import java.util
import concrete.Domain
import scala.annotation.tailrec
import scala.math.BigInt.int2bigInt
object STR {
def apply(data: Array[Array[Int]]): STR = {
// val d = data.toArray
new STR(data, data.length)
}
}
final class STR(val array: Array[Array[Int]],... | concrete-cp/concrete | src/main/scala/concrete/constraint/extension/STR.scala | Scala | lgpl-2.1 | 3,732 |
package io.dylemma.spac
package json
import org.scalatest.funspec.AnyFunSpec
import org.scalatest.matchers.should.Matchers
class Fs2JsonInteropTests extends AnyFunSpec with Matchers with JsonParserBehaviors with JsonErrorHandlingBehaviors {
describe("JSON with fs2-data support") {
import Fs2DataSupport._
describ... | dylemma/xml-spac | json-fs2-data/src/test/scala/io/dylemma/spac/json/Fs2JsonInteropTests.scala | Scala | mit | 862 |
/*
* 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 ... | manuzhang/incubator-gearpump | streaming/src/test/scala/org/apache/gearpump/streaming/storage/InMemoryAppStoreOnMasterSpec.scala | Scala | apache-2.0 | 2,476 |
package org.bizzle.tester.cluster
import
org.bizzle.tester.criteria.{ ToggleFlagManager, Talkative, TestToggleFlag }
/**
* Created by IntelliJ IDEA.
* User: Jason
* Date: 1/29/12
* Time: 6:24 PM
*/
trait TestAnalyzer[T <: ExecutionStatus, U <: TestAnalysisFlagBundle, V <: TestAnalysisResultBundle] {
protect... | TheBizzle/Tester | src/main/org/bizzle/tester/cluster/TestAnalyzer.scala | Scala | bsd-3-clause | 587 |
package models.user
import com.mohiva.play.silhouette.api.{Identity, LoginInfo}
import com.scalableminds.util.accesscontext._
import com.scalableminds.util.tools.JsonHelper.parseJsonToFox
import com.scalableminds.util.tools.{Fox, FoxImplicits}
import com.scalableminds.webknossos.datastore.models.datasource.DataSetView... | scalableminds/webknossos | app/models/user/User.scala | Scala | agpl-3.0 | 17,072 |
package chrome.processes.bindings
import chrome.tabs.bindings.Tab
import scala.scalajs.js
class Process extends js.Object {
val id: Process.Id = js.native
val osProcessId: Process.Id = js.native
val title: String = js.native
val `type`: Process.Type = js.native
val profile: String = js.native
val naclD... | amsayk/scala-js-chrome | bindings/src/main/scala/chrome/processes/bindings/Process.scala | Scala | mit | 1,459 |
/**********************************************************************************************************************
* This file is part of Scrupal, a Scalable Reactive Web Application Framework for Content Management *
* ... | scrupal/scrupal-core | project/ScrupalBuild.scala | Scala | apache-2.0 | 3,799 |
package truerss.util
import org.slf4j.LoggerFactory
import truerss.services.PluginNotFoundError
import sys.process._
import zio.Task
import java.io.File
import java.net.URL
class PluginInstaller(private val pluginHomeDir: String) {
import PluginInstaller._
private val logger = LoggerFactory.getLogger(getClass)... | truerss/truerss | src/main/scala/truerss/util/PluginInstaller.scala | Scala | mit | 1,029 |
package org.jetbrains.plugins.scala
package testingSupport
import java.util.concurrent.atomic.AtomicReference
import com.intellij.execution.configurations.RunnerSettings
import com.intellij.execution.executors.DefaultRunExecutor
import com.intellij.execution.impl.DefaultJavaProgramRunner
import com.intellij.execution... | double-y/translation-idea-plugin | test/org/jetbrains/plugins/scala/testingSupport/ScalaTestingTestCase.scala | Scala | apache-2.0 | 10,765 |
package argonaut
import scalaz._, Scalaz._
case class HCursor(cursor: Cursor, history: CursorHistory) {
import Json._
def acursor: ACursor =
ACursor.ok(this)
/**
* Attempts to decode this cursor focus value to another data type.
*/
def jdecode[A](implicit e: DecodeJson[A]): DecodeResult[A] =
e... | travisbrown/argonaut | src/main/scala/argonaut/HCursor.scala | Scala | bsd-3-clause | 12,105 |
package almond.display
import java.net.URLEncoder
final class IFrame private(
val src: String,
val width: Option[String],
val height: Option[String],
val params: Seq[(String, String)],
val displayId: String
) extends UpdatableDisplay {
private def copy(
src: String = src,
width: Option[String] = ... | alexarchambault/jupyter-scala | modules/scala/jupyter-api/src/main/scala/almond/display/IFrame.scala | Scala | apache-2.0 | 1,834 |
/*
* Scala (https://www.scala-lang.org)
*
* Copyright EPFL and Lightbend, Inc.
*
* Licensed under Apache License 2.0
* (http://www.apache.org/licenses/LICENSE-2.0).
*
* See the NOTICE file distributed with this work for
* additional information regarding copyright ownership.
*/
package scala.tools.partest.sb... | scala/scala | src/partest/scala/tools/partest/sbt/SBTRunner.scala | Scala | apache-2.0 | 3,527 |
package skinny.task.generator
import org.scalatest._
class ScaffoldGeneratorSpec extends FunSpec with Matchers {
val generator = ScaffoldSspGenerator
describe("Controller (SkinnyResource)") {
it("should be created as expected") {
val code = generator.controllerCode(
Seq("admin"),
"memb... | seratch/skinny-framework | task/src/test/scala/skinny/task/generator/ScaffoldGeneratorSpec.scala | Scala | mit | 30,850 |
package me.mtrupkin.control
import java.lang.Math._
import javafx.scene.control.Label
import javafx.scene.layout.{Pane, StackPane}
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, ... | mtrupkin/console-fx | src/main/scala/control/ConsoleFx.scala | Scala | mit | 2,415 |
package org.openurp.edu.base.ws
import org.openurp.edu.base.model.Adminclass
import org.beangle.webmvc.api.annotation.response
import org.beangle.data.model.Entity
import org.beangle.webmvc.api.context.Params
import org.beangle.data.jpa.dao.OqlBuilder
import org.beangle.webmvc.entity.action.RestfulService
class Admin... | openurp/edu-core | base/ws/src/main/scala/org/openurp/edu/base/ws/AdminclassWS.scala | Scala | gpl-3.0 | 540 |
/*
* Copyright (C) 2014 Dennis J. McWherter, Jr.
*
* This software may be modified and distributed under the terms of the MIT License.
*/
package com.deathbytape
import javax.ws.rs.ApplicationPath
import org.glassfish.jersey.server.ResourceConfig
/**
* Application to setup servlets
*/
@ApplicationPath("/")
cla... | DeathByTape/scalaREST | src/main/scala/com/deathbytape/HelloApp.scala | Scala | mit | 389 |
/*
* SpinalHDL
* Copyright (c) Dolu, 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 3.0 of the License, or (at your option) any later versi... | SpinalHDL/VexRiscv | src/main/scala/vexriscv/TestsWorkspace.scala | Scala | mit | 9,315 |
/*
* Copyright 2009 Mark Tye
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* so... | mtye/lift-appengine | lift-appengine-test/src/main/scala/net/liftweb/ext_api/appengine/test/AppEngineSuite.scala | Scala | apache-2.0 | 2,107 |
import sbt.File
object CommonBuild {
def getRecursiveListOfFiles(dir: File): Array[File] = {
val these = dir.listFiles
these ++ these.filter(_.isDirectory).flatMap(getRecursiveListOfFiles)
}
} | seralf/daf-semantics | semantic_repository/project/CommonBuild.scala | Scala | apache-2.0 | 212 |
package repositories
import factories.UUIDFactory
import model.persisted.EventExamples
import model.persisted.assessor.{ Assessor, AssessorAvailability, AssessorStatus }
import model.persisted.eventschedules.{ Location, SkillType }
import model.{ SchemeId, UniqueIdentifier }
import org.joda.time.LocalDate
import react... | hmrc/fset-faststream | it/repositories/AssessorRepositorySpec.scala | Scala | apache-2.0 | 5,437 |
package provingground.fol
// import Logic._, Var.varstream
/** Parameters for a First-Order Language */
trait LanguageParam
/** Logical Functions */
class Func(val degree: Int) extends LanguageParam {
/** TermListitute parameters in the function */
def apply(params: List[Term]): Term = RecTerm(this, params)
... | siddhartha-gadgil/ProvingGround | fol/src/main/scala/provingground/fol/Logic.scala | Scala | mit | 1,660 |
package cn.lambdalib.util.mc
import cn.lambdalib.util.generic.VecUtils
import net.minecraft.entity.Entity
import net.minecraft.util.Vec3
class RichEntity(val entity: Entity) extends AnyVal {
def position: Vec3 = {
if (isThePlayer)
Vec3(entity.posX, entity.posY - 1.6, entity.posZ)
else Vec3(entity.pos... | LambdaInnovation/LambdaLib | src/main/scala/cn/lambdalib/util/mc/RichEntity.scala | Scala | mit | 1,178 |
package sql
import org.apache.spark.sql.{SQLContext, SparkSession}
import org.apache.spark.{SparkConf, SparkContext}
//
// Define data in terms of a case class, convert it to a DataFrame,
// register it as a temporary table, and query it. Print the original DataFrame
// and the ones resulting from the queries, and se... | chocolateBlack/LearningSpark | src/main/scala/sql/Basic.scala | Scala | mit | 2,577 |
/*
* Copyright 2013-2015 Websudos, Limited.
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* - Redistributions of source code must retain the above copyright notice,
* this list of c... | analytically/phantom | phantom-dsl/src/test/scala/com/websudos/phantom/tables/TwoKeys.scala | Scala | bsd-2-clause | 2,424 |
package ee.cone.c4actor
import com.typesafe.scalalogging.LazyLogging
import ee.cone.c4actor.ArgTypes._
import ee.cone.c4actor.Types.{ClName, FieldId, SrcId, TypeId}
import ee.cone.c4assemble.Single
import ee.cone.c4di.Types.ComponentFactory
import ee.cone.c4di.{CreateTypeKey, TypeKey, c4, provide}
import ee.cone.c4pr... | conecenter/c4proto | base_lib/src/main/scala/ee/cone/c4actor/ProtocolImpl.scala | Scala | apache-2.0 | 8,223 |
/*
* 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 | tests/src/test/scala/system/basic/WskSequenceTests.scala | Scala | apache-2.0 | 25,867 |
package org.elasticsearch.spark.sql
import scala.collection.JavaConverters.mapAsJavaMapConverter
import scala.collection.Map
import org.apache.spark.annotation.AlphaComponent
import org.apache.spark.annotation.DeveloperApi
import org.apache.spark.api.java.JavaRDD.fromRDD
import org.apache.spark.sql.SQLContext
import ... | Gavin-Yang/elasticsearch-hadoop | spark/sql-12/src/main/scala/org/elasticsearch/spark/sql/EsSparkSQL.scala | Scala | apache-2.0 | 2,679 |
package com.socrata.balboa.metrics.data.impl
import java.util.concurrent.TimeUnit
import java.util.{Date, GregorianCalendar, TimeZone}
import com.socrata.balboa.metrics.Metric.RecordType
import com.socrata.balboa.metrics.data.{DateRange, Period}
import com.socrata.balboa.metrics.{Metric, Metrics}
import junit.framewo... | socrata-platform/balboa | balboa-core/src/test/scala/com/socrata/balboa/metrics/data/impl/CassandraDataStoreTest.scala | Scala | apache-2.0 | 13,244 |
package com.lkroll.ep.mapviewer.graphics
import org.denigma.threejs._
import org.denigma.threejs.extensions.Container3D
import com.lkroll.ep.mapviewer.datamodel.{
Habitat => HabitatData,
Orbiting,
Disc,
ONeillCylinder,
HamiltonCylinder,
BernalSphere,
ModifiedBernalSphere,
Cluster,
Swarm,
Torus,
... | Bathtor/ep-explorer | src/main/scala/com/lkroll/ep/mapviewer/graphics/Habitat.scala | Scala | mit | 7,078 |
package spire
package example
import spire.algebra._
import spire.math._
import spire.implicits._
object Gcd {
def gcd0[A:Integral](x: A, y: A): A =
if ((x emod y) === Integral[A].fromInt(0)) y else gcd0(y, x emod y)
def gcd1[A:EuclideanRing:Order](x: A, y: A): A =
if ((x emod y) === EuclideanRing[A].zer... | non/spire | examples/src/main/scala/spire/example/operators.scala | Scala | mit | 510 |
package plumitive.metadata
import plumitive.ImageBytes
import plumitive.http.ImagePayload
import scala.concurrent.Future
object TextExtractor {
class TextExtractionFailed(msg: String) extends RuntimeException
}
trait TextExtractor {
def extract(bytes: ImagePayload): Future[String]
}
| ostapneko/plumitive | src/main/scala/plumitive/metadata/TextExtractor.scala | Scala | mit | 292 |
package pl.pej.trelloilaro.api.data
import org.scalatest.Suite
import pl.pej.trelloilaro.api.model.ActionJson
import pl.pej.trelloilaro.api.requestBuilder.GetBoardActions
import pl.pej.trelloilaro.api.requestBuilder.builder.action.ActionField
import pl.pej.trelloilaro.api.serialization.BoardId
/** Triples Request-JSO... | tomaszym/trelloilaro | src/test/scala/pl/pej/trelloilaro/api/data/GetBoardActionsTestData.scala | Scala | mit | 5,216 |
/*
* 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/test/scala/org/powerapi/module/extpowermeter/ExtPowerMeterSensorSuite.scala | Scala | agpl-3.0 | 7,643 |
/***********************************************************************
* Copyright (c) 2013-2018 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... | jahhulbert-ccri/geomesa | geomesa-geojson/geomesa-geojson-rest/src/test/scala/org/locationtech/geomesa/geojson/servlet/GeoJsonServletTest.scala | Scala | apache-2.0 | 6,968 |
/*
* 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 | core/src/main/scala/org/apache/spark/ui/WebUI.scala | Scala | apache-2.0 | 6,984 |
object PatmatADT {
abstract sealed class Odd(x: Odd)
case class Good(x: Odd) extends Odd(x)
case class Bad(x: Odd) extends Odd(x)
def foo1a(x: Odd) = x match { // warning: Good(_: Bad), Bad(_: Good)
case Good(_: Good) => false
case Bad(_: Bad) => false
}
def foo1b(x: Odd) = x match {
case Goo... | som-snytt/dotty | tests/patmat/patmat-adt.scala | Scala | apache-2.0 | 1,407 |
package CNN
import org.apache.spark._
import org.apache.spark.SparkContext._
import org.apache.spark.rdd.RDD
import org.apache.spark.Logging
import org.apache.spark.mllib.regression.LabeledPoint
import org.apache.spark.mllib.linalg._
import org.apache.spark.mllib.linalg.distributed.RowMatrix
import breeze.linalg.{
... | XiaoqingWang/SparkMLlibDeepLearn | src/CNN/CNN.scala | Scala | apache-2.0 | 23,766 |
object Test {
def foo(a: Int) {
var bar: Int = 0
bar = try { 0 } catch { case ex: Throwable => 0 }
new { foo(bar) }
}
def main(args: Array[String]): Unit =
try foo(0) catch { case _: java.lang.StackOverflowError => println("ok") }
}
| felixmulder/scala | test/files/run/t6154.scala | Scala | bsd-3-clause | 256 |
package im.actor.server.api.rpc.service.groups
import im.actor.server.{ ApiConversions, models, persist }
import im.actor.util.misc.IdUtils
import scala.concurrent.duration._
import scala.concurrent.forkjoin.ThreadLocalRandom
import scala.concurrent.{ ExecutionContext, Future }
import akka.actor.ActorSystem
import a... | liruqi/actor-platform | actor-server/actor-rpc-api/src/main/scala/im/actor/server/api/rpc/service/groups/GroupsServiceImpl.scala | Scala | mit | 14,546 |
package chandu0101.scalajs.react.components.demo.components
import chandu0101.scalajs.react.components.demo.routes.LeftRoute
import japgolly.scalajs.react._
import japgolly.scalajs.react.extra.router2.RouterCtl
import japgolly.scalajs.react.vdom.prefix_<^._
import scala.scalajs.js
import scala.scalajs.js.UndefOr
impo... | coreyauger/scalajs-react-components | demo/src/main/scala/chandu0101/scalajs/react/components/demo/components/LeftNav.scala | Scala | apache-2.0 | 1,677 |
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.