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 flagship.console.layout
/**
* User: mtrupkin
* Date: 7/21/13
*/
case class LayoutData(snap: Boolean, grab: Boolean)
case class Layout(
left: LayoutData = LayoutData.NONE,
right: LayoutData = LayoutData.NONE,
top: LayoutData = LayoutData.NONE,
bottom: LayoutData = LayoutData.NONE)
object Layout {
... | mtrupkin/brace-for-impact | console-lib/src/main/scala/flagship/console/layout/Layout.scala | Scala | mit | 538 |
/*
Listok is a dialect of LISP
Copyright (C) 2011 Konstantin Boukreev
ru.kolyvan@gmail.com
This file is part of Listok.
Listok 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 ... | kolyvan/listok | src/main/scala/parser.scala | Scala | lgpl-3.0 | 8,493 |
package edu.rice.habanero.benchmarks.concdict
import java.util
import akka.actor.{ActorRef, Props}
import edu.rice.habanero.actors.{AkkaActor, AkkaActorState}
import edu.rice.habanero.benchmarks.concdict.DictionaryConfig.{DoWorkMessage, EndWorkMessage, ReadMessage, WriteMessage}
import edu.rice.habanero.benchmarks.{B... | shamsmahmood/savina | src/main/scala/edu/rice/habanero/benchmarks/concdict/DictionaryAkkaActorBenchmark.scala | Scala | gpl-2.0 | 4,066 |
/*
* 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 ... | WindCanDie/spark | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/CaseInsensitiveMap.scala | Scala | apache-2.0 | 2,295 |
package skuber.api.client.impl
import akka.actor.ActorSystem
import akka.event.Logging
import akka.http.scaladsl.marshalling.Marshal
import akka.http.scaladsl.model._
import akka.http.scaladsl.settings.{ClientConnectionSettings, ConnectionPoolSettings}
import akka.http.scaladsl.unmarshalling.Unmarshal
import akka.http... | doriordan/skuber | client/src/main/scala/skuber/api/client/impl/KubernetesClientImpl.scala | Scala | apache-2.0 | 32,453 |
/*
* Copyright 2016 Guy Van den Broeck and Wannes Meert (UCLA and KU Leuven)
*
* 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
*
* Un... | UCLA-StarAI/Forclift | src/main/scala/edu/ucla/cs/starai/forclift/examples/models/mln/OriginalFriendsSmokerModel.scala | Scala | apache-2.0 | 1,324 |
package com.sksamuel.elastic4s
import com.sksamuel.elastic4s.ElasticDsl._
import com.sksamuel.elastic4s.source.StringDocumentSource
import org.elasticsearch.action.ActionListener
import org.elasticsearch.action.admin.cluster.node.shutdown.NodesShutdownResponse
import org.elasticsearch.action.admin.indices.close.CloseI... | l15k4/elastic4s | elastic4s-core/src/main/scala/com/sksamuel/elastic4s/ElasticClient.scala | Scala | apache-2.0 | 9,251 |
package com.github.mdr.mash.compiler
import com.github.mdr.mash.parser.AbstractSyntax._
import com.github.mdr.mash.parser.{ Abstractifier, MashParser, Provenance }
import org.scalatest.{ FlatSpec, Matchers }
class ParenRemoverTest extends FlatSpec with Matchers {
"ParenRemover" should "remove parens" in {
val ... | mdr/mash | src/test/scala/com/github/mdr/mash/compiler/ParenRemoverTest.scala | Scala | mit | 1,419 |
/*
Copyright 2013 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... | suchang/zipkin | zipkin-storm/src/main/scala/com/twitter/zipkin/Serialization.scala | Scala | apache-2.0 | 2,101 |
var count = 1
/*start*/count += 1/*end*/
//Unit | ilinum/intellij-scala | testdata/typeInference/statements/AssignWithFunction.scala | Scala | apache-2.0 | 47 |
package hotpepper4s
/**
* @author ponkotuy
*/
trait CodeName {
import CodeName._
def code: String
def name: String
def toCodeName: CodeNameImpl = CodeNameImpl(code, name)
def toTuple: (String, String) = code -> name
}
object CodeName {
def apply(code: String, name :String): CodeName = CodeNameImpl(code,... | ponkotuy/hotpepper4s | src/main/scala/hotpepper4s/CodeName.scala | Scala | mit | 400 |
/**
* Copyright 2009 Google 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... | masterx2/noop | interpreter/src/main/scala/noop/interpreter/BlockScopes.scala | Scala | apache-2.0 | 2,061 |
package models.daos
import scala.Left
import scala.Right
import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.Future
import javax.inject.Inject
import javax.inject.Singleton
import models.Gallery
import play.api.libs.json.JsArray
import play.api.libs.json.JsBoolean
import play.api.libs.jso... | carlosFattor/DoceTentacaoScala | app/models/daos/GalleryDAOImp.scala | Scala | apache-2.0 | 4,271 |
package org.scaladebugger.api.profiles.java.info
import com.sun.jdi._
import org.scaladebugger.api.profiles.traits.info._
import org.scaladebugger.api.virtualmachines.ScalaVirtualMachine
import org.scaladebugger.test.helpers.ParallelMockFunSpec
import org.scalamock.scalatest.MockFactory
import org.scalatest.{FunSpec, ... | ensime/scala-debugger | scala-debugger-api/src/test/scala/org/scaladebugger/api/profiles/java/info/JavaFieldInfoSpec.scala | Scala | apache-2.0 | 11,355 |
/**
* Copyright (C) 2012-2013 Vadim Bartko (vadim.bartko@nevilon.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 2 of the License, or
* (at your option) any later ve... | hudvin/nomad | src/main/scala/com/nevilon/nomad/crawler/DomainInjector.scala | Scala | gpl-2.0 | 997 |
package mesosphere.marathon
package api.v2
import java.time.Clock
import java.net.URI
import javax.inject.Inject
import javax.servlet.http.HttpServletRequest
import javax.ws.rs._
import javax.ws.rs.container.{AsyncResponse, Suspended}
import javax.ws.rs.core.{Context, MediaType, Response}
import akka.event.EventStrea... | gsantovena/marathon | src/main/scala/mesosphere/marathon/api/v2/AppsResource.scala | Scala | apache-2.0 | 16,081 |
/*
* Copyright 2012-2014 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
*
* Unl... | weggert/sirius | src/main/scala/com/comcast/xfinity/sirius/api/impl/OrderedEvent.scala | Scala | apache-2.0 | 1,235 |
package org.trustedanalytics.sparktk.saveload
import org.apache.spark.SparkContext
import org.json4s.JsonAST.JValue
import org.trustedanalytics.sparktk.frame.Frame
import org.trustedanalytics.sparktk.models.dimreduction.pca.PcaModel
import org.trustedanalytics.sparktk.models.classification.naive_bayes.NaiveBayesModel
... | shibanis1/spark-tk | core/src/main/scala/org/trustedanalytics/sparktk/saveload/Loaders.scala | Scala | apache-2.0 | 2,280 |
package meerkat
import org.scalatest.{FlatSpec, Matchers}
class FSMTest extends FlatSpec with Matchers {
import TrafficLight._
"An FSM" should "transit correctly" in {
fsm ! Command.ready ! Command.go ! Command.stop ! Command.go
fsm.currentState should be (Light.green)
}
object TrafficLight {
... | dant3/meerkat | src/test/scala/meerkat/FSMTest.scala | Scala | apache-2.0 | 1,205 |
/***
* 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/JSONSchema.scala | Scala | apache-2.0 | 2,772 |
package org.coursera.courier
import org.coursera.courier.generator.NilGeneratorMixin
class ScalaGenerator() extends ConfigurableScalaGenerator(NilGeneratorMixin)
| coursera/courier | scala/generator/src/main/scala/org/coursera/courier/ScalaGenerator.scala | Scala | apache-2.0 | 164 |
/**
* Copyright 2015 Yahoo Inc. Licensed under the Apache License, Version 2.0
* See accompanying LICENSE file.
*/
package models.form
import kafka.manager.model.ClusterConfig
/**
* @author hiral
*/
sealed trait Operation
case object Enable extends Operation
case object Disable extends Operation
case object Del... | xuwei-k/kafka-manager | app/models/form/ClusterOperation.scala | Scala | apache-2.0 | 2,166 |
package com.sksamuel.elastic4s.index
import com.sksamuel.elastic4s.indexes.{IndexDefinition, IndexShowImplicits}
import com.sksamuel.elastic4s.{Executable, XContentFieldValueWriter}
import org.elasticsearch.action.index.{IndexRequestBuilder, IndexResponse}
import org.elasticsearch.client.Client
import org.elasticsearc... | tyth/elastic4s | elastic4s-tcp/src/main/scala/com/sksamuel/elastic4s/index/IndexExecutables.scala | Scala | apache-2.0 | 1,811 |
package edu.gemini.model.p1.targetio.table
import edu.gemini.model.p1.targetio.api._
import uk.ac.starlink.table.{StarTableOutput, RowListStarTable, StarTable}
import java.io.{FileOutputStream, BufferedOutputStream, OutputStream, File}
object TableWriter {
def toStarTable[R](rows: Iterable[R], cols: List[Column[R,_... | arturog8m/ocs | bundle/edu.gemini.model.p1.targetio/src/main/scala/edu/gemini/model/p1/targetio/table/TableWriter.scala | Scala | bsd-3-clause | 1,911 |
package asobu.distributed.service
import akka.ConfigurationException
import akka.actor.ActorSystem
import akka.util.Timeout
import asobu.distributed.protocol.EndpointDefinition
import asobu.distributed.{DefaultEndpointsRegistry, EndpointsRegistry, SystemValidator}
import asobu.distributed.protocol.Prefix
import play.a... | iheartradio/asobu | distributed/src/main/scala/asobu/distributed/service/ControllerRegister.scala | Scala | apache-2.0 | 2,939 |
/**
* Copyright 2015 Frank Austin Nothaft
*
* 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 ... | fnothaft/ananas | src/main/scala/net/fnothaft/ananas/models/IntMer.scala | Scala | apache-2.0 | 7,152 |
/*
* 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 ... | jatin9896/incubator-carbondata | integration/spark-common/src/main/scala/org/apache/spark/sql/execution/streaming/CarbonAppendableStreamSink.scala | Scala | apache-2.0 | 14,217 |
package coursier.util
import coursier.util.Monad.ops._
final case class EitherT[F[_], L, R](run: F[Either[L, R]]) {
def map[S](f: R => S)(implicit M: Monad[F]): EitherT[F, L, S] =
EitherT(
run.map(_.map(f))
)
def flatMap[S](f: R => EitherT[F, L, S])(implicit M: Monad[F]): EitherT[F, L, S] =
Ei... | alexarchambault/coursier | modules/util/shared/src/main/scala/coursier/util/EitherT.scala | Scala | apache-2.0 | 1,380 |
package com.overviewdocs.clustering
/** Debugging app, so we can check why clustering is failing.
*/
object DumpDocuments extends App {
if (args.length != 1) {
System.err.println("Usage: DumpDocuments [docset-id]")
System.exit(1)
}
val documents = new CatDocuments(args(0).toLong, None)
documents.fo... | overview/overview-server | worker/src/main/scala/com/overviewdocs/clustering/DumpDocuments.scala | Scala | agpl-3.0 | 440 |
package uScheduler.core.reader
import uScheduler.model.Group
import uScheduler.model.Lecture
import uScheduler.model.Student
import uScheduler.model.Event
case class Data(s: Seq[Student], l: Seq[Lecture], g: Seq[Group]) {
private lazy val event: Seq[Event] = g ++ l
lazy val conflicts = { for (e <- event.combinati... | LarsHadidi/uScheduler | src/main/scala/uScheduler/core/reader/Data.scala | Scala | apache-2.0 | 811 |
package autolift.cats
import autolift.cats.applicative._
import cats.implicits._
class LiftMergeTest extends BaseSpec{
"liftMerge on a Option[Int] from a Option[Int]" should "work" in{
val in = Option(1)
val out = in liftMerge in
same[Option[(Int,Int)]](out, Option(1 -> 1))
}
"liftMerge on a Either[Option]... | wheaties/AutoLifts | autolift-cats/src/test/scala/autolift/cats/LiftMergeTest.scala | Scala | apache-2.0 | 960 |
package com.flurdy.socialcrowd.model
import scala.collection.mutable.{MutableList,HashSet => MutableHashSet}
case class SocialMember(memberName: String){
val posts = new MutableList[SocialMessage]
val friends = new MutableHashSet[SocialMember]
def getPosts: List[SocialMessage] = posts.toList.sorted
... | flurdy/socialcrowd | src/main/scala/model/SocialMember.scala | Scala | mit | 740 |
package slack
import akka.actor._
import slack.rtm.SlackRtmClient
import scala.concurrent.duration._
object Main extends App {
val token = "..."
implicit val system = ActorSystem("slack")
implicit val ec = system.dispatcher
val client = SlackRtmClient(token)
val selfId = client.state.self.id
client.onE... | weirded/slack-scala-client | src/main/scala/slack/Main.scala | Scala | mit | 594 |
package juju.messages
import org.scalatest.{FunSuiteLike, Matchers}
case class DoSomething(foo: String) extends Command
case class SomethingDone(foo: String) extends DomainEvent
class MessageSpec extends FunSuiteLike with Matchers {
test("Created Command has a timestamp with default value") {
DoSomething("fak... | brokersquare/juju | core/src/test/scala/juju/messages/MessagesSpec.scala | Scala | apache-2.0 | 495 |
package org.scalaide.ui.internal.editor.decorators.implicits
import org.scalaide.core.extensions.SemanticHighlightingParticipant
/** This class is referenced through plugin.xml. */
class ImplicitHighlightingParticipant extends SemanticHighlightingParticipant(
viewer => new ImplicitHighlightingPresenter(viewer)) | Kwestor/scala-ide | org.scala-ide.sdt.core/src/org/scalaide/ui/internal/editor/decorators/implicits/ImplicitHighlightingParticipant.scala | Scala | bsd-3-clause | 318 |
import leon.lang._
object Arithmetic {
/* VSTTE 2008 - Dafny paper */
def mult(x : BigInt, y : BigInt): BigInt = ({
var r: BigInt = 0
if(y < 0) {
var n = y
(while(n != 0) {
r = r - x
n = n + 1
}) invariant(r == x * (y - n) && 0 <= -n)
} else {
var n = y
(w... | regb/leon | testcases/verification/xlang/math/Arithmetic.scala | Scala | gpl-3.0 | 1,787 |
/**
* Copyright 2013, 2016 Gianluca Amato
*
* This file is part of JANDOM: JVM-based Analyzer for Numerical DOMains
* JANDOM 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 Licens... | amato-gianluca/Jandom | core/src/test/scala/it/unich/jandom/utils/numberext/RationalExtSuite.scala | Scala | lgpl-3.0 | 5,790 |
/**
* Illustrates filtering and union to extract lines with "error" or "warning"
*/
package com.oreilly.learningsparkexamples.scala
import org.apache.spark._
import org.apache.spark.SparkContext._
object BasicFilterUnionCombo {
def main(args: Array[String]) {
val conf = new SparkConf
conf.setMaster(... | holdenk/learning-spark-examples | src/main/scala/com/oreilly/learningsparkexamples/scala/BasicFilterUnionCombo.scala | Scala | mit | 642 |
package com.github.jeroenr.tepkin.protocol.command
import com.github.jeroenr.bson.BsonDsl._
import com.github.jeroenr.bson.{BsonDocument, BsonDsl}
/**
* The findAndModify command modifies and returns a single document. By default, the returned document does not include
* the modifications made on the update. To ret... | jeroenr/tepkin | tepkin/src/main/scala/com/github/jeroenr/tepkin/protocol/command/FindAndModify.scala | Scala | apache-2.0 | 2,910 |
package slamdata.engine.physical.mongodb
sealed trait SortType {
def bson: Bson = this match {
case Ascending => Bson.Int32(1)
case Descending => Bson.Int32(-1)
}
}
case object Ascending extends SortType
case object Descending extends SortType | mossprescott/slamengine | src/main/scala/slamdata/engine/physical/mongodb/sort.scala | Scala | agpl-3.0 | 256 |
package io.udash.demos.rest
import io.udash._
import io.udash.demos.rest.model.{ContactId, PhoneBookId}
sealed abstract class RoutingState(val parentState: Option[ContainerRoutingState]) extends State {
type HierarchyRoot = RoutingState
def url(implicit application: Application[RoutingState]): String =
s"${a... | UdashFramework/udash-demos | rest-akka-http/frontend/src/main/scala/io/udash/demos/rest/states.scala | Scala | gpl-3.0 | 1,022 |
/*
The MIT License (MIT)
Copyright (c) 2013 Marco Rico Gomez <http://mrico.eu>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use,... | mrico/async-dbx-client | src/main/scala/OAuthHandler.scala | Scala | mit | 2,491 |
/*
* Copyright 2015 The SIRIS Project
*
* 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... | simulator-x/core | src/simx/core/svaractor/semantictrait/example/Test2.scala | Scala | apache-2.0 | 4,946 |
/**
* Copyright (C) 2011 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... | evlist/orbeon-forms | src/main/scala/org/orbeon/oxf/xforms/analysis/ElementAnalysis.scala | Scala | lgpl-2.1 | 21,215 |
package ch.hepia.abaplans.server
//#user-registry-actor
import akka.actor.{ Actor, ActorLogging, Props }
import scala.concurrent.Future
import scala.util.{ Failure, Success, Try }
//#user-case-classes
final case class User(name: String, age: Int, countryOfResidence: String)
final case class Users(users: Seq[User])
... | ABAPlan/abaplan-restapi | src/main/scala/ch/hepia/abaplans/server/MapRegistryActor.scala | Scala | mit | 4,427 |
package weaponmark
final case class BenchmarkResults(
usesPerTurn: Int,
turns: Int,
private var hits: Int = 0,
private var misses: Int = 0,
private var zeroDamage: Int = 0,
private var botches: Int = 0,
private var damage: Int = 0) {
//... | locke8/weaponmark | src/main/scala/weaponmark/BenchmarkResults.scala | Scala | mit | 1,701 |
package de.aderenbach.gatlingdsl.parser.simpledsl
import de.aderenbach.gatlingdsl.parser.{RampUp, Scenario, DslParser}
import io.gatling.core.Predef._
import io.gatling.core.structure.{ScenarioBuilder, PopulationBuilder}
import io.gatling.http.Predef._
import io.gatling.http.request.builder.HttpRequestBuilder
/**
* ... | aderenbach/gatlingDslDriver | src/main/scala/de/aderenbach/gatlingdsl/parser/simpledsl/SimpleDslSimlationBuilder.scala | Scala | mit | 1,368 |
/*
* 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 ... | hhbyyh/spark | resource-managers/yarn/src/test/scala/org/apache/spark/deploy/yarn/security/YARNHadoopDelegationTokenManagerSuite.scala | Scala | apache-2.0 | 1,898 |
package org.ferrit.dao.cassandra
import com.typesafe.config.Config
import com.datastax.driver.core.{Cluster, Session}
import com.datastax.driver.core.policies.Policies
import org.ferrit.core.model._
class CassandraPersistenceManager(config: CassandraConfig) {
val cluster: Cluster = CassandraPersistenceManager.i... | reggoodwin/ferrit | src/main/scala/org/ferrit/dao/cassandra/CassandraPersistenceManager.scala | Scala | mit | 1,496 |
/*
* 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 agreed to in ... | SRGOM/scalatest | project/GenContainBase.scala | Scala | apache-2.0 | 99,895 |
package com.overviewdocs.models.tables
import com.overviewdocs.database.Slick.api._
import com.overviewdocs.models.DocumentProcessingError
class DocumentProcessingErrorsImpl(tag: Tag) extends Table[DocumentProcessingError](tag, "document_processing_error") {
def id = column[Long]("id", O.PrimaryKey)
def documentS... | overview/overview-server | common/src/main/scala/com/overviewdocs/models/tables/DocumentProcessingErrors.scala | Scala | agpl-3.0 | 1,083 |
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2015-2021 Andre White.
*
* 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
*
* https://www.apache.org/licenses/LICENSE... | adarro/ddo-calc | subprojects/common/ddo-core/src/main/scala/io/truthencode/ddo/model/compendium/types/Animals.scala | Scala | apache-2.0 | 908 |
package com.github.ldaniels528.broadway.core.io.record.impl
import com.github.ldaniels528.broadway.core.io.Scope
import com.github.ldaniels528.broadway.core.io.record.{DataTypes, Field}
import org.scalatest.Matchers._
import org.scalatest.mock.MockitoSugar
import org.scalatest.{BeforeAndAfterEach, FeatureSpec, GivenWh... | ldaniels528/broadway | app-cli/src/test/scala/com/github/ldaniels528/broadway/core/io/record/impl/DelimiterRecordSpec.scala | Scala | apache-2.0 | 3,069 |
package com.sksamuel.elastic4s.indexes
import com.sksamuel.elastic4s.http.ElasticDsl
import com.sksamuel.elastic4s.testkit.DockerTests
import org.scalatest.{Matchers, WordSpec}
class DeleteIndexTest extends WordSpec with Matchers with DockerTests {
"delete index request" should {
"delete index" in {
cli... | Tecsisa/elastic4s | elastic4s-tests/src/test/scala/com/sksamuel/elastic4s/indexes/DeleteIndexTest.scala | Scala | apache-2.0 | 1,760 |
package org.aprsdroid.app
import android.content.Context
import android.content.Intent
import android.content.pm.PackageManager
import android.net.Uri
import android.view.MenuItem
import com.google.android.gms.common.GoogleApiAvailability
import com.google.android.gms.maps.GoogleMap
object MapModes {
val all_mapmod... | ge0rg/aprsdroid | src/MapMode.scala | Scala | gpl-2.0 | 2,938 |
package coder.simon.slots
import scala.util.Random
package object common {
case class Symbol(t: Int) extends AnyVal
case class Cell(x: Int, y: Int)
case class ReelInfo(numOfSymbols: Int, lenOfReel: Int)
type Matrix = Seq[Seq[Int]]
type Lines = Map[String, List[Cell]]
case class OneLineResult(name:Strin... | erlangxk/fpscala | src/main/scala/coder/simon/slots/common/package.scala | Scala | mit | 560 |
class Test:
import ArbitraryDerivation.given
private def test[A: Arbitrary]: Unit = {}
test[Foo] | dotty-staging/dotty | tests/pos/i13001/Test_2.scala | Scala | apache-2.0 | 102 |
import java.nio.file.Paths
import sbt.Keys.{version, _}
import sbt._
import MyTasks._
import bintray.BintrayPlugin.autoImport._
object Settings {
val commonSettings = Seq(
resolvers += Resolver.bintrayRepo("cuzfrog", "maven"),
organization := "com.github.cuzfrog",
scalacOptions ++= Seq(
//"-Xlin... | cuzfrog/sbt-tmpfs | project/Settings.scala | Scala | apache-2.0 | 2,458 |
/*
* 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 ... | jatin9896/incubator-carbondata | integration/spark2/src/main/spark2.2/org/apache/spark/sql/hive/CarbonInMemorySessionState.scala | Scala | apache-2.0 | 10,134 |
package org.genericConfig.admin.models.component
import org.genericConfig.admin.controllers.websocket.WebClient
import org.genericConfig.admin.models.logic.RidToHash
import org.genericConfig.admin.models.persistence.orientdb.PropertyKeys
import org.genericConfig.admin.models.{CommonFunction, common}
import org.generic... | gennadij/admin | server/test/org/genericConfig/admin/models/component/UpdateComponentSpecs.scala | Scala | apache-2.0 | 3,208 |
package sp.optimization.oscarmodels
import sp.optimization.OscaRModel
import oscar.cp.{CPModel, _}
class Queens(data: String) extends OscaRModel(data) with CPModel {
val nQueens = 8 // Number of queens
val Queens = 0 until nQueens
// Variables
val queens = Array.fill(nQueens)(CPIntVar.sparse(0, nQueens - 1)... | kristoferB/SP | sp1/src/main/scala/sp/optimization/models/OscaR/Queens.scala | Scala | mit | 720 |
/***********************************************************************
* Copyright (c) 2013-2019 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... | elahrvivaz/geomesa | geomesa-accumulo/geomesa-accumulo-datastore/src/test/scala/org/locationtech/geomesa/accumulo/data/BackCompatibilityTest.scala | Scala | apache-2.0 | 14,066 |
/*
* Copyright 2016 Guy Van den Broeck and Wannes Meert (UCLA and KU Leuven)
*
* 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
*
* Un... | UCLA-StarAI/Forclift | src/main/scala/edu/ucla/cs/starai/forclift/examples/Random3CNFCounter.scala | Scala | apache-2.0 | 6,574 |
/*
* Copyright (C) 2015 DANS - Data Archiving and Networked Services (info@dans.knaw.nl)
*
* 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
... | DANS-KNAW/easy-sword2 | src/test/scala/nl.knaw.dans.easy.sword2/BagExtractorSpec.scala | Scala | apache-2.0 | 4,212 |
/*
* 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 ... | ksattler/piglet | src/main/scala/dbis/pig/op/Foreach.scala | Scala | apache-2.0 | 9,521 |
/**
* 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... | roadboy/KafkaACL | core/src/test/scala/unit/kafka/log/LogTest.scala | Scala | apache-2.0 | 34,228 |
package com.github.truerss.base
import utest._
object EnclosureTypeTest extends TestSuite {
override val tests: Tests = Tests {
test("decode audio formats") {
test("audio/mpeg") {
assert(EnclosureType.withName("audio/mpeg") == EnclosureType.Audio.`audio/mpeg`)
}
test("audio/x-m4a") {
... | truerss/plugins | base/src/test/scala/com/github/truerss/base/EnclosureTypeTest.scala | Scala | mit | 1,108 |
// Project: surf (https://github.com/jokade/surf)
// Module: rest / shared
// Description: Interface for instances that resolve a RESTService for a given path.
// Copyright (c) 2016 Johannes Kastner <jokade@karchedon.de>
// Distributed under the MIT license (see included LICENSE file)
package su... | jokade/surf | rest/shared/src/main/scala/surf/rest/RESTResolver.scala | Scala | mit | 4,222 |
/*
* Copyright 2021 HM Revenue & Customs
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or a... | hmrc/amls-frontend | test/models/declaration/BusinessNominatedOfficerSpec.scala | Scala | apache-2.0 | 2,141 |
package org.zalando.grafter.macros
import scala.annotation.StaticAnnotation
import scala.language.experimental.macros
object ReadersMacro {
def impl(c: scala.reflect.macros.whitebox.Context)(annottees: c.Expr[Any]*): c.Expr[Any] = {
import c.universe._
val inputs : (Tree, Tree, Option[Tree]) =
annot... | jcranky/grafter | macros/src/main/scala/org/zalando/grafter/macros/ReadersMacro.scala | Scala | mit | 2,696 |
/*
* Copyright 2012 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 require... | Comcast/money | money-core/src/test/scala/com/comcast/money/core/samplers/AlwaysOnSamplerSpec.scala | Scala | apache-2.0 | 1,104 |
/*
* Copyright 2012 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... | jfeltesse-mdsol/zipkin | zipkin-receiver-scribe/src/test/scala/com/twitter/zipkin/receiver/scribe/ScribeSpanReceiverTest.scala | Scala | apache-2.0 | 4,694 |
package mesosphere.marathon.api.v2
import mesosphere.marathon.api.v2.json.Formats._
import mesosphere.marathon.state.AppDefinition
import mesosphere.marathon.state.PathId._
import mesosphere.marathon.{ MarathonConf, MarathonSpec }
import mesosphere.marathon.tasks.TaskQueue
import org.scalatest.Matchers
import play.api... | 14Zen/marathon | src/test/scala/mesosphere/marathon/api/v2/QueueResourceTest.scala | Scala | apache-2.0 | 1,293 |
/*
* 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 ... | caneGuy/spark | sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/InsertIntoHadoopFsRelationCommand.scala | Scala | apache-2.0 | 11,508 |
/*
Copyright 2016 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... | twitter/summingbird | summingbird-online/src/test/scala/com/twitter/summingbird/online/FutureQueueLaws.scala | Scala | apache-2.0 | 4,939 |
/**
* This file is part of mycollab-web.
*
* mycollab-web 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.
*
* mycollab-web is d... | maduhu/mycollab | mycollab-web/src/main/scala/com/esofthead/mycollab/module/user/accountsettings/view/parameters/RoleScreenData.scala | Scala | agpl-3.0 | 1,330 |
package uk.gov.digital.ho.proving.financialstatus.client
import java.util
import org.springframework.beans.factory.annotation.{Autowired, Value}
import org.springframework.http._
import org.springframework.retry.backoff.FixedBackOffPolicy
import org.springframework.retry.policy.SimpleRetryPolicy
import org.springfram... | UKHomeOffice/pttg-fs-api | src/main/scala/uk/gov/digital/ho/proving/financialstatus/client/HttpUtils.scala | Scala | mit | 2,524 |
package controllers
import exceptions.{ StorageInsertionException, AccessKeyException }
import play.api.mvc._
import java.util.zip.{ GZIPOutputStream, ZipEntry, ZipOutputStream, GZIPInputStream }
import java.io._
import org.apache.commons.io.{ FileUtils, IOUtils }
import play.api.libs.iteratee.Enumerator
import play.l... | delving/culture-hub | modules/dataset/app/controllers/SipCreatorEndPoint.scala | Scala | apache-2.0 | 28,513 |
/*
* Copyright (c) 2014 Ben Whitehead.
*
* 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 ... | BenWhitehead/finagle-gw2-client | src/main/scala/io/github/benwhitehead/gw2/api/model/Event.scala | Scala | apache-2.0 | 1,603 |
package net.lshift.diffa.kernel.config
import net.lshift.diffa.kernel.frontend.DomainEndpointDef
class NoopEndpointLifecycleListener extends EndpointLifecycleListener {
/**
* Indicates that the given endpoint has become available (or has been updated).
*/
def onEndpointAvailable(e: DomainEndpointDef) {}
... | 0x6e6562/diffa | kernel/src/main/scala/net/lshift/diffa/kernel/config/NoopEndpointLifecycleListener.scala | Scala | apache-2.0 | 496 |
/*------------------------------------------------------------------------------
MiniLight Scala : minimal global illumination renderer
Harrison Ainsworth / HXA7241 : 2008-2013
http://www.hxa.name/minilight
------------------------------------------------------------------------------*/
package hxa7241.ge... | hxa7241/minilight-scala | src/hxa7241/general/Random.scala | Scala | cc0-1.0 | 3,021 |
/*
* Copyright (C) 2017
*
* 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.
*
* This program is distributed in the hope t... | EasterTheBunny/ourdistrict | src/main/scala/code/model/CommitteeTopic.scala | Scala | gpl-3.0 | 1,445 |
package main
class WorldMap {
private var myRegions = Set.empty[Region]
private var mySuperRegions = Set.empty[SuperRegion]
def add(region: Region): Unit = {
myRegions += region
}
def add(region: SuperRegion): Unit = {
mySuperRegions += region
}
def getRegion(id: Int): Option[Region] = {
... | ramn/warlight-starterbot-scala | src/main/scala/main/WorldMap.scala | Scala | apache-2.0 | 1,453 |
// Copyright 2012 Foursquare Labs Inc. All Rights Reserved.
package io.fsq.hfile.common
trait HFileMetadataKeys {
val ThriftClassKey: String = "key.thrift.class"
val ThriftClassValue: String = "value.thrift.class"
val ThriftEncodingKey: String = "thrift.protocol.factory.class"
val TimestampKey: String = "gene... | foursquare/fsqio | src/jvm/io/fsq/hfile/common/HFileMetadataKeys.scala | Scala | apache-2.0 | 805 |
/*
* Copyright 2019 Spotify AB.
*
* 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 ... | regadas/scio | scio-jdbc/src/main/scala/com/spotify/scio/jdbc/JdbcIO.scala | Scala | apache-2.0 | 5,165 |
package com.socrata.soda.server.highlevel
import com.socrata.soda.clients.datacoordinator.{FeedbackSecondaryManifestClient, DataCoordinatorClient}
import com.socrata.soda.server.copy.{Published, Unpublished}
import com.socrata.soda.server.id.ResourceName
import com.socrata.soda.server.persistence.NameAndSchemaStore
im... | socrata-platform/soda-fountain | soda-fountain-lib/src/test/scala/com/socrata/soda/server/highlevel/DatasetDAOSpec.scala | Scala | apache-2.0 | 1,945 |
/*
* sbt
* Copyright 2011 - 2018, Lightbend, Inc.
* Copyright 2008 - 2010, Mark Harrah
* Licensed under Apache License 2.0 (see LICENSE)
*/
package sbt
package std
import scala.annotation.tailrec
import scala.reflect.macros._
import sbt.util.OptJsonWriter
private[sbt] object KeyMacro {
def settingKeyImpl[T: ... | xuwei-k/xsbt | main-settings/src/main/scala/sbt/std/KeyMacro.scala | Scala | apache-2.0 | 3,326 |
package streams
import common._
/**
* This component implements the solver for the Bloxorz game
*/
trait Solver extends GameDef {
/**
* Returns `true` if the block `b` is at the final position
*/
def done(b: Block): Boolean = b == Block(goal, goal)
/**
* This function takes two arguments: the curre... | syhan/coursera | progfun2/streams/src/main/scala/streams/Solver.scala | Scala | gpl-3.0 | 3,763 |
package org.jetbrains.plugins.scala.testingSupport.scalatest.scala2_10.scalatest1_9_2
import org.jetbrains.plugins.scala.DependencyManagerBase._
import org.jetbrains.plugins.scala.base.libraryLoaders.{IvyManagedLoader, LibraryLoader}
import org.jetbrains.plugins.scala.debugger.{ScalaVersion, Scala_2_10}
import org.jet... | jastice/intellij-scala | scala/scala-impl/test/org/jetbrains/plugins/scala/testingSupport/scalatest/scala2_10/scalatest1_9_2/Scalatest2_10_1_9_2_Base.scala | Scala | apache-2.0 | 709 |
/*
* 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/Spec.scala | Scala | apache-2.0 | 60,525 |
/*
*
* Copyright 2015 Gaëtan La Marca
*
* 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... | glamarca/cuam | app/controllers/permission/PermissionForms.scala | Scala | apache-2.0 | 752 |
/*
* Copyright 2017 Workday, Inc.
*
* This software is available under the MIT license.
* Please see the LICENSE.txt file in this project.
*/
package com.workday.esclient
/**
* Utility object for [[com.workday.esclient]] traits.
*/
object EsNames {
val FilterPath = "filter_path"
// Values for ES to retur... | Workday/escalar | src/main/scala/com/workday/esclient/EsNames.scala | Scala | mit | 1,388 |
import sbt._
import Keys._
import Helpers._
object Selenate extends Build {
lazy val root = top(
Seq(
Core.root
)
)
}
| mlegac/selenate | code/scala/project/Selenate.scala | Scala | bsd-3-clause | 140 |
package com.ajjpj.cassdriver.util
import java.nio.ByteBuffer
import com.ajjpj.cassdriver.AbstractCassDriverTest
class ParsableByteBuffersTest extends AbstractCassDriverTest {
private def parsableBuffer(bytes: Int*) = {
ParsableByteBuffers(Seq(buffer(bytes:_*)))
}
private def buffer(bytes: Int*) = {
va... | arnohaase/cass-driver | src/test/scala/com/ajjpj/cassdriver/util/ParsableByteBuffersTest.scala | Scala | apache-2.0 | 9,374 |
package net.cassite.jsonbind
import play.api.libs.json.{JsString, JsArray, JsObject, JsValue}
/**
* data and meta data of the json that is in parsing process
*/
class ParsingContext(val $scope: Scope, val appContext: AppContext) {
val ite = appContext.parsers.iterator
/**
* parse the current JsValue with th... | wkgcass/JsonBind | src/main/scala/net/cassite/jsonbind/ParsingContext.scala | Scala | mit | 2,912 |
package controllers
import play.api._
import play.api.mvc._
import play.api.data._
import play.api.data.Forms._
import models._
import views._
/**
* Manage projects related operations.
*/
object Projects extends Controller with Secured {
/**
* Display the dashboard.
*/
def index = IsAuthenticated { user... | sbtrun-maven-plugin/sbtrun-maven-test-projects | play23/scala/zentasks/app/controllers/Projects.scala | Scala | apache-2.0 | 2,557 |
package com.twitter.finatra.http.internal.request
import com.twitter.finagle.http.ParamMap
private[http] class RouteParamMap(
paramMap: => ParamMap, //avoid constructing paramMap from Finagle request unless needed
params: Map[String, String])
extends ParamMap {
override def isValid = paramMap.isValid
over... | syamantm/finatra | http/src/main/scala/com/twitter/finatra/http/internal/request/RouteParamMap.scala | Scala | apache-2.0 | 642 |
package wandou.math.random
/**
* Deterministic random number generators are repeatable, which can prove
* useful for testing and validation. This interface defines an operation
* to return the seed data from a repeatable RNG. This seed value can then
* be reused to create a random source with identical output.
... | wandoulabs/wandou-math | wandou-math/src/main/scala/wandou/math/random/RepeatableRNG.scala | Scala | apache-2.0 | 497 |
package ml.combust.mleap.core.feature
import ml.combust.mleap.core.Model
import ml.combust.mleap.core.types.{ScalarType, StructType}
/**
* Created by hollinwilkins on 12/27/16.
*/
sealed trait UnaryOperation {
def name: String
}
object UnaryOperation {
case object Log extends UnaryOperation {
override def... | combust-ml/mleap | mleap-core/src/main/scala/ml/combust/mleap/core/feature/MathUnaryModel.scala | Scala | apache-2.0 | 1,637 |
package com.microsoft.partnercatalyst.fortis.spark.sinks.cassandra.aggregators
import java.util.{Date, UUID}
import com.microsoft.partnercatalyst.fortis.spark.analyzer.timeseries.Period
import com.microsoft.partnercatalyst.fortis.spark.dba.ConfigurationManager
import com.microsoft.partnercatalyst.fortis.spark.dto.Sit... | CatalystCode/project-fortis-spark | src/test/scala/com/microsoft/partnercatalyst/fortis/spark/sinks/cassandra/aggregators/HeatmapsOfflineAggregatorTestSpec.scala | Scala | mit | 5,009 |
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.