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 mesosphere.marathon.upgrade
import akka.actor.{ ActorSystem, Props }
import akka.testkit.{ TestActorRef, TestKit }
import mesosphere.marathon.TaskUpgradeCanceledException
import mesosphere.marathon.event.{ HealthStatusChanged, MesosStatusUpdateEvent }
import mesosphere.marathon.state.AppDefinition
import mesos... | tnachen/marathon | src/test/scala/mesosphere/marathon/upgrade/TaskStartActorTest.scala | Scala | apache-2.0 | 4,519 |
package me.pzang.utils
import org.scalatest.{FlatSpec, Matchers}
import scala.util.Random
/**
* Created by pzang on 4/6/16.
*/
class CommonUtilsTests extends FlatSpec with Matchers {
val d: java.lang.Double = java.lang.Double.valueOf(1.234)
val i: java.lang.Integer = java.lang.Integer.valueOf(123)
val l: j... | pzang/config-sbt-plugin | src/test/scala/me/pzang/utils/CommonUtilsTests.scala | Scala | mit | 2,120 |
/*
* 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/test/scala/org/scalatest/jmock/SuiteExpectations.scala | Scala | apache-2.0 | 1,951 |
/*
* Copyright (C) 2009-2017 Lightbend Inc. <https://www.lightbend.com>
*/
package play.api.data.format
import java.text.{ DateFormat, SimpleDateFormat }
import java.time.temporal.{ ChronoField, TemporalAccessor, TemporalField, TemporalQueries }
import java.time._
import java.time.format.{ DateTimeFormatter, DateTim... | ktoso/playframework | framework/src/play/src/main/scala/play/api/data/format/Format.scala | Scala | apache-2.0 | 11,640 |
package com.twitter.server.handler
/** Marker trait for LoggingHandlers */
trait LoggingHandler extends AdminHttpMuxHandler {
/** Implementation name */
def name: String
}
| twitter/twitter-server | server/src/main/scala/com/twitter/server/handler/LoggingHandler.scala | Scala | apache-2.0 | 178 |
/***********************************************************************
* Copyright (c) 2013-2017 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... | ronq/geomesa | geomesa-fs/geomesa-fs-tools/src/main/scala/org/locationtech/geomesa/fs/tools/FsDataStoreCommand.scala | Scala | apache-2.0 | 2,717 |
package pimpathon
import org.junit.Test
import scala.collection.{mutable ⇒ M}
import scala.collection.generic.CanBuildFrom
import pimpathon.builder._
import pimpathon.multiMap._
import pimpathon.util._
class MultiMapTest {
@Test def multiMapCBF(): Unit = {
val cbf = MultiMap.build[List, Int, String]
val b... | raymanoz/pimpathon | src/test/scala/pimpathon/multiMap.scala | Scala | apache-2.0 | 5,580 |
package skinny.util
import scala.language.implicitConversions
import skinny.ParamType
import org.joda.time._
import scala.util.Try
/**
* DateTime utility.
*/
object DateTimeUtil {
/**
* The ISO8601 standard date format.
*/
//val ISO_DATE_TIME_FORMAT = "%04d-%02d-%02dT%02d:%02d:%02d%s"
val ISO_DATE_TIM... | Kuchitama/skinny-framework | common/src/main/scala/skinny/util/DateTimeUtil.scala | Scala | mit | 9,075 |
/**
* The MIT License (MIT)
* <p/>
* Copyright (c) 2016 ScalateKids
* <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 ... | ScalateKids/Actorbase-Server | src/main/scala/com/actorbase/actorsystem/actors/httpserver/HTTPServer.scala | Scala | mit | 8,611 |
/*
* Bioinformatics Algorithms in Scala
* Copyright (C) 2016 Jason Mar
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later ... | sterglee/ScalaLabBioinf | src/main/scala/bioinf/Input.scala | Scala | gpl-3.0 | 3,843 |
import sbt._
import Keys._
import com.typesafe.sbt.SbtMultiJvm
import com.typesafe.sbt.SbtMultiJvm.MultiJvmKeys.{ MultiJvm }
object WordsBuild extends Build {
lazy val buildSettings = Defaults.defaultSettings ++ multiJvmSettings ++ Seq(
crossPaths := false
)
lazy val project = Project(
id = "words-cl... | RayRoestenburg/akka-in-action | chapter-cluster/project/WordsBuild.scala | Scala | mit | 1,302 |
/*
* 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 | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/generators.scala | Scala | apache-2.0 | 14,278 |
package uk.gov.homeoffice.configuration
import java.time.Duration
import scala.concurrent.duration.FiniteDuration
import org.specs2.matcher.Scope
import org.specs2.mutable.Specification
class ConfigFactorySupportSpec extends Specification {
trait Context extends Scope with HasConfig with ConfigFactorySupport
"Co... | UKHomeOffice/rtp-io-lib | src/test/scala/uk/gov/homeoffice/configuration/ConfigFactorySupportSpec.scala | Scala | mit | 851 |
/*
* Copyright 2013-2014 IQ TECH <http://www.iqtech.pl>
*
* 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 appl... | iqtech/abyss | abyss-graph/src/test/scala/io/abyss/test/ModelFactory.scala | Scala | apache-2.0 | 1,456 |
/**
* Licensed to Big Data Genomics (BDG) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The BDG licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use ... | FusionWorks/avocado | avocado-core/src/test/scala/org/bdgenomics/avocado/algorithms/em/EMforAllelesSuite.scala | Scala | apache-2.0 | 2,751 |
package io.buoyant.linkerd
import com.twitter.finagle.naming.buoyant.DstBindingFactory
import com.twitter.finagle.naming.NameInterpreter
import com.twitter.finagle.param.Label
import com.twitter.finagle.stats.{BroadcastStatsReceiver, LoadedStatsReceiver, NullStatsReceiver}
import com.twitter.finagle.tracing.{Broadcast... | linkerd/linkerd | linkerd/core/src/main/scala/io/buoyant/linkerd/Linker.scala | Scala | apache-2.0 | 8,209 |
/*
* Copyright 2001-2008 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... | kevinwright/scalatest | src/test/scala/org/scalatest/TestFailedExceptionWithImportSpec.scala | Scala | apache-2.0 | 10,232 |
/*
* ActorBasedXmppComponentImpl.scala
*
* Licensed to the Communitivity, Inc 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.... | Java-Communitivity/Shellack | src/org/communitivity/shellack/ActorBasedXmppComponentImpl.scala | Scala | apache-2.0 | 1,967 |
package ch.descabato
import java.io.{ByteArrayInputStream, File}
import java.nio.file.Files
import ch.descabato.utils.Utils
import org.scalatest.FlatSpecLike
trait TestUtils extends Utils {
def replay(out: CustomByteArrayOutputStream) = {
new ByteArrayInputStream(finishByteArrayOutputStream(out))
}
def f... | Stivo/DeScaBaTo | core/src/test/scala/ch/descabato/TestUtils.scala | Scala | gpl-3.0 | 1,554 |
/*
* 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/ct-calculations | src/main/scala/uk/gov/hmrc/ct/ct600e/v3/E85.scala | Scala | apache-2.0 | 1,007 |
package slack
import javax.inject.Inject
import com.atlassian.jira.rest.client.api.domain.Issue
import com.google.common.collect.ImmutableList
import jira.JiraConfig
import jira.JiraQuery
import net.gpedro.integrations.slack.SlackAttachment
import net.gpedro.integrations.slack.SlackField
import phabricator.Phabricato... | rsumbaly/phabricator-report | app/slack/SlackCommandInterpreter.scala | Scala | apache-2.0 | 6,018 |
package scala.tasty.reflect
class ExprCastError(msg: String) extends Throwable(msg)
| som-snytt/dotty | library/src/scala/tasty/reflect/ExprCastError.scala | Scala | apache-2.0 | 85 |
package net.nablux.dockergen
import org.scalatest.{BeforeAndAfter, Matchers, FlatSpec}
class DockerImageSpec
extends FlatSpec
with Matchers
with BeforeAndAfter {
class MinimalImage extends DockerImage {
override def image: String = "test.img"
override def tag: String = "0.1"
}
var desc: DockerI... | tgpfeiffer/dockergen | src/test/scala/net/nablux/dockergen/DockerImageSpec.scala | Scala | bsd-3-clause | 1,292 |
package org.eknet.publet.webdav
import grizzled.slf4j.Logging
import org.eknet.publet.vfs.Path
import org.eknet.publet.Publet
import io.milton.http.ResourceFactory
import io.milton.http.exceptions.BadRequestException
/**
* @author Eike Kettner eike.kettner@gmail.com
* @since 25.06.12 21:01
*/
class WebdavResourceF... | eikek/publet | webdav/src/main/scala/org/eknet/publet/webdav/WebdavResourceFactory.scala | Scala | apache-2.0 | 1,051 |
/*
*************************************************************************************
* Copyright 2011-2013 Normation SAS
*************************************************************************************
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affe... | jooooooon/rudder | rudder-web/src/main/scala/com/normation/rudder/web/snippet/administration/ChangeRequestManagement.scala | Scala | agpl-3.0 | 9,849 |
package com.twitter.tiny.exceptions
import com.twitter.finagle.httpx.{Request, Response}
import com.twitter.finatra.http.exceptions.ExceptionMapper
import com.twitter.finatra.http.response.ResponseBuilder
import java.net.MalformedURLException
import javax.inject.Inject
class MalformedURLExceptionMapper @Inject()(resp... | deanh/finatra | examples/tiny-url/src/main/scala/com/twitter/tiny/exceptions/MalformedURLExceptionMapper.scala | Scala | apache-2.0 | 561 |
package com.sksamuel.elastic4s.testkit
import com.sksamuel.elastic4s.embedded.LocalNode
import com.sksamuel.elastic4s.{ElasticDsl, IndexAndTypes, Indexes, TcpClient}
import org.elasticsearch.ResourceAlreadyExistsException
import org.elasticsearch.action.admin.indices.refresh.RefreshResponse
import org.elasticsearch.cl... | tyth/elastic4s | elastic4s-testkit/src/main/scala/com/sksamuel/elastic4s/testkit/ElasticSugar.scala | Scala | apache-2.0 | 5,339 |
package org.scalatra
import org.scalatra.test.scalatest.ScalatraFunSuite
class AfterTestServlet extends ScalatraServlet with AfterTestAppBase
trait AfterTestAppBase extends ScalatraBase {
after() {
response.setStatus(204)
}
after("/some/path") {
response.setStatus(202)
}
after("/other/path") {
... | lightvector/scalatra | core/src/test/scala/org/scalatra/AfterTest.scala | Scala | bsd-2-clause | 856 |
package co.blocke.scalajack
package json4s
import model._
import model.Writer
import scala.collection.{Map, mutable}
import org.json4s._
case class Json4sWriter() extends Writer[JValue] {
def writeArray[Elem](t: Iterable[Elem], elemTypeAdapter: TypeAdapter[Elem], out: collection.mutable.Builder[JValue, JValue]): ... | gzoller/ScalaJack | core/src/main/scala/co.blocke.scalajack/json4s/Json4sWriter.scala | Scala | mit | 4,450 |
package bifrost.program
import java.time.Instant
import bifrost.{BifrostGenerators, ValidGenerators}
import io.circe.{Json, JsonObject}
import org.scalacheck.Gen
import org.scalatest.prop.{GeneratorDrivenPropertyChecks, PropertyChecks}
import org.scalatest.{Matchers, PropSpec}
import bifrost.transaction.box.propositi... | Topl/Project-Bifrost | src/test/scala/bifrost/program/ProgramSpec.scala | Scala | mpl-2.0 | 2,640 |
package com.clemble.util.validator
import play.api.libs.json.{JsObject, Reads, JsValue, __}
import shapeless._
import shapeless.labelled.FieldType
/**
* Partial JSON validator for entity, that allows to make partial object presentation validation.
* @tparam T entity type
*/
trait PatchValidator[T] {
/**
* Ch... | clemble/scala-validator | src/main/scala/com/clemble/util/validator/PatchValidator.scala | Scala | apache-2.0 | 3,028 |
package io.shaka.http
import io.shaka.http.Http.HttpHandler
import io.shaka.http.HttpHeader.CONTENT_LENGTH
import io.shaka.http.Method.{GET, HEAD}
import io.shaka.http.Status.INTERNAL_SERVER_ERROR
object Handlers {
object HEADRequestHandler {
def ~>(handler: HttpHandler): HttpHandler = (request) => {
def... | stacycurl/naive-http | src/main/scala/io/shaka/http/Handlers.scala | Scala | apache-2.0 | 916 |
package mimir.lenses
import java.io.File
import java.sql._
import java.util
import mimir.algebra._
import mimir.ctables._
import mimir.util.RandUtils
import mimir.Database
import mimir.parser._
import mimir.models._
import scala.collection.JavaConversions._
import scala.util._
import mimir.ml.spark.{SparkML, Classi... | UBOdin/mimir | src/main/scala/mimir/lenses/PickerLens.scala | Scala | apache-2.0 | 4,676 |
/*
* 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 ... | rednaxelafx/apache-spark | sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/ExpressionEvalHelper.scala | Scala | apache-2.0 | 21,342 |
package nl.iljabooij.garmintrainer.importer
import java.io.{File,InputStream}
import scala.collection.jcl.Conversions._
import org.scalatest.junit.{AssertionsForJUnit,JUnit3Suite}
import org.scalatest.mock.MockitoSugar
import org.junit.{Before,Test}
import org.mockito.Matchers._
import org.mockito.Mockito._
import org... | chmandrade/garmintrainer | src/test/scala/nl/iljabooij/garmintrainer/importer/TcxImporterScalaTest.scala | Scala | gpl-3.0 | 2,134 |
package com.sksamuel.elastic4s
import org.scalatest.{Matchers, WordSpec}
class CountShowTest extends WordSpec with Matchers {
import ElasticDsl._
"Search" should {
"have a show typeclass implementation" in {
val request = {
count from "gameofthrones" / "characters" query {
bool {
... | tototoshi/elastic4s | elastic4s-core-tests/src/test/scala/com/sksamuel/elastic4s/CountShowTest.scala | Scala | apache-2.0 | 1,441 |
package mesosphere.mesos
import mesosphere.marathon.MarathonTestHelper.Implicits._
import mesosphere.marathon.Protos.Constraint
import mesosphere.marathon.Protos.Constraint.Operator
import mesosphere.marathon.core.task.Task
import mesosphere.marathon.state.AppDefinition
import mesosphere.marathon.{ MarathonSpec, Marat... | ss75710541/marathon | src/test/scala/mesosphere/mesos/ConstraintsTest.scala | Scala | apache-2.0 | 17,840 |
package gitbucket.core.controller
import org.scalatra.MovedPermanently
class PreProcessController extends PreProcessControllerBase
trait PreProcessControllerBase extends ControllerBase {
/**
* Provides GitHub compatible URLs for Git client.
*
* <ul>
* <li>git clone http://localhost:8080/owner/repo</... | gencer/gitbucket | src/main/scala/gitbucket/core/controller/PreProcessController.scala | Scala | apache-2.0 | 1,192 |
package example
class EtaExpansion/*<-example::EtaExpansion#*/ {
Some/*->scala::Some.*//*->scala::Some.apply().*/(1).map/*->scala::Option#map().*/(identity/*->scala::Predef.identity().*//*->local0*/)
List/*->scala::package.List.*//*->scala::collection::IterableFactory#apply().*/(1).foldLeft/*->scala::collection::L... | som-snytt/dotty | tests/semanticdb/expect/EtaExpansion.expect.scala | Scala | apache-2.0 | 390 |
package com.sksamuel.scapegoat.inspections.unneccesary
import scala.reflect.internal.Flags
import com.sksamuel.scapegoat._
/**
* @author Stephen Samuel
*/
class UnusedMethodParameter
extends Inspection(
text = "Unused parameter",
defaultLevel = Levels.Warning,
description = "Checks for unused... | sksamuel/scalac-scapegoat-plugin | src/main/scala/com/sksamuel/scapegoat/inspections/unneccesary/UnusedMethodParameter.scala | Scala | apache-2.0 | 5,328 |
import sbt._
import Keys._
import java.io.{FileInputStream, FileOutputStream}
object BuildSettings {
val sonatypeRepo = "http://oss.sonatype.org/service/local/staging/deploy/maven2"
lazy val credentialsSetting = credentials ++=
(Seq("build.publish.user", "build.publish.password").map(k => Option(System.getPro... | linkedin/norbert | project/Build.scala | Scala | apache-2.0 | 7,921 |
package org.jetbrains.plugins.scala.testingSupport.scalatest.scala2_11.scalatest3_0_1
import org.jetbrains.plugins.scala.testingSupport.scalatest.ScalaTestPackageNewTest
class Scalatest2_11_3_0_1_PackageTest extends Scalatest2_11_3_0_1_Base with ScalaTestPackageNewTest
| JetBrains/intellij-scala | scala/scala-impl/test/org/jetbrains/plugins/scala/testingSupport/scalatest/scala2_11/scalatest3_0_1/Scalatest2_11_3_0_1_PackageTest.scala | Scala | apache-2.0 | 272 |
package io.github.binaryfoo.lagotto.shell
import java.util
import scala.collection.JavaConversions._
/**
* Keep at most N things.
*/
class BoundedQueue[T](val capacity: Int) extends util.ArrayDeque[T] {
override def add(e: T): Boolean = {
if (capacity == 0 || !isEmpty && peek() == e) {
return false
... | binaryfoo/lagotto | src/main/scala/io/github/binaryfoo/lagotto/shell/BoundedQueue.scala | Scala | mit | 544 |
/*
* 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 ... | lvdongr/spark | resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s/features/bindings/RDriverFeatureStep.scala | Scala | apache-2.0 | 2,548 |
package scala.meta.tests
package semanticdb
// Contributing tips:
// - To run an individual test: ~testsJVM/testOnly *TargetedSuite -- -z "package YYY"
// and replace YYY with the package name of your test.
// - On test failure, the obtained output is printed to the console for
// easy copy-paste to replace the cu... | olafurpg/scalameta | tests/jvm/src/test/scala/scala/meta/tests/semanticdb/TargetedSuite.scala | Scala | bsd-3-clause | 4,254 |
/***
* 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/WordCountFaultTolerant/src/main/scala/com/paulbutcher/Parser.scala | Scala | gpl-2.0 | 1,418 |
object Curry {
def curry[A,B,C](f: (A, B) => C): A => (B=>C) = {
def inner(a:A): (B=>C) = {
def even_inner(b:B):C = {
f(a, b)
}
even_inner
}
inner
}
}
| Bolt64/my_code | scala/curry.scala | Scala | mit | 193 |
import javax.mail._
import javax.mail.internet._
import java.io._
import java.text.SimpleDateFormat
import java.util._
import java.lang.management.ManagementFactory
import com.google.api.client.auth.oauth2.Credential
import com.google.api.client.extensions.java6.auth.oauth2.AuthorizationCodeInstalledApp
import com.goo... | rpelisse/tasks | src/main/scala/tasks.scala | Scala | gpl-2.0 | 17,950 |
package mesosphere.marathon.api.v2
import java.util
import javax.inject.Inject
import javax.ws.rs._
import javax.ws.rs.core.{ MediaType, Response }
import com.codahale.metrics.annotation.Timed
import mesosphere.marathon.Protos.MarathonTask
import mesosphere.marathon.api.v2.json.EnrichedTask
import mesosphere.marathon... | murat-lacework/marathon | src/main/scala/mesosphere/marathon/api/v2/TasksResource.scala | Scala | apache-2.0 | 3,784 |
package com.datastax.driver.spark
/** Contains components for writing RDDs to Cassandra */
package object writer {
}
| bovigny/cassandra-driver-spark | src/main/scala/com/datastax/driver/spark/writer/package.scala | Scala | apache-2.0 | 119 |
/*
* 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 ... | tysonnorris/openwhisk | common/scala/src/main/scala/whisk/http/ErrorResponse.scala | Scala | apache-2.0 | 9,905 |
package util.plugins
import collins.graphs.{GraphPlugin => GraphPlayPlugin}
import play.api.{Application, Mode, Play}
object GraphPlugin {
def option(): Option[GraphPlayPlugin] = {
Play.maybeApplication.flatMap { app =>
app.plugin[GraphPlayPlugin].filter(_.enabled)
}
}
}
| Shopify/collins | app/util/plugins/GraphPlugin.scala | Scala | apache-2.0 | 292 |
package poly.collection.search
import poly.collection._
/**
* Enables searching functions on objects.
* @author Tongfei Chen
* @since 0.1.0
*/
object ops extends LowerPriorityImplicits {
implicit class withSearchOps[T](val x: T) extends AnyVal {
/**
* Performs depth first tree traversal given the tran... | ctongfei/poly-collection | core/src/main/scala/poly/collection/search/ops.scala | Scala | mit | 1,972 |
object SCL5790 {
import scala.reflect.api.Universe
class Test[U <: Universe](val u: U) {
def someMethod: u.Type = ???
}
class AnotherTest[U <: Universe](val u: U) {
val test = new Test[u.type](/*start*/u/*end*/)
def anotherMethod: u.Type = test.someMethod
}
}
//AnotherTest.this.u.type | ilinum/intellij-scala | testdata/typeInference/scalaReflect/SCL5790.scala | Scala | apache-2.0 | 309 |
/*
* Copyright 2012 Pascal Voitot
*
* 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 ... | avdv/Play-ReactiveMongo | src/main/scala/play/modules/reactivemongo/ReactiveMongoPlugin.scala | Scala | apache-2.0 | 4,368 |
package wykopml.storage
import java.time.LocalDateTime
import com.websudos.phantom.dsl._
import wykopml.bo.Wykop
class WykopsTable extends CassandraTable[WykopsTable, Wykop] {
object id extends IntColumn(this) with PartitionKey[Int]
object title extends StringColumn(this)
object description extends StringCo... | blstream/wykopml | updater/src/main/scala/wykopml/storage/WykopsTable.scala | Scala | mit | 1,022 |
package edu.gemini.spModel.obs
import edu.gemini.pot.sp.{SPComponentType, ISPObservation}
import edu.gemini.spModel.core.Site
import edu.gemini.spModel.obs.plannedtime.PlannedTimeCalculator
import edu.gemini.spModel.rich.pot.sp.obsWrapper
import edu.gemini.spModel.rich.shared.immutable._
import edu.gemini.spModel.targ... | spakzad/ocs | bundle/edu.gemini.pot/src/main/scala/edu/gemini/spModel/obs/ObsTargetCalculatorService.scala | Scala | bsd-3-clause | 3,302 |
/*
* 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 ... | darionyaphet/flink | flink-table/flink-table-api-scala-bridge/src/main/scala/org/apache/flink/table/api/bridge/scala/BatchTableEnvironment.scala | Scala | apache-2.0 | 16,743 |
// Copyright: 2010 - 2016 https://github.com/ensime/ensime-server/graphs
// Licence: http://www.gnu.org/licenses/gpl-3.0.en.html
package org.ensime.core
import org.ensime.api._
import org.ensime.fixture._
import org.ensime.util.EnsimeSpec
import scala.reflect.internal.util.{ OffsetPosition, RangePosition }
class Impl... | d1egoaz/ensime-sbt | src/sbt-test/sbt-ensime/ensime-server/core/src/it/scala/org/ensime/core/ImplicitAnalyzerSpec.scala | Scala | apache-2.0 | 3,942 |
package unluac.parse
class LString(val size:BSizeT, _value:String) extends LObject {
final val value: String = if (_value.length == 0) "" else _value.substring(0, _value.length - 1)
override def deref: String = {
value
}
override def toString: String = {
"\"" + value + "\""
}
override def equal... | danielwegener/unluac-scala | shared/src/main/scala/unluac/parse/LString.scala | Scala | mit | 442 |
package com.twitter.finagle.exp.mysql.transport
import com.twitter.finagle.client.Transporter
import com.twitter.finagle.exp.mysql.{Request, Result}
import com.twitter.finagle.netty3.{ChannelSnooper, Netty3Transporter}
import com.twitter.finagle.Stack
import com.twitter.util.NonFatal
import java.util.logging.{Level, L... | JustinTulloss/finagle | finagle-mysql/src/main/scala/com/twitter/finagle/mysql/transport/Netty3.scala | Scala | apache-2.0 | 2,628 |
package app
import service._
import util.Directory._
import util.{UsersAuthenticator, OwnerAuthenticator}
import jp.sf.amateras.scalatra.forms._
import org.apache.commons.io.FileUtils
import org.scalatra.FlashMapSupport
import org.scalatra.i18n.Messages
import service.WebHookService.WebHookPayload
import uti... | geeksville/gitbucket | src/main/scala/app/RepositorySettingsController.scala | Scala | apache-2.0 | 7,140 |
/***
* Copyright 2014 Rackspace US, 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 applica... | tylerroyal/api-checker | core/src/main/scala/com/rackspace/com/papi/components/checker/step/base/ConnectedStep.scala | Scala | apache-2.0 | 3,494 |
package wykopml.spark
import com.typesafe.scalalogging.StrictLogging
import org.apache.spark.{SparkConf, SparkContext}
case object WithSpark extends StrictLogging {
def apply(fn: (SparkContext) => Unit): Unit = {
try {
val sparkConfig = new SparkConf().setAppName("wykopml")
.set("spark.executor.m... | blstream/wykopml | prediction/src/main/scala/wykopml/spark/WithSpark.scala | Scala | mit | 826 |
package com.sksamuel.elastic4s.indexes
import java.util.UUID
import com.sksamuel.elastic4s.VersionType.External
import com.sksamuel.elastic4s.testkit.DockerTests
import com.sksamuel.elastic4s.{Indexable, RefreshPolicy, VersionType}
import org.scalatest.{Matchers, WordSpec}
import scala.util.Try
class IndexTest exte... | Tecsisa/elastic4s | elastic4s-tests/src/test/scala/com/sksamuel/elastic4s/indexes/IndexTest.scala | Scala | apache-2.0 | 7,031 |
/*
* Copyright (c) 2016 Miles Sabin
*
* 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... | liff/shapeless | core/src/test/scala_2.11+/shapeless/labelledgeneric.scala | Scala | apache-2.0 | 1,399 |
package mesosphere.marathon
package core.launcher.impl
import java.util
import java.util.Collections
import mesosphere.UnitTest
import mesosphere.marathon.core.instance.TestInstanceBuilder._
import mesosphere.marathon.core.instance.{ Instance, TestInstanceBuilder }
import mesosphere.marathon.core.launcher.{ InstanceO... | guenter/marathon | src/test/scala/mesosphere/marathon/core/launcher/impl/TaskLauncherImplTest.scala | Scala | apache-2.0 | 3,876 |
/*
* This file is part of the sbt-concrete plugin.
* Copyright (c) 2012 Scott Buckley, Anthony M Sloane, Macquarie University.
* All rights reserved.
* Distributed under the New BSD license.
* See file LICENSE at top of distribution.
*/
import sbt._
object Transformer {
import scala.util.matching.Regex
... | scottbuckley/sbt-concrete | src/Transformer.scala | Scala | bsd-3-clause | 1,571 |
///////////////////////////////////////////////////////////////////////////////
// Copyright (C) 2010 Travis Brown, The University of Texas at Austin
//
// 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 ... | utcompling/fieldspring | src/main/scala/opennlp/fieldspring/tr/util/sanity/CandidateCheck.scala | Scala | apache-2.0 | 2,340 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | ueshin/apache-spark | core/src/test/scala/org/apache/spark/deploy/security/HadoopDelegationTokenManagerSuite.scala | Scala | apache-2.0 | 5,985 |
/*
* 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 | examples/src/main/scala/org/apache/spark/examples/ml/GBTExample.scala | Scala | apache-2.0 | 12,420 |
/*
* 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 | mllib/src/main/scala/org/apache/spark/ml/tree/impl/GradientBoostedTrees.scala | Scala | apache-2.0 | 15,214 |
package spire.math
import spire.algebra.{IsIntegral, Order, Rig, Signed}
object UInt extends UIntInstances {
@inline final def apply(n: Int): UInt = new UInt(n)
@inline final def apply(n: Long): UInt = new UInt(n.toInt)
@inline final val MinValue: UInt = UInt(0)
@inline final val MaxValue: UInt = UInt(-1)
}
... | woparry/spire | core/src/main/scala/spire/math/UInt.scala | Scala | mit | 4,731 |
/*
* 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... | scalatest/scalatest | jvm/scalatest-test/src/test/scala/org/scalatest/AllOfContainMatcherEqualitySpec.scala | Scala | apache-2.0 | 16,042 |
/*
* 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... | yiheng/BigDL | spark/dl/src/main/scala/com/intel/analytics/bigdl/nn/Recurrent.scala | Scala | apache-2.0 | 30,227 |
/**
* Author : Florian Simon <florian@tentwentyfour.lu>
* Role : Textual version of the main menu view.
*/
package Views.Swing;
import Game.Grid;
import Views.Base;
import Controllers.Controller;
import Views.Swing.Components.GridCanvas;
import scala.util.Success;
import scala.swing.event.WindowClosing;
import ... | floriansimon1/learning.trpg | src/Views/Swing/GameView.scala | Scala | mit | 1,527 |
import types.{MalList, _list, _list_Q, MalVector, MalHashMap,
Func, MalFunction}
import env.Env
object step9_try {
// read
def READ(str: String): Any = {
reader.read_str(str)
}
// eval
def is_pair(x: Any): Boolean = {
types._sequential_Q(x) && x.asInstanceOf[MalList].value.length > 0
... | hterkelsen/mal | scala/step9_try.scala | Scala | mpl-2.0 | 7,118 |
package dev.budget.reconciler.es
import io.dropwizard.lifecycle.Managed
import org.elasticsearch.node.Node
import org.slf4j.Logger
import org.slf4j.LoggerFactory.getLogger
import scaldi.{Injector, Injectable}
class ManagedElasticSearch(implicit val injector: Injector) extends Managed with Injectable {
val log: Logg... | jhungerford/MintYnabReconciler | src/main/scala/dev/budget/reconciler/es/ManagedElasticSearch.scala | Scala | apache-2.0 | 799 |
package com.scala.exercises.impatient.chapter5
/**
* Created by Who on 2014/7/8.
*/
class Counter {
private[this] var value = 0
def increment() {
value += 1
}
def current() = value
def isLess(other: Counter) = {
// Because the member value is tagged private[this], so it will be only accessible f... | laonawuli/scalalearning | src/com/scala/exercises/impatient/chapter5/Counter.scala | Scala | mit | 372 |
/*
* Copyright (C) 2017 Stratio (http://stratio.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by app... | compae/tiki-takka | core/src/main/scala/com/stratio/tikitakka/core/ServiceActor.scala | Scala | apache-2.0 | 2,258 |
package object sakismet {
import dispatch.{HttpExecutor, Http}
val UserAgent = "Sakismet/1.0.0"
val AkismetBaseHost = "rest.akismet.com"
val AkismetKeyedHost = "%s.rest.akismet.com"
val AkismetDebugHeader = "x-akismet-debug-help"
val AkismetBasePath = "1.1"
val AkismetPort = 80
type N = None.ty... | seance/Sakismet | src/main/scala/sakismet/sakismet.scala | Scala | bsd-3-clause | 4,374 |
/* *\\
** Squants **
** **
** Scala Quantities and Units of Measure Library and DSL **
** (c) 2013-2014, G... | non/squants | src/main/scala/squants/market/Price.scala | Scala | apache-2.0 | 2,684 |
/* *\\
** \\ \\ / _) \\ \\ / \\ | **
** \\ \\ / | __ \\ _ \\ __| \\ \\ / |\\/ | **
** \\ \\ / | | | __/ | \\ \\ / | | **
** \\_/ _| .__/ \\___| _| \\_/ _| _| **
** _| ... | hsyl20/Scala_ViperVM | src/main/scala/org/vipervm/platform/opencl/Network.scala | Scala | gpl-3.0 | 2,542 |
// See LICENSE.txt for license details.
package solutions
import chisel3.iotesters.PeekPokeTester
class VendingMachineTests(c: VendingMachine) extends PeekPokeTester(c) {
var money = 0
var isValid = false
for (t <- 0 until 20) {
val coin = rnd.nextInt(3)*5
val isNickel = coin == 5
val isDime =... | timtian090/Playground | chiselTutorial/src/test/scala/solutions/VendingMachineTest.scala | Scala | mit | 619 |
package skinny.test
import org.scalatest._
import org.scalatest.junit.{ JUnit3Suite, JUnitSuite }
import skinny.engine.test.scalatest.SkinnyEngineSuite
/**
* Convenience trait to add Skinny test support to JUnit3Suite.
*/
trait SkinnyJUnit3Suite
extends JUnit3Suite
with SkinnyEngineSuite
/**
* Convenience tra... | holycattle/skinny-framework | engine-test/src/main/scala/skinny/test/ScalaTestSpecs.scala | Scala | mit | 1,404 |
/*
* Copyright 2011 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 t... | VisualDNA/scrooge | scrooge-generator/src/main/scala/com/twitter/scrooge/Compiler.scala | Scala | apache-2.0 | 3,456 |
/*
* 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 ... | maropu/spark | sql/core/src/test/scala/org/apache/spark/sql/execution/SQLExecutionSuite.scala | Scala | apache-2.0 | 5,417 |
package models.req
/**
* Date: 14/06/19.
*/
case class DeleteSnapshot(userId: Long, snapId: Long)
object DeleteSnapshot {
def fromReq(req: Map[String, Seq[String]]): Option[DeleteSnapshot] = {
val f = controllers.Common.reqHead(req)(_)
for {
userId <- f("userId")
snapId <- f("snapId")
} yi... | nekoworkshop/MyFleetGirls | server/app/models/req/DeleteSnapshot.scala | Scala | mit | 389 |
package scala.virtualization.lms
package common
import java.io.PrintWriter
import scala.reflect.SourceContext
trait ImplicitOps extends Base {
/**
* Implicit conversion from Rep[X] to Rep[Y]
*
* As long as a conversion is in scope, it will be invoked in the generated scala code.
* Code-gen for other ... | afernandez90/virtualization-lms-core | src/common/ImplicitOps.scala | Scala | bsd-3-clause | 2,110 |
package dsentric
trait AndMatcher {
object && {
def unapply[A](a: A) = Some((a, a))
}
}
object AndMatcher extends AndMatcher | HigherState/dsentric | core/src/main/scala/dsentric/AndMatcher.scala | Scala | apache-2.0 | 133 |
package org.http4s.client.blaze
import org.http4s.client.ClientRouteTestBattery
class BlazeSimpleHttp1ClientSpec extends
ClientRouteTestBattery("SimpleHttp1Client", SimpleHttp1Client(BlazeClientConfig.defaultConfig))
| m4dc4p/http4s | blaze-client/src/test/scala/org/http4s/client/blaze/BlazeSimpleHttp1ClientSpec.scala | Scala | apache-2.0 | 219 |
/*
* 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... | wzhongyuan/BigDL | spark/dl/src/main/scala/com/intel/analytics/bigdl/nn/BatchNormalization.scala | Scala | apache-2.0 | 17,192 |
package edu.gemini.qv.plugin.charts.util
import edu.gemini.qpt.shared.sp.Obs
import edu.gemini.qv.plugin.QvContext
import edu.gemini.qv.plugin.selector.OptionsSelector._
import edu.gemini.qv.plugin.selector.{OptionsSelector, ConstraintsSelector}
import edu.gemini.qv.plugin.util.ConstraintsCache.{MaxElevation, MinEleva... | arturog8m/ocs | bundle/edu.gemini.qv.plugin/src/main/scala/edu/gemini/qv/plugin/charts/util/XYPlotter.scala | Scala | bsd-3-clause | 10,838 |
package me.axiometry.blocknet.entity
import me.axiometry.blocknet.item._
trait Humanoid extends Creature {
trait Armor {
def helmet: Option[ItemStack]
def chestplate: Option[ItemStack]
def leggings: Option[ItemStack]
def boots: Option[ItemStack]
def helmet_=(helmet: Option[ItemStack]): Armor
... | Axiometry/Blocknet | blocknet-api/src/main/scala/me/axiometry/blocknet/entity/Humanoid.scala | Scala | bsd-2-clause | 615 |
/**
* Copyright 2009-2010 LinkedIn, 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... | jhartman/norbert | cluster/src/main/scala/com/linkedin/norbert/norbertutils/Clock.scala | Scala | apache-2.0 | 1,278 |
/**
* 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... | ashaarunkumar/spark-tk | sparktk-core/src/main/scala/org/trustedanalytics/sparktk/models/classification/logistic_regression/LogisticRegressionModel.scala | Scala | apache-2.0 | 25,626 |
/*
* 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/Shape.scala | Scala | apache-2.0 | 3,338 |
package io.github.oxlade39.storrent.test.util
import akka.actor.{Terminated, Props, ActorRef, Actor}
import akka.event.LoggingReceive
/**
* @author dan
*/
class StepParent(child: Props, fwd: ActorRef) extends Actor {
context.watch(context.actorOf(child, "child"))
def receive = LoggingReceive {
case Terminat... | oxlade39/STorrent | src/test/scala/io/github/oxlade39/storrent/test/util/StepParent.scala | Scala | apache-2.0 | 1,065 |
/* Copyright 2015 Devon Miller
*
* 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 wri... | nightscape/scala-vdom | jvm/src/test/scala/org/im/vdom/backend/BakendSpec.scala | Scala | apache-2.0 | 6,408 |
package mesosphere.marathon
package core.storage.repository
import java.time.OffsetDateTime
import akka.stream.scaladsl.Source
import akka.{ Done, NotUsed }
import scala.concurrent.Future
/** Repository that can store exactly one value of T */
trait SingletonRepository[T] {
def get(): Future[Option[T]]
def stor... | guenter/marathon | src/main/scala/mesosphere/marathon/core/storage/repository/Repository.scala | Scala | apache-2.0 | 1,521 |
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.