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 |
|---|---|---|---|---|---|
//
// Copyright 2014-2020 Paytronix Systems, 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 ... | paytronix/utils-open | interchange/base/src/main/scala/com/paytronix/utils/interchange/base/container.scala | Scala | apache-2.0 | 4,273 |
import sbt.io.Path._
import sbt._
import Keys._
object Transform {
lazy val transformSources = TaskKey[Seq[File]]("transform-sources")
lazy val inputSourceDirectories = SettingKey[Seq[File]]("input-source-directories")
lazy val inputSourceDirectory = SettingKey[File]("input-source-directory")
lazy val inputSou... | Duhemm/sbt | project/Transform.scala | Scala | bsd-3-clause | 4,430 |
class C {
def xx(verb: String, a: Array[Int]): Unit = {
val reYYYY = """(\d\d\d\d)""".r
verb match {
case "time" if a.isEmpty =>
case "time" =>
case reYYYY(y) =>
}
}
}
| scala/scala | test/files/pos/t9855.scala | Scala | apache-2.0 | 217 |
package demo.test
import java.net.InetAddress
import akka.actor.{Props, Actor, ActorSystem}
import com.persist.logging._
import logging_demo.BuildInfo
import scala.concurrent.duration._
import scala.language.postfixOps
import scala.concurrent.Await
object DemoActor {
def props() = Props(new DemoActor())
}
class D... | nestorpersist/logging | demo/src/main/scala/demo/test/ActorDemo.scala | Scala | apache-2.0 | 1,171 |
package org.powlab.jeye.tests
import org.powlab.jeye.tests.advent._
import org.powlab.jeye.decompile._
import scala.collection.mutable.ArrayBuffer
package advent {
class Eg1Test extends DecompileTestClass(classOf[Eg1]) {}
class Eg2Test extends DecompileTestClass(classOf[Eg2], false, ArrayBuffer(("intint3=", "re... | powlab/jeye | src/test/scala/org/powlab/jeye/tests/AdventTests.scala | Scala | apache-2.0 | 483 |
/***
* Excerpted from "Seven Concurrency Models in Seven Weeks",
* published by The Pragmatic Bookshelf.
* Copyrights apply to this code. It may not be used to create training material,
* courses, books, articles, and the like. Contact us if you are in doubt.
* We make no guarantees that this code is fit for any ... | XBOOS/concurrency | code/ActorsScala/WordCountMultipleCounters/src/main/scala/com/paulbutcher/Accumulator.scala | Scala | gpl-2.0 | 884 |
/* Copyright 2009-2016 EPFL, Lausanne */
object IfExpr2 {
def foo(): Int = {
var a = 1
var b = 2
if(a < b) {
a = a + 3
b = b + 2
a = a + b
}
a
} ensuring(_ == 0)
}
| regb/leon | src/test/resources/regression/verification/xlang/invalid/IfExpr2.scala | Scala | gpl-3.0 | 209 |
package ch.epfl.bluebrain.nexus.iam.acls
import java.time.Instant
import ch.epfl.bluebrain.nexus.iam.config.AppConfig.HttpConfig
import ch.epfl.bluebrain.nexus.iam.config.Contexts._
import ch.epfl.bluebrain.nexus.iam.types.Identity
import ch.epfl.bluebrain.nexus.iam.types.Identity.Subject
import ch.epfl.bluebrain.nex... | hygt/nexus-iam | src/main/scala/ch/epfl/bluebrain/nexus/iam/acls/AclEvent.scala | Scala | apache-2.0 | 3,838 |
package charactor.core.messages
class ProvideVisibilityRangeMessage(val timeScale: Double)
{
}
| PiotrTrzpil/charactor | src/charactor/core/messages/ProvideVisibilityRangeMessage.scala | Scala | apache-2.0 | 97 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | bravo-zhang/spark | sql/core/src/main/scala/org/apache/spark/sql/expressions/UserDefinedFunction.scala | Scala | apache-2.0 | 3,367 |
package cromwell.util
import javax.crypto.Cipher
import cromwell.core.{SecretKey, Aes256Cbc}
import org.scalatest.{Assertions, FlatSpec, Matchers}
object EncryptionSpec {
import Assertions._
def assumeAes256Cbc() = assume(
Cipher.getMaxAllowedKeyLength(Aes256Cbc.encryption) >= Aes256Cbc.keySize,
"""|
... | cowmoo/cromwell | engine/src/test/scala/cromwell/util/EncryptionSpec.scala | Scala | bsd-3-clause | 1,176 |
/*
* Copyright © 2015 Reactific Software LLC. All Rights Reserved.
*
* 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 us... | reactific/RxMongo | messages/src/main/scala/rxmongo/messages/Message.scala | Scala | mit | 21,665 |
package services.sitedata
import javax.inject._
import scala.concurrent.Future
import utils.Awaits
import models.sitedata.SiteInfoAccessMail
import dao.sitedata.SiteInfoAccessMailDao
import dao.sitedata.ISiteInfoAccessMailDao
trait ISiteInfoAccessMailService extends BaseService[SiteInfoAccessMail]{
def insert(sitei... | tnddn/iv-web | portal/rest-portal/app/services/sitedata/SiteInfoAccessMailService.scala | Scala | apache-2.0 | 2,087 |
/*
* 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... | liquidarmour/ct-calculations | src/test/scala/uk/gov/hmrc/ct/accounts/frs102/boxes/AC117Spec.scala | Scala | apache-2.0 | 1,850 |
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you ... | manuzhang/incubator-gearpump | streaming/src/main/scala/org/apache/gearpump/streaming/dsl/api/functions/SerializableFunction.scala | Scala | apache-2.0 | 1,297 |
/*
* Copyright 2007-2010 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... | jeppenejsum/liftweb | framework/lift-base/lift-util/src/test/scala/net/liftweb/util/BindHelpersSpec.scala | Scala | apache-2.0 | 10,202 |
package com.arcusys.valamis.persistence.impl.scorm.schema
import com.arcusys.valamis.persistence.common.DbNameUtils._
import com.arcusys.valamis.persistence.common.{LongKeyTableComponent, SlickProfile, TypeMapper}
import com.arcusys.valamis.persistence.impl.scorm.model.SequencingTrackingModel
import com.arcusys.valami... | igor-borisov/valamis | valamis-slick-persistence/src/main/scala/com/arcusys/valamis/persistence/impl/scorm/schema/SequencingTrackingTableComponent.scala | Scala | gpl-3.0 | 1,535 |
/*
* 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 ... | bwsw/sj-platform | core/sj-common/src/main/scala/com/bwsw/sj/common/dal/model/service/RestServiceDomain.scala | Scala | apache-2.0 | 1,768 |
/*
* 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 ... | duynguyen/incubator-openwhisk | common/scala/src/main/scala/whisk/core/entity/ActivationResult.scala | Scala | apache-2.0 | 9,896 |
/* Copyright 2012-2016 Micronautics Research 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 applicable... | mslinn/awslib_scala | src/main/scala/com/micronautics/aws/IAM.scala | Scala | mit | 6,559 |
/*
* 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... | intel-analytics/BigDL | scala/dllib/src/main/scala/com/intel/analytics/bigdl/dllib/utils/tf/loaders/Rint.scala | Scala | apache-2.0 | 1,207 |
package com.twitter.scrooge.goldfile
import com.twitter.scrooge.backend.CocoaGeneratorFactory
class CocoaGoldFileTest extends GoldFileTest {
protected def language: String = CocoaGeneratorFactory.language
}
| twitter/scrooge | scrooge-generator-tests/src/test/scala/com/twitter/scrooge/goldfile/CocoaGoldFileTest.scala | Scala | apache-2.0 | 213 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | tophua/spark1.52 | sql/core/src/test/scala/org/apache/spark/sql/execution/TungstenSortSuite.scala | Scala | apache-2.0 | 4,444 |
package progfun
class Coffee {
val prezzo = 1.0
}
class CartaCredito {
def charge(p: Double): Option[Double] =
if (Math.random() > 0.5) {
val totale = p * (1.05)
println(s"Pagato $totale euro tramite carta di credito")
Some(totale)
} else {
println("Pagamento non riuscito")
N... | midthegap/progfun | src/main/scala/progfun/App.scala | Scala | apache-2.0 | 848 |
package im.mange.driveby
trait SpecificationAware {
def specification: Specification
//TODO: why arent these List[Function1[Specification, Unit]]?
def beforeSpecification: List[Function0[Unit]] = Nil
def afterSpecification: List[Function0[Unit]] = Nil
final def doBeforeSpecification() { beforeSpecification... | alltonp/driveby | src/main/scala/im/mange/driveby/SpecificationAware.scala | Scala | apache-2.0 | 416 |
import java.io._
class Account{
var balance = 100.0
}
trait Logger{
def log(msg: String)
def info(msg: String){log("INFO: " + msg)}
def warn(msg: String){log("WARN: " + msg)}
}
trait FileLogger extends Logger{
val filename: String
lazy val out = new PrintStream(filename) //PrintWriter
... | PengLiangWang/Scala | Class/traitTest/TraitTest4.scala | Scala | gpl-3.0 | 1,324 |
package org.jetbrains.plugins.scala.lang.psi.impl.expr
import com.intellij.lang.ASTNode
import org.jetbrains.plugins.scala.lang.psi.ScalaPsiElementImpl
import org.jetbrains.plugins.scala.lang.psi.api.expr._
/**
* @author Alexander Podkhalyuzin
* Date: 06.03.2008
*/
class ScTryBlockImpl(node: ASTNode) extends ScalaP... | gtache/intellij-lsp | intellij-lsp-dotty/src/org/jetbrains/plugins/scala/lang/psi/impl/expr/ScTryBlockImpl.scala | Scala | apache-2.0 | 404 |
package pt.tecnico.dsi.akkastrator
import scala.Proxy.Typed
sealed trait Id extends Any with Typed[Long]
final class DeliveryId(val self: Long) extends AnyVal with Id {
override def toString: String = s"DeliveryId($self)"
}
final class CorrelationId(val self: Long) extends AnyVal with Ordered[CorrelationId] with Id... | ist-dsi/akkastrator | src/main/scala/pt/tecnico/dsi/akkastrator/Ids.scala | Scala | mit | 660 |
package dvla.common.microservice
import java.text.SimpleDateFormat
import java.util.Date
import akka.actor.{Actor, ActorContext}
import akka.event.LoggingAdapter
import dvla.common.microservice.AccessLogging.dateFormat
import dvla.common.microservice.HttpHeaders.{`Tracking-Id`, `X-Real-Ip`}
import spray.http.HttpHead... | dvla/vehicles-services-common | src/main/scala/dvla/common/microservice/AccessLogging.scala | Scala | mit | 3,277 |
package de.uni_potsdam.hpi.coheel.debugging
object ObjectSize {
def main(args: Array[String]): Unit = {
determineMemorySizeUsingInstrumentation()
}
private def determineMemorySizeUsingInstrumentation(): Unit = {
// One can also determine the object size by instrumentation.
// However, as this is more compli... | stratosphere/coheel | src/main/scala/de/uni_potsdam/hpi/coheel/debugging/ObjectSize.scala | Scala | apache-2.0 | 711 |
/*
* Copyright 2013-2015 Websudos, Limited.
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* - Redistributions of source code must retain the above copyright notice,
* this list of c... | analytically/phantom | phantom-dsl/src/main/scala/com/websudos/phantom/builder/query/ExecutableQuery.scala | Scala | bsd-2-clause | 7,563 |
import java.net.InetSocketAddress
import java.util.concurrent.TimeUnit
import com.flashbird.http.framework.{RoutersPool, HttpService}
import com.twitter.finagle.builder.ServerBuilder
import com.twitter.finagle.httpx.{Http}
import com.twitter.util.Duration
/**
* Created by yangguo on 15/10/10.
*/
object StarHellowor... | guoyang2011/flashbird | src/test/scala-2.10/StarHelloworld.scala | Scala | apache-2.0 | 657 |
package repositories.storage.dao
import com.google.inject.Inject
import models.storage.event.move.MoveObject
import no.uio.musit.MusitResults.{
MusitDbError,
MusitResult,
MusitSuccess,
MusitValidationError
}
import no.uio.musit.models.ObjectTypes.ObjectType
import no.uio.musit.models.{EventId, MuseumId, Object... | MUSIT-Norway/musit | service_backend/app/repositories/storage/dao/LocalObjectDao.scala | Scala | gpl-2.0 | 3,078 |
/*
* Copyright (C) 2009-2018 Lightbend Inc. <https://www.lightbend.com>
*/
package play.api
import java.io._
import akka.actor.{ ActorSystem, CoordinatedShutdown }
import akka.stream.{ ActorMaterializer, Materializer }
import javax.inject.{ Inject, Singleton }
import play.api.ApplicationLoader.DevContext
import pl... | Shenker93/playframework | framework/src/play/src/main/scala/play/api/Application.scala | Scala | apache-2.0 | 15,341 |
/*
* 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 ... | shaoxuan-wang/flink | flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/plan/nodes/physical/batch/BatchExecIntermediateTableScan.scala | Scala | apache-2.0 | 1,649 |
package xyz.jmullin.drifter.entity
import com.badlogic.gdx.InputProcessor
import com.badlogic.gdx.utils.viewport.Viewport
import xyz.jmullin.drifter.enrich.RichGeometry
import RichGeometry._
/**
* Abstracts a renderable layer of the screen with some viewport. Generally layers will create
* entities as children to ... | JustinMullin/drifter | src/main/scala/xyz/jmullin/drifter/entity/Layer.scala | Scala | mit | 753 |
package rpgboss.editor
import java.awt.Toolkit
import java.io._
import java.util.Scanner
import java.awt.Desktop
import java.net.URL
import scala.collection.JavaConversions._
import scala.swing._
import javax.swing.ImageIcon
import rpgboss.editor.Internationalized._
import rpgboss.editor.dialog.ExportDialog
import rpg... | toastythought/rpgboss | editor/src/main/scala/rpgboss/editor/ProjectPanel.scala | Scala | agpl-3.0 | 7,032 |
/*******************************************************************************
* Copyright 2017 Capital One Services, LLC and Bitwise, 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... | capitalone/Hydrograph | hydrograph.engine/hydrograph.engine.spark/src/main/scala/hydrograph/engine/spark/components/platform/BaseComponentParams.scala | Scala | apache-2.0 | 2,759 |
package com.twitter.finagle.ssl
/**
* ApplicationProtocols represent the prioritized list of Application-Layer Protocol
* Negotiation (ALPN) or Next Protocol Negotiation (NPN) values that a configured TLS
* [[Engine]] should support.
*
* @note Currently supported values include IANA Registered Application-Layer P... | twitter/finagle | finagle-core/src/main/scala/com/twitter/finagle/ssl/ApplicationProtocols.scala | Scala | apache-2.0 | 3,583 |
/*
* 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 swave.core.macros
private[macros] trait ConnectFanInAndSealWith { this: Util =>
val c: scala.reflec... | sirthias/swave | core-macros/src/main/scala/swave/core/macros/ConnectFanInAndSealWith.scala | Scala | mpl-2.0 | 1,547 |
package shredzzz.kirkwood.cumath.tensor.modules
import shredzzz.kirkwood.cumath.CuValue
import shredzzz.kirkwood.cumath.tensor.{CuMatrix, CuVector, CuTensor}
import shredzzz.kirkwood.driver.{CuKernels, CuModule}
trait FunctionModule[V, TT[X] <: CuTensor[X, _, TT]] extends KernelModule[V] with ElementModule[V] with Te... | shredzzz/kirkwood | src/main/scala/shredzzz/kirkwood/cumath/tensor/modules/FunctionModule.scala | Scala | apache-2.0 | 2,728 |
/******************************************************************************
Copyright (c) 2012-2013, KAIST, S-Core.
All rights reserved.
Use is subject to license terms.
This distribution may include materials developed by third parties.
**********************************************************... | darkrsw/safe | src/main/scala/kr/ac/kaist/jsaf/shell/CoverageMain.scala | Scala | bsd-3-clause | 1,653 |
package com.rasterfoundry.database
import com.rasterfoundry.database.Implicits._
import com.rasterfoundry.database.util.Cache
import com.rasterfoundry.datamodel.PageRequest
import com.rasterfoundry.datamodel._
import cats.effect.LiftIO
import cats.implicits._
import doobie._
import doobie.implicits._
import doobie.im... | raster-foundry/raster-foundry | app-backend/db/src/main/scala/ProjectLayerDao.scala | Scala | apache-2.0 | 6,530 |
package factory
import body.{Body, BodyOptionSetters, BodyOptions, BodyOptions$}
import geometry.Vector
import scala.scalajs.js
import scala.scalajs.js.annotation.JSGlobal
import scala.scalajs.js.|
import org.querki.jsext.{JSOptionBuilder, JSOptionSetter, OptMap, noOpts}
/**
* Created by Dan on 3/24/2017.
*/
@j... | kramer425/matter-scala-js | src/main/scala/factory/Bodies.scala | Scala | mit | 2,175 |
/*
* Copyright 2019 CJWW Development
*
* 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... | cjww-development/auth-service | app/services/RegisterService.scala | Scala | apache-2.0 | 2,367 |
package views.html.b4.my
package object vertical {
import views.html.b4._
import play.twirl.api.Html
import play.api.mvc.Call
import play.api.i18n.Messages
import views.html.helper._
/**
* Declares the class for the Vertical FieldConstructor.
*/
class VerticalFieldConstructor extends B4FieldConst... | mkurz/play-bootstrap3 | play25-bootstrap4/sample/app/views/b4/my/vertical/package.scala | Scala | apache-2.0 | 1,844 |
package fr.hmil.roshttp.node.http
import scala.scalajs.js
private[roshttp] trait AgentOptions extends js.Object {
val keepAlive: Boolean
val keepAliveMsecs: Integer
val maxSockets: Integer
val maxFreeSockets: Integer
}
private[roshttp] object AgentOptions {
/**
*
* @param keepAlive Keep sockets a... | hmil/RosHTTP | js/src/main/scala/fr/hmil/roshttp/node/http/AgentOptions.scala | Scala | mit | 1,416 |
package net.sansa_stack.inference.spark.conformance
import com.holdenkarau.spark.testing.SharedSparkContext
import net.sansa_stack.inference.spark.forwardchaining.triples.{ForwardRuleReasoner, ForwardRuleReasonerOWLHorst}
import org.scalatest.Suite
/**
* Test context to share an OWL Horst reasoner.
*
* @author ... | SANSA-Stack/SANSA-RDF | sansa-inference/sansa-inference-spark/src/test/scala/net/sansa_stack/inference/spark/conformance/SharedOWLHorstReasonerContext.scala | Scala | apache-2.0 | 697 |
/*
* This software is licensed under the GNU Affero General Public License, quoted below.
*
* This file is a part of PowerAPI.
*
* Copyright (C) 2011-2016 Inria, University of Lille 1.
*
* PowerAPI is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public Lice... | Spirals-Team/powerapi | powerapi-core/src/main/scala/org/powerapi/module/SensorChannel.scala | Scala | agpl-3.0 | 2,391 |
/*
* 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 ... | alec-heif/MIT-Thesis | spark-bin/examples/src/main/scala/org/apache/spark/examples/ml/IsotonicRegressionExample.scala | Scala | mit | 1,879 |
package net.hearthstats.util
import java.awt.Desktop
import java.net.URI
import java.io.IOException
import net.hearthstats.Main
object Browse {
def apply(url: String): Unit =
try {
Desktop.getDesktop.browse(new URI(url))
} catch {
case e1: IOException =>
Main.showErrorDialog("Error launc... | HearthStats/HearthStats.net-Uploader | companion/src/main/scala/net/hearthstats/util/Browse.scala | Scala | bsd-3-clause | 361 |
package au.com.agiledigital.toolform.model
import au.com.agiledigital.toolform.util.ConfigHelpers.handleErrorWithEither
import au.com.agiledigital.toolform.util.StringUtil
import enumeratum.{Enum, EnumEntry}
import pureconfig._
import scala.collection.immutable.IndexedSeq
/**
* Defines a port mapping between two p... | agiledigital/toolform | src/main/scala/au/com/agiledigital/toolform/model/PortMapping.scala | Scala | apache-2.0 | 2,854 |
package im.actor.server.push
import scala.concurrent._
import scala.concurrent.duration._
import akka.actor._
import akka.util.Timeout
import org.joda.time.DateTime
import im.actor.api.rpc.codecs.UpdateBoxCodec
import im.actor.api.rpc.messaging.UpdateMessageSent
import im.actor.api.rpc.sequence.{ FatSeqUpdate, SeqUp... | x303597316/actor-platform | actor-server/actor-core/src/main/scala/im/actor/server/push/UpdatesConsumer.scala | Scala | mit | 5,543 |
/*
* 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 ... | SHASHANKB/spark | core/src/test/scala/org/apache/spark/scheduler/TaskSetBlacklistSuite.scala | Scala | apache-2.0 | 8,648 |
package main
import akka.actor.ActorSystem
import spray.routing.SimpleRoutingApp
case class Order(prices: Seq[Float], quantities: Seq[Int], country: String)
object Server extends App with SimpleRoutingApp {
implicit val system = ActorSystem("my-system")
type ProcessOrder = Order => Option[Float]
// TODO Mod... | octo-technology/extreme-carpaccio | clients/scala/src/main/scala/main/Server.scala | Scala | bsd-3-clause | 1,279 |
/*
* The MIT License (MIT)
* <p>
* Copyright (c) 2018-2020
* <p>
* 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,... | amannocci/streamy | core/src/main/scala/io/techcode/streamy/util/parser/StringParser.scala | Scala | mit | 1,616 |
package epic.trees
/**
* root index is words.length
* @author dlwh
*/
case class DependencyTree[+L, +W](dependencies: IndexedSeq[(L, Int)], words: IndexedSeq[W]) {
def render : String = {
for(((label, head),dep) <- dependencies.zipWithIndex) yield {
if(head == words.length) s"ROOT(${words(dep)}-$dep)" e... | briantopping/epic | src/main/scala/epic/trees/DependencyTree.scala | Scala | apache-2.0 | 1,209 |
package com.goyeau.kubernetes.client.util
import java.io.{ByteArrayInputStream, File, FileInputStream, InputStreamReader}
import java.security.cert.{CertificateFactory, X509Certificate}
import java.security.{KeyStore, SecureRandom, Security}
import java.util.Base64
import com.goyeau.kubernetes.client.KubeConfig
import... | joan38/kubernetes-client | kubernetes-client/src/com/goyeau/kubernetes/client/util/SslContexts.scala | Scala | apache-2.0 | 4,556 |
/**
* ____ __ ____ ____ ____,,___ ____ __ __ ____
* ( _ \\ /__\\ (_ )(_ _)( ___)/ __) ( _ \\( )( )( _ \\ Read
* ) / /(__)\\ / /_ _)(_ )__) \\__ \\ )___/ )(__)( ) _ < README.txt
* (_)\\_)(__)(__)(____)(____)(____)(___/ (__) (______)(____/ LICENSE.txt
**/
... | razie/wikireactor | diesel/src/main/scala/razie/diesel/exec/EEMemDb.scala | Scala | apache-2.0 | 6,106 |
/*
* 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... | JerryYanWan/BigDL | spark/dl/src/main/scala/com/intel/analytics/bigdl/nn/LookupTable.scala | Scala | apache-2.0 | 10,224 |
package com.mildlyskilled.protocol
import akka.actor.ActorRef
object Server {
sealed trait State
case object Idle extends State
case object Active extends State
sealed trait Data
case class Channels(channels: List[ActorRef]) extends Data
}
| mildlyskilled/sIRC | src/main/scala/com/mildlyskilled/protocol/Server.scala | Scala | mit | 259 |
package com.twitter.finagle.netty4.param
import com.twitter.concurrent.NamedPoolThreadFactory
import com.twitter.finagle.Stack
import com.twitter.finagle.netty4.numWorkers
import com.twitter.finagle.util.BlockingTimeTrackingThreadFactory
import io.netty.channel.EventLoopGroup
import io.netty.channel.nio.NioEventLoopGr... | spockz/finagle | finagle-netty4/src/main/scala/com/twitter/finagle/netty4/param/WorkerPool.scala | Scala | apache-2.0 | 1,778 |
def foo(x: Array[String]) = x match {
case _: Array[_] =>
}
def bar(x: Array[String]) = x match {
case _: Array[_ <: Int] =>
} | som-snytt/dotty | tests/patmat/i6197d.scala | Scala | apache-2.0 | 131 |
package japgolly.scalajs.react.util
import japgolly.scalajs.react.util.Util.identityFn
import scala.annotation.tailrec
import scala.scalajs.js
import scala.util.Try
trait Effect[F[_]] extends Monad[F] {
def delay [A] (a: => A) : F[A]
def handleError[A, AA >: A](fa: => F[A])(... | japgolly/scalajs-react | util/src/main/scala/japgolly/scalajs/react/util/Effect.scala | Scala | apache-2.0 | 9,843 |
// These are meant to be typed into the REPL. You can also run
// scala -Xnojline < repl-session.scala to run them all at once.
val names = List("Peter", "Paul", "Mary")
names.map(_.toUpperCase) // List("PETER", "PAUL", "MARY")
for (n <- names) yield n.toUpperCase
def ulcase(s: String) = Vector(s.toUpperCase(), s.t... | yeahnoob/scala-impatient-2e-code | src/ch13/sec08/repl-session.scala | Scala | gpl-3.0 | 452 |
package com.asto.dop.streamprocessor.process
import com.asto.dop.core.CoreModel
import com.asto.dop.streamprocessor.DOPContext
import org.apache.commons.pool2.impl.GenericObjectPoolConfig
import org.apache.spark.Logging
import org.apache.spark.rdd.RDD
import redis.clients.jedis.JedisPool
object RedisProcessor extends... | zj-lingxin/dop | source/stream-processor/src/main/scala/com/asto/dop/streamprocessor/process/RedisProcessor.scala | Scala | mit | 1,091 |
package org.jetbrains.plugins.scala.failed.decompiler
import com.intellij.psi.PsiDocumentManager
import org.jetbrains.plugins.scala.PerfCycleTests
import org.jetbrains.plugins.scala.base.{AssertMatches, ScalaFixtureTestCase}
import org.jetbrains.plugins.scala.util.TestUtils.ScalaSdkVersion
import org.junit.experimenta... | katejim/intellij-scala | test/org/jetbrains/plugins/scala/failed/decompiler/DecompilerHIghlightingTest.scala | Scala | apache-2.0 | 2,706 |
/*
* Copyright 2012-2014 Kieron Wilkinson.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law o... | vyadh/viper | source/src/main/scala/viper/source/Source.scala | Scala | apache-2.0 | 799 |
package java.lang
import scala.scalajs.js
private trait ScalaJSClassData[A] extends js.Object {
val name: String
val isPrimitive: scala.Boolean
val isInterface: scala.Boolean
val isArrayClass: scala.Boolean
def isInstance(obj: Object): scala.Boolean
def getFakeInstance(): Object
def getSuperclass(): C... | swhgoon/scala-js | javalib/source/src/java/lang/Class.scala | Scala | bsd-3-clause | 1,504 |
package com.arcusys.valamis.persistence.impl.slide
import com.arcusys.valamis.persistence.common.DbNameUtils._
import com.arcusys.valamis.persistence.impl.slide.schema.SlideTableComponent
import com.arcusys.valamis.slide.model.SlideSet
import com.arcusys.valamis.slide.storage.SlideSetRepository
import com.arcusys.vala... | arcusys/Valamis | valamis-slick-persistence/src/main/scala/com/arcusys/valamis/persistence/impl/slide/SlideSetRepositoryImpl.scala | Scala | gpl-3.0 | 4,945 |
package org.jetbrains.plugins.scala
package lang
package psi
package api
package toplevel
import com.intellij.openapi.util.text.StringUtil
import com.intellij.psi.{PsiClass, PsiMethod}
import org.jetbrains.plugins.scala.extensions._
import org.jetbrains.plugins.scala.lang.psi.api.statements._
import org.jetbrains.plug... | ilinum/intellij-scala | src/org/jetbrains/plugins/scala/lang/psi/api/toplevel/ScTypedDefinition.scala | Scala | apache-2.0 | 4,815 |
package doobie.hi
import doobie.enum.holdability._
import doobie.enum.transactionisolation._
import doobie.enum.fetchdirection._
import doobie.syntax.catchable.ToDoobieCatchableOps._
import doobie.free.{ connection => C }
import doobie.free.{ preparedstatement => PS }
import doobie.free.{ callablestatement => CS }
i... | wedens/doobie | core/src/main/scala/doobie/hi/resultset.scala | Scala | mit | 8,460 |
/*
* Copyright 2017 Dmytro Rashko
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed t... | dimetron/NetServer | src/main/scala/com/carmonit/server/ServerMain.scala | Scala | mit | 954 |
/**********************************************************************************************************************
* This file is part of Scrupal, a Scalable Reactive Web Application Framework for Content Management *
* ... | scrupal/scrupal | scrupal-api/src/test/scala/scrupal/api/EventHandlerSpec.scala | Scala | apache-2.0 | 1,903 |
/**
* Copyright (C) 2012 Typesafe, Inc. <http://www.typesafe.com>
*/
package org.pantsbuild.zinc.compiler
import java.io.File
import java.nio.file.attribute.BasicFileAttributes
import java.nio.file.{FileVisitResult, Files, Path, Paths, SimpleFileVisitor}
import java.util.jar.{JarEntry, JarInputStream, JarOutputStr... | tdyas/pants | src/scala/org/pantsbuild/zinc/compiler/OutputUtils.scala | Scala | apache-2.0 | 3,968 |
package hyperion
import java.util.concurrent.atomic.AtomicInteger
import java.util.concurrent.locks.ReentrantReadWriteLock
import scala.collection._
import scala.reflect.ClassTag
/**
* A collection that is limited in size and will purge the oldest items when the limit is exceeded.
* This allows for efficient mem... | mthmulders/hyperion | app/src/main/scala/hyperion/RingBuffer.scala | Scala | mit | 2,273 |
package org.jetbrains.plugins.scala
package codeInspection.collections
import org.jetbrains.plugins.scala.codeInspection.InspectionBundle
import org.jetbrains.plugins.scala.lang.psi.api.expr.ScExpression
import org.jetbrains.plugins.scala.lang.psi.impl.ScalaPsiElementFactory
import org.jetbrains.plugins.scala.codeInsp... | consulo/consulo-scala | src/org/jetbrains/plugins/scala/codeInspection/collections/SimplifiableFoldOrReduceInspection.scala | Scala | apache-2.0 | 3,399 |
package com.mdsol.mauth.scaladsl
import com.mdsol.mauth.MAuthRequest
import scala.concurrent.duration.Duration
import scala.concurrent.{ExecutionContext, Future}
trait Authenticator {
/**
* Performs the validation of an incoming HTTP request.
*
* The validation process consists of recreating the mAuth... | mdsol/mauth-java-client | modules/mauth-authenticator-scala/src/main/scala/com/mdsol/mauth/scaladsl/Authenticator.scala | Scala | mit | 963 |
package org.greencheek.spray.cache.memcached.spyconnectionfactory
import net.spy.memcached.ConnectionFactoryBuilder.{Protocol, Locator}
import net.spy.memcached._
import net.spy.memcached.transcoders.Transcoder
import org.greencheek.spray.cache.memcached.keyhashing._
import org.greencheek.spy.extensions.FastSerializin... | tootedom/spray-cache-spymemcached | src/main/scala/org/greencheek/spray/cache/memcached/spyconnectionfactory/SpyConnectionFactoryBuilder.scala | Scala | apache-2.0 | 1,871 |
package mesosphere.marathon.core.launcher
import mesosphere.marathon.MarathonSchedulerDriverHolder
import mesosphere.marathon.core.base.Clock
import mesosphere.marathon.core.launcher.impl.{ OfferProcessorImpl, TaskLauncherImpl }
import mesosphere.marathon.core.matcher.base.OfferMatcher
import mesosphere.marathon.metri... | sepiroth887/marathon | src/main/scala/mesosphere/marathon/core/launcher/LauncherModule.scala | Scala | apache-2.0 | 946 |
/*
* Part of NDLA image-api
* Copyright (C) 2017 NDLA
*
* See LICENSE
*/
package no.ndla.imageapi.model.domain
import java.awt.image.BufferedImage
import java.io.InputStream
trait ImageStream {
def contentType: String
def stream: InputStream
def fileName: String
def format: String = fileName.substring(f... | NDLANO/image-api | src/main/scala/no/ndla/imageapi/model/domain/ImageStream.scala | Scala | gpl-3.0 | 385 |
package com.programmaticallyspeaking.ncd.nashorn
import com.programmaticallyspeaking.ncd.testing.UnitTest
import org.scalatest.prop.TableDrivenPropertyChecks
class ArbitraryObjectPropertyHolderTest extends UnitTest with TableDrivenPropertyChecks {
val beanNameExtractionCases = Table(
("methodName", "propertyNa... | provegard/ncdbg | src/test/scala/com/programmaticallyspeaking/ncd/nashorn/ArbitraryObjectPropertyHolderTest.scala | Scala | bsd-3-clause | 780 |
package org.bitcoins.node
import org.bitcoins.server.BitcoinSAppConfig
import org.bitcoins.testkit.BitcoinSTestAppConfig
import org.bitcoins.testkit.node.NodeTestWithCachedBitcoindV19
import org.bitcoins.testkit.node.fixture.NeutrinoNodeConnectedWithBitcoind
import org.bitcoins.testkit.util.TorUtil
import org.scalates... | bitcoin-s/bitcoin-s | node-test/src/test/scala/org/bitcoins/node/NeutrinoUnsupportedPeerTest.scala | Scala | mit | 1,716 |
//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
/** @author John Miller
* @version 1.2
* @date Thu Aug 25 13:58:23 EDT 2011
* @see LICENSE (MIT style license file).
*/
package apps.game
import scalation.random.Randi
import scalation.util.Swap.swap
//::::::::::::::::::... | mvnural/scalation | src/main/scala/apps/game/Cards.scala | Scala | mit | 2,451 |
package s_mach.similar.impl
import scala.collection.mutable
import scala.language.higherKinds
import scala.reflect.ClassTag
import breeze.linalg._
import s_mach.similar._
object SimilarOps {
/**
* Creates a Similar[A] that calculates similarity based on concepts
* of distance, maximum distance, and the rati... | S-Mach/s_mach.similar | src/main/scala/s_mach/similar/impl/SimilarOps.scala | Scala | mit | 6,830 |
/*
* 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/amls-frontend | test/models/notifications/NotificationResponseSpec.scala | Scala | apache-2.0 | 1,331 |
package com.eevolution.context.dictionary.infrastructure.repository
import java.util.UUID
import com.eevolution.context.dictionary.domain._
import com.eevolution.context.dictionary.domain.model.LabelPrinterFunction
import com.eevolution.context.dictionary.infrastructure.db.DbContext._
import com.eevolution.utils.Pagi... | adempiere/ADReactiveSystem | dictionary-impl/src/main/scala/com/eevolution/context/dictionary/infrastructure/repository/LabelPrinterFunctionRepository.scala | Scala | gpl-3.0 | 2,983 |
package com.buysomegames.controller
import com.buysomegames.kernel.BuysomegamesServer
import com.buysomegames.test.FreshDatabase
import com.buysomegames.test.TestUtilities.readResource
import com.twitter.finagle.http.Status
import com.twitter.finatra.http.EmbeddedHttpServer
import com.twitter.inject.server.FeatureTest... | kaliy/buysomegames | src/test/scala/com/buysomegames/controller/GameControllerFeatureTest.scala | Scala | agpl-3.0 | 743 |
package slick.dbio
/** A phantom type used as the streaming result type for DBIOActions that do not support streaming.
* Note that this is a supertype of `Streaming` (and it is used in covariant position),
* so that any streaming action can be used where a non-streaming action is expected. */
sealed trait NoStream... | jkutner/slick | slick/src/main/scala/slick/dbio/NoStream.scala | Scala | bsd-2-clause | 465 |
package com.basho.riak.spark.rdd.failover
import com.basho.riak.client.core.query.Namespace
import com.basho.riak.client.core.util.HostAndPort
import com.basho.riak.stub.{RiakMessageHandler, RiakNodeStub}
import org.apache.commons.lang3.exception.ExceptionUtils
import org.apache.spark.{Logging, SparkConf, SparkContext... | basho/spark-riak-connector | connector/src/test/scala/com/basho/riak/spark/rdd/failover/AbstractFailoverOfflineTest.scala | Scala | apache-2.0 | 2,606 |
package org.vitrivr.adampro.web.controller
import com.twitter.finagle.http.Request
import com.twitter.finatra.http.Controller
import org.vitrivr.adampro.communication.RPCClient
import org.vitrivr.adampro.communication.datastructures.{RPCAttributeDefinition, RPCGenericQueryObject, RPCQueryResults}
import org.vitrivr.ad... | dbisUnibas/ADAMpro | web/src/main/scala/org/vitrivr/adampro/web/controller/AdamController.scala | Scala | mit | 12,997 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | shuangshuangwang/spark | sql/core/src/test/scala/org/apache/spark/sql/sources/BucketedReadSuite.scala | Scala | apache-2.0 | 42,054 |
package gapt.examples.hoare
import gapt.examples.Script
import gapt.expr.formula.Neg
import gapt.formats.hoare.ProgramParser
import gapt.proofs.expansion.extractInstances
import gapt.proofs.hoare.{ ForLoop, SimpleLoopProblem }
import gapt.formats.prover9.Prover9TermParserLadrStyle._
import gapt.proofs.lk.transformatio... | gapt/gapt | examples/hoare/addition.scala | Scala | gpl-3.0 | 1,439 |
package scalacl
class MapConversionTest extends BaseTest {
behavior of "map"
it should "capture simple scalars" in context {
implicit context =>
val capturedScala = 0.2f
val array = Array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9)
val clArray: CLArray[Int] = array.cl
val clResult = clArray.map((... | nativelibs4java/ScalaCL | src/test/scala/scalacl/MapConversionTest.scala | Scala | bsd-3-clause | 582 |
package com.blinkbox.books.reading.persistence
import java.net.URI
import com.blinkbox.books.reading._
import com.blinkbox.books.slick.{DatabaseComponent, H2DatabaseSupport, TablesContainer}
import com.blinkbox.books.spray.v2.Link
import com.blinkbox.books.test.{FailHelper, MockitoSyrup}
import com.blinkbox.books.tim... | blinkboxbooks/reading-service | common/src/test/scala/com/blinkbox/books/reading/persistence/DbLibraryStoreTests.scala | Scala | mit | 9,827 |
package net.ruippeixotog.scalascraper.scraper
import scala.util.matching.Regex
import org.joda.time.format._
import org.joda.time.{DateTime, DateTimeZone}
/** An object containing functions for parsing extracted content. They can be used together with the DSL `extractor`
* method or by calling `map` on a `HtmlExtr... | ruippeixotog/scala-scraper | core/src/main/scala/net/ruippeixotog/scalascraper/scraper/ContentParsers.scala | Scala | mit | 5,639 |
/*
* 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 ... | mike0sv/spark | sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/encoders/ExpressionEncoderSuite.scala | Scala | apache-2.0 | 16,549 |
package streams
import java.io.FileWriter
import dataFormats.{WikiListResult, WikiListScores}
import ratings.TfIdfRating
import spray.json.{JsArray, JsNumber, JsObject, JsString}
import util.UriUtils
/**
* Created by nico on 13/07/15.
*/
object JsonWriter {
// def createResultJson(result: Map[String, List[Strin... | Wikilist-Extraction/wikipedia-list-extraction | src/main/scala/streams/JsonWriter.scala | Scala | mit | 1,643 |
/*
* Licensed to the Programming Language and Software Methodology Lab (PLSM)
* under one or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information regarding copyright
* ownership.
* The PLSM licenses this file to You under the Apache License, Version 2.0
... | AtkinsChang/geoconvert | project/project/PlayPlugin.scala | Scala | apache-2.0 | 2,093 |
package org.jetbrains.plugins.scala.compiler
import com.intellij.execution.process._
import com.intellij.openapi.diagnostic.Logger
import com.intellij.openapi.project.Project
import com.intellij.openapi.util.Key
import com.intellij.util.io.BaseOutputReader
import org.jetbrains.jps.incremental.scala.utils.CompileServer... | JetBrains/intellij-scala | scala/scala-impl/src/org/jetbrains/plugins/scala/compiler/ProcessWatcher.scala | Scala | apache-2.0 | 4,345 |
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.