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 |
|---|---|---|---|---|---|
/*
* 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 | streaming/src/main/scala/org/apache/spark/streaming/dstream/ForEachDStream.scala | Scala | apache-2.0 | 2,197 |
package db.migration
import io.circe.Json
import org.scalatest.{FlatSpec, Matchers}
import pl.touk.nussknacker.engine.api.CirceUtil
class V1_031__FragmentSpecificDataSpec extends FlatSpec with Matchers {
private lazy val expectedScenario = {
val rawJsonString =
"""{
| "metaData": {
| ... | TouK/nussknacker | ui/server/src/test/scala/db/migration/V1_031__FragmentSpecificDataSpec.scala | Scala | apache-2.0 | 3,235 |
/**
* Generated by Scrooge
* version: 3.13.0
* rev: 0921444211eb6b3d2ac9fd31a1bf189f94c6ae85
* built at: 20140325-114520
*/
package com.twitter.zipkin.gen
import com.twitter.scrooge.{
TFieldBlob, ThriftException, ThriftStruct, ThriftStructCodec3, ThriftStructFieldInfo, ThriftUtil}
import org.apache.thrift... | pkoryzna/zipkin | zipkin-scrooge/target/src_managed/main/com/twitter/zipkin/gen/QueryResponse.scala | Scala | apache-2.0 | 14,332 |
package net.lshift.diffa.agent.client
/**
* Copyright (C) 2010-2011 LShift Ltd.
*
* 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
... | aprescott/diffa | agent/src/test/scala/net/lshift/diffa/agent/client/ScanningRestClient.scala | Scala | apache-2.0 | 2,506 |
package com.nrinaudo.fetch
import java.net.URI
object Url {
// - URI-based construction ------------------------------------------------------------------------------------------
// -------------------------------------------------------------------------------------------------------------------
def fromUri(ur... | nrinaudo/fetch | core/src/main/scala/com/nrinaudo/fetch/Url.scala | Scala | mit | 3,528 |
package Pacman
import Chisel._
class CircularPeekBuffer(
numberOfBlocks: Int,
wordPerBlock: Int,
wordWidth: Int
) extends Module {
val io = new Bundle {
val wordIn = Decoupled(Bits(width = wordWidth)).flip
val wordOut = Bits(width = wordWidth).asOutput
val startOut = Bool().asOutput
va... | martinhath/bnn | src/main/scala/CircularPeekBuffer.scala | Scala | mit | 1,332 |
package observatory
import java.time.LocalDate
import org.apache.spark.sql.Dataset
import org.apache.spark.sql.functions._
/**
* 1st milestone: data extraction
*/
object Extraction {
import Spark.session.implicits._
import observatory.Implicits._
def readStations(stationsFile: String): Dataset[Station] =... | yurii-khomenko/fpScalaSpec | c5w1observatory/src/main/scala/observatory/Extraction.scala | Scala | gpl-3.0 | 2,387 |
package org.jetbrains.plugins.scala.lang.typeInference.generated
import org.jetbrains.plugins.scala.DependencyManagerBase._
import org.jetbrains.plugins.scala.SlowTests
import org.jetbrains.plugins.scala.base.libraryLoaders.{IvyManagedLoader, LibraryLoader}
import org.jetbrains.plugins.scala.lang.typeInference.TypeInf... | jastice/intellij-scala | scala/scala-impl/test/org/jetbrains/plugins/scala/lang/typeInference/generated/TypeInferenceSlickTest.scala | Scala | apache-2.0 | 939 |
package com.arcusys.learn.controllers.api
import com.arcusys.learn.exceptions.BadRequestException
import com.arcusys.learn.facades.{ PackageFacadeContract, TagFacadeContract }
import com.arcusys.learn.ioc.Configuration
import com.arcusys.learn.liferay.permission.{ PortletName, ModifyPermission, ViewPermission, Permiss... | icacic/Valamis | learn-portlet/src/main/scala/com/arcusys/learn/controllers/api/PackageApiController.scala | Scala | gpl-3.0 | 8,860 |
/*
* 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 ... | ueshin/apache-flink | flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/api/java/BatchTableEnvironment.scala | Scala | apache-2.0 | 11,775 |
package mu.node.echod.grpc
import java.security.PublicKey
import com.google.common.collect.Iterables
import io.grpc._
import mu.node.echod.models.UserContext
/*
* Obtain the user context by reading from the JSON Web Token that is sent as an OAuth bearer
* token with the HTTP request header.
*/
class UserContextSe... | vyshane/grpc-scala-microservice-kit | app/src/main/scala/grpc/UserContextServerInterceptor.scala | Scala | apache-2.0 | 1,547 |
package za.jwatson.glycanoweb.react
import japgolly.scalajs.react._
import japgolly.scalajs.react.extra._
import japgolly.scalajs.react.MonocleReact._
import japgolly.scalajs.react.vdom.prefix_<^._
import za.jwatson.glycanoweb.convention.Convention.Palette
import monocle.Monocle._
import za.jwatson.glycanoweb.react.... | james-za/glycano | core/src/main/scala/za/jwatson/glycanoweb/react/ResiduePanel.scala | Scala | mit | 5,689 |
package controllers
import models.dao.{ User, UserDAO }
import play.api.mvc._
trait SecuredController extends BaseController {
val userDAO: UserDAO
private def username(request: RequestHeader): Option[String] =
request.session.get("email")
private def onUnauthorized(request: RequestHeader): Result =
R... | jcranky/lojinha | app/controllers/SecuredController.scala | Scala | gpl-3.0 | 1,024 |
package org.apache.mesos.chronos.scheduler.jobs
import org.apache.mesos.chronos.scheduler.config.SchedulerConfiguration
import org.apache.mesos.chronos.scheduler.graph.JobGraph
import org.apache.mesos.chronos.scheduler.mesos.MesosOfferReviver
import org.apache.mesos.chronos.scheduler.state.PersistenceStore
import com.... | kapil-malik/chronos | src/test/scala/org/apache/mesos/chronos/scheduler/jobs/TaskManagerSpec.scala | Scala | apache-2.0 | 4,177 |
package org.nlogo.extensions.webview
import org.nlogo.nvm._
class NotifyingConcurrentJob(
delegate: Job,
val onFinished: (Option[AnyRef]) => Unit,
val onError: Exception => Unit)
extends ConcurrentJob(delegate.owner, delegate.agentset, delegate.topLevelProcedure, 0, delegate.parentContext, delegate.random) ... | NetLogo/webview | src/main/scala/NotifyingConcurrentJob.scala | Scala | cc0-1.0 | 762 |
package dotty.tools.dotc
package sbt
import core._
import Annotations._
import Contexts._
import Decorators._
import Denotations._
import Flags._
import Phases._
import Types._
import Symbols._
import NameOps._
import xsbti.api
import xsbti.api.SafeLazy.strict
/** Utilities to deal with xsbti.api.
*
* Mostly come... | som-snytt/dotty | compiler/src/dotty/tools/dotc/sbt/APIUtils.scala | Scala | apache-2.0 | 2,158 |
package org.oxygen.redio.gui
import io.netty.buffer.Unpooled
import net.minecraft.client.gui.{GuiButton, GuiTextField}
import net.minecraft.client.resources.I18n
import net.minecraft.network.PacketBuffer
import net.minecraft.network.play.client.C17PacketCustomPayload
import net.minecraft.tileentity.TileEntity
import n... | chenzhuoyu/RedIO | src/main/scala/org/oxygen/redio/gui/GuiSetName.scala | Scala | lgpl-2.1 | 2,334 |
/*
* (c) Copyright 2019 EntIT Software LLC, a Micro Focus company, L.P.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Apache License v2.0 which accompany this distribution.
*
* The Apache License is available at
* http://www.apache.org/licenses/LICE... | CloudSlang/cs-actions | cs-google/src/main/scala/io/cloudslang/content/google/actions/compute/compute_engine/networks/NetworksInsert.scala | Scala | apache-2.0 | 11,273 |
package com.seanshubin.learn.datomic.domain
class AddTaskServiceImpl(todoDatabaseService: TaskDatabaseService) extends AddTaskService {
override def addTodo(name: String): Long = ???
override def clearDone(): Unit = ???
override def setDone(id: Long, done: Boolean): Unit = ???
override def list(): Seq[Todo]... | SeanShubin/learn-datomic | domain/src/main/scala/com/seanshubin/learn/datomic/domain/AddTaskServiceImpl.scala | Scala | unlicense | 329 |
/*
* 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 ... | saltstar/spark | core/src/main/scala/org/apache/spark/util/Utils.scala | Scala | apache-2.0 | 107,740 |
package by.verkpavel.grafolnet.personal
import java.awt.Image
trait Personal {
def parse(item: Image)
} | VerkhovtsovPavel/BSUIR_Labs | Diploma/diplom/src/main/scala/by/verkpavel/grafolnet/personal/Personal.scala | Scala | mit | 107 |
package pureconfig
trait NamingConvention {
def toTokens(s: String): Seq[String]
def fromTokens(l: Seq[String]): String
}
trait CapitalizedWordsNamingConvention extends NamingConvention {
def toTokens(s: String): Seq[String] = {
CapitalizedWordsNamingConvention.wordBreakPattern.split(s).map(_.toLowerCase)
... | derekmorr/pureconfig | core/src/main/scala/pureconfig/NamingConvention.scala | Scala | mpl-2.0 | 1,800 |
/*
* 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 | e2/src/test/scala/org/apache/predictionio/e2/engine/CategoricalNaiveBayesTest.scala | Scala | apache-2.0 | 5,042 |
package de.frosner.broccoli.models
import enumeratum.{Enum, EnumEntry, PlayJsonEnum}
import scala.collection.immutable
sealed trait ParameterType extends EnumEntry with EnumEntry.Lowercase
object ParameterType extends Enum[ParameterType] with PlayJsonEnum[ParameterType] {
val values: immutable.IndexedSeq[Paramete... | FRosner/cluster-broccoli | server/src/main/scala/de/frosner/broccoli/models/ParameterType.scala | Scala | apache-2.0 | 513 |
/*
* Copyright 2012 杨博 (Yang Bo)
*
* 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... | Atry/commons-continuations | src/main/scala/com/dongxiguo/commons/continuations/SequentialRunner.scala | Scala | apache-2.0 | 6,621 |
package com.cds.learnscala.test.seqTest
object GivenNames {
def unapplySeq(name: String): Option[Seq[String]] = {
val names = name.trim.split(" ")
if (names.forall(_.isEmpty)) None
else Some(names)
}
}
| anancds/scala-project | learn-scala/src/main/scala/com/cds/learnscala/test/seqTest/GivenNames.scala | Scala | mit | 219 |
package io.mth.route
import scalaz._, Scalaz._
sealed trait Method {
def route[A](r: Route[A]): Route[A] =
Route.route(req =>
if (this == req.method)
r(req)
else
notfound
)
def apply[A](a: A) = constant(a)
def constant[A](a: A): Route[A] =
route(a.point[Route])
}
objec... | markhibberd/route | src/scala/io/mth/route/Method.scala | Scala | bsd-3-clause | 814 |
package com.daxin
//
//private[daxin] class Dog限制dog类只能在daxin包下或者daxin的子包下
//反编译之后的class文件是public权限的
private[daxin] class Dog {
var name:String=_
var age:Int=0
//测试文件去看com.test下面的DogTest.scala文件
}
//反编译之后的文件class是public权限的
//Cat后面的private是私有的构造方法,只能在期伴生对象中new
private[daxin] class Cat private{
v... | Dax1n/Scala | ObjectOrientedDemo/src/com/daxin/Dog.scala | Scala | apache-2.0 | 731 |
package org.scalafmt.cli
import java.io.File
import java.util.Date
import org.scalafmt.Versions
import org.scalafmt.config.Config
import org.scalafmt.util.AbsoluteFile
import org.scalafmt.util.BuildTime
import org.scalafmt.util.FileOps
import org.scalafmt.util.GitCommit
import scopt.OptionParser
object CliArgParser ... | Daxten/scalafmt | cli/src/main/scala/org/scalafmt/cli/CliArgParser.scala | Scala | apache-2.0 | 5,777 |
package latis.writer
import latis.dm._
/**
* Writes the .proto file that describes the dataset but contains no data or metadata.
*/
class ProtoWriter extends TextWriter {
override def makeHeader(dataset: Dataset): String = "message " + toCamelCase(dataset.getName) + " {" + newLine
override def makeFoote... | dlindhol/LaTiS | src/main/scala/latis/writer/ProtoWriter.scala | Scala | epl-1.0 | 4,890 |
package com.datastax.spark.connector.cql.sai
import com.datastax.oss.driver.api.core.CqlSession
import com.datastax.spark.connector.SparkCassandraITSpecBase
import com.datastax.spark.connector.cql.CassandraConnector
import com.datastax.spark.connector.datasource.{CassandraScan, CassandraScanBuilder}
import com.datasta... | datastax/spark-cassandra-connector | connector/src/it/scala/com/datastax/spark/connector/cql/sai/SaiBaseSpec.scala | Scala | apache-2.0 | 4,111 |
/*
* Copyright (C) 2009 Lalit Pant <pant.lalit@gmail.com>
*
* The contents of this file are subject to the GNU General Public License
* Version 3 (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.gnu.org/copyleft/gpl.html
*
*... | dotta/kojo | KojoEnv/src/net/kogics/kojo/turtle/Pen.scala | Scala | gpl-3.0 | 1,241 |
/*
Copyright 2016-17, Hasso-Plattner-Institut fuer Softwaresystemtechnik GmbH
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 applicab... | bpn1/ingestion | src/main/scala/de/hpi/ingestion/textmining/preprocessing/RedirectResolver.scala | Scala | apache-2.0 | 5,890 |
// scalac: -Xfatal-warnings
//
class A
case object B extends A
object Test {
val x1 = (B: A)
println(x1 == B) // no warning
println(B == x1) // no warning
val x2 = (B: A with Product)
println(x2 == B) // no warning
println(B == x2) // spurious warning: "always returns false"
}
| scala/scala | test/files/pos/t5932.scala | Scala | apache-2.0 | 295 |
package json.entity
import play.api.libs.json._
import plm.universe.Entity
import plm.universe.bugglequest.AbstractBuggle
import play.api.libs.json.Json.toJsFieldJsValueWrapper
object EntityToJson {
def entitiesWrite(entities: Array[Entity]): JsValue = {
var json: JsValue = Json.obj()
entities.foreach { ... | BaptisteMounier/webPLM | app/json/entity/EntityToJson.scala | Scala | agpl-3.0 | 715 |
package com.routably.beessolver.vrp.data
import com.routably.beessolver.vrp.Location
import com.routably.beessolver.vrp.Job
// Best
//
// 2960 976 -1168.37760100 ---------------------------
// COMMENT : (Christophides and Eilon)
object P09D151K14 extends Problem {
def maxVehicles = 15
def maxCapacity = 200
... | aishfenton/bees_solver | src/main/scala/com/routably/beessolver/vrp/data/P09D151K14.scala | Scala | mit | 3,136 |
/*
* Copyright 2011, Patrick Boe
* ===========================
* This program is distributed under the terms of the GNU General Public License.
*
* This file is part of Thimblus.
*
* Thimblus is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as publ... | patrickboe/thimblus | src/main/scala/org/thimblus/ssh/ssh.scala | Scala | gpl-3.0 | 1,231 |
package mesosphere.mesos
import mesosphere.marathon.MarathonTestHelper
import mesosphere.marathon.tasks.{ PortsMatcher, PortsMatch }
import org.scalatest.{ Matchers, GivenWhenThen, FunSuite }
import scala.collection.immutable.Seq
class ResourceMatchTest
extends FunSuite with GivenWhenThen with Matchers {
test("... | yp-engineering/marathon | src/test/scala/mesosphere/mesos/ResourceMatchTest.scala | Scala | apache-2.0 | 1,495 |
/**
* 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"); yo... | TiVo/kafka | core/src/test/scala/unit/kafka/coordinator/group/GroupMetadataManagerTest.scala | Scala | apache-2.0 | 115,351 |
package com.github.diegopacheco.sandbox.scala.camel.boot
import org.springframework.context.support.ClassPathXmlApplicationContext
import org.apache.camel.impl.DefaultCamelContext
import com.github.diegopacheco.sandbox.scala.camel.beans.Stopper
object MainApp extends App {
var ctx = new ClassPathXmlApplicationC... | diegopacheco/scala-playground | camel/camel-sandbox/src/main/scala/com/github/diegopacheco/sandbox/scala/camel/boot/MainApp.scala | Scala | unlicense | 578 |
import annotation.nowarn
trait Pattern {
trait NumericOps[T] extends Serializable {
def zero: T
def add(a: T, b: T): T
def add(a: T, b: T, c: T): T = add(a, add(b, c))
def sum(terms: Iterable[T]) = terms.foldLeft(zero)(add)
def sum(terms: Iterator[T]) = terms.foldLeft(zero)(add)
}
trait... | lrytz/scala | test/files/pos/patmat-exprs-b.scala | Scala | apache-2.0 | 1,436 |
/*
* 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/test/scala/org/neo4j/cypher/internal/compiler/v2_3/planner/logical/greedy/ProjectEndpointsTest.scala | Scala | apache-2.0 | 5,603 |
/*
* Copyright (c) 2013-2014 Telefónica Investigación y Desarrollo S.A.U.
*
* 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
*
* Unles... | telefonicaid/fiware-cosmos-platform | common/src/test/scala/es/tid/cosmos/common/WrappedTest.scala | Scala | apache-2.0 | 1,319 |
package org.crudible.lift.binding.model
import scala.xml.Text
import scala.xml.NodeSeq
import org.crudible.lift.util.WebHelpers
class LiftMarkup extends WebHelpers {
implicit def optStrToOptText(opt: Option[String]) = { opt.map(m => Text(m)) }
implicit def optIntToOptText(opt: Option[Int]) = { opt.map(m => Text(... | rehei/crudible | crudible-lift/src/main/scala/org/crudible/lift/binding/model/LiftMarkup.scala | Scala | apache-2.0 | 426 |
package tests.emptyparens
class C {
def f1()(implicit i: Int) = i
def f2()(using i: Int) = i
def f3(s: String)(implicit i: Int) = i
def f4(s: String)(using i: Int) = i
def f5()()(using i: Int) = i
def f6() = 1
def f7()() = 2
def f8(i: Int)() = 1
}
class C1()(implicit i: Int)
class C2()(using i... | dotty-staging/dotty | scaladoc-testcases/src/tests/emptyparens.scala | Scala | apache-2.0 | 360 |
/*
* # Trove
*
* This file is part of Trove - A FREE desktop budgeting application that
* helps you track your finances, FREES you from complex budgeting, and
* enables you to build your TROVE of savings!
*
* Copyright © 2016-2019 Eric John Fredericks.
*
* Trove is free software: you can redistribute it ... | emanchgo/budgetfree | src/main/scala/trove/ui/fxext/TextField.scala | Scala | gpl-3.0 | 1,645 |
/*
* DifferenceSpec.scala
*
* Copyright 2017 wayfarerx <x@wayfarerx.net> (@thewayfarerx)
*
* 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/LICENS... | wayfarerx/dreamsleeve | shared/data/src/test/scala/net/wayfarerx/dreamsleeve/data/DifferenceSpec.scala | Scala | apache-2.0 | 2,611 |
/**
* Copyright 2011-2016 GatlingCorp (http://gatling.io)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by appli... | GabrielPlassard/gatling | gatling-recorder/src/main/scala/io/gatling/recorder/scenario/ScenarioElement.scala | Scala | apache-2.0 | 6,042 |
/*
* 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 ... | zohar-mizrahi/flink | flink-libraries/flink-table/src/test/scala/org/apache/flink/table/expressions/utils/userDefinedScalarFunctions.scala | Scala | apache-2.0 | 5,715 |
package es.upm.oeg.epnoi.matching.metrics.corpus
import es.upm.oeg.epnoi.matching.metrics.domain.entity.{Metadata, RegularResource}
import es.upm.oeg.epnoi.matching.metrics.feature.LuceneTokenizer
import es.upm.oeg.epnoi.matching.metrics.topics._
import es.upm.oeg.epnoi.matching.metrics.utils.SparkWrapper
/**
* Corp... | cbadenes/epnoi-matching-metrics | src/test/scala/es/upm/oeg/epnoi/matching/metrics/corpus/Articles.scala | Scala | apache-2.0 | 2,557 |
package org.http4s.dsl
/** A conjunction extractor. Generally used as an infix operator.
*
* {{{
* scala> import org.http4s.dsl.&
* scala> object Even { def unapply(i: Int) = (i % 2) == 0 }
* scala> object Positive { def unapply(i: Int) = i > 0 }
* scala> def describe(i: Int) = i match {
* | case... | ChristopherDavenport/http4s | dsl/src/main/scala/org/http4s/dsl/and.scala | Scala | apache-2.0 | 871 |
/**
* 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... | Ishiihara/kafka | core/src/test/scala/integration/kafka/api/AdminClientIntegrationTest.scala | Scala | apache-2.0 | 62,709 |
package com.sksamuel.elastic4s
import com.sksamuel.elastic4s.DefinitionAttributes.{DefinitionAttributePreference, DefinitionAttributeRefresh}
import org.elasticsearch.action.get.MultiGetRequest.Item
import org.elasticsearch.action.get.{MultiGetRequest, MultiGetRequestBuilder, MultiGetResponse}
import org.elasticsearch... | ExNexu/elastic4s | elastic4s-core/src/main/scala/com/sksamuel/elastic4s/MultiGetDsl.scala | Scala | apache-2.0 | 1,306 |
/*
* Copyright 2016 Groupon, 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... | groupon/sparklint | src/main/scala/com/groupon/sparklint/events/FolderEventSourceGroupManager.scala | Scala | apache-2.0 | 1,809 |
/*
* 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/connectors/TaxEnrolmentsConnectorSpec.scala | Scala | apache-2.0 | 6,385 |
/***********************************************************************
* 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-raster/src/main/scala/org/locationtech/geomesa/raster/data/AccumuloRasterStore.scala | Scala | apache-2.0 | 16,090 |
package chandu0101.scalajs.react.components
package semanticui
import chandu0101.macros.tojs.JSMacro
import japgolly.scalajs.react._
import japgolly.scalajs.react.vdom.VdomNode
import scala.scalajs.js
import scala.scalajs.js.`|`
import scala.scalajs.js.annotation.JSName
/**
* This file is generated - submit issues ... | rleibman/scalajs-react-components | core/src/main/scala/chandu0101/scalajs/react/components/semanticui/SuiGridRow.scala | Scala | apache-2.0 | 1,355 |
//package com.burness.demo
//import org.json4s._
//import org.json4s.jackson.JsonMethods._
///**
// * Created by burness on 16/5/9.
// */
//class ReadConfig (private val configFile : String){
//
// def loadconfig(configFile :String): Unit ={
// val data = parse()
//
//
//
// }
//
//}
| spark-mler/algorithmEngine | src/main/scala/com.burness/algorithm/demo/ReadConfig.scala | Scala | apache-2.0 | 292 |
package sample.stream.data_transfer.utils
import akka.util.ByteString
trait CommonMarshallers extends SourceMarshallers {
implicit val stringMarshaller = marshaller[String](x => ByteString(x))
implicit val stringUnmarshaller = unmarshaller[String](x => x.utf8String)
implicit val bytesMarshaller = marshaller[By... | pallavig/akka-examples | src/main/scala/sample/stream/data_transfer/utils/CommonMarshallers.scala | Scala | cc0-1.0 | 412 |
/*
* Copyright (c) 2015-2022 Snowplow Analytics Ltd. All rights reserved.
*
* This program is licensed to you under the Apache License Version 2.0,
* and you may not use this file except in compliance with the Apache License Version 2.0.
* You may obtain a copy of the Apache License Version 2.0 at http://www.apach... | snowplow/scala-weather | src/main/scala/com.snowplowanalytics/weather/providers/darksky/CreateDarkSky.scala | Scala | apache-2.0 | 4,610 |
package filodb.core.metadata
import scala.collection.JavaConverters._
import com.typesafe.config.{Config, ConfigFactory, ConfigRenderOptions}
import net.ceedubs.ficus.Ficus._
import org.scalactic._
import filodb.core._
import filodb.core.binaryrecord2._
import filodb.core.downsample.{ChunkDownsampler, DownsamplePeri... | tuplejump/FiloDB | core/src/main/scala/filodb.core/metadata/Dataset.scala | Scala | apache-2.0 | 13,015 |
package concrete
import org.scalatest.FlatSpec
import org.scalatest.Matchers
import concrete.constraint.semantic.ClauseConstraint
/**
* @author vion
*/
class ProblemStateTest extends FlatSpec with Matchers {
"entailment manager" should "compute entailed constraint" in {
val v1 = new Variable("v1", BooleanDom... | concrete-cp/concrete | src/test/scala/concrete/ProblemStateTest.scala | Scala | lgpl-2.1 | 932 |
package bad.robot.temperature.server
import bad.robot.temperature._
import bad.robot.temperature.rrd.Host
import org.specs2.mutable.Specification
class ConnectionTest extends Specification {
"Encode Json" >> {
encode(Connection(Host("box.local", Some("Z"), Some("Europe/London")), IpAddress("127.0.0.1"))).space... | tobyweston/temperature-machine | src/test/scala/bad/robot/temperature/server/ConnectionTest.scala | Scala | apache-2.0 | 590 |
package sri.sangria.web.components
import sri.sangria.web.styles.Colors
import sri.universal.components.{View, _}
import sri.web.all._
import sri.web.styles.WebStyleSheet
import scala.scalajs.js.{UndefOr => U, undefined}
object Footer {
val Component = () => View(style = styles.footer)(
Text()("Built using Sri... | chandu0101/sri-sangria-example | web/src/main/scala/sri/sangria/web/components/Footer.scala | Scala | apache-2.0 | 610 |
// Solution-2.scala
// Solution to Exercise 2 in "Vectors"
import com.atomicscala.AtomicTest._
val v4 = Vector(Vector(0, 1, 2), Vector(3, 4, 5))
println(v4)
/* REPL Session:
scala> val v4 = Vector(Vector(0, 1, 2), Vector(3, 4, 5))
v4: scala.collection.immutable.Vector[scala.collection.immutable.Vector[Int]] = Vector(... | P7h/ScalaPlayground | Atomic Scala/atomic-scala-solutions/18_Vectors/Solution-2.scala | Scala | apache-2.0 | 422 |
package chapter3
import FilteringActorProtocol._
import akka.actor.{ActorRef, Props}
class FilteringActorTest extends tool.combinTestKitAndSpec{
"filter out message " in {
val props = Props(new FilteringActor(testActor, 5))
val filter = system.actorOf(props, "filter-1")
filter ! Event(1)
... | wjingyao2008/firsttry | myarchtype/src/test/scala/chapter3/FilteringActorTest.scala | Scala | apache-2.0 | 671 |
package uk.gov.gds.ier.transaction.crown.previousAddress
import uk.gov.gds.ier.transaction.crown.CrownControllers
import com.google.inject.{Inject, Singleton}
import uk.gov.gds.ier.config.Config
import uk.gov.gds.ier.security.EncryptionService
import uk.gov.gds.ier.serialiser.JsonSerialiser
import uk.gov.gds.ier.servi... | michaeldfallen/ier-frontend | app/uk/gov/gds/ier/transaction/crown/previousAddress/PreviousAddressPostcodeStep.scala | Scala | mit | 1,960 |
/*
* Copyright (c) 2014 Snowplow Analytics Ltd. All rights reserved.
*
* This program is licensed to you under the Apache License Version 2.0,
* and you may not use this file except in compliance with the Apache License Version 2.0.
* You may obtain a copy of the Apache License Version 2.0 at http://www.apache.org... | wesley1001/snowplow | 3-enrich/scala-hadoop-shred/project/Dependencies.scala | Scala | apache-2.0 | 3,474 |
/*
* Copyright (C) 2012 Pavel Fatin <http://pavelfatin.com>
*
* 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 version.
*
... | pavelfatin/toyfs | src/main/scala/com/pavelfatin/fs/internal/data/package.scala | Scala | gpl-3.0 | 880 |
package com.twitter.finagle.zookeeper
import com.twitter.finagle.common.zookeeper.{ZooKeeperClient, ZooKeeperUtils}
import com.twitter.concurrent.{Offer, Broker, AsyncMutex}
import com.twitter.finagle.addr.StabilizingAddr.State._
import com.twitter.finagle.util.InetSocketAddressUtil
import com.twitter.util.Duration
im... | twitter/finagle | finagle-serversets/src/main/scala/com/twitter/finagle/zookeeper/ZkClientFactory.scala | Scala | apache-2.0 | 1,858 |
package com.twitter.finagle
import com.twitter.conversions.DurationOps._
import com.twitter.finagle.benchmark.StdBenchAnnotations
import com.twitter.finagle.stats.InMemoryStatsReceiver
import com.twitter.util.{Await, Var}
import org.openjdk.jmh.annotations._
/**
* This is primarily a test for allocations not perform... | twitter/finagle | finagle-benchmark/src/main/scala/com/twitter/finagle/InetResolverBenchmark.scala | Scala | apache-2.0 | 980 |
package circumflex
package web
import java.lang.reflect.InvocationTargetException
import javax.servlet._
import javax.servlet.http.{HttpServletResponse, HttpServletRequest}
import java.io._
import util.control.ControlThrowable
import core._
/*!# Circumflex Filter
`CircumflexFilter` is an entry point of your web appl... | inca/circumflex | web/src/main/scala/filter.scala | Scala | bsd-2-clause | 6,808 |
/*
* Copyright 2016 Nikolay Donets
*
* 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 ... | nikdon/telepooz | src/main/scala/com/github/nikdon/telepooz/model/ParseMode.scala | Scala | apache-2.0 | 1,106 |
package com.twitter.finatra.http.internal.marshalling
import com.twitter.finagle.httpx.{Method, Request}
import com.twitter.finatra.http.fileupload.MultipartItem
import org.apache.commons.fileupload.{FileItemFactory, FileItemHeaders, FileItemIterator, FileUploadBase}
import org.apache.commons.io.IOUtils
import scala.c... | deanh/finatra | http/src/main/scala/com/twitter/finatra/http/internal/marshalling/FinatraFileUpload.scala | Scala | apache-2.0 | 2,044 |
/*
* Copyright (c) 2012-2014 Snowplow Analytics Ltd. All rights reserved.
*
* This program is licensed to you under the Apache License Version 2.0,
* and you may not use this file except in compliance with the Apache License Version 2.0.
* You may obtain a copy of the Apache License Version 2.0 at http://www.apach... | jramos/snowplow | 3-enrich/scala-common-enrich/src/test/scala/com.snowplowanalytics.snowplow.enrich.common/adapters/registry/CallrailAdapterSpec.scala | Scala | apache-2.0 | 6,177 |
package ch.bsisa.hyperbird.patman.simulations.actors
import akka.actor.{ Actor, ActorRef, ActorLogging }
import ch.bsisa.hyperbird.patman.simulations.messages._
import play.api.libs.concurrent.Akka
import scala.concurrent.duration._
import play.api.Play.current
import play.api.libs.concurrent.Execution.Implicits._
imp... | bsisa/hb-api | app/ch/bsisa/hyperbird/patman/simulations/actors/ShutdownCoordinatorActor.scala | Scala | gpl-2.0 | 2,001 |
package com.plasmaconduit.framework
import scala.collection.immutable.HashMap
final case class HttpSession(data: Map[String, String] = HashMap()) {
def withFreshData(newData: Map[String, String]): HttpSession = {
copy(data = newData)
}
def withData(moreData: Map[String, String]): HttpSession = {
with... | plasmaconduit/plasmaconduit-framework | src/main/scala/com/plasmaconduit/framework/HttpSession.scala | Scala | mit | 587 |
/*
* Copyright 2014 Christos KK Loverdos
*
* 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... | loverdos/topsort | src/main/test/scala/com/ckkloverdos/topsort/SymbolGraphTest.scala | Scala | apache-2.0 | 5,734 |
package edu.uwm.cs.pir.domain.features.concrete
/**
* The example will consume a list of images and desired feature names as input to allow PIR to perform indexing
* based on provided API name
*
*/
object DeclarativeTransformation extends App {
trait SpecEngine {
def parse(in: String): Spec
}
class Ke... | pir-dsl/pir-embedding | core/src/main/scala/edu/uwm/cs/pir/domain/features/concrete/DeclarativeTransformation.scala | Scala | gpl-2.0 | 2,160 |
/*
* 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 ... | SnappyDataInc/spark | sql/core/src/main/scala/org/apache/spark/sql/execution/exchange/ShuffleExchange.scala | Scala | apache-2.0 | 12,686 |
package org.jetbrains.plugins.scala.codeInspection
package unused
import com.intellij.codeInspection.LocalInspectionTool
import com.intellij.testFramework.EditorTestUtil
import org.jetbrains.plugins.scala.codeInspection.varCouldBeValInspection.VarCouldBeValInspection
/**
* Created by Svyatoslav Ilinskiy on 11.07.16... | jastice/intellij-scala | scala/scala-impl/test/org/jetbrains/plugins/scala/codeInspection/unused/VarCouldBeValInspectionTest.scala | Scala | apache-2.0 | 3,236 |
/*
* 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/keras/layers/Merge.scala | Scala | apache-2.0 | 9,617 |
/*
* 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 ... | shaneknapp/spark | resource-managers/kubernetes/integration-tests/src/test/scala/org/apache/spark/deploy/k8s/integrationtest/backend/IntegrationTestBackend.scala | Scala | apache-2.0 | 2,316 |
/*
* 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 ... | michalsenkyr/spark | sql/core/src/test/scala/org/apache/spark/sql/streaming/sources/StreamingDataSourceV2Suite.scala | Scala | apache-2.0 | 12,607 |
package lightning.server
import scala.util.Properties
import scalaz.NonEmptyList
import scalaz.Validation
import lightning.configuration.loader.FallbackConfigurationLoader
object Server extends App {
private def loadConfiguration() = {
lazy val config: String = Properties.propOrNone("config").getOrElse {
... | lancewalton/lightning | server/src/main/scala/lightning/server/Server.scala | Scala | mit | 1,140 |
package com.tutorial.sparksql.DataSources
import com.tutorial.utils.SparkCommon
import org.apache.spark.sql.SQLContext
/**
* Created by ved on 29/1/16.
*/
object CsvFile {
val sc = SparkCommon.sparkContext
val sqlContext = SparkCommon.sparkSQLContext
def main(args: Array[String]) {
val sqlContext = ... | rklick-solutions/spark-tutorial | src/main/scala/com/tutorial/sparksql/DataSources/CsvFile.scala | Scala | apache-2.0 | 892 |
package com.rayrobdod.boardGame
import org.scalatest.FunSpec
final class HorizontalHexagonalRoomTest extends FunSpec
with RoomTests
{
singleElementRoom("A Room containing a single space and no warps")(
idx = (0,0)
, unequalIndex = (1,1)
, clazz = " "
, generator = Room.horizontalHexagonalSpaceGenerator... | rayrobdod/boardGame | Model/src/test/scala/HorizontalHexagonalRoomTest.scala | Scala | gpl-3.0 | 2,981 |
/*
* 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 ... | mylog00/flink | flink-libraries/flink-table/src/test/scala/org/apache/flink/table/runtime/batch/table/AggregateITCase.scala | Scala | apache-2.0 | 16,814 |
package mesosphere.marathon
package core.storage.backup
import akka.Done
import akka.actor.ActorSystem
import akka.http.scaladsl.Http
import akka.stream.ActorMaterializer
import ch.qos.logback.classic.{ Level, Logger }
import com.typesafe.scalalogging.StrictLogging
import kamon.Kamon
import mesosphere.marathon.core.ba... | guenter/marathon | src/main/scala/mesosphere/marathon/core/storage/backup/Backup.scala | Scala | apache-2.0 | 3,741 |
package sangria.validation.rules
import sangria.ast
import sangria.ast.AstVisitorCommand._
import sangria.renderer.{QueryRenderer, SchemaRenderer}
import sangria.schema.LeafType
import sangria.validation._
import scala.language.postfixOps
/**
* Variables are input types
*
* A GraphQL operation is only valid if al... | narahari92/sangria | src/main/scala/sangria/validation/rules/VariablesAreInputTypes.scala | Scala | apache-2.0 | 895 |
/*
* 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 ... | nickhristov/norbert | network/src/main/scala/com/linkedin/norbert/network/netty/NettyNetworkServer.scala | Scala | apache-2.0 | 6,797 |
/*
* Copyright 2017 Zhang Di
*
* 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 ... | statgenetics/seqspark | src/main/scala/org/dizhang/seqspark/assoc/SKATO.scala | Scala | apache-2.0 | 13,746 |
package pimpathon
import scala.language.{dynamics, higherKinds, implicitConversions}
import _root_.argonaut.Json.{jFalse, jNull, jString, jTrue}
import _root_.argonaut.JsonObjectMonocle.{jObjectEach, jObjectFilterIndex}
import _root_.argonaut.JsonMonocle.{jArrayPrism, jObjectPrism}
import _root_.argonaut.{CodecJson, ... | stacycurl/pimpathon | src/main/scala/pimpathon/argonaut.scala | Scala | apache-2.0 | 37,104 |
package memnets.model.impl
import memnets.linalg._
import memnets.model.Tick._
import memnets.model.VariableType.Continuous
import memnets.model._
import memnets.utils._
import scala.collection.mutable.ArrayBuffer
private[model] final class DynamicSystemImpl(private val _matrix: WMatrix, val params: Params = new Par... | MemoryNetworks/memnets | api/src/main/scala/memnets/model/impl/DynamicSystemImpl.scala | Scala | apache-2.0 | 7,002 |
/***********************************************************************
* Copyright (c) 2013-2022 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... | locationtech/geomesa | geomesa-accumulo/geomesa-accumulo-datastore/src/main/scala/org/locationtech/geomesa/accumulo/iterators/Z2Iterator.scala | Scala | apache-2.0 | 1,212 |
/*
* Copyright (C) 2005, The Beangle Software.
*
* 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 3 of the License, or
* (at your option) any later version.
*
* This... | beangle/commons | core/src/test/scala/org/beangle/commons/lang/DatesTest.scala | Scala | lgpl-3.0 | 1,661 |
/***********************************************************************
* 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-index-api/src/main/scala/org/locationtech/geomesa/index/planning/QueryPlanner.scala | Scala | apache-2.0 | 12,652 |
package odfi.h2dl.indesign.top
import java.io.File
import odfi.h2dl.indesign.h2dl.interpreter.H2DLInterpreter
class TopScript(val path: File) {
// Intepreter
val interpreter = new H2DLInterpreter
interpreter.open
// State
var error: Option[Throwable] = None
def clean = error == None
def rerun = {
... | richnou/h2dl-indesign | src/main/scala/odfi/h2dl/indesign/top/TopScript.scala | Scala | gpl-2.0 | 453 |
package hr.fer.ztel.thesis.spark
import breeze.linalg.{SparseVector => BreezeSparseVector, DenseVector=>BreezeDenseVector}
import com.esotericsoftware.kryo.Kryo
import org.apache.spark.serializer.KryoRegistrator
class SparkKryoRegistrator extends KryoRegistrator {
override def registerClasses(kryo : Kryo) {
kr... | fpopic/master_thesis | src/main/scala/hr/fer/ztel/thesis/spark/SparkKryoRegistrator.scala | Scala | mit | 642 |
package controllers
import play.api.Play
import play.api.mvc._
import models._
import scala.xml.PCData
import org.joda.time.format.DateTimeFormat
import org.joda.time.DateTime
import javax.inject.Inject
class Rss @Inject() (
dumpDb: DumpDB,
tagDb: TagDB) extends Controller {
def dumps = Action { request =>
... | alexanderfloh/dmpster | app/controllers/Rss.scala | Scala | mit | 2,402 |
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.