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 org.scalameta.paradise
package converters
import org.scalameta.paradise.reflect._
import scala.collection.{immutable, mutable}
import scala.collection.immutable.Seq
import scala.reflect.{classTag, ClassTag}
import scala.compat.Platform.EOL
import scala.meta.prettyprinters._
import scala.{meta => m}
trait ToMt... | olafurpg/paradise | plugin/src/main/scala/org/scalameta/paradise/converters/ToMtree.scala | Scala | bsd-3-clause | 26,505 |
/*
* Copyright (C) 2016 University of Basel, Graphics and Vision Research Group
*
* 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) an... | unibas-gravis/scalismo-ui | src/main/scala/scalismo/ui/control/interactor/landmark/complex/posterior/PosteriorReadyForCreating.scala | Scala | gpl-3.0 | 2,927 |
/* - Coeus web framework -------------------------
*
* Licensed under the Apache License, Version 2.0.
*
* Author: Spiros Tzavellas
*/
package com.tzavellas.coeus.bind
/**
* A binding or validation error.
*
* @param code the message code of the error
* @param args any arguments to be used for constructing th... | sptz45/coeus | src/main/scala/com/tzavellas/coeus/bind/Error.scala | Scala | apache-2.0 | 1,749 |
/**
*
*
*
* 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")... | flange/drift-dev | kafka/00-kafka_2.11-0.10.1.0/libs/tmp/kafka/metrics/KafkaMetricsReporter.scala | Scala | apache-2.0 | 2,823 |
package scala.in.programming.step.second
/**
* Learn function expression, it compare with Imperative Programming Language.
*
* @author loustler
* @since 01/14/2017 17:12
*/
object FunctionExpression extends App {
val strs: Array[String] = Array("Hi,", "My", "nickname", "is", "loustler")
// Imperative Pr... | loustler/scala | src/main/scala/scala/in/programming/step/second/FunctionExpression.scala | Scala | mit | 1,596 |
/*
* Copyright 2011-2014 Chris de Vreeze
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agree... | EBPI/yaidom | src/test/scala/nl/ebpi/yaidom/integrationtest/XPathInteropTest.scala | Scala | apache-2.0 | 3,812 |
/***********************************************************************
* 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-fs/geomesa-fs-storage/geomesa-fs-storage-parquet/src/test/scala/org/locationtech/geomesa/parquet/ParquetReadWriteTest.scala | Scala | apache-2.0 | 6,827 |
/*******************************************************************************
Copyright (c) 2013, S-Core.
All rights reserved.
Use is subject to license terms.
This distribution may include materials developed by third parties.
*********************************************************************... | daejunpark/jsaf | src/kr/ac/kaist/jsaf/analysis/typing/models/Tizen/TIZENDownloadRequest.scala | Scala | bsd-3-clause | 9,165 |
package controllers.application
import akka.pattern.ask
import api.ApiResponseBody
import controllers.Application
import controllers.model.RedListCounts
import controllers.model.RedListCountsJsonFormats._
import drt.server.feeds.lgw.LGWForecastXLSExtractor
import drt.server.feeds.lhr.forecast.LHRForecastCSVExtractor
i... | UKHomeOffice/drt-scalajs-spa-exploration | server/src/main/scala/controllers/application/WithImports.scala | Scala | apache-2.0 | 2,959 |
object Test {
type Histogram[X] = Map[X, Int]
type StringlyHistogram[X >: String] = Histogram[X]
val xs: Histogram[String] = Map[String, Int]()
val ys: StringlyHistogram[String] = xs
def e = xs
val zs: StringlyHistogram[_] = e
type IntMap[Y] = Map[Int, Y]
val is = Map[Int, Boolean]()
val js: ... | VladimirNik/dotty | tests/pos/partialApplications.scala | Scala | bsd-3-clause | 737 |
package hello.it
import com.github.dnvriend.aws.lambda.handler.test.ServerlessTest
import hello.Person
class PersonValidationHandlerIntegrationTest extends ServerlessTest {
def feature = Feature("Person Validation Handler") {
Scenario("Posting a Person Validation") {
When I post("/dev/personvalidation").w... | dnvriend/serverless-test | 01-hello-scala/src/test/scala/hello/it/PersonValidationHandlerIntegrationTest.scala | Scala | apache-2.0 | 441 |
/*
* Copyright (C) 2018 Lightbend Inc. <https://www.lightbend.com>
* Copyright (C) 2017-2018 Alexis Seigneurin.
*
* 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 o... | noslowerdna/kafka | streams/streams-scala/src/main/scala/org/apache/kafka/streams/scala/kstream/KStream.scala | Scala | apache-2.0 | 34,332 |
package colossus.protocols.http.streaming
import colossus.controller.{Controller, Encoding}
import colossus.core.{InitContext, PipelineHandler, ServerConnectionHandler}
import colossus.service._
class StreamingHttpServiceHandler(rh: GenRequestHandler[StreamingHttp]) extends ServiceServer[StreamingHttp](rh)
class Str... | tumblr/colossus | colossus/src/main/scala/colossus/protocols/http/streaming/StreamingHttpServer.scala | Scala | apache-2.0 | 1,107 |
/**
* Swaggy Jenkins
* Jenkins API clients generated from Swagger / Open API specification
*
* The version of the OpenAPI document: 1.1.2-pre.0
* Contact: blah@cliffano.com
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not ed... | cliffano/swaggy-jenkins | clients/scala-httpclient-deprecated/generated/src/main/scala/org/openapitools/client/model/FreeStyleBuild.scala | Scala | mit | 1,081 |
package com.eclipsesource.schema
import com.eclipsesource.schema.drafts.{Version4, Version7}
import com.eclipsesource.schema.test.JsonSpec
import org.specs2.mutable.Specification
class TypeSpec extends Specification with JsonSpec {
"type draft4" in {
import Version4._
implicit val validator: SchemaValidato... | eclipsesource/play-json-schema-validator | src/test/scala/com/eclipsesource/schema/TypeSpec.scala | Scala | apache-2.0 | 549 |
package com.twitter.finagle.stats
/**
* Provides a `StatsReceiver` that prints nice summaries. Handy for
* short-lived programs where you want summaries.
*/
import com.google.common.util.concurrent.AtomicLongMap
import com.google.common.cache.{CacheBuilder, CacheLoader}
import scala.collection.JavaConverters._
imp... | travisbrown/finagle | finagle-core/src/main/scala/com/twitter/finagle/stats/SummarizingStatsReceiver.scala | Scala | apache-2.0 | 3,734 |
/* ___ _ ___ _ _ *\\
** / __| |/ (_) | | The SKilL Generator **
** \\__ \\ ' <| | | |__ (c) 2013-18 University of Stuttgart **
** |___/_|\\_\\_|_|____| see LICENSE ... | skill-lang/skill | src/main/scala/de/ust/skill/generator/csharp/api/SkillFileMaker.scala | Scala | bsd-3-clause | 3,106 |
def unit[A](a: => A): Par[A]
def get[A](a: Par[A]): A
def sum(ints: IndexedSeq[Int]): Int =
if (ints.size <= 1)
ints.headOption getOrElse 0
else {
val (l, r) = ints.splitAt(ints.length/2)
val sumL: Par[Int] = Par.unit(sum(l))
val sumR: Par[Int] = Par.unit(sum(r))
Par.g... | Tomcruseal/FunctionalLearn | fpinscala/src/main/scala/fpinScala/pars/ParType.scala | Scala | mit | 672 |
package embed.sampling
import embed.dist.Distribution
/**
* Created by takun on 01/08/2017.
*/
class MetropolisHastings(p:Distribution, q:Distribution, epoch:Int) extends DoubleSampling{
def apply() = {
var xt = 0.0
var t = 0
while( t < epoch ) {
val x = q.random
val u = r.nextDouble
... | LiteML/EmbedLib | src/main/scala/embed/sampling/MetropolisHastings.scala | Scala | apache-2.0 | 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 ... | shenbaise/mltoy | src/main/scala/org/apache/spark/examples/streaming/SqlNetworkWordCount.scala | Scala | apache-2.0 | 3,668 |
/* sbt -- Simple Build Tool
* Copyright 2008, 2009 Mark Harrah
*/
package sbt
/** The trap methods execute the provided code in a try block and handle a thrown exception.*/
object Control
{
def trap[T](errorMessagePrefix: => String, log: Logger)(execute: => Either[String, T]): Either[String, T] =
try { execute }
... | matheshar/simple-build-tool | src/main/scala/sbt/Control.scala | Scala | bsd-3-clause | 2,371 |
package com.markfeeney.circlet
import java.security.KeyStore
import scala.language.implicitConversions
import com.markfeeney.circlet.JettyOptions.{ClientAuth, SslStoreConfig}
import org.eclipse.jetty.server.Server
/**
* Options for configuring Jetty.
*
* @param join If true, calls join() on Server instance (blocki... | overthink/circlet | src/main/scala/com/markfeeney/circlet/JettyOptions.scala | Scala | mit | 3,878 |
/*
* 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 ... | sryza/spark | core/src/main/scala/org/apache/spark/rdd/PairRDDFunctions.scala | Scala | apache-2.0 | 32,256 |
/*
* 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 ... | pgandhi999/spark | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/aggregate/Min.scala | Scala | apache-2.0 | 2,264 |
package outer {
private class A() {
override def toString = "A"
}
package inner {
object Test {
def main(args: Array[String]): Unit = {
println(new A()) // now ok
}
}
}
}
object Test extends App {
outer.inner.Test.main(Array())
} | som-snytt/dotty | tests/run/i3339.scala | Scala | apache-2.0 | 274 |
package mesosphere.mesos
import com.typesafe.scalalogging.StrictLogging
import mesosphere.marathon.util.SemanticVersion
import org.apache.mesos.MesosNativeLibrary
object LibMesos extends StrictLogging {
/**
* The changelog should describe why this version is needed.
*
* **ATTENTATION**
* Make sure ... | mesosphere/marathon | src/main/scala/mesosphere/mesos/LibMesos.scala | Scala | apache-2.0 | 2,374 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | h2oai/sparkling-water | core/src/main/scala/ai/h2o/sparkling/backend/api/rdds/RDDToH2OFrame.scala | Scala | apache-2.0 | 1,616 |
/*
* Copyright 2017-2018 47 Degrees, LLC. <http://www.47deg.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 require... | frees-io/freestyle | modules/logging/jvm/src/main/scala/free/journal.scala | Scala | apache-2.0 | 743 |
package jp.co.reraku.harmony
trait Repository[ID <: Identifier[_], E <: Entity[ID], X, M[+_]] {
def resolve(id: ID)(implicit context: X): M[E]
def store(entity: E)(implicit context: X): M[E]
}
class RepositoryException(message: String) extends Exception(message)
class EntityNotFoundException(message: String) ex... | ReRaKuIMS/harmony | core/src/main/scala/jp/co/reraku/harmony/Repository.scala | Scala | mit | 355 |
/*
* 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 ... | witgo/spark | core/src/main/scala/org/apache/spark/storage/DiskBlockManager.scala | Scala | apache-2.0 | 7,006 |
package net.maffoo.jsonquote
import net.liftweb.json._
import net.maffoo.jsonquote.Macros._
import scala.language.experimental.macros
package object lift {
/**
* Rendering JValue produces valid json literal
*/
implicit class LiftToLiteralJson(val json: JValue) extends AnyVal {
def toLiteral: literal.Jso... | maffoo/jsonquote | lift/src/main/scala/net/maffoo/jsonquote/lift/package.scala | Scala | mit | 8,714 |
/**
* 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... | stealthly/kafka | core/src/main/scala/kafka/api/ConsumerMetadataRequest.scala | Scala | apache-2.0 | 3,062 |
package io.backchat.hookup
import scala.concurrent.Future
/**
* A broadcast channel represents a connection
*/
trait BroadcastChannel extends BroadcastChannelLike {
/**
* @return The connection id
*/
def id: Int
}
/**
* Broadcast channel like is either a connection or a proxy for a connection.
* It con... | backchatio/hookup | src/main/scala/io/backchat/hookup/broadcast_channel.scala | Scala | mit | 910 |
/*
* LambdaExpressionExporterTest.scala
*
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
*/
package at.logic.gapt.formats.expr.xml
import at.logic.gapt.formats.xml.HOLTermXMLExporter
import org.specs2.mutable._
import scala.xml._
import at.logic.gapt.expr.hol.... | loewenheim/gapt | src/test/scala/at/logic/gapt/formats/language/xml/HOLTermExporterTest.scala | Scala | gpl-3.0 | 8,036 |
package org.scalatra
import test.scalatest.ScalatraFunSuite
object RouteRegistryTestServlet extends ScalatraServlet {
get("/foo") { }
post("/foo/:bar") { }
put("""^/foo.../bar$""".r) { }
get("/nothing", false) { }
get(false) { }
def renderRouteRegistry: String = routes.toString
}
class RouteRegistryTest... | etorreborre/scalatra | core/src/test/scala/org/scalatra/RouteRegistryTest.scala | Scala | bsd-2-clause | 655 |
/*
* 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 ... | jiangxb1987/spark | sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/V2ScanRelationPushDown.scala | Scala | apache-2.0 | 11,666 |
/**
* Copyright (C) 2018 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 p... | brunobuzzi/orbeon-forms | form-runner/js/src/main/scala/org/orbeon/xbl/Tabbable.scala | Scala | lgpl-2.1 | 7,757 |
/* sbt -- Simple Build Tool
* Copyright 2010, 2011 Mark Harrah
*/
package object sbt extends sbt.std.TaskExtra with sbt.internal.util.Types with sbt.ProcessExtra
with sbt.internal.librarymanagement.impl.DependencyBuilders with sbt.io.PathExtra with sbt.ProjectExtra
with sbt.internal.librarymanagement.Dependen... | dansanduleac/sbt | sbt/src/main/scala/package.scala | Scala | bsd-3-clause | 1,955 |
/*
* 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/test/scala/org/apache/spark/sql/DataFrameStatSuite.scala | Scala | apache-2.0 | 8,195 |
/*
* Copyright (C) 2017 HAT Data Exchange Ltd
* SPDX-License-Identifier: AGPL-3.0
*
* This file is part of the Hub of All Things project (HAT).
*
* HAT is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License
* as published by the Free Software Founda... | Hub-of-all-Things/HAT2.0 | hat/app/org/hatdex/hat/utils/ErrorHandler.scala | Scala | agpl-3.0 | 6,934 |
package com.catinthedark.lib.records
import java.io.{File, FileWriter}
import scala.io.Source
/**
* Created by over on 23.08.15.
*/
abstract class RecordStorage[T <: Ordered[T]](val fname: String, maxSize: Int) extends Store[T] {
def withFile[U](fname: String, f: Source => U) = {
val file = new File(fname)
... | cat-in-the-dark/old48_33_game | src/main/scala/com/catinthedark/lib/records/RecordStorage.scala | Scala | mit | 910 |
/**
* Orders
* Service for processing orders
*
* OpenAPI spec version:
*
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*
* Licensed under the Apache License, Version 2.0 (the "Lic... | Compositional/orders-aws | src/main/scala/works.weave.socks.aws.orders/presentation/value/OrderCustomerAddresses.scala | Scala | apache-2.0 | 1,031 |
package controllers
import play.api._
import play.api.mvc._
import models._
import play.api.data._
import play.api.data.Forms._
import org.joda.time.DateTime
import play.api.data.validation.Constraints
//Case class specifically for handling form
case class IncidentFormTemp(title: String, description: String, incid... | larryoatmeal/Incident-Response-Manager | app/controllers/IncidentCreator.scala | Scala | apache-2.0 | 3,783 |
package com.github.tototoshi.play2.auth.social.providers.twitter
import com.github.tototoshi.play2.auth.social.core.OAuth10aController
import com.github.tototoshi.play2.auth.{ AuthConfig, Login, OptionalAuthElement }
import play.api.libs.oauth.RequestToken
trait TwitterController extends OAuth10aController
with A... | tototoshi/play2-auth | social/src/main/scala/com/github/tototoshi/play2/auth/social/providers/twitter/TwitterController.scala | Scala | apache-2.0 | 599 |
package co.theasi.plotly
sealed trait Series {
type Self <: Series
type OptionType <: SeriesOptions
val options: OptionType
def options(newOptions: OptionType): Self
}
sealed trait CartesianSeries extends Series {
type Self <: CartesianSeries
def xsAs[T : Readable]: Iterable[T] = {
this match {
... | ASIDataScience/scala-plotly-client | src/main/scala/co/theasi/plotly/Series.scala | Scala | mit | 3,068 |
package looty.model
import scala.scalajs.js
//////////////////////////////////////////////////////////////
// Copyright (c) 2013 Ben Jackman, Jeff Gomberg
// All Rights Reserved
// please contact ben@jackman.biz or jeff@cgtanalytics.com
// for licensing inquiries
// Created by bjackman @ 12/14/13 8:23 PM
///////////... | benjaminjackman/looty | looty/src/main/scala/looty/model/WeaponTypes.scala | Scala | gpl-2.0 | 4,071 |
package dispatch
// handy projections
import scala.concurrent.{ExecutionContext}
object FutureEither {
class LeftProjection[+A,+B]
(underlying: Future[Either[A,B]])(implicit executor: ExecutionContext) {
def flatMap[BB >: B,X](f: A => Future[Either[X,BB]]):
Future[Either[X,BB]] =
underlying.fla... | dispatch/reboot | core/src/main/scala/projections.scala | Scala | lgpl-3.0 | 4,349 |
/***********************************************************************
* 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... | boundlessgeo/geomesa | geomesa-fs/geomesa-fs-datastore/src/test/scala/org/locationtech/geomesa/fs/converter/ConverterDataStoreTest.scala | Scala | apache-2.0 | 5,428 |
/*
* 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 ... | hongyuhong/flink | flink-libraries/flink-table/src/test/scala/org/apache/flink/table/api/scala/stream/sql/SortTest.scala | Scala | apache-2.0 | 2,722 |
/*
Spot is a bot, implementing a subset of AIML, and some extensions.
Copyright (C) 2016 Marius Feteanu
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 o... | mariusfeteanu/spot | src/main/scala/com/spotai/state/BotContextType.scala | Scala | gpl-3.0 | 945 |
package scala.meta.internal.parsers
import scala.meta.tokens.Token
// NOTE: public methods of TokenIterator return scannerTokens-based positions
trait TokenIterator {
def next(): Unit
def prevTokenPos: Int
def tokenPos: Int
def currentIndentation: Int
def token: Token
def fork: TokenIterator
def observe... | scalameta/scalameta | scalameta/parsers/shared/src/main/scala/scala/meta/internal/parsers/TokenIterator.scala | Scala | bsd-3-clause | 438 |
/*!
* Copyright 2013-2014 Dennis Hörsch.
*
* 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 ... | dhs3000/dropwizard-scala | src/main/scala/de/dennishoersch/dropwizard/blog/view/controller/IndexController.scala | Scala | apache-2.0 | 951 |
package base64
import java.util.Arrays
/** Base64 encodings. This implementation does not support line breaks */
object Encode {
/** Encodes an array of bytes into a base64 encoded string
* which accounts for url encoding provisions */
def urlSafe[T : Input](in: T, multiline: Boolean = false) =
encodeWit... | non/base64 | src/main/scala/encode.scala | Scala | mit | 3,416 |
/**
* Copyright (c) 2014 Marco Sarti <marco.sarti at gmail.com>
*
* 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, including without limitation the rights to use,
... | elogiclab/guardbee | modules/ldap/app/com/elogiclab/guardbee/providers/ldap/LdapAuthenticator.scala | Scala | mit | 6,637 |
/*
* 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 ... | guggla/guggla | src/main/scala/guggla/AbstractSettingsProvider.scala | Scala | apache-2.0 | 2,722 |
package org.bitcoins.core.wallet.utxo
import org.bitcoins.core.currency.{CurrencyUnits, Satoshis}
import org.bitcoins.core.number.UInt32
import org.bitcoins.core.protocol.script._
import org.bitcoins.core.protocol.transaction._
import org.bitcoins.core.wallet.signer.BitcoinSigner
import org.bitcoins.crypto.{ECPrivateK... | bitcoin-s/bitcoin-s | core-test/src/test/scala/org/bitcoins/core/wallet/utxo/InputInfoTest.scala | Scala | mit | 9,210 |
package views
import java.time.format.DateTimeFormatter
import java.time.{OffsetDateTime, ZoneOffset}
import models.{CancellationStatus, CommStatus}
import scala.xml.Elem
object ViewHelper {
def formatDate(offsetDateTime: OffsetDateTime): String =
offsetDateTime
.atZoneSameInstant(ZoneOffset.UTC)
... | ovotech/comms-audit-log | app/views/ViewHelper.scala | Scala | mit | 1,511 |
package com.github.pheymann.rrt
import akka.actor.ActorSystem
import cats.free.Free
import com.github.pheymann.rrt.util.BodyAsStringComparison
import com.github.pheymann.rrt.util.ResponseComparator.{BodyComparison, ComparisonResult}
trait RefactoringTest {
def runSequential(testCase: Free[TestAction, TestResult],
... | pheymann/rest-refactoring-test | core/src/main/scala/com/github/pheymann/rrt/RefactoringTest.scala | Scala | mit | 1,940 |
// AORTA is copyright (C) 2012 Dustin Carlino, Mike Depinet, and Piyush
// Khandelwal of UT Austin
// License: GNU GPL v2
package utexas.aorta.common.algorithms
object Distance {
// In meters
private val earth_radius = 6378100.0
// Haversine formula (slow, but accurate) from
// http://www.movable-type.co.uk/... | dabreegster/aorta | utexas/aorta/common/algorithms/Distance.scala | Scala | gpl-2.0 | 1,359 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | esi-mineset/spark | resource-managers/mesos/src/main/scala/org/apache/spark/scheduler/cluster/mesos/MesosHadoopDelegationTokenManager.scala | Scala | apache-2.0 | 6,486 |
package org.infinispan.spark.examples.twitter
import java.util.Properties
import java.util.concurrent.{Executors, TimeUnit}
import org.apache.log4j.{Level, Logger}
import org.apache.spark.streaming.twitter.TwitterUtils
import org.apache.spark.streaming.{Seconds, StreamingContext}
import org.apache.spark.{SparkConf, S... | rnowling/infinispan-spark | examples/twitter/src/main/scala/org/infinispan/spark/examples/twitter/StreamConsumerScala.scala | Scala | apache-2.0 | 3,303 |
/*
* Copyright 2014 YMC. See LICENSE for details.
*/
package controllers
import play.api.mvc._
import views.html.{servers => html}
object Servers extends Controller {
def index = Action { implicit request =>
Ok(html.index())
}
} | Connexity/hannibal | app/controllers/Servers.scala | Scala | apache-2.0 | 241 |
package org.jetbrains.plugins.scala.project.migration.api
/**
* User: Dmitry.Naydanov
* Date: 07.09.16.
*/
case class SettingsDescriptor(checkBoxes: Iterable[(String, Boolean)],
comboBoxes: Iterable[(String, Iterable[String])], textFields: Iterable[(String, String)])
object Settin... | ilinum/intellij-scala | src/org/jetbrains/plugins/scala/project/migration/api/SettingsDescriptor.scala | Scala | apache-2.0 | 426 |
/**
* 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... | brunobuzzi/orbeon-forms | xforms/jvm/src/main/scala/org/orbeon/oxf/xforms/control/controls/XFormsInputControl.scala | Scala | lgpl-2.1 | 8,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 "License"); you may... | mjtieman/kafka-manager | app/kafka/manager/utils/LogkafkaAdminUtils.scala | Scala | apache-2.0 | 5,311 |
/*
* Copyright 2017 PayPal
*
* 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 ... | akara/squbs | squbs-pattern/src/main/scala/org/squbs/pattern/orchestration/impl/OPromise.scala | Scala | apache-2.0 | 6,127 |
package com.twitter.finagle.thrift
import com.twitter.finagle.stats.{ClientStatsReceiver, StatsReceiver}
import com.twitter.finagle.thrift.service.{Filterable, ServicePerEndpointBuilder}
import com.twitter.finagle.util.Showable
import com.twitter.finagle.{Client, Name, Resolver, Service, Stack}
import org.apache.thrif... | luciferous/finagle | finagle-thrift/src/main/scala/com/twitter/finagle/thrift/ThriftRichClient.scala | Scala | apache-2.0 | 14,590 |
package controllers.device
import javax.inject.Inject
import annots.ConfigProperty
import controllers.device.DeviceControllerImplicits._
import cz.jenda.pidifrky.proto.DeviceBackend.DebugReportRequest
import play.api.mvc._
import utils.helpers.{EmailHelper, GZipHelper}
/**
* @author Jenda Kolena, jendakolena@gmail.... | jendakol/pidifrky | backend/server/app/controllers/device/DeviceReportController.scala | Scala | apache-2.0 | 914 |
package nest.sparkle.time.transform
import nest.sparkle.time.protocol.IntervalParameters
import spray.json.JsObject
import nest.sparkle.util.PeriodWithZone
import scala.reflect.runtime.universe._
import scala.concurrent.ExecutionContext
import spray.json.JsonFormat
import scala.concurrent.Future
import scala.util.cont... | mighdoll/sparkle | protocol/src/main/scala/nest/sparkle/time/transform/OnOffParameters.scala | Scala | apache-2.0 | 3,862 |
package leo
import java.io.File
import leo.agents.impl.{CounterContextControlAgent, ContextControlAgent}
import leo.datastructures.blackboard.Blackboard
import leo.datastructures.blackboard.scheduler.Scheduler
import leo.datastructures.context.Context
import leo.modules._
import leo.modules.Utility._
import leo.modu... | cbenzmueller/LeoPARD | src/main/scala/leo/Main.scala | Scala | bsd-3-clause | 4,977 |
package mesosphere.marathon
package core.matcher.manager.impl
import java.time.Clock
import akka.actor.{ Actor, Cancellable, Props }
import akka.event.LoggingReceive
import akka.pattern.pipe
import com.typesafe.scalalogging.StrictLogging
import mesosphere.marathon.core.matcher.base.OfferMatcher
import mesosphere.mara... | Caerostris/marathon | src/main/scala/mesosphere/marathon/core/matcher/manager/impl/OfferMatcherManagerActor.scala | Scala | apache-2.0 | 15,512 |
/*
* 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 ... | tejasapatil/spark | core/src/main/scala/org/apache/spark/status/AppStatusStore.scala | Scala | apache-2.0 | 20,030 |
package pl.newicom.dddd.view.sql
import akka.actor.{ActorSystem, Props}
import akka.testkit.TestProbe
import com.typesafe.config.Config
import pl.newicom.dddd.actor.PassivationConfig
import pl.newicom.dddd.aggregate.AggregateRootActorFactory
import pl.newicom.dddd.eventhandling.LocalPublisher
import pl.newicom.dddd.me... | ahjohannessen/akka-ddd | view-update-sql/src/test/scala/pl/newicom/dddd/view/sql/SqlViewUpdateServiceIntegrationSpec.scala | Scala | mit | 2,725 |
/*
* 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... | jenniew/BigDL | spark/dl/src/main/scala/com/intel/analytics/bigdl/models/inception/Inception_v1.scala | Scala | apache-2.0 | 18,960 |
package io.github.chenfh5.hadoop_spark
import org.apache.spark.sql.Dataset
import org.elasticsearch.spark.sql.EsSparkSQL
import org.slf4j.LoggerFactory
import io.github.chenfh5.common.OwnConfigReader
object SparkInsert {
private val LOG = LoggerFactory.getLogger(getClass.getName)
def indexDsToEs[T](ds: Dataset... | chenfh5/test-spark-connect-es | src/main/scala/io/github/chenfh5/hadoop_spark/SparkInsert.scala | Scala | apache-2.0 | 860 |
package com.airbnb.aerosolve.training
import java.io.{BufferedReader, BufferedWriter, StringReader, StringWriter}
import com.airbnb.aerosolve.core.models.ModelFactory
import com.airbnb.aerosolve.core.ModelRecord
import com.airbnb.aerosolve.training.pipeline.PipelineTestingUtil
import com.typesafe.config.ConfigFactory... | ralic/aerosolve | training/src/test/scala/com/airbnb/aerosolve/training/DecisionTreeTrainerTest.scala | Scala | apache-2.0 | 8,333 |
/*
* Copyright (C) 2009-2017 Lightbend Inc. <https://www.lightbend.com>
*/
package play.api.libs.logback
import java.io.File
import java.net.URL
import ch.qos.logback.classic._
import ch.qos.logback.classic.joran._
import ch.qos.logback.classic.jul.LevelChangePropagator
import ch.qos.logback.core.util._
import org.... | aradchykov/playframework | framework/src/play-logback/src/main/scala/play/api/libs/logback/LogbackLoggerConfigurator.scala | Scala | apache-2.0 | 6,608 |
/*
* 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://mozilla.org/MPL/2.0/.
*/
package viper.silicon.tests
import java.nio.file.Path
import viper.silver.testing.{MissingOutput, UnexpectedO... | sccblom/vercors | viper/silicon/src/test/scala/SiliconTests.scala | Scala | mpl-2.0 | 2,832 |
package com.harrys.hyppo.coordinator
import com.harrys.hyppo.worker.api.proto.{FailureResponse, WorkerInput, WorkerResponse}
import scala.annotation.tailrec
/**
* Created by jpetty on 11/11/15.
*/
final class WorkResponseHandlerChain(handlers: List[WorkResponseHandler]) extends WorkResponseHandler {
override ... | harrystech/hyppo-worker | worker/src/main/scala/com/harrys/hyppo/coordinator/WorkResponseHandlerChain.scala | Scala | mit | 1,370 |
package controllers
import java.io._
import javax.script.{ScriptEngine, SimpleScriptContext, ScriptEngineManager}
import akka.util.Timeout
import benchmark.Reporter
import benchmark.Reporter.{EngineFinished, RequestFinished, EngineStart, RequestStart}
import com.typesafe.jse.{Node, Engine}
import com.typesafe.jse.Eng... | dribba/play-node-benchmark | app/controllers/React.scala | Scala | mit | 2,963 |
package services.documents.pdf
import java.io.{ InputStream, OutputStream }
import java.util.Base64
import com.itextpdf.text._
import com.itextpdf.text.pdf._
import org.apache.commons.io.IOUtils
import org.log4s.getLogger
import play.api.libs.json.JsValue
object PDFStamping {
private[this] val logger = getLogger
... | vetafi/vetafi-web | app/services/documents/pdf/PDFStamping.scala | Scala | apache-2.0 | 5,805 |
package mesosphere.marathon
package api.v2.json
import mesosphere.marathon.api.v2.{ AppNormalization, Validation }
import mesosphere.marathon.api.v2.validation.AppValidation
import mesosphere.marathon.core.pod.ContainerNetwork
import mesosphere.marathon.core.readiness.ReadinessCheckTestHelper
import mesosphere.maratho... | guenter/marathon | src/test/scala/mesosphere/marathon/api/v2/json/AppDefinitionFormatsTest.scala | Scala | apache-2.0 | 22,821 |
import sbt._
import com.typesafe.sbt.SbtScalariform
import com.typesafe.sbt.SbtScalariform.ScalariformKeys
import com.typesafe.sbt.SbtScalariform._
import scalariform.formatter.preferences._
object Formatting {
lazy val formatSettings = SbtScalariform.scalariformSettings ++ Seq(
ScalariformKeys.preferences in Co... | sgrouples/sbt-solr-plugin | project/Formatting.scala | Scala | apache-2.0 | 1,217 |
/*
* 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 ... | tzulitai/flink | flink-table/flink-table-planner/src/test/scala/org/apache/flink/table/api/batch/sql/JoinTest.scala | Scala | apache-2.0 | 8,987 |
/**
* CSPFJ - CSP solving API for Java
* Copyright (C) 2006 Julien VION
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your op... | concrete-cp/concrete | src/main/scala/concrete/constraint/extension/ReduceableExt.scala | Scala | lgpl-2.1 | 3,433 |
/*
* 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 ... | Panos-Bletsos/spark-cost-model-optimizer | sql/core/src/test/scala/org/apache/spark/sql/streaming/StreamingQuerySuite.scala | Scala | apache-2.0 | 20,842 |
package coursier.cli.publish.conf
import argonaut._
import argonaut.Argonaut._
import coursier.core.Organization
final case class OrganizationDetails(
organization: Option[Organization],
url: Option[String]
)
object OrganizationDetails {
val empty = OrganizationDetails(None, None)
implicit val decoder: Dec... | alexarchambault/coursier | modules/cli/src/main/scala/coursier/cli/publish/conf/OrganizationDetails.scala | Scala | apache-2.0 | 933 |
package wdltool.graph
import java.nio.file.{Files, Paths}
import java.util.concurrent.atomic.AtomicInteger
import cats.derived.monoid._
import cats.derived.monoid.legacy._
import cats.implicits._
import wdl4s.wdl.{CallOutput, Declaration, If, Scatter, WdlCall, WdlGraphNode, _}
import scala.collection.JavaConverters.... | broadinstitute/wdltool | src/main/scala/wdltool/graph/GraphPrint.scala | Scala | bsd-3-clause | 3,582 |
package net.liftmodules.staticsitemap
import net.liftweb.sitemap.{NormalLocPath, Loc}
import net.liftweb.common.{Empty, Box}
import net.liftweb.sitemap.Loc.LocParam
import net.liftweb.util.NamedPartialFunction
import net.liftweb.sitemap.Menu.ParamsMenuable
import net.liftmodules.staticsitemap.path.PathUtils._
import n... | jeffmay/lift-staticsitemap | src/main/scala/net/liftmodules/staticsitemap/ParamsRoute.scala | Scala | apache-2.0 | 4,709 |
/*
* 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... | asorianostratio/incubator-toree | pyspark-interpreter/src/main/scala/org/apache/toree/magic/builtin/PySpark.scala | Scala | apache-2.0 | 2,283 |
/*
* MkDoubleVector.scala
* (FScape)
*
* Copyright (c) 2001-2022 Hanns Holger Rutz. All rights reserved.
*
* This software is published under the GNU Affero General Public License v3+
*
*
* For further information, please contact Hanns Holger Rutz at
* contact@sciss.de
*/
package de.sciss.fscape.lucre... | Sciss/FScape-next | lucre/shared/src/main/scala/de/sciss/fscape/lucre/graph/MkDoubleVector.scala | Scala | agpl-3.0 | 2,481 |
/**
* Copyright (c) 2012-2013, Tomasz Kaczmarzyk.
*
* This file is part of BeanDiff.
*
* BeanDiff is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your o... | tkaczmarzyk/beandiff | src/main/scala/org/beandiff/lcs/LcsGridGenerator.scala | Scala | lgpl-3.0 | 1,936 |
package io.estatico.confide
import scala.annotation.StaticAnnotation
/**
* Type macro annotation which tries to automatically derive an instance
* of `FromConfObj` from the annotated type's `shapeless.LabelledGeneric` instance. The
* macro will define the `FromConfObj` instance in the companion object of the
* an... | estatico/confide | macros/src/main/scala/io/estatico/confide/Conf.scala | Scala | apache-2.0 | 859 |
package com.typesafe.stylus
import akka.actor.ActorRef
import akka.pattern.ask
import java.io.File
import spray.json._
import akka.util.Timeout
import scala.concurrent.{ExecutionContext, Future}
import com.typesafe.jse.Engine
import com.typesafe.jse.Engine.JsExecutionResult
import scala.util.control.NonFatal
/*
* Th... | jamesward/sbt-stylus | src/main/scala/com/typesafe/stylus/StylusCompiler.scala | Scala | apache-2.0 | 6,840 |
/*
* Scala.js (https://www.scala-js.org/)
*
* Copyright EPFL.
*
* Licensed under Apache License 2.0
* (https://www.apache.org/licenses/LICENSE-2.0).
*
* See the NOTICE file distributed with this work for
* additional information regarding copyright ownership.
*/
package scala.scalajs.js
import scala.languag... | scala-js/scala-js | library/src/main/scala-new-collections/scala/scalajs/js/WrappedArray.scala | Scala | apache-2.0 | 3,177 |
/*
* 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/PruneFileSourcePartitions.scala | Scala | apache-2.0 | 3,127 |
package glint.messages.server.response
/**
* A response containing longs
*
* @param values The response values
*/
private[glint] case class ResponseRowsLong(values: Array[Array[Long]], columns: Int) extends Response
| rjagerman/glint | src/main/scala/glint/messages/server/response/ResponseRowsLong.scala | Scala | mit | 225 |
/*
* 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 ... | cbickel/openwhisk | tests/src/test/scala/org/apache/openwhisk/core/containerpool/mesos/test/MesosContainerFactoryTest.scala | Scala | apache-2.0 | 10,235 |
package io.iohk.ethereum.utils
object VersionInfo {
/** Produce a node name that get sent in `WireProtocol.Hello.clientId` according to Ethereum conventions.
*
* Check out examples on https://etcnodes.org
*
* e.g.
* - mantis/v3.0-cd5ae33/linux-amd64/ubuntu-openjdk64bitservervm-java-11.0.9
* ... | input-output-hk/etc-client | src/main/scala/io/iohk/ethereum/utils/VersionInfo.scala | Scala | mit | 1,442 |
/*
* Copyright 2006-2011 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... | pbrant/framework | persistence/mapper/src/main/scala/net/liftweb/mapper/MappedTextarea.scala | Scala | apache-2.0 | 1,494 |
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.