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 |
|---|---|---|---|---|---|
/*
* 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 ... | jkbradley/spark | sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/text/TextTable.scala | Scala | apache-2.0 | 2,144 |
package ee.cone.c4gate
import ee.cone.c4actor._
import ee.cone.c4actor_kafka_impl.{KafkaConsumerApp, KafkaProducerApp, LZ4DeCompressorApp}
import ee.cone.c4actor_logback_impl.BasicLoggingApp
import ee.cone.c4di.c4app
@c4app class DumperAppBase extends EnvConfigCompApp with VMExecutionApp with NoAssembleProfilerCompA... | conecenter/c4proto | base_examples/src/main/scala/ee/cone/c4gate/ConsumerExamplesMix.scala | Scala | apache-2.0 | 1,367 |
/*
* Copyright 2014-2022 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 agr... | Netflix/atlas | atlas-core/src/main/scala/com/netflix/atlas/core/util/RollingInterval.scala | Scala | apache-2.0 | 3,642 |
/*
* Copyright (c) 2012 Pongr, 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 a... | pongr/fourarms | src/main/scala/email.scala | Scala | apache-2.0 | 5,393 |
package juju.sample
import akka.actor.ActorRef
import juju.domain.Saga
import juju.domain.resolvers.{BindAll, ActivatedBy}
import juju.messages.{Activate, Command, DomainEvent, WakeUp}
import juju.sample.PersonAggregate.WeightChanged
case class AveragePersonWeightActivate(correlationId: String) extends Activate
case ... | brokersquare/juju | core/src/test/scala/juju/sample/AveragePersonWeightSaga.scala | Scala | apache-2.0 | 1,506 |
package lmxml
package transforms
package json
package test
import org.scalatest.FlatSpec
import org.scalatest.matchers.ShouldMatchers
class JSONTest extends FlatSpec with ShouldMatchers {
val source = """
test
h1 will
p "Various degrees of: {determination}"
ul .people
people
li "{id}: {firstname} {lastna... | philcali/lmxml | json/src/test/scala/json.scala | Scala | mit | 1,309 |
package fr.acinq.eclair.payment
import fr.acinq.bitcoin.ByteVector32
import fr.acinq.bitcoin.Crypto.{PrivateKey, PublicKey}
import fr.acinq.eclair.channel.CMD_FAIL_HTLC
import fr.acinq.eclair.crypto.Sphinx
import fr.acinq.eclair.router.Router.{ChannelHop, Hop, NodeHop}
import fr.acinq.eclair.wire._
import fr.acinq.ecl... | btcontract/wallet | app/src/main/java/fr/acinq/eclair/payment/PaymentPacket.scala | Scala | apache-2.0 | 13,815 |
/**
* Copyright (c) 2016 Intel Corporation
*
* 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 applicabl... | aayushidwivedi01/spark-tk | sparktk-core/src/main/scala/org/graphframes/lib/org/trustedanalytics/sparktk/BetweennessCentrality.scala | Scala | apache-2.0 | 3,280 |
package com.outr.arango.api
import com.outr.arango.api.model._
import io.youi.client.HttpClient
import io.youi.http.HttpMethod
import io.youi.net._
import io.circe.Json
import scala.concurrent.{ExecutionContext, Future}
object APIReplicationApplierStop {
def put(client: HttpClient)(implicit ec: ExecutionCont... | outr/arangodb-scala | api/src/main/scala/com/outr/arango/api/APIReplicationApplierStop.scala | Scala | mit | 457 |
/*
* Copyright (c) Microsoft. All rights reserved.
* Licensed under the MIT license. See LICENSE file in the project root for full license information.
*/
package org.apache.spark.api.csharp
import java.io.{DataOutputStream, File, FileOutputStream, IOException}
import java.net.{InetAddress, InetSocketAddress, Serv... | skaarthik/Mobius | scala/src/main/org/apache/spark/api/csharp/CSharpBackend.scala | Scala | mit | 4,412 |
/***********************************************************************
* 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... | ddseapy/geomesa | geomesa-kudu/geomesa-kudu-datastore/src/main/scala/org/locationtech/geomesa/kudu/index/KuduTieredFeatureIndex.scala | Scala | apache-2.0 | 6,868 |
/*
* (c) Copyright 2016 Hewlett Packard Enterprise Development LP
*
* 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 b... | hpe-cct/cct-core | src/main/scala/cogx/platform/types/AbstractKernel.scala | Scala | apache-2.0 | 12,234 |
package scalaprops
import scalaz._
import scalaz.std.anyVal._
import ScalapropsScalaz._
object EitherTTest extends Scalaprops {
val iListBindRec =
scalazlaws.bindRec.laws[({ type l[a] = EitherT[Byte, IList, a] })#l].andThenParam(Param.maxSize(1))
val maybe = {
type F[A] = EitherT[Int, Maybe, A]
Prope... | scalaprops/scalaprops | scalaz/src/test/scala/scalaprops/EitherTTest.scala | Scala | mit | 1,235 |
package org.scaladebugger.api.profiles.java.info.events
import com.sun.jdi.event._
import com.sun.jdi.{Location, ReferenceType, ThreadReference, VirtualMachine}
import org.scaladebugger.api.lowlevel.JDIArgument
import org.scaladebugger.api.lowlevel.events.JDIEventArgument
import org.scaladebugger.api.lowlevel.requests... | ensime/scala-debugger | scala-debugger-api/src/test/scala/org/scaladebugger/api/profiles/java/info/events/JavaLocatableEventInfoSpec.scala | Scala | apache-2.0 | 4,892 |
package controllers
import controllers.AuthController.{UserLoginData, UserSignupData}
import org.postgresql.util.PSQLException
import play.api.libs.functional.syntax._
import play.api.libs.json._
import play.api.mvc._
import services.{AuthService, DatabaseService}
import scala.concurrent.{ExecutionContext, Future}
im... | stuart-xyz/rate-my-area | app/controllers/AuthController.scala | Scala | mit | 3,640 |
/*
* @author Philip Stutz
*
* Copyright 2014 University of Zurich
*
* 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
*
* U... | hicolour/triplerush | src/main/scala/com/signalcollect/triplerush/sparql/VariableEncoding.scala | Scala | apache-2.0 | 1,118 |
package com.pragmasoft.eventaggregator.streams.esrestwriter
import java.util
import java.util.concurrent.atomic.AtomicInteger
import akka.actor.ActorSystem
import akka.testkit.{TestKit, TestProbe}
import com.pragmasoft.eventaggregator.GenericRecordEventJsonConverter.EventHeaderDescriptor
import com.pragmasoft.eventag... | galarragas/event-aggregator | src/test/scala/com/pragmasoft/eventaggregator/streams/esrestwriter/EsRestWriterActorSpec.scala | Scala | apache-2.0 | 6,522 |
package io.eels.component.parquet.avro
import io.eels.Predicate
import io.eels.component.parquet.{ParquetPredicateBuilder, ParquetReaderConfig}
import org.apache.avro.Schema
import org.apache.avro.generic.GenericRecord
import org.apache.hadoop.conf.Configuration
import org.apache.hadoop.fs.Path
import org.apache.parqu... | stheppi/eel | eel-components/src/main/scala/io/eels/component/parquet/avro/AvroParquetReaderFn.scala | Scala | apache-2.0 | 2,102 |
/*
* Copyright 2001-2013 Artima, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agre... | dotty-staging/scalatest | scalactic-test/src/test/scala/org/scalactic/anyvals/NonEmptyMapSpec.scala | Scala | apache-2.0 | 54,091 |
package com.seanshubin.server
class ServerErrorHandlerImpl(jsonSerialization: JsonSerialization) extends ServerErrorHandler {
def handle(request: SimplifiedRequest, exception: ExceptionInfo): SimplifiedResponse = {
val responseObject = ServerErrorDuringRequest(request, exception)
val responseBodyJson = jsonS... | SeanShubin/schulze | server/src/main/scala/com/seanshubin/server/ServerErrorHandlerImpl.scala | Scala | unlicense | 508 |
/*
* Copyright 2016 Scalalaz Podcast 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 law or ... | scalalaz-podcast/scalalaz-gen | src/test/scala/ru/scalalaz/gen/parsing/EpisodeParserSpec.scala | Scala | apache-2.0 | 1,799 |
object Test extends App {
import collection.mutable.ListBuffer
def newLB = ListBuffer(Symbol("a"), Symbol("b"), Symbol("c"), Symbol("d"), Symbol("e"))
val lb0 = newLB
try {
lb0.insert(9, Symbol("x"))
} catch {
case ex: IndexOutOfBoundsException => println(ex)
}
val lb1 = newLB
try {
lb1... | dotty-staging/dotty | tests/run/t6633.scala | Scala | apache-2.0 | 753 |
package router
package dto
import com.wordnik.swagger.annotations.{ ApiModelProperty, ApiModel }
import spray.json.DefaultJsonProtocol
import scala.annotation.meta.field
/**
* Created by gneotux on 18/07/15.
*/
@ApiModel(description = "A Location creation entity")
case class LocationDto(
@(ApiModelProperty@field... | Gneotux/pfc | src/main/scala/router/dto/LocationDto.scala | Scala | apache-2.0 | 1,083 |
/*
* 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 ... | brad-kaiser/spark | streaming/src/main/scala/org/apache/spark/streaming/ui/BatchPage.scala | Scala | apache-2.0 | 14,721 |
package com.twitter.finagle.mux.lease.exp
import com.twitter.util.{StorageUnit, Time}
import com.twitter.conversions.DurationOps._
import com.twitter.conversions.StorageUnitOps._
import org.scalactic.source.Position
import org.scalatest.Tag
import org.scalatest.funsuite.AnyFunSuite
class AlarmTest extends AnyFunSuite... | twitter/finagle | finagle-mux/src/test/scala/com/twitter/finagle/mux/lease/exp/AlarmTest.scala | Scala | apache-2.0 | 5,837 |
/***********************************************************************
* 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... | ccri/geomesa | geomesa-arrow/geomesa-arrow-gt/src/main/scala/org/locationtech/geomesa/arrow/io/SimpleFeatureArrowFileWriter.scala | Scala | apache-2.0 | 4,575 |
package co.verdigris.spark.connector.cql
import com.amazonaws.regions.Regions
@deprecated("Use co.verdigris.spark.connector.cql.S3ConnectionFactory with spark.executorEnv.AWS_REGION instead", "0.4.0")
object AwsS3CACentral1ConnectionFactory extends S3ConnectionFactory {
}
| VerdigrisTech/spark-cassandra-connection-factory | src/main/scala/co/verdigris/spark/connector/cql/AwsS3CACentral1ConnectionFactory.scala | Scala | apache-2.0 | 275 |
package com.sksamuel.elastic4s.http
import java.nio.charset.Charset
import com.fasterxml.jackson.annotation.JsonInclude
import com.fasterxml.jackson.core.JsonParser
import com.fasterxml.jackson.databind.{DeserializationFeature, ObjectMapper}
import com.fasterxml.jackson.module.scala.DefaultScalaModule
import com.fast... | aroundus-inc/elastic4s | elastic4s-http/src/main/scala/com/sksamuel/elastic4s/http/ResponseHandler.scala | Scala | apache-2.0 | 2,734 |
package org.bitcoins.core.number
import org.scalatest.{ FlatSpec, MustMatchers }
class UInt8Test extends FlatSpec with MustMatchers {
"UInt8" must "convert a byte to a UInt8 correctly" in {
UInt8.toUInt8(0.toByte) must be(UInt8.zero)
UInt8.toUInt8(1.toByte) must be(UInt8.one)
UInt8.toUInt8(255.toByte) ... | Christewart/bitcoin-s-core | src/test/scala/org/bitcoins/core/number/UInt8Test.scala | Scala | mit | 355 |
package com.xah.chat.ui.fragments
import android.app.Fragment
import com.xah.chat.framework.TraitFragmentContext
/**
* some fragment helpers
* Created by lemonxah on 2014/10/10.
*/
abstract class BaseFragment extends Fragment with TraitFragmentContext | lemonxah/xaHChat | src/main/scala/com/xah/chat/ui/fragments/BaseFragment.scala | Scala | mit | 256 |
package io.scalaland.chimney.dsl
import io.scalaland.chimney.internal.TransformerCfg._
import io.scalaland.chimney.internal._
import io.scalaland.chimney.internal.macros.dsl.{TransformerBlackboxMacros, TransformerIntoWhiteboxMacros}
import scala.language.experimental.macros
/** Provides DSL for configuring [[io.scal... | scalalandio/chimney | chimney/src/main/scala/io/scalaland/chimney/dsl/TransformerInto.scala | Scala | apache-2.0 | 7,586 |
package documentation
import org.qirx.littlespec.assertion.Assertion
import org.qirx.littlespec.fragments.Code
import org.qirx.littlespec.fragments.CompoundResult
import org.qirx.littlespec.fragments.Fragment
import org.qirx.littlespec.Specification
import org.qirx.littlespec.fragments.Success
import org.qirx.littlesp... | EECOLOR/little-spec | core/src/test/scala/documentation/5_Customization.scala | Scala | mit | 3,348 |
package spire.math
import spire.algebra.{IsIntegral, Order, Rig, Signed}
object UByte extends UByteInstances {
@inline final def apply(n: Byte): UByte = new UByte(n)
@inline final def apply(n: Int): UByte = new UByte(n.toByte)
@inline final def MinValue: UByte = UByte(0)
@inline final def MaxValue: UByte = U... | guersam/spire | core/shared/src/main/scala/spire/math/UByte.scala | Scala | mit | 5,523 |
/* __ *\\
** ________ ___ / / ___ Scala API **
** / __/ __// _ | / / / _ | (c) 2003-2010, LAMP/EPFL **
** __\\ \\/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\\___/_/... | cran/rkafkajars | java/scala/util/regexp/SyntaxError.scala | Scala | apache-2.0 | 780 |
package io.mca.oauth
import org.scalatest._
class OAuthClientTest extends FunSpec with Matchers {
describe("Twitter API example") {
it("generates the expected signature base") {
val token = Fixtures.TwitterAPITest.token
val requestParams = Fixtures.TwitterAPITest.requestParams
val oAuthParams... | mmacaulay/scala-oauth | src/test/scala/io/mca/oauth/OAuthClientTest.scala | Scala | mit | 9,424 |
package fp
import scala.annotation.tailrec
sealed abstract class Free[F[_], A] {
def flatMap[B](f: A => Free[F, B]): Free[F, B] =
FlatMap(this, f)
def map[B](f: A => B): Free[F, B] =
flatMap(f andThen (Return(_)))
}
case class Return[F[_], A](a: A) extends Free[F, A]
case class Suspend[F[_], A](r: F[A]... | adamgfraser/fp | src/main/scala/fp/Free.scala | Scala | apache-2.0 | 2,126 |
/**
* 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 ma... | WillCh/cs286A | dataMover/kafka/core/src/test/scala/unit/kafka/consumer/ConsumerIteratorTest.scala | Scala | bsd-2-clause | 5,040 |
package net.bhardy.braintree.scala
import net.bhardy.braintree.scala.util.NodeWrapper
import scala.collection.JavaConversions._
import java.util.Iterator
import java.lang.Iterable
/**
* A collection used to page through query or search results.
*
* @tparam T
* type of object being paged, e.g. { @link Tran... | benhardy/braintree-scala | src/main/scala/ResourceCollection.scala | Scala | mit | 1,823 |
/*
* Copyright (c) 2013 Oculus Info Inc.
* http://www.oculusinfo.com/
*
* Released under the MIT License.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, includ... | aashish24/aperture-tiles | tile-examples/twitter-topics/twitter-topics-utilities/src/main/scala/com/oculusinfo/twitter/tilegen/TwitterTopicBinner.scala | Scala | mit | 9,263 |
/*
* Copyright 2013 Turkcell Teknoloji Inc. and individual
* contributors by the 'Created by' comments.
* 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/lic... | Turkcell/swarm | core/src/main/scala/io/swarm/UUIDGenerator.scala | Scala | apache-2.0 | 959 |
/**
* 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... | rhauch/kafka | core/src/test/scala/unit/kafka/log/LogValidatorTest.scala | Scala | apache-2.0 | 36,350 |
package epic.parser.kbest
import epic.parser.{ViterbiDecoder, ParserTestHarness}
import org.scalatest.FunSuite
/**
*
* @author dlwh
*/
class TopDownKBestAStarTest extends FunSuite with ParserTestHarness {
test("KBest recovers viterbi tree") {
val parser = ParserTestHarness.viterbiParser
val kbestParser =... | maxim-rabinovich/epic | src/test/scala/epic/parser/kbest/TopDownKBestAStarTest.scala | Scala | apache-2.0 | 643 |
package io.corbel.resources.rem.utils
import io.corbel.resources.rem.plugin.RemPlugin
import org.springframework.context.ApplicationContext
import org.springframework.context.annotation.AnnotationConfigApplicationContext
import org.springframework.context.support.GenericApplicationContext
import scala.reflect.{ClassT... | devialab/corbel-rem-utils | src/main/scala/io/corbel/resources/rem/utils/InjectableServices.scala | Scala | mit | 1,102 |
/**
* Copyright 2015 Otto (GmbH & Co KG)
*
* 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... | ottogroup/schedoscope | schedoscope-core/src/test/scala/org/schedoscope/dsl/transformations/ExportTest.scala | Scala | apache-2.0 | 7,632 |
package com.cloudray.scalapress.plugin.ecommerce.tag
import org.scalatest.{FlatSpec, OneInstancePerTest}
import org.scalatest.mock.MockitoSugar
import javax.servlet.http.HttpServletRequest
import com.cloudray.scalapress.item.Item
import com.cloudray.scalapress.plugin.ecommerce.tags.AddToBasketTag
import com.cloudray.s... | vidyacraghav/scalapress | src/test/scala/com/cloudray/scalapress/plugin/ecommerce/tag/AddToBasketTagTest.scala | Scala | apache-2.0 | 887 |
trait First {type Out}
given First with {type Out = 123}
trait Second {type Out}
transparent inline given (using f: First): Second = new Second {type Out = f.Out}
val s = summon[Second]
val x = summon[s.Out =:= 123] | dotty-staging/dotty | tests/pos/i13503.scala | Scala | apache-2.0 | 217 |
package aiouniya.spark.common
import java.text.SimpleDateFormat
import java.util.Date
import aiouniya.spark.Loaders._
import aiouniya.spark.MyRDDFunctions._
import aiouniya.spark.util.MD5Util
import magneto.analysis.util.ImeiUtil
import org.apache.commons.codec.digest.DigestUtils
import org.apache.hadoop.fs... | 7u/spark-learning | spark.learning/src/main/scala/aiouniya/spark/common/MacMD5MapComm_2.scala | Scala | apache-2.0 | 7,214 |
//
// $Id$
//
// Wiggle - a 2D game development library - http://code.google.com/p/wiggle/
// Copyright 2008-2010 Michael Bayne
// Distributed under the "Simplified BSD License" in LICENSE.txt
package wiggle.gfx
import scala.collection.mutable.ArrayBuffer
/**
* Convenience methods for creating groups of elements.
... | zdevzee/wiggle | src/main/scala/wiggle/gfx/Group.scala | Scala | bsd-3-clause | 1,408 |
package org.kapunga.tm
import akka.actor.{Props, Actor}
import akka.event.Logging
import org.kapunga.tm.command.{CommandExecutorService}
import org.kapunga.tm.soul.{Spirit, SpiritAgent, Agent, Soul}
/**
* This actor is responsible for handling sanitized input from a player once that player
* has been logged in, and... | kapunga/thor-mud | src/main/scala/org/kapunga/tm/SoulHandler.scala | Scala | mit | 3,346 |
/* NSC -- new Scala compiler
* Copyright 2005-2013 LAMP/EPFL
* @author Stephane Micheloud
*/
package scala.man1
/**
* @author Lex Spoon
*/
object fsc extends Command {
import _root_.scala.tools.docutil.ManPage._
protected def cn = new Error().getStackTrace()(0).getClassName()
val name = Section("NAME",
... | martijnhoekstra/scala | src/manual/scala/man1/fsc.scala | Scala | apache-2.0 | 5,345 |
package com.softwaremill.macwire
/**
* - object graph
* - case class -> toString()
* - manual DI
*/
object Step1Complete extends App with Macwire {
case class Field()
case class Digger()
case class PotatoFarm(field: Field, digger: Digger)
case class CowPasture()
case class Meatery(cowPasture: CowPasture... | adamw/nodi-macwire-pres | core/src/main/scala/com/softwaremill/macwire/Step1Complete.scala | Scala | apache-2.0 | 771 |
package com.countrygamer.arcanacraft.client.gui
import com.countrygamer.arcanacraft.common.ArcanaCraft
import com.countrygamer.arcanacraft.common.extended.ArcanePlayer
import com.countrygamer.arcanacraft.common.quom.Quom
import com.countrygamer.cgo.wrapper.common.extended.ExtendedEntityHandler
import cpw.mods.fml.comm... | TheTemportalist/ArcanaCraft | src/main/scala/com/countrygamer/arcanacraft/client/gui/ArcaneOverlay.scala | Scala | apache-2.0 | 1,940 |
package dpla.ingestion3.messages
import scala.collection.mutable.ListBuffer
class MessageCollector[IngestMessage] {
protected val messages: ListBuffer[IngestMessage] = ListBuffer[IngestMessage]()
def add(msg: IngestMessage) = messages += msg
def getAll() = messages
def deleteAll() = messages.remove(0, mes... | dpla/ingestion3 | src/main/scala/dpla/ingestion3/messages/MessageCollector.scala | Scala | mit | 334 |
package io.finch
import java.util.UUID
import scala.reflect.ClassTag
import cats.data.NonEmptyList
import cats.laws.discipline.AlternativeTests
import com.twitter.conversions.time._
import com.twitter.finagle.http.{Cookie, Method, Request}
import com.twitter.io.Buf
import com.twitter.util.{Future, Throw, Try}
import ... | yanana/finch | core/src/test/scala/io/finch/EndpointSpec.scala | Scala | apache-2.0 | 13,293 |
package com.ybrikman.ping.scalaapi.bigpipe
import play.api.libs.iteratee.{Enumeratee, Enumerator}
import play.twirl.api.{Appendable, HtmlFormat, Format, Html}
import play.api.mvc.{Codec, Result}
import scala.language.implicitConversions
import scala.concurrent.{ExecutionContext, Future}
/**
* A custom Appendable tha... | carlosFattor/ping-play | big-pipe/src/main/scala/com/ybrikman/ping/scalaapi/bigpipe/HtmlStream.scala | Scala | mit | 4,588 |
// scalac: -Xfatal-warnings
sealed abstract class X
sealed case class A(x: Boolean) extends X
case object B extends X
object Test {
def test(x: X) = x match {
case A(true) =>
case A(false) | B =>
}
}
| scala/scala | test/files/pos/exhaust_alternatives.scala | Scala | apache-2.0 | 213 |
package pl.pholda.malpompaaligxilo.dsl
object MathExprParserJVMTest extends MathExprParserTest {
override def testForm: TestForm = TestFormJVM
}
| pholda/MalpompaAligxilo | dsl/jvm/src/test/scala/pl/pholda/malpompaaligxilo/dsl/MathExprParserJVMTest.scala | Scala | gpl-3.0 | 148 |
package eu.daxiongmao.training.scala.chp6
/**
* This represents a rational number (x) where x = n/d <br>
* n = numerator<br>
* d = denominator<br>
* <br>
* Note that all values are immutable (~ Java: private final)
*/
class Rational(numer: Int, denom: Int) {
// Construct validators
require(denom !... | guihome-diaz/training | progInScala/src/main/scala/eu/daxiongmao/training/scala/chp6/Rational.scala | Scala | gpl-2.0 | 2,189 |
package twatcher.actors
import twatcher.globals.twitter
import twatcher.logics.TwitterLogic
import twatcher.models.Account
import play.api.Logger
import play.api.libs.concurrent.Execution.Implicits.defaultContext
import scala.concurrent.Future
import akka.actor._
class TwitterActor extends Actor {
def receive = ... | srd7/twatcher | app/actors/TwitterActor.scala | Scala | mit | 2,895 |
/*
* Copyright 2017 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... | VlachJosef/bforms-frontend | app/uk/gov/hmrc/bforms/models/FormId.scala | Scala | apache-2.0 | 913 |
package modules.time
import java.io.{BufferedReader, File}
import java.nio.charset.StandardCharsets
import java.nio.file.Files
import us.feliscat.ir.fulltext.indri.IndriResult
import us.feliscat.m17n.MultiLingual
import us.feliscat.text.{StringNone, StringOption, StringSome}
import us.feliscat.time.{TimeExtractor, Ti... | ktr-skmt/FelisCatusZero-multilingual | src/main/scala/modules/time/MultiLingualTimeExtractorFromPreviousParagraphInTextbook.scala | Scala | apache-2.0 | 2,958 |
/* Copyright 2009-2016 EPFL, Lausanne */
import leon.lang._
object Monotonic {
def composeMonotonic(f: BigInt => BigInt, g: BigInt => BigInt): BigInt => BigInt = {
require(forall((a: BigInt, b: BigInt) => (a > b ==> f(a) > f(b)) && (a > b ==> g(a) > g(b))))
(x: BigInt) => f(g(x))
} ensuring { res => foral... | epfl-lara/leon | src/test/resources/regression/verification/purescala/valid/Monotonic.scala | Scala | gpl-3.0 | 406 |
/**
* Copyright 2015 Yahoo Inc. Licensed under the Apache License, Version 2.0
* See accompanying LICENSE file.
*/
package kafka.manager
import java.util.Properties
import akka.actor.{ActorRef, ActorSystem, Kill, Props}
import akka.pattern._
import akka.util.Timeout
import akka.util.Timeout._
import com.typesafe.c... | krux/kafka-manager | test/kafka/manager/TestKafkaStateActor.scala | Scala | apache-2.0 | 5,059 |
/**
* Copyright: Copyright (C) 2016, ATS Advanced Telematic Systems GmbH
* License: MPL-2.0
*/
package org.genivi.sota.resolver.filters
import eu.timepit.refined.api.{Refined, Validate}
import org.genivi.sota.data.Namespace
import org.genivi.sota.resolver.filters.FilterAST._
case class Filter(
namespace: Namesp... | PDXostc/rvi_sota_server | external-resolver/src/main/scala/org/genivi/sota/resolver/filters/Filter.scala | Scala | mpl-2.0 | 1,457 |
/*
* 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 ... | ueshin/apache-spark | external/docker-integration-tests/src/test/scala/org/apache/spark/sql/jdbc/PostgresIntegrationSuite.scala | Scala | apache-2.0 | 19,773 |
package de.leanovate.swaggercheck.schema.gen
import de.leanovate.swaggercheck.schema.adapter.NodeAdapter
import de.leanovate.swaggercheck.schema.model.{JsonPath, Schema, ValidationResult}
import de.leanovate.swaggercheck.shrinkable.{CheckJsNull, CheckJsValue}
import org.scalacheck.Gen
object GeneratableEmpty extends ... | leanovate/swagger-check | json-schema-gen/src/main/scala/de/leanovate/swaggercheck/schema/gen/GeneratableEmpty.scala | Scala | mit | 620 |
/*
* Copyright 2012 The SIRIS Project
*
* 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... | simulator-x/jbullet-physics | src/simx/components/physics/jbullet/JBulletConverters.scala | Scala | apache-2.0 | 3,143 |
// Generated by <a href="http://scalaxb.org/">scalaxb</a>.
package eveapi.xml.account.char.CharacterInfo
case class Eveapi(currentTime: String,
result: eveapi.xml.account.char.CharacterInfo.Result,
cachedUntil: String,
attributes: Map[String, scalaxb.DataRecord[Any... | scala-eveapi/eveapi | xml/src/main/scala/eveapi/xml/char/CharacterInfo/CharacterInfo.scala | Scala | mit | 2,812 |
package doodle
package turtle
import doodle.core._
object Turtle {
final case class State(at: Vec, heading: Angle)
def draw(instructions: List[Instruction], angle: Angle = Angle.zero): Image = {
import Instruction._
import PathElement._
val initialState = State(Vec.zero, angle)
// Note that ite... | Angeldude/doodle | shared/src/main/scala/doodle/turtle/Turtle.scala | Scala | apache-2.0 | 1,256 |
package de.tu_berlin.dima.bdapro.flink.oddsemordnilaps.christophholtmann
import org.apache.flink.api.scala._
/**
* Created by christophholtmann on 03/11/2016.
*/
object OddSemordnilaps {
def main(args: Array[String]): Unit =
{
val env = ExecutionEnvironment.getExecutionEnvironment
val input = env.r... | cristiprg/BDAPRO.GlobalStateML | bdapro-ws1617-flink-jobs/src/main/scala/de/tu_berlin/dima/bdapro/flink/oddsemordnilaps/christophholtmann/OddSemordnilaps.scala | Scala | apache-2.0 | 741 |
/** 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 ... | alex9311/PredictionIO | core/src/main/scala/org/apache/predictionio/controller/PPreparator.scala | Scala | apache-2.0 | 1,435 |
package com.rumblesan.scalapd.util
import akka.actor.Actor
import scala.sys.process.Process
class SubProcess extends Actor {
def receive = {
case SubProcessRun(p) => {
val result = p.exitValue()
sender ! SubProcessFinished(result)
}
}
}
case class SubProcessRun(p: Process)
case class Su... | rumblesan/scalapd | src/main/scala/com/rumblesan/scalapd/util/SubProcess.scala | Scala | mit | 351 |
package scala.tools.nsc.typechecker
import org.junit.Assert.assertEquals
import org.junit.Test
import scala.tools.testkit.BytecodeTesting
class TypedTreeTest extends BytecodeTesting {
override def compilerArgs = "-Ystop-after:typer"
@Test
def constantFoldedOriginalTreeAttachment(): Unit = {
val code =
... | martijnhoekstra/scala | test/junit/scala/tools/nsc/typechecker/TypedTreeTest.scala | Scala | apache-2.0 | 791 |
package grammarcomp
package grammar
import CFGrammar._
import EBNFGrammar._
import java.io._
import scala.io.StdIn
object GrammarWriter {
def dumpPrettyGrammar[T](filename: String, g: Grammar[T]) = {
dumpGrammar(filename, CFGrammar.renameAutoSymbols(g))
}
def dumpGrammar[T](file: File, g: BNFGramma... | epfl-lara/GrammarComparison | src/main/scala/grammarcomp/grammar/GrammarWriters.scala | Scala | mit | 809 |
// relevant doc:
// * https://developer.github.com/guides/getting-started/
// * https://developer.github.com/v3/
// A note on terminology: a repository is identified by a combination
// of a user name and a repository name. The user name might be an
// individual's, but is more likely an organization name.
// A note... | scala/scabot | github/src/main/scala/scabot/github/GithubApi.scala | Scala | apache-2.0 | 18,944 |
package scala.tools.scalap
package scalax
package rules
package scalasig
sealed trait Type
trait FunctionType extends Type {
def resultType: Type
def paramSymbols: Seq[Symbol]
}
case object NoType extends Type
case object NoPrefixType extends Type
case class ThisType(symbol : Symbol) extends Type
case class Sup... | LPTK/intellij-scala | scalap/src/scalap/scalax/rules/scalasig/Type.scala | Scala | apache-2.0 | 1,675 |
package us.stivers.blue.route
import scalax.util.{Try,Success,Failure}
import us.stivers.blue.http.{Request}
/**
* Finds the best match route for a given request.
*/
trait Router extends (Request=>Try[Route]) {
def routes: Iterable[Route]
}
| cstivers78/blue | blue-core/src/main/scala/us/stivers/blue/route/Router.scala | Scala | apache-2.0 | 247 |
package blended.itestsupport.condition
import akka.actor.Actor
import blended.util.logging.Logger
import scala.concurrent.{ExecutionContext, Future}
/**
* An Actor to be used by [[AsyncCondition]].
*/
abstract class AsyncChecker extends Actor {
import AsyncChecker._
protected implicit val ctxt : ExecutionCon... | woq-blended/blended | blended.itestsupport/src/main/scala/blended/itestsupport/condition/AsyncChecker.scala | Scala | apache-2.0 | 1,480 |
package no.vestein.webapp.eventhandler
abstract class Event
| WoodStone/PurpleRain-ScalaJS | src/main/scala/no/vestein/webapp/eventhandler/Event.scala | Scala | gpl-3.0 | 61 |
package wakfutcp.protocol.common
import enumeratum.values.{IntEnum, IntEnumEntry}
import wakfutcp.protocol.Codec
import scala.collection.immutable
sealed abstract class Community(val value: Int) extends IntEnumEntry with Serializable
case object Community extends IntEnum[Community] {
import Codec._
import cats.... | OpenWakfu/wakfutcp | protocol/src/main/scala/wakfutcp/protocol/common/Community.scala | Scala | mit | 1,017 |
package com.vivint.ceph
package model
import java.util.UUID
case class PersistentState(
id: UUID,
cluster: String,
role: JobRole.EnumVal,
goal: Option[RunState.EnumVal] = None,
lastLaunched: Option[RunState.EnumVal] = None,
reservationConfirmed: Boolean = false,
reservationId: Option[UUID] = None,
sla... | vivint-smarthome/ceph-on-mesos | src/main/scala/com/vivint/ceph/model/PersistentState.scala | Scala | apache-2.0 | 939 |
package scalding
import sbt._
import Keys._
import sbtassembly.Plugin._
import AssemblyKeys._
import com.typesafe.tools.mima.plugin.MimaPlugin.mimaDefaultSettings
import com.typesafe.tools.mima.plugin.MimaKeys._
import scala.collection.JavaConverters._
object ScaldingBuild extends Build {
val sharedSettings = Proj... | danosipov/scalding | project/Build.scala | Scala | apache-2.0 | 10,715 |
package models
import play.api.libs.json.Json
import reactivemongo.api.indexes.{IndexType, Index}
import reactivemongo.bson.BSONObjectID
import scala.concurrent.ExecutionContext.Implicits.global
import scala.util.Random
case class Token(userId: String, id: String)
object Token extends MongoModel("tokens") {
val T... | jdauphant/play_api_example | app/models/Token.scala | Scala | isc | 714 |
package s3.website.model
import java.io.File
import s3.website.model.Files.recursiveListFiles
// ssg = static site generator
trait Ssg {
def outputDirectory: String
}
object Ssg {
val automaticallySupportedSiteGenerators = Jekyll :: Nanoc :: Middleman :: Nil
def autodetectSiteDir(workingDirectory: File): Opti... | naytev/naytev-blog | vendor/bundle/ruby/2.3.0/gems/s3_website-2.14.0/src/main/scala/s3/website/model/ssg.scala | Scala | mit | 759 |
package io.toolsplus.atlassian.connect.play.actions.asymmetric
import io.toolsplus.atlassian.connect.play.TestSpec
import io.toolsplus.atlassian.connect.play.actions.{JwtActionRefiner, JwtRequest}
import io.toolsplus.atlassian.connect.play.api.models.DefaultAtlassianHostUser
import io.toolsplus.atlassian.connect.play.... | toolsplus/atlassian-connect-play | modules/core/test/io/toolsplus/atlassian/connect/play/actions/asymmetric/AsymmetricallySignedAtlassianHostUserActionSpec.scala | Scala | apache-2.0 | 11,180 |
package spatial.lang
package control
import argon.core._
import forge._
import spatial.metadata._
import spatial.nodes._
protected class ReduceAccum[T](accum: Option[Reg[T]], style: ControlStyle, ii: Option[Double], zero: Option[T], fold: Option[T]) {
/** 1 dimensional reduction **/
@api def apply(domain1D: Count... | stanford-ppl/spatial-lang | spatial/core/src/spatial/lang/control/Reduce.scala | Scala | mit | 8,009 |
/*
* Copyright (C) 2014 - 2019 Dennis Vriend <https://github.com/dnvriend>
* Copyright (C) 2019 - 2021 Lightbend Inc. <https://www.lightbend.com>
*/
package akka.persistence.jdbc.query.dao
import akka.NotUsed
import akka.persistence.PersistentRepr
import akka.persistence.jdbc.AkkaSerialization
import akka.persisten... | dnvriend/akka-persistence-jdbc | core/src/main/scala/akka/persistence/jdbc/query/dao/DefaultReadJournalDao.scala | Scala | apache-2.0 | 2,450 |
/*
* Copyright 2014 http4s.org
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to i... | http4s/blaze | core/src/main/scala-2.13/org/http4s/blaze/internal/compat.scala | Scala | apache-2.0 | 723 |
package edu.gemini.ags.gems
import edu.gemini.ags.TargetsHelper
import edu.gemini.ags.gems.mascot.MascotProgress
import edu.gemini.ags.gems.mascot.Strehl
import edu.gemini.catalog.votable.TestVoTableBackend
import edu.gemini.shared.skyobject.{Magnitude => JMagnitude}
import edu.gemini.shared.skyobject.coords.HmsDegCoo... | arturog8m/ocs | bundle/edu.gemini.ags/src/test/scala/edu/gemini/ags/gems/GemsResultsAnalyzerSpec.scala | Scala | bsd-3-clause | 21,388 |
package net.pierreandrews.utils
/**
* An Iterator that takes in a set of partially sorted inputs and merges them in a sorted manned, in descending order.
*
* If the inputs are not partially sorted, than the output will not be sorted properly. This sorter more or less
* only needs inputs.size*size(I) memory as it l... | Mortimerp9/LogSplit | src/main/scala/net/pierreandrews/utils/LineSorter.scala | Scala | gpl-3.0 | 2,144 |
package lib
import io.apibuilder.api.v0.models.{Original, OriginalForm, OriginalType}
import org.scalatestplus.play.PlaySpec
import org.scalatestplus.play.guice.GuiceOneAppPerSuite
class OriginalHelpersSpec extends PlaySpec with GuiceOneAppPerSuite with TestHelper {
"original" in {
val data = readFile("../spec... | gheine/apidoc | api/test/lib/OriginalHelpersSpec.scala | Scala | mit | 1,601 |
package code.model
import _root_.net.liftweb.mapper._
import _root_.net.liftweb.util._
import _root_.net.liftweb.common._
class Recipient extends LongKeyedMapper[Recipient] with IdPK {
def getSingleton = Recipient
object addressIndex extends MappedEmail(this, 256)
def url: String = "/recipient/" + primaryKeyFie... | scsibug/fermata | src/main/scala/code/model/Recipient.scala | Scala | bsd-3-clause | 761 |
package example.gql_server.routing
import akka.http.scaladsl.model.StatusCodes._
import akka.http.scaladsl.server.Directives
import akka.http.scaladsl.server.Route
import de.heikoseeberger.akkahttpcirce.FailFastCirceSupport._
import example.gql_server.component.GraphQLComponent
import example.gql_server.context.UserCo... | t-mochizuki/scala-study | circleci-example/gql-server/src/main/scala/example/gql_server/routing/GraphQLRoute.scala | Scala | mit | 3,536 |
package com.verizon.bda.trapezium.framework.apps
import org.apache.spark.sql.SparkSession
/**
* Created by sankma8 on 10/11/17.
*/
object Main {
def main(args: Array[String]): Unit = {
val session = SparkSession.builder().master("local[2]").getOrCreate()
}
}
| Verizon/trapezium | framework/example/kafkaHADRSample/src/main/scala/com/verizon/bda/trapezium/framework/apps/Main.scala | Scala | apache-2.0 | 277 |
package nest.sparkle.http
import spray.http.{HttpMessage, HttpRequest, HttpResponse}
import spray.routing.Directive.SingleValueModifiers
import spray.routing.{Directive0, Directive1, Directives}
import nest.sparkle.util.Log
/** Mix in to a Directives route structure to add the withRequestResponseLog directive.
* W... | mighdoll/sparkle | http-common/src/main/scala/nest/sparkle/http/HttpLogging.scala | Scala | apache-2.0 | 2,410 |
/*
* 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... | cheeseng/scalatest | scalatest/src/main/scala/org/scalatest/concurrent/Futures.scala | Scala | apache-2.0 | 33,320 |
package uk.gov.gds.ier.transaction.ordinary.dateOfBirth
import uk.gov.gds.ier.validation.{CountryValidator, ErrorTransformForm}
import play.api.mvc.Call
import play.api.templates.Html
import uk.gov.gds.ier.step.StepTemplate
import uk.gov.gds.ier.transaction.ordinary.InprogressOrdinary
import play.api.data.validation.C... | alphagov/ier-frontend | app/uk/gov/gds/ier/transaction/ordinary/dateOfBirth/DateOfBirthMustache.scala | Scala | mit | 3,222 |
package org.camunda.feel.api.context
import org.camunda.feel.context.VariableProvider
case class SimpleTestContext(context: Map[String, _]) extends VariableProvider {
override def getVariable(name: String): Option[Any] = {
if (context.contains(name)) {
Some(context.get(name))
} else {
None
... | camunda/feel-scala | src/test/scala/org/camunda/feel/api/context/SimpleTestContext.scala | Scala | apache-2.0 | 383 |
package monocle.law.function
import monocle.function._
import monocle.law.{IsoLaws, OptionalLaws, PrismLaws, TraversalLaws}
import org.scalacheck.Prop._
import org.scalacheck.{Arbitrary, Properties}
import scalaz.Equal
import scalaz.std.anyVal._
import scalaz.std.tuple._
import scalaz.syntax.equal._
/**
* Laws that... | CapeSepias/Monocle | law/src/main/scala/monocle/law/function/SequenceLaws.scala | Scala | mit | 1,350 |
package _99Problems.WorkingWithLists
/**
* Created by dan.dixey on 27/06/2017.
*/
object P28 {
/**
* Sorting a list of lists according to length of sublists.
*/
def lsort[T](xa: List[List[T]]): List[List[T]] =
xa.sortWith((l1, l2) => l1.length - l2.length < 0)
/**
* Again, we suppose that a... | dandxy89/LearningScala | src/main/scala/_99Problems/WorkingWithLists/P28.scala | Scala | mit | 868 |
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.