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 |
|---|---|---|---|---|---|
/*
* sbt
* Copyright 2011 - 2018, Lightbend, Inc.
* Copyright 2008 - 2010, Mark Harrah
* Licensed under Apache License 2.0 (see LICENSE)
*/
package sbt
package internal
import java.io.File
import java.nio.file.Path
import org.apache.ivy.core.module.descriptor.{ DefaultArtifact, Artifact => IArtifact }
import or... | xuwei-k/xsbt | main/src/main/scala/sbt/internal/RemoteCache.scala | Scala | apache-2.0 | 17,714 |
/*§
===========================================================================
Chronos
===========================================================================
Copyright (C) 2015-2016 Gianluca Costa
===========================================================================
Licensed under the Apache Lic... | giancosta86/Chronos | src/main/scala/info/gianlucacosta/chronos/ast/expressions/ExponentialRandom.scala | Scala | apache-2.0 | 1,187 |
package doobie.contrib.postgresql.hi
import org.postgresql.{ PGConnection, PGNotification }
import doobie.contrib.postgresql.free.pgconnection.PGConnectionIO
import doobie.contrib.postgresql.free.copymanager.CopyManagerIO
import doobie.contrib.postgresql.free.fastpath.FastpathIO
import doobie.contrib.postgresql.free.... | jamescway/doobie | contrib/postgresql/src/main/scala/doobie/contrib/postgresql/hi/connection.scala | Scala | mit | 2,978 |
/*
* 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 ... | chenc10/Spark-PAF | sql/core/src/main/scala/org/apache/spark/sql/expressions/Aggregator.scala | Scala | apache-2.0 | 3,105 |
package monocle.law.discipline.function
import monocle.function.FilterIndex._
import monocle.function._
import monocle.law.discipline.TraversalTests
import org.scalacheck.Arbitrary
import org.typelevel.discipline.Laws
import monocle.catssupport.Implicits._
object FilterIndexTests extends Laws {
def apply[S: Equal... | fkz/Monocle | law/shared/src/main/scala/monocle/law/discipline/function/FilterIndexTests.scala | Scala | mit | 653 |
import language.experimental.macros
import reflect.macros.Context
import macrame.{ internal ⇒ fn }
package object macrame {
/**
* Logs the source code of the given expression to the console during
* compliation.
*/
def trace[A](a : A) : A = macro Impl.trace[A]
/** A list of all members of type `... | ChrisNeveu/macrame | macrame/src/main/scala/macrame/package.scala | Scala | bsd-3-clause | 3,759 |
package uk.co.rajaconsulting.sbtjna
import sbt._
import org.junit.Test
import org.junit.Assert._
import org.scalatest.junit.JUnitSuite
import java.io._;
/**
* @author sumitraja
*
*/
class JNAeratorTest extends JUnitSuite {
@Test
def testJNAerate() {
new JNAerator("target/generated-sources/java", "src/tes... | sumo/sbt-jna | src/test/scala/uk/co/rajaconsulting/sbtjna/JNAeratorTest.scala | Scala | bsd-2-clause | 916 |
/**
* Copyright 2011-2016 GatlingCorp (http://gatling.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.org/licenses/LICENSE-2.0
*
* Unless required by appli... | GabrielPlassard/gatling | gatling-recorder/src/test/scala/io/gatling/recorder/har/HarReaderSpec.scala | Scala | apache-2.0 | 5,433 |
package com.twitter.finagle.http.codec
import com.twitter.finagle.http.{Request, Response}
import com.twitter.finagle.http.netty3.Bijections
import com.twitter.finagle.http.netty3.Bijections.responseFromNetty
import java.nio.charset.{StandardCharsets => Charsets}
import org.jboss.netty.buffer.{ChannelBuffer, ChannelBu... | mkhq/finagle | finagle-base-http/src/main/scala/com/twitter/finagle/http/codec/HttpCodec.scala | Scala | apache-2.0 | 2,648 |
package org.example.implicitplay
/**
* Created by kailianghe on 1/22/15.
*/
trait Comparable[T] {
def comp(o:T) : Int
}
class A
object B {
implicit class ExA(a : A) extends Comparable[A] {
override def comp(o: A): Int = a.hashCode - o.hashCode
}
}
object C {
implicit def int2A(v : Int) = new A
}
cla... | hekailiang/akka-play | actor-samples/src/main/scala/org/example/implicitplay/ImplicitPlay.scala | Scala | apache-2.0 | 1,000 |
package com.pygmalios.reactiveinflux.examples
import java.net.URI
import com.pygmalios.reactiveinflux._
import org.joda.time.DateTime
import scala.concurrent.duration._
/**
* Example of blocking, synchronous usage of SyncReactiveInflux.
*
* It assumes that you have InfluxDB running locally on port 8086. How t... | pygmalios/reactiveinflux | examples/src/main/scala/com/pygmalios/reactiveinflux/examples/SyncExample.scala | Scala | apache-2.0 | 1,443 |
package im.actor.server.session
import java.util.concurrent.TimeUnit
import akka.actor.{ ActorLogging, ActorRef, Cancellable, Props }
import akka.stream.actor._
import com.typesafe.config.Config
import im.actor.server.mtproto.codecs.protocol.MessageBoxCodec
import im.actor.server.mtproto.protocol._
import im.actor.se... | jamesbond12/actor-platform | actor-server/actor-session/src/main/scala/im/actor/server/session/Resender.scala | Scala | mit | 9,326 |
package de.tudarmstadt.lt.flinkdt.tasks
import de.tudarmstadt.lt.flinkdt.types.CT2
import org.apache.flink.api.common.operators.Order
import org.apache.flink.api.common.typeinfo.TypeInformation
import org.apache.flink.api.scala._
import org.apache.flink.util.Collector
import scala.reflect.ClassTag
/**
* Created by... | remstef/flinkfun | src/main/scala/de/tudarmstadt/lt/flinkdt/tasks/FilterSortDT.scala | Scala | apache-2.0 | 1,987 |
package nak.stats
/*
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 by applicable law... | scalanlp/nak | src/main/scala/nak/stats/ContingencyStats.scala | Scala | apache-2.0 | 5,202 |
/*
* 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 ... | yelshater/hadoop-2.3.0 | spark-core_2.10-1.0.0-cdh5.1.0/src/main/scala/org/apache/spark/storage/BlockFetcherIterator.scala | Scala | apache-2.0 | 14,053 |
package slate
package app
import cats.Applicative
import cats.data.Validated
import cats.implicits._
import monix.eval.Task
import org.atnos.eff._
import org.atnos.eff.syntax.all._
import org.scalajs.dom.XMLHttpRequest
import qq.Json
import qq.Platform.Rec._
import qq.cc.{CompiledFilter, CompiledFilterStack, OrCompila... | edmundnoble/dashboarder | ui/src/main/scala/slate/app/SlatePrelude.scala | Scala | mit | 7,750 |
/*
* 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 ... | chenc10/Spark-PAF | core/src/test/scala/org/apache/spark/ui/UIUtilsSuite.scala | Scala | apache-2.0 | 3,418 |
// Copyright (C) 2011-2012 the original author or authors.
// See the LICENCE.txt file distributed with this work for additional
// information regarding copyright ownership.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You ... | dwango/scalastyle | src/main/scala/org/scalastyle/scalariform/SimpleExprWithBraceChecker.scala | Scala | apache-2.0 | 7,066 |
package com.twitter.finagle.channel
import com.twitter.collection.BucketGenerationalQueue
import com.twitter.finagle.service.FailedService
import com.twitter.finagle.{param, Stack, Stackable}
import com.twitter.finagle.stats.{NullStatsReceiver, StatsReceiver}
import com.twitter.finagle.{ConnectionRefusedException, Sim... | yancl/finagle-6.22.0 | finagle-core/src/main/scala/com/twitter/finagle/channel/IdleConnectionFilter.scala | Scala | apache-2.0 | 5,121 |
package info.mukel.telegrambot4s.methods
import info.mukel.telegrambot4s.models.{InputFile, Message, ReplyMarkup}
/** Use this method to send audio files, if you want Telegram clients to display the file as a playable voice message. For this to work, your audio must be in an .ogg file encoded with OPUS (other formats... | hugemane/telegrambot4s | src/main/scala/info/mukel/telegrambot4s/methods/SendVoice.scala | Scala | apache-2.0 | 2,247 |
package Pacman
import Chisel._
class NetLedHarness(
layers: List[LayerData],
testInput: Array[Array[Int]]
) extends Module {
if (layers.last.parameters.NumberOfCores != 1) {
throw new AssertionError("NetLedHarness only support single output")
}
val waitCycles = 100e6.toInt
val inputWordSize = la... | martinhath/bnn | src/main/scala/NetLedHarness.scala | Scala | mit | 3,659 |
package mesosphere.marathon.api.v2
import java.util.Collections
import mesosphere.marathon.api.{ TaskKiller, TestAuthFixture }
import mesosphere.marathon.health.HealthCheckManager
import mesosphere.marathon.state.{ GroupManager, PathId, Timestamp }
import mesosphere.marathon.tasks.{ MarathonTasks, TaskIdUtil, TaskTra... | matsluni/marathon | src/test/scala/mesosphere/marathon/api/v2/TasksResourceTest.scala | Scala | apache-2.0 | 4,282 |
package com.adamsresearch.mbs.fanniemae.issuancefiles
import java.text.SimpleDateFormat
import org.scalatest.FunSuite
/**
* Created by wma on 1/22/15.
*/
class NewIssuePoolStatisticsRecordTest extends FunSuite {
val recordType1Example = "AL6280|01|3138EN6S3|12/01/2014||$63,676,686.00|4.0|||||||10/01/2044|||||||... | waynemadams/mbs-parser | src/test/scala/com/adamsresearch/mbs/fanniemae/issuancefiles/NewIssuePoolStatisticsRecordTest.scala | Scala | apache-2.0 | 12,371 |
package sampler.samplable
import cats.data.State
import sampler.maths.Random
case class Draw[R, T](remainder: R, drawnCounts: Map[T, Int])
/** Trait for sampling without replacement
*
* Wraps some kind of collection [R] of items of type [T], and allows them to be sampled
* without replacement.
*
*/
trait W... | tearne/Sampler | sampler-core/src/main/scala/sampler/samplable/WithoutReplacement.scala | Scala | apache-2.0 | 2,874 |
package cbb.cloudphylo
abstract class BaseApp extends App {
val parser = new scopt.OptionParser[Config]("Cloudphylo") {
head("Cloudphylo", "1.0")
opt[String]('i', "in") required() valueName "<fasta input>" action { (x, c) =>
c.copy(in = x) } text "Sequences fasta file"
opt[String]('o', "out") a... | xingjianxu/cloudphylo | src/main/scala/cbb/cloudphylo/BaseApp.scala | Scala | apache-2.0 | 992 |
/*
* Copyright 2017 Spotify AB.
*
* 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 ... | spotify/featran | core/src/test/scala/com/spotify/featran/transformers/BinarizerSpec.scala | Scala | apache-2.0 | 1,144 |
package org.labrad
import io.netty.channel.EventLoopGroup
import java.io.File
import org.labrad.data._
import scala.concurrent.ExecutionContext
class Client(
val name: String = Client.defaults.name,
val host: String = Client.defaults.host,
val port: Int = Client.defaults.port,
val credential: Credential = Cli... | labrad/scalabrad | core/src/main/scala/org/labrad/Client.scala | Scala | mit | 1,351 |
package org.vitrivr.adampro.web.datastructures
/**
* ADAMpro
*
* Ivan Giangreco
* June 2016
*/
private[web] object Entity {}
private[web] case class EntityListResponse(code: Int, entities: Seq[String])
private[web] case class EntityDetailResponse(code: Int, entityname: String, attribute : String, details: ... | dbisUnibas/ADAMpro | web/src/main/scala/org/vitrivr/adampro/web/datastructures/Entity.scala | Scala | mit | 1,226 |
/*
* 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 app... | danielcsant/sparta | sdk/src/test/scala/com/stratio/sparta/sdk/DimensionTest.scala | Scala | apache-2.0 | 2,696 |
import scala.util.control.NonLocalReturns._
inline def [T, E <: Throwable](op: => T) rescue (fallback: PartialFunction[E, T]) =
try op
catch {
case ex: ReturnThrowable[_] => throw ex
case ex: E =>
if (fallback.isDefinedAt(ex)) fallback(ex) else throw ex
}
def test: Unit = {
9 / 0 rescue { case ... | som-snytt/dotty | tests/pos/i7041.scala | Scala | apache-2.0 | 352 |
/*
*
* * 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 "L... | eBay/Eagle | eagle-core/eagle-data-process/eagle-stream-process-api/src/main/scala/org/apache/eagle/datastream/StreamAlertExpansion.scala | Scala | apache-2.0 | 8,979 |
package com.github.j5ik2o.forseti.adaptor.validator
import com.github.j5ik2o.forseti.domain.auhtorizationCode.AuthorizationCode
import com.github.j5ik2o.forseti.domain.exception.{InvalidGrantException, OAuthException}
import com.github.j5ik2o.forseti.domain.pkce.{CodeChallenge, CodeVerifier}
import com.github.j5ik2o.f... | j5ik2o/forseti | server/server-use-case-port/src/main/scala/com/github/j5ik2o/forseti/adaptor/validator/CodeVerifierValidator.scala | Scala | mit | 1,903 |
package eggman89.extra
import org.apache.log4j.{Level, Logger}
import org.apache.spark.sql.SQLContext
import org.apache.spark.{SparkContext, SparkConf}
import org.joda.time.DateTime
/**
* Created by snehasis on 12/14/2015.
*/
object combineAndMakeCsv {
def main(args: Array[String]) {
val path = "C:/Users/... | eggman89/TagGenerationAndMusicReco | src/main/scala-2.10/eggman89/extra/combineAndMakeCsv.scala | Scala | apache-2.0 | 2,207 |
/*
* tswrdb - a program and API to export the TSW resource database
*
* Copyright (C) 2013 Joakim Bjørnstad <joakibj@gmail.com>
*
* Licensed under the GNU General Public License version 2.
* Please see the LICENSE file for the license text in verbatim.
*/
package com.joakibj.tswrdb
import java.io.File
import r... | joakibj/tswrdb | tswrdb-cmdui/src/main/scala/com/joakibj/tswrdb/TswRdb.scala | Scala | gpl-2.0 | 3,687 |
package skinny.controller
import org.scalatra.test.scalatest._
import scalikejdbc._, SQLInterpolation._
import skinny.orm.SkinnyCRUDMapper
import skinny.validator._
import skinny.ParamType
class SkinnyApiResourceSpec extends ScalatraFlatSpec {
behavior of "SkinnyApiResource"
Class.forName("org.h2.Driver")
Glo... | BlackPrincess/skinny-framework | framework/src/test/scala/skinny/controller/SkinnyApiResourceSpec.scala | Scala | mit | 2,798 |
package mgoeminne.scalaggplot.geom
import mgoeminne.scalaggplot.position.Position
import mgoeminne.scalaggplot.stat.Statistic
import mgoeminne.scalaggplot.stat
import mgoeminne.scalaggplot.position
import org.saddle.Frame
/**
* Points, jittered to reduce overplotting.
*
* The Position.jitter geom is a convenient ... | mgoeminne/scala-ggplot | src/main/scala/mgoeminne/scalaggplot/geom/jitter.scala | Scala | lgpl-3.0 | 1,825 |
/*
* 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 ... | yelshater/hadoop-2.3.0 | spark-core_2.10-1.0.0-cdh5.1.0/src/main/scala/org/apache/spark/deploy/worker/WorkerArguments.scala | Scala | apache-2.0 | 5,198 |
package scorex.utils
import java.net.InetAddress
import org.apache.commons.net.ntp.NTPUDPClient
object NTP extends ScorexLogging {
private val TimeTillUpdate = 1000 * 60 * 10L
private val NtpServer = "pool.ntp.org"
private var lastUpdate = 0L
private var offset = 0L
def correctedTime() = {
//CHECK I... | Pole-he/Scorex-Lagonaki | src/main/scala/scorex/utils/NTP.scala | Scala | cc0-1.0 | 1,046 |
package org.jetbrains.plugins.scala.lang.psi
import org.jetbrains.plugins.scala.lang.psi.types.ScSubstitutor
import org.jetbrains.plugins.scala.lang.resolve.ScalaResolveResult
/**
* @author Nikolay.Tropin
*/
package object implicits {
type Candidate = (ScalaResolveResult, ScSubstitutor)
}
| loskutov/intellij-scala | src/org/jetbrains/plugins/scala/lang/psi/implicits/package.scala | Scala | apache-2.0 | 298 |
/**
* Copyright (c) 2013-2015 Patrick Nicolas - Scala for Machine Learning - All rights reserved
*
* The source code in this file is provided by the author for the sole purpose of illustrating the
* concepts and algorithms presented in "Scala for Machine Learning". It should not be used to
* build commercial ap... | batermj/algorithm-challenger | books/cs/machine-learning/scala-for-machine-learning/1rst-edition/original-src-from-the-book/src/main/scala/org/scalaml/supervised/Supervised.scala | Scala | apache-2.0 | 1,533 |
package org.bitcoins.core.wallet.fee
import org.bitcoins.core.currency.{CurrencyUnit, Satoshis}
import org.bitcoins.core.number.Int64
import org.bitcoins.core.protocol.transaction.Transaction
/**
* This is meant to be an abstract type that represents different fee unit measurements for
* blockchains
*/
sealed a... | bitcoin-s/bitcoin-s-core | core/src/main/scala/org/bitcoins/core/wallet/fee/FeeUnit.scala | Scala | mit | 1,851 |
package org.ensime.core.javac
import akka.event.slf4j.SLF4JLogging
import com.sun.source.tree.Scope
import com.sun.source.tree.Tree
import com.sun.source.tree.{ IdentifierTree, MemberSelectTree }
import com.sun.source.util.{ JavacTask, TreePath, Trees }
import java.io.{ File, FileInputStream, InputStream }
import java... | jacobono/ensime-server | core/src/main/scala/org/ensime/core/javac/JavaCompiler.scala | Scala | gpl-3.0 | 8,432 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | techaddict/spark | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/aggregate/Sum.scala | Scala | apache-2.0 | 3,233 |
package monocle.std
import monocle.function._
import monocle.{Iso, Lens}
import scalaz.Tree
import scala.annotation.tailrec
import scala.collection.immutable.Stream.Empty
object tree extends TreeFunctions with TreeInstances
trait TreeFunctions {
def rootLabel[A]: Lens[Tree[A], A] =
Lens[Tree[A], A](_.rootLa... | CapeSepias/Monocle | core/src/main/scala/monocle/std/Tree.scala | Scala | mit | 1,811 |
package model
import grizzled.slf4j.Logging
import io._
import io.config.ConfigMappings._
import io.config.Configuration
import maths.RandomNumberGenerator
import maths.integration.RungeKuttaIntegration
import physical.Turbulence
import physical.flow.Flow
import utilities.SimpleTimer
class CoupledBiophysicalModel(val... | shawes/zissou | src/main/scala/model/CoupledBiophysicalModel.scala | Scala | mit | 3,313 |
package de.hyronx.matter.compiler.types
import org.scalatest._
class TypesTest extends FlatSpec with Matchers {
"The standard types" should "correctly show up" in {
Types.root.printTree(true, 0, true)
succeed
}
}
| hyronx/matter | src/test/scala/de/hyronx/matter/compiler/types/TypesTest.scala | Scala | apache-2.0 | 227 |
package shield.implicits
import org.specs2.mutable.Specification
import spray.http.HttpHeaders.RawHeader
import spray.http.{HttpResponse, HttpRequest}
import shield.implicits.HttpImplicits._
class ImplicitsSpec extends Specification {
"HttpImplicits" should {
"Replace a request header" in {
var request = ... | RetailMeNot/shield | src/test/scala/shield/implicits/ImplicitsSpec.scala | Scala | mit | 3,233 |
package controllers
import java.util.concurrent.TimeUnit
import javax.inject._
import org.pac4j.core.config.Config
import org.pac4j.core.profile.{CommonProfile, ProfileManager}
import org.pac4j.play.scala.{Security, SecurityComponents}
import org.pac4j.play.store.PlaySessionStore
import play.api._
import play.api.mv... | kristiankime/calc-tutor | app/controllers/ApplicationController.scala | Scala | mit | 2,206 |
/*
Copyright (c) 2016, Robby, Kansas State University
All rights reserved.
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 cond... | sireum/v3-intellij | src/org/sireum/intellij/logika/LogikaFileTypeFactory.scala | Scala | bsd-2-clause | 2,188 |
/*
* 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 ... | aosagie/spark | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala | Scala | apache-2.0 | 128,855 |
/*
* Copyright 2011-2022 GatlingCorp (https://gatling.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.org/licenses/LICENSE-2.0
*
* Unless required by appli... | gatling/gatling | gatling-core/src/test/scala/io/gatling/core/assertion/AssertionDSLSpec.scala | Scala | apache-2.0 | 3,048 |
/*
* 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 agreed to in writ... | cheeseng/scalatest | scalatest-test/src/test/scala/org/scalatest/EveryShouldContainOnlyLogicalOrSpec.scala | Scala | apache-2.0 | 49,372 |
package net.fwbrasil.zoot.core.filter
import scala.concurrent.Future
import net.fwbrasil.zoot.core.request.Request
import net.fwbrasil.zoot.core.response.Response
trait Filter extends ((Request, (Request => Future[Response[Array[Byte]]])) => Future[Response[Array[Byte]]]) {
self =>
protected type Service = ... | fwbrasil/zoot | zoot-core/src/main/scala/net/fwbrasil/zoot/core/filter/Filter.scala | Scala | lgpl-2.1 | 724 |
package notebook.front.widgets
import scala.xml.{NodeSeq, UnprefixedAttribute, Null}
import play.api.libs.json._
import notebook._
import notebook.front._
import notebook.JsonCodec._
import notebook.front.widgets.magic._
trait Images extends Generic with Utils {
import java.awt.image.BufferedImage
import java.io.... | andypetrella/spark-notebook | modules/common/src/main/scala/notebook/front/widgets/Images.scala | Scala | apache-2.0 | 1,794 |
/*
*
* /\\\\\\\\\\
* /\\\\\\///\\\\\\
* /\\\\\\/ \\///\\\\\\ /\\\\\\\\\\\\\\\\\\ /\\\\\\ /\\\\\\
* /\\\\\\ \\//\\\\\\ /\\\\\\/////\\\\\\ /\\\\\\\\\\\\\\\\\\\\\\ \\/// /\\\\\\\\\\ /\\\\\\\\\\ /\\\\\\ /\\\\\\ /\\\\\\\\\\\\\\\\\\\\
* \\/\\\\\\ \\/\\\\\\ \\/\\\\\\\\\\\\\\\\\\\... | vagm/Optimus | solver-gurobi/src/test/scala/optimus/optimization/GurobiSpecTest.scala | Scala | lgpl-3.0 | 21,729 |
package com.arcusys.valamis.updaters.version320.schema3203
import com.arcusys.valamis.persistence.common.SlickProfile
import com.arcusys.valamis.persistence.common.DbNameUtils._
trait StatementObjectSchema {
self: SlickProfile =>
import driver.api._
type StatementObjectRow = (Long, String)
class StatementO... | arcusys/Valamis | valamis-updaters/src/main/scala/com/arcusys/valamis/updaters/version320/schema3203/StatementObjectSchema.scala | Scala | gpl-3.0 | 642 |
package org.jetbrains.plugins.scala.editor.documentationProvider
import com.intellij.psi.PsiFile
import org.jetbrains.plugins.scala.ScalaFileType
abstract class ScalaDocumentationProviderTestBase extends DocumentationProviderTestBase
with ScalaDocumentationsSectionsTesting {
override protected def documentationPr... | JetBrains/intellij-scala | scala/scala-impl/test/org/jetbrains/plugins/scala/editor/documentationProvider/ScalaDocumentationProviderTestBase.scala | Scala | apache-2.0 | 499 |
package scavlink.link.nav
import akka.actor.Status.Failure
import scavlink.link.Vehicle
import scavlink.link.channel.ChannelTellAPI._
import scavlink.link.fence.{FenceActor, FenceBreach}
import scavlink.link.nav.NavTellAPI._
import scavlink.link.operation._
import scavlink.link.telemetry.Telemetry
import scavlink.mess... | nickolasrossi/scavlink | src/main/scala/scavlink/link/nav/RotorTakeoff.scala | Scala | mit | 5,662 |
/*
* Copyright (c) 2017-2021, Robby, Kansas State University
* All rights reserved.
*
* 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, th... | sireum/v3-logika-runtime | macros/shared/src/main/scala/org/sireum/$internal/Trie.scala | Scala | bsd-2-clause | 1,644 |
/*
* Copyright (C) 2014 Szu-Hsien Lee (misgod.tw@gmail.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 applicable la... | misgod/twculture | server/src/main/scala/com/a30corner/twculture/server/ExtraData.scala | Scala | apache-2.0 | 3,269 |
package japgolly.scalajs
import org.scalajs.dom, dom.html
import scala.scalajs.js
import js.{Dynamic, UndefOr, Object, Any => JAny, Function => JFn}
package object react extends ReactEventAliases {
type TopNode = dom.Element
/**
* These exist for type inference.
* If P,S,B,N types are needed and there's a... | beni55/scalajs-react | core/src/main/scala/japgolly/scalajs/react/package.scala | Scala | apache-2.0 | 6,673 |
package io.mem0r1es.trank.ranking
import java.net.URI
trait RankingAlgo {
def rank(entityTypes: Map[URI, HierInfo]): Seq[(URI, Double)]
} | MEM0R1ES/TRank | src/main/scala/io/mem0r1es/trank/ranking/RankingAlgo.scala | Scala | apache-2.0 | 142 |
/*
* 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 ... | CodingCat/spark-eventhubs | core/src/test/scala/org/apache/spark/sql/streaming/eventhubs/EventHubsAddData.scala | Scala | apache-2.0 | 3,593 |
package controllers.authentication
import javax.inject.Inject
import com.mohiva.play.silhouette.api.{ Environment, LogoutEvent, Silhouette }
import com.mohiva.play.silhouette.impl.authenticators.{JWTAuthenticator, CookieAuthenticator}
import com.mohiva.play.silhouette.impl.providers.SocialProviderRegistry
import mode... | SBP07/backend | app/controllers/authentication/CookieCredentialsTestController.scala | Scala | gpl-2.0 | 1,070 |
/*
* 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... | psyyz10/BigDL | spark/dl/src/main/scala/com/intel/analytics/bigdl/nn/Sigmoid.scala | Scala | apache-2.0 | 1,832 |
package nova.scala.wrapper
import java.util.{List => JList}
import com.google.common.base.CaseFormat
/**
* @author Calclavia
*/
object StringWrapper {
implicit class WrappedString(str: String) {
def toCamelCase: String = str.toPascalCase.decapitalizeFirst
def decapitalizeFirst: String = str.substring(0, 1)... | SoniEx2/NOVA-Scala | src/main/scala/nova/scala/wrapper/StringWrapper.scala | Scala | lgpl-3.0 | 1,141 |
/*
* 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... | hmrc/api-gateway | test/uk/gov/hmrc/apigateway/util/PlayRequestUtilsSpec.scala | Scala | apache-2.0 | 3,215 |
package texteditor.imperative
import scala.math.min
import scala.swing.BorderPanel.Position
import scala.swing.{BorderPanel, Button, Dimension, GridPanel, Label, MainFrame, ScrollPane, SimpleSwingApplication}
import scala.swing.event.ButtonClicked
object ApplicationSwingTextArea extends SimpleSwingApplication {
imp... | volkc/REScala | Examples/Editor/src/main/scala/texteditor/imperative/ApplicationSwingTextArea.scala | Scala | apache-2.0 | 2,301 |
package barneshut
import java.awt._
import java.awt.event._
import javax.swing._
import javax.swing.event._
import scala.collection.parallel.{TaskSupport, defaultTaskSupport}
class SimulationModel {
var screen = new Boundaries
var bodies: Seq[Body] = Nil
var quad: Quad = Empty(screen.centerX, screen.centerY,... | dnc1994/FuncScala | parprog1/barneshut/src/main/scala/barneshut/SimulationModel.scala | Scala | mit | 2,578 |
package de.johanneswachter.projects.db4o
import com.db4o._
import model._
object InitDB {
def main(args : Array[String]) : Unit = {
val db = Db4o.openFile("test-dsl-simpsons.db")
db store Person("Bart","Simpson", 10)
db store Person("Lisa","Simpson", 8)
db store Person("Marge","Simpson", 3... | jwachter/scala-db4o-dsl | src/de/johanneswachter/projects/db4o/InitDB.scala | Scala | apache-2.0 | 767 |
package com.yammer.dropwizard.examples
import javax.ws.rs._
import core.Response.Status
import core.{Response, MediaType}
import com.yammer.metrics.annotation.Timed
@Path("/hello-world")
@Produces(Array(MediaType.APPLICATION_JSON))
class HelloWorldResource(saying: String) {
@GET
@Timed
def sayHello(@QueryParam(... | ericholscher/dropwizard | dropwizard-scala_2.9.1/src/test/scala/com/yammer/dropwizard/examples/HelloWorldResource.scala | Scala | apache-2.0 | 504 |
package org.jetbrains.plugins.scala.lang.completion.postfix
class ScalaForEachPostfixTemplateTest extends PostfixTemplateTest {
override def testPath() = super.testPath() + "foreach/"
def testExample(): Unit = doTest()
}
| JetBrains/intellij-scala | scala/scala-impl/test/org/jetbrains/plugins/scala/lang/completion/postfix/ScalaForEachPostfixTemplateTest.scala | Scala | apache-2.0 | 227 |
import scala.io.StdIn._ //per readline
import java.io._ //per il FileOutputStream e PrintWriter
import scala.io.Source //per il source
object FileIO {
def main(args: Array[String]) {
print("Input: " )
val riga = readLine
println("Hai digitato: " + riga)
//sovrascrive il file
n... | M9k/Scala-learning | 22-fileIO.scala | Scala | bsd-3-clause | 1,441 |
object MyTest
| sbt/sbt | sbt-app/src/sbt-test/actions/remote-cache-semanticdb/src/test/scala/MyTest.scala | Scala | apache-2.0 | 14 |
package com.wavesplatform.state
import com.google.common.primitives.Longs
import com.wavesplatform.account.Address
import com.wavesplatform.common.state.ByteStr
import com.wavesplatform.common.utils._
import com.wavesplatform.lang.v1.estimator.ScriptEstimatorV1
import com.wavesplatform.state.StateHash.SectionId
import... | wavesplatform/Waves | node/src/test/scala/com/wavesplatform/state/StateHashSpec.scala | Scala | mit | 4,268 |
package com.mesosphere.cosmos.handler
import java.util.UUID
import cats.data.Xor
import com.mesosphere.cosmos.ErrorResponse
import com.mesosphere.cosmos.circe.Decoders._
import com.mesosphere.cosmos.http.MediaTypes
import com.mesosphere.cosmos.rpc.v1.circe.Decoders._
import com.mesosphere.cosmos.rpc.v1.model.Uninstal... | movicha/cosmos | cosmos-server/src/it/scala/com/mesosphere/cosmos/handler/UninstallHandlerSpec.scala | Scala | apache-2.0 | 6,051 |
/*
* 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 ... | wangyixiaohuihui/spark2-annotation | sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/json/JsonSuite.scala | Scala | apache-2.0 | 75,068 |
package org.showgregator.core.util
import java.nio.ByteBuffer
object ByteBuffers {
implicit class AsByteArray(buffer: ByteBuffer) {
def asBytes:Array[Byte] = {
val a = new Array[Byte](buffer.remaining())
buffer.get(a)
a
}
}
}
| csm/showgregator | showgregator-core/src/main/scala/org/showgregator/core/util/ByteBuffers.scala | Scala | agpl-3.0 | 258 |
object test {
def make[m[x], b]: m[b] = sys.error("foo")
val lst: List[Int] = make[List, Int]
}
| yusuke2255/dotty | tests/untried/pos/tcpoly_subst.scala | Scala | bsd-3-clause | 100 |
/**
* 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... | wangcy6/storm_app | frame/kafka-0.11.0/kafka-0.11.0.1-src/core/src/main/scala/kafka/utils/ToolsUtils.scala | Scala | apache-2.0 | 2,558 |
import munit.FunSuite
import org.scoverage.issue53.part.b.SubtractorScala
/** Created by Mikhail Kokho on 7/10/2015.
*/
class SubtractorTestSuite extends FunSuite {
test("Subtractor should subtract two numbers") {
assertEquals(SubtractorScala.minus(2, 1), 1)
}
}
| scoverage/sbt-scoverage | src/sbt-test/scoverage/aggregate-only/partB/src/test/scala/SubtractorTestSuite.scala | Scala | apache-2.0 | 274 |
package core.models
import play.api.Play
import play.api._
import play.api.mvc._
import play.api.db.slick.{DatabaseConfigProvider, HasDatabaseConfigProvider}
import scala.concurrent.Future
import slick.driver.JdbcProfile
import slick.driver.MySQLDriver.api._
import scala.concurrent.ExecutionContext.Implicits.global
im... | WernerLDev/ScalaPlayCMS | app/core/models/asset.scala | Scala | gpl-3.0 | 5,786 |
/*
* 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 ... | zhreshold/mxnet | scala-package/examples/src/main/scala/org/apache/mxnetexamples/imclassification/datasets/SyntheticDataIter.scala | Scala | apache-2.0 | 2,644 |
/*
* Copyright 2021 HM Revenue & Customs
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or a... | hmrc/pensions-lifetime-allowance-frontend | app/models/CurrentPensionsModel.scala | Scala | apache-2.0 | 884 |
/**
* Copyright 2015 Thomson Reuters
*
* 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 ag... | nruppin/CM-Well | server/cmwell-controller/src/main/scala/cmwell/ctrl/checkers/SystemChecker.scala | Scala | apache-2.0 | 2,251 |
package dk.gp.mtgpc
import breeze.linalg._
import java.io._
object getMtGpcTestData {
/**
* Returns (x,y)
*/
def apply(): (DenseMatrix[Double], DenseVector[Double]) = {
val x = csvread(new File("src/test/resources/gpml/classification_x.csv"))
val y = csvread(new File("src/test/resources/gpml/classi... | danielkorzekwa/bayes-scala-gp | src/test/scala/dk/gp/mtgpc/getMtGpcTestData.scala | Scala | bsd-2-clause | 947 |
package io.github.binaryfoo.lagotto.doc
import java.io.{ByteArrayOutputStream, File, FileWriter, PrintWriter}
import java.nio.file.{Files, StandardCopyOption}
import io.github.binaryfoo.lagotto.shell.{IsATty, Main}
import org.asciidoctor.internal.JRubyAsciidoctor
import org.asciidoctor.{AsciiDocDirectoryWalker, Optio... | binaryfoo/lagotto | src/test/scala/io/github/binaryfoo/lagotto/doc/RunExamples.scala | Scala | mit | 2,697 |
/*
* Copyright 2011-2019 Asakusa Framework 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 ... | ueshin/asakusafw-spark | runtime/src/main/scala/com/asakusafw/spark/runtime/graph/MapPartitions.scala | Scala | apache-2.0 | 1,533 |
package objsets
import org.scalatest.FunSuite
import org.junit.runner.RunWith
import org.scalatest.junit.JUnitRunner
@RunWith(classOf[JUnitRunner])
class TweetSetSuite extends FunSuite {
trait TestSets {
val set1 = new Empty
val set2 = set1.incl(new Tweet("a", "a body", 20))
val set3 = set2.incl(new Tw... | kharandziuk/scala-coursera | objsets/src/test/scala/objsets/TweetSetSuite.scala | Scala | mit | 1,903 |
package com.amarjanica.discourse.util
trait HasParameters extends Product {
val parameters: Map[String, Any] = {
getClass.getDeclaredFields.map( _.getName ) // all field names
.zip( productIterator.to ).toMap
}
}
| amarjanica/discourse-scala-client | src/main/scala/com/amarjanica/discourse/util/HasParameters.scala | Scala | mit | 240 |
package hello
import org.springframework.boot._
import org.springframework.boot.autoconfigure._
import org.springframework.stereotype._
import org.springframework.web.bind.annotation._
import org.springframework.context.annotation.Configuration
import org.springframework.context.annotation.ComponentScan
/**
* This... | swapniljoshi15/hello-world | src/main/scala/hello/HelloConfig.scala | Scala | mit | 643 |
package io.youi.font
import scala.concurrent.Future
case class OpenTypeFont(otf: opentype.Font) extends Font {
private var glyphs = Map.empty[Char, OpenTypeGlyph]
lazy val cached: CachedFont = new CachedFont(this)
override def glyph(char: Char): Glyph = glyphs.get(char) match {
case Some(g) => g
case ... | outr/youi | ui/js/src/main/scala/io/youi/font/OpenTypeFont.scala | Scala | mit | 1,770 |
package common.validation
import cats.data.NonEmptyList
import cats.syntax.either._
import common.Checked
object Checked {
implicit class ValidCheck[A](val obj: A) extends AnyVal {
def validNelCheck: Checked[A] = obj.asRight[NonEmptyList[String]]
}
implicit class InvalidCheck(val obj: String) extends AnyVa... | ohsu-comp-bio/cromwell | common/src/main/scala/common/validation/Checked.scala | Scala | bsd-3-clause | 403 |
package org.jetbrains.plugins.scala.lang.psi
import com.intellij.openapi.util.text.StringUtil
import com.intellij.psi.{PsiAnnotationSupport, PsiElement, PsiLiteral}
import org.jetbrains.plugins.scala.lang.psi.api.base.ScLiteral
import org.jetbrains.plugins.scala.lang.psi.impl.ScalaPsiElementFactory.createExpressionFro... | loskutov/intellij-scala | src/org/jetbrains/plugins/scala/lang/psi/ScalaAnnotationSupport.scala | Scala | apache-2.0 | 642 |
/*
* 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 | sql/core/src/test/scala/org/apache/spark/sql/execution/SQLExecutionSuite.scala | Scala | apache-2.0 | 3,528 |
/**
* Copyright 2015 Lorand Szakacs
*
* 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 ... | lorandszakacs/util-html | src/test/scala/com/lorandszakacs/util/html/HtmlProcessorTest.scala | Scala | apache-2.0 | 12,126 |
/**
* CPNetSolver
* Copyright (C) 2013 Francesco Burato, Simone Carriero
*
* This program 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 lat... | fburato/CPNetSolver | CPNetSolver/src/constraintobjs/Domain.scala | Scala | gpl-3.0 | 2,333 |
package org.senkbeil.debugger.akka.messages
import org.senkbeil.debugger.akka.messages.structures.JDIThread
case class ThreadStartMessage(
thread: Option[JDIThread] = None
) extends MessageLike
| chipsenkbeil/scala-debugger-akka | src/main/scala/org/senkbeil/debugger/akka/messages/ThreadStartMessage.scala | Scala | apache-2.0 | 198 |
package models.pcf.pcl
import scala.language.existentials
sealed trait PCLExpression extends PCLModel
case class Constant(val constant:PCLConstraintConstantAttribute[_]) extends PCLExpression
// Treat constraint attribute as variable
case class Var(val attribute:PCLConstraintComplexAttribute) extends PCLExpression
/... | shasha-amy-liu/process-constraint-framework | pcf/src/main/scala/models/pcf/pcl/PCLExpression.scala | Scala | mit | 772 |
package sms.core
import java.io.File
object Properties {
private object GetFile {
def unapply(path: String): Option[File] = {
val file = new File(path)
if (file.exists()) Some(file) else None
}
}
def parseFile[T](key: String)(action: File => T): Option[T] = {
sys.props.get(key).collect ... | kjanosz/stock-market-sherlock | core/src/main/scala/sms/core/Properties.scala | Scala | apache-2.0 | 643 |
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.