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 com.whisk.docker
import com.github.dockerjava.core.DockerClientConfig
import org.slf4j.LoggerFactory
import scala.concurrent.duration._
import scala.concurrent.{Await, ExecutionContext, Future}
trait DockerKit {
implicit val docker: Docker = new Docker(DockerClientConfig.createDefaultConfigBuilder().build(... | AdAgility/docker-it-scala | core/src/main/scala/com/whisk/docker/DockerKit.scala | Scala | mit | 2,332 |
/*
* 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 writin... | akara/squbs | squbs-unicomplex/src/test/scala/org/squbs/unicomplex/dummycubesvc/PingPongSvc.scala | Scala | apache-2.0 | 2,076 |
package seqd
object Generator {
object Id {
private[this] val workerMask = 0x000000000001F000L
private[this] val datacenterMask = 0x00000000003E0000L
private[this] val timestampMask = 0xFFFFFFFFFFC00000L
def unapply(l: Long): Option[(Long, Long, Long, Long)] =
Some(
(l & timestampM... | softprops/seqd | seqd-core/src/main/scala/Generator.scala | Scala | mit | 2,723 |
/*
* Copyright 2014–2020 SlamData Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agr... | slamdata/sbt-slamdata | plugin/src/main/scala/slamdata/SbtSlamDataPlugin.scala | Scala | apache-2.0 | 2,421 |
package gui
import javax.swing._
import java.awt.event.{InputEvent, ActionEvent, ActionListener, KeyEvent}
/** Class for creating MenuBar **/
class MenuBar extends JMenuBar with ActionListener {
/** All items in the file menu */
private val fileMenuItems: Array[String] = Array[String]("File", "Exit")
/**... | muthai/slide-desktop | src/gui/MenuBar.scala | Scala | gpl-2.0 | 2,858 |
/***********************************************************************
* Copyright (c) 2013-2016 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 is ... | mdzimmerman/geomesa | geomesa-kafka/geomesa-kafka-datastore/src/main/scala/org/locationtech/geomesa/kafka/KafkaProducerFeatureStore.scala | Scala | apache-2.0 | 5,519 |
// package benchmarks
// package cec
// package cec2013
// package niching
// import benchmarks.cec.Helper
// import benchmarks.dimension._
// import benchmarks.matrix._
// import shapeless._
// import shapeless.ops.nat.ToInt
// trait F8Params[N <: Nat] { val params: Dimension[N, Int] }
// trait F9... | cirg-up/benchmarks | src/main/scala/benchmarks/cec/cec2013/niching/Params.scala | Scala | apache-2.0 | 2,830 |
package is.hail.methods
import breeze.linalg.{*, DenseMatrix, DenseVector}
import is.hail.HailContext
import is.hail.annotations._
import is.hail.expr.ir.functions.MatrixToTableFunction
import is.hail.expr.ir.{ExecuteContext, MatrixValue, TableValue}
import is.hail.types._
import is.hail.types.physical.{PCanonicalStru... | cseed/hail | hail/src/main/scala/is/hail/methods/PCA.scala | Scala | mit | 4,513 |
/*
* Copyright 2001-2013 Artima, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agre... | travisbrown/scalatest | src/main/scala/org/scalatest/tagobjects/Disk.scala | Scala | apache-2.0 | 1,568 |
package imperial
package mocks
import collection.{mutable => mut}
import imperial.measures.Histogram
import imperial.health.{HealthCheck, HealthCheckable}
class MockArmoury extends RootArmoury {
val metricMap: mut.Map[String, Any] = mut.Map.empty
def getOrFetch[T](k: String)(v: T): T = metricMap.getOrElseUpdate(... | thecoda/scala-imperial | src/test/scala/imperial/mocks/MockArmoury.scala | Scala | apache-2.0 | 1,077 |
package org.monarchinitiative.dosdp.cli
import java.io.File
import caseapp._
import caseapp.core.Error.MalformedValue
import caseapp.core.argparser.{ArgParser, SimpleArgParser}
import com.github.tototoshi.csv.{CSVFormat, DefaultCSVFormat, TSVFormat}
import io.circe.generic.auto._
import io.circe.yaml.parser
import or... | balhoff/dosdp-scala | src/main/scala/org/monarchinitiative/dosdp/cli/Config.scala | Scala | mit | 10,589 |
// NOTE: commented out in order to avoid scope pollution for typecheckError
// package scala.meta.tests
// package api
import org.scalatest._
import org.scalameta.tests._
class PublicSuite extends FunSuite {
test("quasiquotes without import") {
assert(typecheckError("""
q"hello"
""") === "value q is n... | Dveim/scalameta | scalameta/scalameta/src/test/scala/scala/meta/tests/api/PublicSuite.scala | Scala | bsd-3-clause | 7,007 |
package mesosphere.marathon
package core.deployment.impl
import akka.Done
import akka.actor._
import akka.event.EventStream
import com.typesafe.scalalogging.StrictLogging
import mesosphere.marathon.core.deployment._
import mesosphere.marathon.core.deployment.impl.DeploymentActor.{ Cancel, Fail, NextStep }
import mesos... | natemurthy/marathon | src/main/scala/mesosphere/marathon/core/deployment/impl/DeploymentActor.scala | Scala | apache-2.0 | 7,809 |
package controllers.admin
import play.api.mvc._
import models._
import play.api.libs.json._
import play.api.libs.json.JsObject
import play.api.libs.json.JsString
import reactivemongo.bson.BSONObjectID
import scala.concurrent.{ExecutionContext, Future}
import ExecutionContext.Implicits.global
import play.modules.reacti... | soapower/soapower | app/controllers/admin/MockGroups.scala | Scala | gpl-3.0 | 3,543 |
/*
* Copyright 2022 HM Revenue & Customs
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or a... | hmrc/iht-frontend | test/iht/utils/EstateNotDeclarableHelperTest.scala | Scala | apache-2.0 | 6,690 |
package jp.hotbrain.makecsv
import java.io.{ByteArrayInputStream, ByteArrayOutputStream, OutputStream}
import java.nio.charset.StandardCharsets
import org.junit.Assert._
import org.junit.Test
/**
* Created by hidek on 2016/09/10.
*/
class XsvConvertTest {
class XsvConv(val body: String) extends EncoderIf {
... | HidekiTak/make_csv | src/test/scala/jp/hotbrain/makecsv/XsvConvertTest.scala | Scala | apache-2.0 | 1,835 |
/*
* Copyright 2016 rdbc contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agre... | rdbc-io/rdbc | rdbc-tck/src/main/scala/io/rdbc/tck/NonExistingTableSpec.scala | Scala | apache-2.0 | 3,211 |
import java.net.InetSocketAddress
import java.security.spec.{PKCS8EncodedKeySpec, X509EncodedKeySpec}
import java.security.{PrivateKey, PublicKey, KeyFactory, KeyPair}
import scala.concurrent.duration._
import akka.io.Tcp.{Write, Received}
import akka.actor.{ Actor, Props, ActorSystem }
import akka.testkit._
import ... | vimvim/AkkaTest | src/test/scala/PublishStreamTest.scala | Scala | agpl-3.0 | 3,476 |
package colossus.metrics
import org.scalatest._
import scala.concurrent.duration._
import MetricValues._
class GaugeSpec extends WordSpec with MustMatchers with BeforeAndAfterAll {
"BasicGauge" must {
"set a value" in {
val params = GaugeParams("/")
val g = new BasicGauge(params)
g.set(Some... | noikiy/colossus | colossus-metrics/src/test/scala/colossus/metrics/GaugeSpec.scala | Scala | apache-2.0 | 2,100 |
/**
* 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/XFormsUploadControl.scala | Scala | lgpl-2.1 | 13,990 |
package mybot
import scala.util.parsing.combinator._
/**
* Created by cebrian on 18/10/14.
*/
trait Parser extends JavaTokenParsers {
// Parser
lazy val parser : Parser[List[ServerMsg]] = repsep(opcode,"|")
// Server Messages
lazy val opcode : Parser[ServerMsg] = welcomeOp |
... | tonicebrian/scalatron-bot-example | src/main/scala/mybot/Parser.scala | Scala | apache-2.0 | 2,118 |
object Test:
def main(args:Array[String]):Unit =
val x1 = X.andThen(1){case x if (x%2 == 0) => x}
val x2 = Macro.mThen{case x:Int if (x%2 == 0) => x}
| dotty-staging/dotty | tests/run-macros/tasty-overload-secondargs/Test_2.scala | Scala | apache-2.0 | 160 |
/*
Copyright 2014 Twitter, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distr... | wanyifu/scaldingtest | scalding-core/src/test/scala/com/twitter/scalding/ConfigTest.scala | Scala | apache-2.0 | 2,609 |
/*
* 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/external/K8sExternalBackendClient.scala | Scala | apache-2.0 | 1,598 |
package funsets
/**
* 2. Purely Functional Sets.
*/
object FunSets {
/**
* We represent a set by its characteristic function, i.e.
* its `contains` predicate.
*/
type Set = Int => Boolean
/**
* Indicates whether a set contains a given element.
*/
def contains(s: Set, elem: Int): Boolean = s(e... | adihubba/progfun1 | progfun1-funsets/src/main/scala/funsets/FunSets.scala | Scala | mit | 2,104 |
package com.arcusys.valamis.lesson.scorm.model.manifest
/**
* A rule executed each time after an attempt on a descendant activity terminates to see if this activity needs to exit
* @param conditions Set of conditions that define whether the rule will be applied or not
*/
class ExitConditionRule(val conditions: Rul... | ViLPy/Valamis | valamis-scorm-lesson/src/main/scala/com/arcusys/valamis/lesson/scorm/model/manifest/ExitConditionRule.scala | Scala | lgpl-3.0 | 334 |
package com.github.gigurra.glasciia
import com.github.gigurra.glasciia.GameEvent.InputEvent
/**
* Created by johan on 2016-10-31.
*/
case class Act(scenes: Vector[Scene], var sceneIndex: Int = 0) extends InputEventHandler {
require(sceneIndex >= 0, s"Cannot create scene with sceneIndex < 0")
require(sceneInd... | GiGurra/glasciia | glasciia-core/src/main/scala/com/github/gigurra/glasciia/Act.scala | Scala | mit | 2,071 |
package examples.strictcontenttypes
import com.twitter.finagle.http.Method.Get
import com.twitter.finagle.http.Request
import com.twitter.finagle.http.filter.Cors
import com.twitter.finagle.http.filter.Cors.HttpFilter
import com.twitter.finagle.http.path.Root
import com.twitter.finagle.{Http, Service}
import com.twitt... | daviddenton/fintrospect | src/main/scala/examples/strictcontenttypes/StrictMultiContentTypeRoute.scala | Scala | apache-2.0 | 2,333 |
package uk.ac.ncl.openlab.intake24.services.fooddb.admin
import uk.ac.ncl.openlab.intake24.errors.{LookupError, UnexpectedDatabaseError}
import uk.ac.ncl.openlab.intake24.{NewNutrientTableRecord, NutrientTable, NutrientTableRecord}
case class SingleNutrientTypeUpdate(nutrientTableRecordId: String, newValue: Option[Do... | digitalinteraction/intake24 | FoodDataServices/src/main/scala/uk/ac/ncl/openlab/intake24/services/fooddb/admin/NutrientTablesAdminService.scala | Scala | apache-2.0 | 1,568 |
/*
* Copyright (c) 2013, Scodec
* 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 conditions a... | scodec/scodec-bits | benchmark/src/main/scala/ScodecBitsBenchmark.scala | Scala | bsd-3-clause | 6,223 |
package no.penger.crud
import unfiltered.filter.Plan.Intent
import unfiltered.filter.request.ContextPath
import unfiltered.response._
trait resources {
val whitelist = List(
"/slick-crud/crud.js",
"/slick-crud/crud.css",
"/slick-crud/3rdparty/jquery-1.11.1.min.js"
)
/* this will serve slick-cruds f... | pengerno/slick-crud | unfiltered/src/main/scala/no/penger/crud/resources.scala | Scala | apache-2.0 | 673 |
import io.gatling.core.Predef._
import io.gatling.http.Predef._
object PatientQuestionnaires {
var showFullYear = exec(http("Show year")
.get("")
.queryParam("filer", "year"))
}
| silverbullet-dk/opentele-performance-tests | src/test/scala/user-files/simulations/processes/clinician/PatientQuestionnaires.scala | Scala | apache-2.0 | 187 |
object test {
def verifyKeyword(keyword : String, source : java.io.File, pos : Int) = {
assert(keyword != null);
}
def verifyKeyword(source : java.io.File, pos : Int) =
verifyKeyword("", source, pos);
}
| lampepfl/dotty | tests/untried/neg/t520.scala | Scala | apache-2.0 | 228 |
/**
* Copyright (C) 2014 TU Berlin (peel@dima.tu-berlin.de)
*
* 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... | fschueler/sysml-benchmark | sysml-benchmark-peelextensions/src/main/scala/eu/stratosphere/benchmarks/systemml/flink/FlinkExperimentSysML.scala | Scala | apache-2.0 | 5,471 |
/*
* Copyright (c) 2013, Hidekatsu Hirose
* Copyright (c) 2013, Hirose-Zouen
* This file is subject to the terms and conditions defined in
* This file is subject to the terms and conditions defined in
* file 'LICENSE.txt', which is part of this source code package.
*/
package org.hirosezouen.hznet
imp... | chokopapashi/HZUtils1.6.x_Scala2.10.5 | src/main/scala/org/hirosezouen/hznet/HZEchoServer.scala | Scala | bsd-3-clause | 2,821 |
/*
* Copyright (c) 2014-2018 by The Monix Project Developers.
* See the project homepage at: https://monix.io
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache... | Wogan/monix | monix-tail/shared/src/test/scala/monix/tail/IterantTakeEveryNthSuite.scala | Scala | apache-2.0 | 4,419 |
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
package com.azure.cosmos.spark.diagnostics
import com.azure.cosmos.implementation.spark.OperationContext
import com.azure.cosmos.implementation.{RxDocumentServiceRequest, RxDocumentServiceResponse}
import com.azure.cosmos.m... | Azure/azure-sdk-for-java | sdk/cosmos/azure-cosmos-spark_3_2-12/src/main/scala/com/azure/cosmos/spark/diagnostics/DefaultMinimalSlf4jLogger.scala | Scala | mit | 3,036 |
/*
* Copyright 2017-2020 47 Degrees Open Source <https://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 ... | frees-io/freestyle-rpc | modules/tests/src/test/scala/higherkindness/mu/rpc/internal/metrics/MetricsOpsRegister.scala | Scala | apache-2.0 | 2,977 |
/*
* 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 ... | gioenn/xSpark | mllib/src/main/scala/org/apache/spark/ml/tuning/TrainValidationSplit.scala | Scala | apache-2.0 | 10,038 |
package com.ponkotuy.proxy
import io.lemonlabs.uri.Uri
import com.ponkotuy.intercept.Interceptor
import io.netty.buffer.ByteBuf
import io.netty.channel.ChannelHandlerContext
import io.netty.handler.codec.http.{HttpHeaders, HttpRequest}
import org.littleshoot.proxy.{HttpFilters, HttpFiltersAdapter, HttpFiltersSourceAda... | ttdoda/MyFleetGirls | client/src/main/scala/com/ponkotuy/proxy/KCFiltersSource.scala | Scala | mit | 947 |
package de.tototec.cmvn.cmdoption
import de.tototec.cmdoption.CmdCommand
import de.tototec.cmdoption.CmdOption
@CmdCommand(names = Array("--generate"), description = "Generate files based on configuration")
class GenerateCmd extends HelpAwareCmd {
@CmdOption(names = Array("--force"), description = "Generate all fi... | ToToTec/cmvn | de.tototec.cmvn/src/main/scala/de/tototec/cmvn/cmdoption/GenerateCmd.scala | Scala | apache-2.0 | 402 |
/*
* Copyright (c) 2014 Oculus Info Inc.
* http://www.oculusinfo.com/
*
* Released under the MIT License.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, includ... | aashish24/aperture-tiles | tile-generation/src/main/scala/com/oculusinfo/tilegen/graph/cluster/LouvainCore.scala | Scala | mit | 19,124 |
/* Copyright 2009-2021 EPFL, Lausanne */
package stainless
package frontends.scalac
import extraction.xlang.{trees => xt}
import scala.tools.nsc
import scala.tools.nsc._
import stainless.frontend.{ UnsupportedCodeException, CallBack }
/** Extract each compilation unit and forward them to the Compiler callback */
tr... | epfl-lara/stainless | frontends/scalac/src/main/scala/stainless/frontends/scalac/StainlessExtraction.scala | Scala | apache-2.0 | 1,229 |
package com.twitter.finagle.service
import com.twitter.finagle.stats.InMemoryStatsReceiver
import com.twitter.util.TimeConversions._
import com.twitter.util._
import com.twitter.finagle._
import com.twitter.finagle.context.Contexts
import com.twitter.finagle.tracing._
import org.mockito.ArgumentCaptor
import org.mocki... | sveinnfannar/finagle | finagle-core/src/test/scala/com/twitter/finagle/service/TimeoutFilterTest.scala | Scala | apache-2.0 | 5,662 |
/*
* Copyright 2001-2013 Artima, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agre... | dotty-staging/scalatest | scalatest-test/src/test/scala/org/scalatest/suiteprop/SuiteMatrix.scala | Scala | apache-2.0 | 3,910 |
/*
* Copyright 2012-2015 Comcast Cable Communications Management, 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 re... | derjust/money | money-http-client/src/main/scala/com/comcast/money/http/client/TraceFriendlyHttpClient.scala | Scala | apache-2.0 | 5,173 |
/*
* 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 | external/kinesis-asl/src/main/scala/org/apache/spark/streaming/kinesis/KinesisReceiver.scala | Scala | apache-2.0 | 15,548 |
/*
* Copyright 2015 Mediative
*
* 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... | jonas/sparrow | core/src/test/scala-2.11/com.mediative.sparrow/CodecLimitations211Test.scala | Scala | apache-2.0 | 906 |
/*
* 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 ... | u2009cf/spark-radar | sql/core/src/test/scala/org/apache/spark/sql/test/SQLTestUtils.scala | Scala | apache-2.0 | 11,979 |
/* Copyright 2015 Mario Pastorelli (pastorelli.mario@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... | jyt109/PureCSV | src/main/scala/purecsv/safe/tryutil/TryUtil.scala | Scala | apache-2.0 | 1,476 |
package breeze.linalg
import org.scalatest.FunSuite
/**
* TODO
*
* @author dlwh
**/
class BitVectorTest extends FunSuite {
test("Ones") {
val as = BitVector.ones(5)
val expected = BitVector(5)(0, 1, 2, 3, 4)
assert( as === expected)
}
test("Or") {
val as = BitVector(10)(1, 3, 5, 7)
val ... | crealytics/breeze | math/src/test/scala/breeze/linalg/BitVectorTest.scala | Scala | apache-2.0 | 2,342 |
package org.json4s
package native
import org.json4s.JsonAST.JField
import org.json4s.native.Document._
import org.json4s.prefs.EmptyValueStrategy
trait JsonMethods extends org.json4s.JsonMethods[Document] {
def parse[A: AsJsonInput](in: A, useBigDecimalForDouble: Boolean = false, useBigIntForLong: Boolean = true):... | json4s/json4s | native-core/shared/src/main/scala/org/json4s/native/JsonMethods.scala | Scala | apache-2.0 | 2,953 |
package almhirt.aggregates
import scalaz._, Scalaz._
import almhirt.common._
/**
* The version of an aggregate root. Used for optimistic concurrency and always starts with 0 whereas 0
* means that the aggregate root is in state [[Vacat]]
*/
final case class AggregateRootVersion(val value: Long) extends AnyVal wit... | chridou/almhirt | almhirt-common/src/main/scala/almhirt/aggregates/AggregateRootVersion.scala | Scala | apache-2.0 | 756 |
/*
* Original implementation (C) 2009-2016 Lightbend Inc. (https://www.lightbend.com).
* Adapted and extended in 2016 by Eugene Yokota
*
* 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
*... | eed3si9n/gigahorse | asynchttpclient/src/main/scala/gigahorse/support/asynchttpclient/AhcConfig.scala | Scala | apache-2.0 | 4,485 |
/*
* Copyright 2001-2005 Stephen Colebourne
*
* 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... | aparo/scalajs-joda | src/main/scala/org/joda/time/field/PreciseDurationField.scala | Scala | apache-2.0 | 4,063 |
package coursier.publish
/** All things related to checksums.
*/
package object checksum
| alexarchambault/coursier | modules/publish/src/main/scala/coursier/publish/checksum/package.scala | Scala | apache-2.0 | 92 |
package com.seanshubin.uptodate.integration
import java.io.IOException
import java.nio.charset.{Charset, StandardCharsets}
import java.nio.file._
import java.nio.file.attribute.BasicFileAttributes
import org.scalatest.{FunSuite, Matchers}
import scala.collection.mutable.ArrayBuffer
class FileSystemTest extends FunS... | SeanShubin/up-to-date | integration/src/test/scala/com/seanshubin/uptodate/integration/FileSystemTest.scala | Scala | unlicense | 3,740 |
/*
* 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 ... | alexparvulescu/bark-oak | src/main/scala/org/apache/jackrabbit/oak/bark/web/view/View.scala | Scala | apache-2.0 | 9,951 |
/*
* 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/appmaster/StreamAppMasterSummary.scala | Scala | apache-2.0 | 2,386 |
/**
* Copyright (C) 2015 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... | joansmith/orbeon-forms | src/main/scala/org/orbeon/oxf/fr/FormRunnerEmail.scala | Scala | lgpl-2.1 | 3,952 |
/*
* Copyright 2014–2017 SlamData Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agr... | drostron/quasar | yggdrasil/src/main/scala/quasar/yggdrasil/table/Slice.scala | Scala | apache-2.0 | 59,367 |
package in.thirumal.zookeeper.group
import scala.io.StdIn.readLine
/**
* Lists the members inside a ZooKeeper group
* Created by thirumal on 20/11/15.
*/
object ListGroup {
/**
* Main function
* @param args Command line arguments: ListGroup <zkHosts> <groupName>
*/
def main(args: Array[String]):... | zapstar/ZooKeeperExamples | src/main/scala/in/thirumal/zookeeper/group/ListGroup.scala | Scala | mit | 678 |
package org.homermultitext.edmodel
import org.scalatest.FlatSpec
class DeletionSpec extends FlatSpec {
"A deletion" should "keep the deleted text as a reading" in {
val example = """urn:cts:greekLit:tlg0012.tlg001.demo:24.212#<l n="212" >ανδρι <add>παρα</add> κρατὲρῳ τοῦ εγω <del>δε</del> <w part="N">μ<uncle... | homermultitext/edmodel | src/test/scala/org/homermultitext/edmodel/old/DeletionSpec.scala | Scala | gpl-3.0 | 1,689 |
package com.twitter.finagle.ssl.client
import com.twitter.finagle.{Address, SslHostVerificationException}
import com.twitter.util.Try
import java.security.cert.X509Certificate
import javax.net.ssl.SSLSession
import sun.security.util.HostnameChecker
private[finagle] object HostnameVerifier extends SslClientSessionVeri... | koshelev/finagle | finagle-core/src/main/scala/com/twitter/finagle/ssl/client/HostnameVerifier.scala | Scala | apache-2.0 | 1,453 |
/*
* 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 ... | pferrel/PredictionIO | core/src/main/scala/org/apache/predictionio/core/BasePreparator.scala | Scala | apache-2.0 | 1,586 |
package com.danielasfregola.twitter4s.http.clients.rest.statuses.parameters
import com.danielasfregola.twitter4s.entities.enums.TweetMode
import org.specs2.mutable.SpecificationLike
class PostParametersSpec extends SpecificationLike {
"PostParameters" should {
"correctly represents each field as the respective... | DanielaSfregola/twitter4s | src/test/scala/com/danielasfregola/twitter4s/http/clients/rest/statuses/parameters/PostParametersSpec.scala | Scala | apache-2.0 | 755 |
/*
* Copyright 2014 Eric Zoerner
*
* 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... | ezoerner/scalable-chat | client/src/main/scala/scalable/client/chat/views/Browser.scala | Scala | apache-2.0 | 3,344 |
package config
import com.mongodb.casbah.Imports._
import com.typesafe.config.ConfigFactory
object OauthConfig {
def get = {
val config = ConfigFactory.load("oauth")
OauthConfig(
config.getString("clientId"),
config.getString("clientSecret"),
config.getString("redirectUri"))
}
}
case cl... | enpassant/rapids | modules/config/src/main/scala/config/KafkaConfig.scala | Scala | apache-2.0 | 1,849 |
/*
* 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 ... | zzcclp/carbondata | integration/spark/src/main/scala/org/apache/spark/sql/hive/CreateCarbonSourceTableAsSelectCommand.scala | Scala | apache-2.0 | 4,995 |
package domala.tests.layered.repository.rdb
import domala._
import domala.tests.layered.domain
import domala.tests.layered.repository.EmpRepository
import scala.reflect.ClassTag
case class Emp(
@Id
@GeneratedValue(GenerationType.IDENTITY)
id: Option[domain.ID[domain.Emp]],
name: domain.Name[domain.Emp],
ag... | bakenezumi/domala | paradise/src/test/scala/domala/tests/layered/repository/rdb/dao.scala | Scala | apache-2.0 | 1,658 |
/**
* Copyright (c) 2016 Intel Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicabl... | aayushidwivedi01/spark-tk | sparktk-core/src/main/scala/org/apache/spark/ml/org/trustedanalytics/sparktk/deeptrees/param/params.scala | Scala | apache-2.0 | 1,814 |
/*
* 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 ... | bdrillard/spark | core/src/test/scala/org/apache/spark/executor/ExecutorSuite.scala | Scala | apache-2.0 | 26,987 |
package notebook.kernel.pfork
import java.io.{EOFException, ObjectInputStream, ObjectOutputStream, File}
import java.net._
import java.util.concurrent.atomic.AtomicBoolean
import java.util.concurrent.Executors
import scala.collection.mutable
import scala.collection.JavaConversions._
import scala.collection.mutable.Li... | jayfans3/spark-notebook | modules/subprocess/src/main/scala/notebook/kernel/pfork/BetterFork.scala | Scala | apache-2.0 | 7,982 |
/*
* Copyright © 2020 University of Texas at Arlington
*
* 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... | fegaras/DIQL | src/diablo/scala/edu/uta/diablo/Normalizer.scala | Scala | apache-2.0 | 9,459 |
package sorm.core
import org.scalatest.FunSuite
import org.scalatest.matchers.ShouldMatchers
import org.junit.runner.RunWith
import org.scalatest.junit.JUnitRunner
@RunWith(classOf[JUnitRunner])
class PathSuite extends FunSuite with ShouldMatchers {
import Path._
test("pathAndRemainder failure"){
pendi... | sorm/sorm | src/test/scala/sorm/core/PathSuite.scala | Scala | mit | 879 |
/*
* Copyright (c) 2002-2018 "Neo Technology,"
* Network Engine for Objects in Lund AB [http://neotechnology.com]
*
* This file is part of Neo4j.
*
* Neo4j 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 Foundatio... | HuangLS/neo4j | community/cypher/cypher-compiler-2.3/src/main/scala/org/neo4j/cypher/internal/compiler/v2_3/ast/convert/plannerQuery/StatementConverters.scala | Scala | apache-2.0 | 2,961 |
object Macros {
def foo[U <: String]: Unit = macro Impls.foo[U]
}
object Test extends App {
import Macros._
foo[Int]
}
| yusuke2255/dotty | tests/untried/neg/macro-invalidusage-badbounds/Macros_Test_2.scala | Scala | bsd-3-clause | 126 |
/*
* Copyright 2014–2018 SlamData Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agr... | jedesah/Quasar | mongodb/src/test/scala/quasar/physical/mongodb/bsoncodec.scala | Scala | apache-2.0 | 3,789 |
package TAPL2.SimpleBool
import TAPL2.TyArith.TypedBool
import TAPL2.Untyped.VarApp
import TAPL2.Util._
import TAPL2.{Term, Ty}
case class TmVar(i: String) extends Term
case class TmAbs(v: String, ty: Ty, t: Term) extends Term
case class TmApp(t1: Term, t2: Term) extends Term
case object TmTrue extends Term
case ... | hy-zhang/parser | Scala/Old/TAPL2/SimpleBool/SimpleBool.scala | Scala | bsd-3-clause | 2,001 |
package com.gravity.goose
import scala.io.Source
import sys.process._
object FetchMany {
def main(args: Array[String]) {
try {
val config: Configuration = new Configuration
config.enableImageFetching = true
config.imagemagickConvertPath = "/usr/bin/convert"
config.imagemagickIdentifyPath... | raisercostin/goose | src/main/scala/com/gravity/goose/FetchMany.scala | Scala | apache-2.0 | 1,403 |
package core.exception
/**
* 权限错误
*
* Created by zephyre on 1/22/16.
*/
class ForbiddenException(message: String, cause: Throwable) extends RuntimeException(message, cause) {
def this() = this(null, null)
def this(message: String) = this(message, null)
def this(cause: Throwable) = this(null, cause)
}
obje... | Lvxingpai/Hanse | app/core/exception/ForbiddenException.scala | Scala | apache-2.0 | 612 |
/*
* 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 | mllib/src/main/scala/org/apache/spark/mllib/clustering/KMeansModel.scala | Scala | apache-2.0 | 5,195 |
package com.nthportal.versions
package object v2 {
val V = Version
val EV = ExtendedVersion
}
| NthPortal/versions | src/main/scala/com/nthportal/versions/v2/package.scala | Scala | apache-2.0 | 100 |
package org.leialearns.logic.utilities
import scala.util.control.Breaks
import org.scalatest.FunSuite
import org.slf4j.LoggerFactory
import java.io.{IOException, StringReader}
class TestPrefixFree extends FunSuite {
val logger = LoggerFactory.getLogger(getClass)
def singlePrefixEncodeBigInteger(n: BigInt) {
... | jeroenvanmaanen/leia | prefixencoding/src/test/java/org/leialearns/logic/utilities/TestPrefixFree.scala | Scala | lgpl-2.1 | 1,470 |
package chess
class SituationTest extends ChessTest {
"a game" should {
"detect" in {
"check" in {
"by rook" in {
("""
K r
""" as White).check must beTrue
}
"by knight" in {
("""
n
K
""" as White).check must beTrue
}
"not" in {
("""
... | cxd4/scalachess | src/test/scala/SituationTest.scala | Scala | mit | 913 |
/* __ *\\
** ________ ___ / / ___ __ ____ Scala.js API **
** / __/ __// _ | / / / _ | __ / // __/ (c) 2013, LAMP/EPFL **
** __\\ \\/ /__/ __ |/ /__/ __ |/_// /_\\ \\ http://scala-lang.org/ **
** /____/\\___/... | CapeSepias/scala-js | library/src/main/scala/scala/scalajs/js/timers/RawTimers.scala | Scala | bsd-3-clause | 2,144 |
package sample {
package lib {
import scala.xml.{Text, NodeSeq}
import net.liftweb.common.{Box,Full,Empty,Failure}
import net.liftweb.util.NamedPF
import net.liftweb.util.Helpers._
import net.liftweb.http.{SHtml,S,RewriteRequest,RewriteResponse,ParsePath}
import net.liftweb.sitemap.Loc
import net.liftweb.mapper.{Order... | timperrett/lift-in-action | chapter-7/src/main/scala/sample/lib/Wiki.scala | Scala | apache-2.0 | 4,719 |
val list = List(1,2,3,4,5)
println(f"\\n=> list: $list%-35s")
val filtered_mapped = list filter (_ < 4) map (_ * 2)
println(f"\\n=> filtered_mapped list: $filtered_mapped%-35s")
println
| nvijayap/scala-ruby | scala/filter_map.scala | Scala | apache-2.0 | 202 |
package scala.tools.nsc
import java.nio.file.attribute.BasicFileAttributes
import java.nio.file.{FileVisitResult, Files, Path, SimpleFileVisitor}
import difflib.DiffUtils
import scala.jdk.CollectionConverters._
import scala.reflect.io.PlainNioFile
import scala.tools.nsc.backend.jvm.AsmUtils
object FileUtils {
def... | scala/scala | test/junit/scala/tools/nsc/FileUtils.scala | Scala | apache-2.0 | 5,070 |
/*
,i::,
:;;;;;;;
;:,,::;.
1ft1;::;1tL
t1;::;1,
:;::; _____ __ ___ __
fCLff ;:: tfLLC / ___/ / |/ /____ _ _____ / /_
CLft11 :,, i1tffLi \\__ \\ ____ / /|_/ ... | S-Mach/s_mach.explain | explain_json/src/test/scala/s_mach/explain_json/JsonStringBuilderTest.scala | Scala | mit | 7,537 |
package com.github.mogproject.dockersbttest.example
import org.specs2.mutable._
import com.redis.RedisClientPool
trait context extends BeforeAfter {
lazy val clients = new RedisClientPool(host = "localhost", port = 6379, database = 0)
val keys = (1 to 100).map { i => f"test-sbt-parallel-$i%03d" }
// takes ove... | mogproject/docker-sbt-test | example/src/test/scala/com/github/mogproject/dockersbttest/example/RedisConnectionSpec.scala | Scala | apache-2.0 | 1,760 |
package com.verizon.bda.trapezium.dal.lucene
import java.io.{File, _}
import java.sql.Time
import com.verizon.bda.trapezium.dal.exceptions.LuceneDAOException
import org.apache.hadoop.conf.Configuration
import org.apache.hadoop.fs.{FileStatus, FileSystem, FileUtil, PathFilter, Path => HadoopPath}
import org.apache.log... | Verizon/trapezium | dal/src/main/scala/com/verizon/bda/trapezium/dal/lucene/LuceneDAO.scala | Scala | apache-2.0 | 25,439 |
package breeze.linalg.support
/*
*
* Copyright 2015 David Hall
*
* 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 requir... | scalanlp/breeze | math/src/main/scala/breeze/linalg/support/CanMapValues.scala | Scala | apache-2.0 | 3,518 |
package org.bitcoins.rpc.common
import org.bitcoins.rpc.client.common.BitcoindVersion
import org.bitcoins.rpc.client.common.BitcoindVersion.{V19, V20, V21}
import org.bitcoins.testkit.util.BitcoindRpcTest
class BitcoindVersionTest extends BitcoindRpcTest {
behavior of "BitcoindVersion"
it should "return version ... | bitcoin-s/bitcoin-s | bitcoind-rpc-test/src/test/scala/org/bitcoins/rpc/common/BitcoindVersionTest.scala | Scala | mit | 697 |
package com.twitter.server
import com.twitter.app.GlobalFlag
import com.twitter.app.lifecycle.Event
import com.twitter.app.lifecycle.Event.{PrebindWarmup, WarmupComplete}
import com.twitter.finagle.http.Method.Post
import com.twitter.finagle.http.{HttpMuxer, Route, RouteIndex}
import com.twitter.server.handler._
impor... | twitter/twitter-server | server/src/main/scala/com/twitter/server/Lifecycle.scala | Scala | apache-2.0 | 4,967 |
package com.monsanto.arch.kamon.spray.can
import java.util.concurrent.TimeUnit
import com.typesafe.config.{Config, ConfigFactory}
import scala.concurrent.duration.FiniteDuration
/** Container for the settings of the `KamonHttp` extension. All of the configuration is placed under the path
* `spray.can.server`. R... | MonsantoCo/spray-kamon-metrics | src/main/scala/com/monsanto/arch/kamon/spray/can/KamonHttpSettings.scala | Scala | bsd-3-clause | 897 |
package sri.universal.navigation
import scala.scalajs.js
/**
* make sure you check for null cases even its defined.
*/
@js.native
trait NavigationStateUtils extends js.Object {
def getParent(state: NavigationState): js.UndefOr[NavigationParentState] = js.native
def get(state: NavigationState, key: String): js... | chandu0101/sri | universal/src/main/scala/sri/universal/navigation/NavigationStateUtils.scala | Scala | apache-2.0 | 1,289 |
package com.natalinobusa.wavr
import akka.actor.Actor
import com.datastax.driver.core._
trait CassandraClientActor extends Actor {
// Cassandra Driver Futures to scala futures
import CassandraQuery.ResultSet._
// Get the implict Actor execution context
import context.dispatcher
// postFix conversions
... | natalinobusa/wavr | src/main/scala/com/natalinobusa/wavr/CassandraClient.scala | Scala | apache-2.0 | 1,356 |
/*
* 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 ... | starpit/openwhisk | tests/performance/gatling_tests/src/gatling/scala/org/apache/openwhisk/extension/whisk/OpenWhiskActionBuilder.scala | Scala | apache-2.0 | 4,680 |
package service
import java.util.GregorianCalendar
import dao.SemesterDao
import database.SemesterDb
import javax.inject.{Inject, Singleton}
import org.joda.time.LocalDate
import service.actor.NaturalDescribableYear
@Singleton
final class SemesterService @Inject()(private val semesterDao: SemesterDao) {
def creat... | THK-ADV/lwm-reloaded | app/service/SemesterService.scala | Scala | mit | 1,520 |
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.