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 ... | vgmartinez/incubator-zeppelin | scio/src/main/scala/org/apache/zeppelin/scio/ScioInterpreter.scala | Scala | apache-2.0 | 7,614 |
package com.monsanto.arch.kamon.prometheus.converter
import com.monsanto.arch.kamon.prometheus.PrometheusGen
import com.monsanto.arch.kamon.prometheus.metric.{Metric, MetricFamily}
import org.scalacheck.Gen
import org.scalatest.prop.GeneratorDrivenPropertyChecks
import org.scalatest.{Matchers, WordSpec}
/** A suite o... | MonsantoCo/kamon-prometheus | library/src/test/scala/com/monsanto/arch/kamon/prometheus/converter/MungersSpec.scala | Scala | bsd-3-clause | 4,967 |
package eva4s
package mutating
/** A mutagen that always uses the same probability.
*
* @param probability the probability for each generation
*/
case class ConstantMutagen(probability: Double) extends Mutagen {
override def apply(generation: Int): Double =
probability
override def toString: String =
... | wookietreiber/eva4s-old | core/main/scala/mutating/ConstantMutagen.scala | Scala | gpl-3.0 | 375 |
/*
* 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 ... | yu-iskw/spark-parallelized-sgd | src/test/scala/org/apache/spark/mllib/util/MLlibTestSparkContext.scala | Scala | apache-2.0 | 1,627 |
// Copyright: 2010 - 2018 https://github.com/ensime/ensime-server/graphs
// License: http://www.gnu.org/licenses/gpl-3.0.en.html
package org.ensime.core
import akka.util.ByteString
import org.ensime.api._
/**
* Provides a generic message encoding/dblocking I/O API for reading and writing to the wire.
*/
trait Proto... | yyadavalli/ensime-server | core/src/main/scala/org/ensime/core/Protocol.scala | Scala | gpl-3.0 | 670 |
package com.github.mdr.mash.completions
import com.github.mdr.mash.inference.Type
sealed trait CompletionSpec
object CompletionSpec {
case object Directory extends CompletionSpec
case object File extends CompletionSpec
case class Members(targetType: Type) extends CompletionSpec
case class Items(items: Seq[S... | mdr/mash | src/main/scala/com/github/mdr/mash/completions/CompletionSpec.scala | Scala | mit | 354 |
package iot.pood.base.config
import com.typesafe.config.Config
/**
* Created by rafik on 22.9.2017.
*/
trait Configurator[A] {
def appConfig: Config
def componentConfig: Config
def get(name: String):A
}
| rafajpet/iot-pood | iot-pood-base/src/main/scala/iot/pood/base/config/Configurator.scala | Scala | mit | 219 |
package com.roundeights.scalon
/**
* The base class for all nParser Exception
*/
abstract class nException(message: String) extends Exception(message)
/**
* Parsing Exception
*/
case class nParserException (message: String) extends nException(message)
/**
* Type mismatch errors
*/
case class nTypeMismatch (
... | Nycto/Scalon | src/main/scala/Scalon/Exceptions.scala | Scala | mit | 689 |
package edu.uwm.cs.dsl.mir.examples
import org.scalatest.FunSuite
import org.junit.runner.RunWith
import common._
import edu.uwm.cs.mir.prototypes.feature._
import edu.uwm.cs.mir.prototypes.utils._
import edu.uwm.cs.mir.prototypes.proj.lucene._
import edu.uwm.cs.mir.prototypes.composer._
import edu.uwm.cs.mir.prototyp... | pir-dsl/pir | core/src/test/scala/edu/uwm/cs/dsl/mir/examples/ImageQueryTestSuite.scala | Scala | gpl-2.0 | 1,173 |
/*
* Copyright (C) 2005, The OpenURP 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... | openurp/api | edu/src/main/scala/org/openurp/edu/program/domain/DefaultProgramMatcher.scala | Scala | lgpl-3.0 | 2,254 |
package teststate
import japgolly.scalajs.react._
import japgolly.scalajs.react.test._
import java.time.Instant
import teststate.data.{Failure, Or}
import teststate.typeclass.{ErrorHandler, ExecutionModel}
trait ExtScalaJsReact extends domzipper.Exports {
import ExtScalaJsReact._
final implicit def toReactExtHtm... | japgolly/test-state | ext-scalajs-react/src/main/scala/teststate/ExtScalaJsReact.scala | Scala | apache-2.0 | 4,145 |
package org.lolczak.dcg.parser
import org.lolczak.dcg.loader.GrammarLoader
import org.lolczak.dcg.model.Term
import org.lolczak.dcg.parser.grammar.GrammarParser._
import org.lolczak.dcg.parser.language.{Leaf, Node, ChartParser}
import org.scalatest.{Matchers, WordSpec}
import scala.io.Source
class ParserSpec extend... | lolczak/dcg | src/test/scala/org/lolczak/dcg/parser/ParserSpec.scala | Scala | apache-2.0 | 1,452 |
object HelloWorld {
/*
* This will print 'Hello World' as the output
*/
def main(args: Array[String]) {
println("Hello, world!") // prints Hello World
}
} | bikoheke/hacktoberfest | scripts/HelloWorld.scala | Scala | gpl-3.0 | 187 |
package knot.core.stream.flows
import java.util.concurrent.{CountDownLatch, TimeUnit, TimeoutException}
import knot.core.Done
import knot.core.stream.Flow
import knot.core.stream.ops.FlowOps
import knot.core.stream.ops.StreamOps.Completed
import knot.core.stream.plugs.{Input, OutputPort}
import knot.core.testKit.Cell... | defvar/knot | knot-core/src/test/scala/knot/core/stream/flows/FlowsSpec.scala | Scala | mit | 3,419 |
package com.translate.ideaplugin.api
import java.util
import com.translate.ideaplugin.config.LanguageConfigurable
import org.apache.http.client.config.RequestConfig
import org.apache.http.client.methods.HttpGet
import org.apache.http.client.utils.URLEncodedUtils
import org.apache.http.impl.client.HttpClientBuilder
im... | double-y/translation-idea-plugin | src/com/translate/ideaplugin/api/WordMeaningApi.scala | Scala | apache-2.0 | 2,413 |
/*
* Copyright 2016 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... | ahudspith-equalexperts/ct-calculations | src/main/scala/uk/gov/hmrc/ct/ct600e/v2/E15.scala | Scala | apache-2.0 | 876 |
package io.finch.internal
import com.twitter.concurrent.AsyncStream
import com.twitter.io.Buf
import com.twitter.util.Await
import io.finch._
import java.nio.charset.StandardCharsets
class ToResponseSpec extends FinchSpec {
behavior of "ToResponse"
it should "pick correct instance for AsyncStream[Buf]" in {
... | yanana/finch | core/src/test/scala/io/finch/internal/ToResponseSpec.scala | Scala | apache-2.0 | 613 |
package com.twitter.finagle.http
import com.twitter.finagle.Service
import com.twitter.util.{Await, Future, Time}
import java.net.InetSocketAddress
import java.util.Arrays.{equals => arrayEquals}
import org.ietf.jgss.GSSContext
import org.junit.runner.RunWith
import org.mockito.Matchers.any
import org.mockito.Mockito.... | sveinnfannar/finagle | finagle-http/src/test/scala/com/twitter/finagle/http/SpnegoAuthenticatorTest.scala | Scala | apache-2.0 | 3,179 |
/*
* 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 ... | manishgupta88/incubator-carbondata | integration/spark-common-cluster-test/src/test/scala/org/apache/spark/sql/common/util/QueryTest.scala | Scala | apache-2.0 | 10,837 |
/*
* Copyright 2019 ACINQ SAS
*
* 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... | ACINQ/eclair | eclair-core/src/test/scala/fr/acinq/eclair/channel/states/e/OfflineStateSpec.scala | Scala | apache-2.0 | 33,828 |
package wandou.avro
import java.io.ByteArrayOutputStream
import java.io.IOException
import java.io.StringWriter
import org.apache.avro.Schema
import org.apache.avro.Schema.Type
import org.apache.avro.generic.GenericDatumWriter
import org.apache.avro.generic.GenericEnumSymbol
import org.apache.avro.generic.IndexedRecor... | wandoulabs/avpath | src/main/scala/wandou/avro/ToJson.scala | Scala | apache-2.0 | 8,787 |
import actor.CellManager
import akka.actor.Props
import play.api.libs.concurrent.Akka
import play.api.{Application, GlobalSettings}
import play.api.Play.current
object Global extends GlobalSettings{
override def onStart(app: Application): Unit = {
super.onStart(app)
Akka.system.actorOf(Props[CellManager], "C... | semberal/good-cells | app/Global.scala | Scala | mit | 339 |
package cpup.mc.lib.util
import scala.collection.mutable
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
import net.minecraftforge.fml.common.gameevent.TickEvent
object TickUtil {
val handlers = new mutable.HashMap[(TickEvent.Type, TickEvent.Phase, Side.T), mutable.Queue[() => Unit]]
def register... | CoderPuppy/cpup-mc | src/main/scala/cpup/mc/lib/util/TickUtil.scala | Scala | mit | 855 |
package org.oxyjen.ozone.commands
import org.oxyjen.common.{ReturnCode, StdIo}
import org.oxyjen.ozone.commands.common._
object Search {
def main(args: String*): ReturnCode = {
if (args.length != 1) {
StdIo pute "Usage: ozone search <term>"
return ReturnCode.IncorrectNumberOfArguments
}
val... | skinny85/oxyjen | oxyjen-cli/src/main/scala/org/oxyjen/ozone/commands/Search.scala | Scala | mit | 1,075 |
package sangria.validation.rules
import sangria.ast
import sangria.ast.AstVisitorCommand._
import sangria.validation._
import scala.collection.mutable.{Set => MutableSet}
/**
* Unique operation names
*
* A GraphQL document is only valid if all defined operations have unique names.
*/
class UniqueOperationNames e... | narahari92/sangria | src/main/scala/sangria/validation/rules/UniqueOperationNames.scala | Scala | apache-2.0 | 803 |
/**
* Copyright 2015 Adrian Hurtado (adrianhurt)
*
* 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 l... | adrianhurt/play-bootstrap3 | play25-bootstrap4/module/test/FormsSpec.scala | Scala | apache-2.0 | 3,203 |
/*
* Copyright 2022 HM Revenue & Customs
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or a... | hmrc/iht-frontend | app/iht/models/des/ihtReturn/Trust.scala | Scala | apache-2.0 | 1,078 |
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.i18n.Messages
import service.WebHookService.WebHookPayload
import util.JGitUtil.CommitInfo
import util.Co... | ihad28/gitbucket | src/main/scala/app/RepositorySettingsController.scala | Scala | apache-2.0 | 10,163 |
/*
* 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 ... | romangarcia/fixturate | src/test/scala/fixturate/FixtureSpec.scala | Scala | apache-2.0 | 2,574 |
/**
* Copyright 2017 Daniel Götten
*
* 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 ag... | dangoe/freda | hikari-support/src/main/scala/de/dangoe/freda/hikari/HikariConnectionProvider.scala | Scala | apache-2.0 | 1,542 |
/**
* 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... | unix1986/universe | tool/kafka-0.8.1.1-src/core/src/main/scala/kafka/utils/Pool.scala | Scala | bsd-2-clause | 2,919 |
/*
* Copyright 2016 Alexey Kardapoltsev
*
* 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 ag... | kardapoltsev/astparser | src/test/scala/com/github/kardapoltsev/astparser/model/VersionsIntervalSpec.scala | Scala | apache-2.0 | 1,855 |
// Jubatus: Online machine learning framework for distributed environment
// Copyright (C) 2014-2015 Preferred Networks and Nippon Telegraph and Telephone Corporation.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License version 2.1... | jubatus/jubaql-server | processor/src/main/scala/us/jubat/jubaql_server/processor/json/Unregister.scala | Scala | lgpl-2.1 | 932 |
package ui.texture
class DataTexture(val data: Seq[Int]) extends Texture {
}
| gvatn/play-scalajs-webgl-spark | client/src/main/scala/ui/texture/DataTexture.scala | Scala | mit | 84 |
package com.datastax.spark.connector.cql
import scala.concurrent.Future
import com.datastax.spark.connector._
import com.datastax.spark.connector.cluster.DefaultCluster
class CassandraPartitionKeyWhereSpec extends SparkCassandraITFlatSpecBase with DefaultCluster {
override lazy val conn = CassandraConnector(defaul... | datastax/spark-cassandra-connector | connector/src/it/scala/com/datastax/spark/connector/cql/CassandraPartitionKeyWhereSpec.scala | Scala | apache-2.0 | 2,884 |
/*
* Sentilab SARE: a Sentiment Analysis Research Environment
* Copyright (C) 2013 Sabanci University Sentilab
* http://sentilab.sabanciuniv.edu
*
* This file is part of SARE.
*
* SARE is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published b... | musabhusaini/sare | sare-lib/modules/core/src/main/scala/edu/sabanciuniv/sentilab/core/models/UserInaccessibleModel.scala | Scala | gpl-3.0 | 1,226 |
package mesosphere.chaos.http
import com.codahale.metrics.jetty8.InstrumentedHandler
import com.google.inject._
import com.google.inject.servlet.GuiceFilter
import java.io.File
import java.net.InetSocketAddress
import java.util
import org.apache.log4j.Logger
import javax.servlet.DispatcherType
import org.eclipse.jetty... | spacejam/marathon | src/main/scala/chaos/http/HttpModule.scala | Scala | apache-2.0 | 7,305 |
package com.nekopiano.scala.jira.rest
import java.net.URI
import com.atlassian.jira.rest.client.internal.async.AsynchronousJiraRestClientFactory
import org.joda.time.DateTime
import org.joda.time.format._
import scala.collection.JavaConverters._
/**
* Created on 2015/12/02.
*/
object Auth {
def main(args: Ar... | lamusique/ScalaJIRA | src/main/scala/com/nekopiano/scala/jira/rest/Auth.scala | Scala | apache-2.0 | 2,059 |
package com.twitter.scalding
import cascading.flow.planner.PlannerException
/**
* Provide handlers and mapping for exceptions
* @param xMap - mapping as Map with Throwable class as key and String as value
* @param dVal - default value for undefined keys in mapping
*/
class XHandler(xMap: Map[Class[_ <: Throwable]... | danosipov/scalding | scalding-core/src/main/scala/com/twitter/scalding/XHandler.scala | Scala | apache-2.0 | 2,128 |
package leo.modules.encoding
import leo.{Checked, Ignored, LeoTestSuite}
import leo.datastructures.{Signature, Term, Type}
import leo.modules.input.Input
/**
* Checks whether the [[leo.modules.encoding.Monotonicity]] inference rules work as expected.
*
* @see [[leo.modules.encoding.BBPS]] -- the calculus tested... | leoprover/Leo-III | src/test/scala/leo/modules/encoding/MonotonicityTest.scala | Scala | bsd-3-clause | 3,687 |
package scells
import scala.swing._
import scala.swing.event._
class Spreadsheet(val height: Int, val width: Int) extends ScrollPane {
val cellModel = new Model(height, width)
import cellModel._
val table = new Table(height, width) {
rowHeight = 25
autoResizeMode = Table.AutoResizeMode.Off
showGrid... | mhotchen/programming-in-scala | src/scells/Spreadsheet.scala | Scala | apache-2.0 | 1,279 |
/*
* 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 ... | goldmedal/spark | external/kafka-0-10-sql/src/main/scala/org/apache/spark/sql/kafka010/producer/InternalKafkaProducerPool.scala | Scala | apache-2.0 | 7,244 |
/**
* Copyright (C) 2015 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 ap... | darroyocazorla/spark-mongodb | spark-mongodb/src/main/scala/com/stratio/datasource/mongodb/client/MongodbConnection.scala | Scala | apache-2.0 | 1,135 |
import scala.collection.JavaConversions.propertiesAsScalaMap
import scala.collection.Map
val props: Map[String, String] = System.getProperties()
val maxLength = props.keys.maxBy(_.length).length
for ((k, v) <- props) {
println(k + (" " * (maxLength - k.length + 10)) + " | " + v)
}
| demiazz/scala-impatient | chapter-04/exercise-07/main.scala | Scala | unlicense | 303 |
package controllers
import akka.actor.Actor
class SessionCleansingActor extends Actor{
def receive = {
case _ => SessionChecker.cleanse
}
} | richardchankiyin/sysdashboard | Portal/app/controllers/SessionCleansingActor.scala | Scala | gpl-3.0 | 149 |
/**
* Copyright 2016, deepsense.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 applicable law or agreed ... | deepsense-io/seahorse-workflow-executor | deeplang/src/main/scala/io/deepsense/deeplang/doperables/RowsFilterer.scala | Scala | apache-2.0 | 2,388 |
/*
Copyright 2013 Josh Conrad
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
di... | jmconrad/scala-groupcache | src/main/scala/groupcache/GroupCache.scala | Scala | apache-2.0 | 4,168 |
package provingground.translation
import provingground._, HoTT._
trait FoldedTerm[U <: Term with Subs[U]] extends Term {
val op: Func[U, Func[U, U]]
val elems: Iterable[U]
}
trait TermRec[U] {
val specialTerms: PartialFunction[Term, U]
def fromString(str: String)(implicit typ: Typ[Term]): U
def appln(fun... | siddhartha-gadgil/ProvingGround | core/src/main/scala/provingground/translation/TermRec.scala | Scala | mit | 2,131 |
package cucumber.runtime.scala
import _root_.java.lang.reflect.Type
import _root_.gherkin.formatter.model.Step
import _root_.gherkin.I18n
import _root_.java.util.regex.Pattern
import _root_.cucumber.runtime.StepDefinition
import _root_.cucumber.runtime.JdkPatternArgumentMatcher
import _root_.cucumber.runtime.Parameter... | chiranjith/cucumber-jvm | scala/src/main/scala/cucumber/runtime/scala/ScalaStepDefinition.scala | Scala | mit | 3,037 |
/**
* Copyright 2015, deepsense.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 applicable law or agreed ... | deepsense-io/seahorse-workflow-executor | deeplang/src/test/scala/io/deepsense/deeplang/doperables/SparkTransformerWrapperSpec.scala | Scala | apache-2.0 | 4,318 |
package controllers
import play.api.mvc.{Action, Controller}
import models.{CrawlerJobRun, CrawlerJob}
import no.bekk.bekkopen.mightycrawler.{Configuration, Crawler}
import org.slf4j.LoggerFactory
import play.api.db._
import play.api.Play.current
import play.api.libs.concurrent.Execution.Implicits.defaultContext
impo... | computerlove/Mightycrawler-Launcer | app/controllers/CrawlerJobRunner.scala | Scala | apache-2.0 | 2,908 |
/*
* La Trobe University - Distributed Deep Learning System
* Copyright 2016 Matthias Langer (t3l@threelights.de)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apa... | bashimao/ltudl | blaze/src/main/scala/edu/latrobe/blaze/optimizerexitcodes/ComplexExitCode.scala | Scala | apache-2.0 | 1,932 |
package mesosphere.marathon
package plugin.task
import mesosphere.marathon.plugin.{ApplicationSpec, PodSpec}
import mesosphere.marathon.plugin.plugin.Plugin
import org.apache.mesos.Protos.{ExecutorInfo, TaskGroupInfo, TaskInfo}
/**
* RunSpecTaskProcessor mutates a Mesos task info given some app specification.
*/
... | mesosphere/marathon | plugin-interface/src/main/scala/mesosphere/marathon/plugin/task/RunSpecTaskProcessor.scala | Scala | apache-2.0 | 1,239 |
package org.improving.scalify
import Scalify._
import org.eclipse.jdt.core.dom
import org.eclipse.jdt.core.compiler.IProblem
import scala.collection.immutable
import scala.collection.mutable.{ HashMap, HashSet }
// import scalaz.OptionW._
trait SafeImplicits
{
// why oh why
implicit def seqToList[T](x: Seq[T]): List... | mbana/scalify | src/main/node/NodeSafe.scala | Scala | isc | 6,398 |
package org.elinker.core.api.service
import akka.actor.Props
import org.elinker.core.api.process.EntityMentions
import spray.routing.PathMatchers.Segment
import spray.routing.{RequestContext, HttpService}
/**
* Created by nilesh on 03/06/15.
*/
trait MentionApiService extends HttpService {
def mentionActor(impli... | nilesh-c/elinker | src/main/scala/org/elinker/core/api/service/MentionApiService.scala | Scala | apache-2.0 | 937 |
package de.hska.wifl1011.seminararbeit
import scala.concurrent.{ future, Future }
import scala.concurrent.ExecutionContext.Implicits.global
import scala.util.Success
import scala.util.Random
object Main {
def main(args: Array[String]) {
val doctor1: Future[String] = future {
Thread.sleep(Random.nextInt(... | sputnik27/hska-seminararbeit | code/accident/Main.scala | Scala | mit | 925 |
package de.unihamburg.vsis.sddf.indexing
import org.apache.spark.rdd.RDD
import de.unihamburg.vsis.sddf.indexing.blocking.PipeBlockerSortedNeighborhood
import de.unihamburg.vsis.sddf.indexing.blocking.keygeneration.BlockingKeyBuilder
import de.unihamburg.vsis.sddf.pipe.PipeElement
import de.unihamburg.vsis.sddf.pipe.... | numbnut/sddf | src/main/scala/de/unihamburg/vsis/sddf/indexing/PipeIndexerSortedNeighborhood.scala | Scala | gpl-3.0 | 2,036 |
package org.jetbrains.plugins.scala.lang.completion.lookups
import com.intellij.codeInsight.lookup.LookupElement
import com.intellij.psi._
import org.jetbrains.plugins.scala.extensions._
import org.jetbrains.plugins.scala.lang.psi.ScalaPsiUtil
import org.jetbrains.plugins.scala.lang.psi.fake.FakePsiMethod
import org.j... | double-y/translation-idea-plugin | src/org/jetbrains/plugins/scala/lang/completion/lookups/LookupElementManager.scala | Scala | apache-2.0 | 3,923 |
/*
* 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/ListShouldBeEmptyLogicalAndSpec.scala | Scala | apache-2.0 | 10,833 |
package scala.meta.tests
package api
import scala.meta._
import scala.meta.semantic.Context
import scala.meta.dialects.Scala211
object ScalaDays {
def adtImpl(T: Type)(implicit c: Context) = {
T match {
case ref: Type.Ref =>
def validateLeaf(leaf: Member) = {
if (!leaf.isFinal) abort(s"$... | beni55/scalameta | scalameta/scalameta/src/test/scala/scala/meta/tests/api/ScalaDays.scala | Scala | bsd-3-clause | 2,963 |
/* Copyright (C) 2012-2013 Treode, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agr... | Treode/cps | src/stub/scala/com/treode/cps/stub/io/AbstractSocketStub.scala | Scala | apache-2.0 | 2,735 |
/**
* Copyright (C) 2015 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 ap... | luismcl/crossdata | core/src/main/scala/org/apache/spark/sql/crossdata/models/EphemeralStatusModel.scala | Scala | apache-2.0 | 859 |
package recfun
import org.scalatest.FunSuite
import org.junit.runner.RunWith
import org.scalatest.junit.JUnitRunner
@RunWith(classOf[JUnitRunner])
class BalanceSuite extends FunSuite {
import Main.balance
test("balance: '(if (zero? x) max (/ 1 x))' is balanced") {
assert(balance("(if (zero? x) max (/ 1 x))"... | faloi/progfun-scala | recfun/src/test/scala/recfun/BalanceSuite.scala | Scala | mit | 842 |
package net.liftweb.machine;
/* *\\
(c) 2006-2008 WorldWide Conferencing, LLC
Distributed under an Apache License
http://www.apache.org/licenses/LICENSE-2.0
\\* */
import _root_.net.liftweb.mapper._
import _root_.net.li... | andreum/liftweb | lift-machine/src/main/scala/net/liftweb/machine/ProtoStateMachine.scala | Scala | apache-2.0 | 11,881 |
package io.github.vigoo.barlang.compiler
import io.github.vigoo.barlang.compiler.Compiler.predefined
import io.github.vigoo.barlang.language.Expressions._
import io.github.vigoo.barlang.language.SingleStatements._
import io.github.vigoo.barlang.language.Statements.{NoOp, Sequence, Single}
import io.github.vigoo.barlan... | vigoo/barlang | src/main/scala/io/github/vigoo/barlang/compiler/Predefined.scala | Scala | apache-2.0 | 11,198 |
/*
* 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 ... | Panos-Bletsos/spark-cost-model-optimizer | sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveTableScanSuite.scala | Scala | apache-2.0 | 7,237 |
package gr.cslab.ece.ntua.musqle.plan
import gr.cslab.ece.ntua.musqle.plan.hypergraph.{AbstractPlan, DPJoinPlan}
import gr.cslab.ece.ntua.musqle.plan.spark.MuSQLEMove
import org.apache.log4j.Logger
import scala.collection.mutable
/**
* Created by vic on 9/3/2017.
*/
class Cache {
val logger = Logger.getLogger(... | gsvic/MuSQLE | src/main/scala/gr/cslab/ece/ntua/musqle/plan/Cache.scala | Scala | apache-2.0 | 1,378 |
/* - Coeus web framework -------------------------
*
* Licensed under the Apache License, Version 2.0.
*
* Author: Spiros Tzavellas
*/
package com.tzavellas.coeus.i18n.locale
import java.util.Locale
import org.junit.Test
import org.junit.Assert._
import org.springframework.mock.web.MockHttpServletRequest
class A... | sptz45/coeus | src/test/scala/com/tzavellas/coeus/i18n/locale/AcceptHeaderLocaleResolverTest.scala | Scala | apache-2.0 | 856 |
package konstructs.utils
import scala.collection.mutable
import scala.collection.JavaConverters._
import konstructs.Matrix
import konstructs.api._
case class BlockMachine(alphabet: Map[Char, BlockTypeId]) {
import BlockMachine._
def interpretJava(program: String, initPos: Position, initDir: Matrix):
java.u... | Henningstone/server | src/main/scala/konstructs/utils/blockmachine.scala | Scala | mit | 2,460 |
package sri.web.router
import sri.core.ReactElement
import sri.universal.components.NavigatorSceneConfig
import scala.scalajs.js
private[router]trait WebRouteDefinitions {
/**
* use this method define static routes in app
* @param page a StaticPage
* @param component static component that should be rende... | chandu0101/sri | web/src/main/scala/sri/web/router/WebRouteDefinitions.scala | Scala | apache-2.0 | 785 |
package org.machine.engine.graph.commands
import com.typesafe.scalalogging._
import org.neo4j.graphdb._
import scala.collection.JavaConversions._
import scala.collection.mutable.{ArrayBuffer, Map}
import org.machine.engine.exceptions._
import org.machine.engine.graph._
import org.machine.engine.graph.commands._
imp... | sholloway/graph-engine | src/main/scala/org/machine/engine/graph/commands/Shutdown.scala | Scala | mit | 1,633 |
import scala.quoted.*
object TestMacro {
def use(f: () => String): Unit = ()
inline def test: Unit = ${testImpl}
def testImpl(using Quotes): Expr[Unit] = {
import quotes.reflect.*
def resultDefBody(): Term = '{
val result: String = "xxx"
result
}.asTerm
val resultDefSymbol = Symbol... | dotty-staging/dotty | tests/pos-macros/i12309/Macro_1.scala | Scala | apache-2.0 | 755 |
/*
* Copyright 2022 HM Revenue & Customs
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or a... | hmrc/play-conditional-form-mapping | src/test/scala/uk/gov/voa/play/form/MandatoryIfAnyAreTrue.scala | Scala | apache-2.0 | 1,580 |
object desugar {
// variables
var x: Int = 2
var y = x * x
val list = List(1, 2, 3)
{ var z: Int = y }
def foo0(first: Int, second: Int = 2, third: Int = 3) = first + second
def foo1(first: Int, second: Int = 2)(third: Int = 3) = first + second
def foo2(first: Int)(second: Int = 2)(third: Int = 3) =... | DarkDimius/dotty | tests/pos/desugar.scala | Scala | bsd-3-clause | 2,117 |
package io.github.binaryfoo.lagotto.shell.output
import io.github.binaryfoo.lagotto.dictionary.DataDictionary
import io.github.binaryfoo.lagotto.shell.{ContentType, PlainText, OutputFormat}
import io.github.binaryfoo.lagotto.{JposEntry, LogEntry}
import scala.collection.mutable
case class NamedAttributesFormat(dicti... | binaryfoo/lagotto | src/main/scala/io/github/binaryfoo/lagotto/shell/output/NamedAttributesFormat.scala | Scala | mit | 1,490 |
package controllers
import javax.inject.Inject
import com.mohiva.play.silhouette.api._
import com.mohiva.play.silhouette.api.exceptions.ProviderException
import com.mohiva.play.silhouette.api.services.AuthInfoService
import com.mohiva.play.silhouette.impl.authenticators.JWTAuthenticator
import com.mohiva.play.silhouet... | BaptisteMounier/webPLM | app/controllers/SocialAuthController.scala | Scala | agpl-3.0 | 3,067 |
package edu.berkeley.eecs.btrdb.sparkconn.util
import java.io.FileInputStream
import java.util.Properties
/**
* Created by almightykim on 6/13/15.
*/
class BTrDBConf(
val btrdbconf:String,
val cephconf:String
) extends Serializable {
val (cmons, mserver, qcoll ) = {
// get
var qconf = new Properties... | SoftwareDefinedBuildings/quasar-spark-connector | src/main/scala/edu/berkeley/eecs/btrdb/sparkconn/util/BTrDBConf.scala | Scala | gpl-3.0 | 1,075 |
package step8
case class Item(name: String)
trait Result
case class ResultP(tail: Result, item: Item) extends Result {
override def toString: String = s"($tail, ${item.name})"
}
case object ResultZero extends Result {
override def toString: String = "Zero"
}
trait Num {
def 被索取(cTree: CTree): Result
}
case cla... | djx314/ubw | a42-stream/src/main/scala/step8/建模.scala | Scala | bsd-3-clause | 6,222 |
package scalan.it.lms.MappingMethodFromJar
object run {
def main(args: Array[String]): Unit = {
println(execute(new Exception("xxx")))
}
def execute(s: Throwable): String = {
val m = new MappingMethodFromJar()
m(s)
}
} | scalan/scalan | lms-backend/tests/src/it/resources/scalan/it/lms/MappingMethodFromJar/run.scala | Scala | apache-2.0 | 240 |
package org.scalatra
import skinny.micro.SkinnyMicroServlet
import skinny.micro.routing.{ PathPattern, RouteMatcher }
class UrlGeneratorTestServlet extends SkinnyMicroServlet {
val cat: String = "meea"
val simpleString = get("/foo") {}
val singleNamed = get("/foo/:bar") {}
val multipleNameds = get("/foo/:b... | xerial/skinny-micro | micro/src/test/scala/org/scalatra/UrlGeneratorTestServlet.scala | Scala | bsd-2-clause | 1,386 |
/**
* 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 not us... | geeag/kafka | core/src/test/scala/integration/kafka/api/ConsumerBounceTest.scala | Scala | apache-2.0 | 6,110 |
package io.bartholomews.spotify4s.core.entities
case class NewReleases(albums: Page[SimpleAlbum])
| bartholomews/spotify-scala-client | modules/core/src/main/scala/io/bartholomews/spotify4s/core/entities/NewReleases.scala | Scala | mit | 99 |
package de.unihamburg.vsis.sddf.classification
import scala.beans.BeanInfo
import org.apache.spark.mllib.classification.NaiveBayes
import org.apache.spark.mllib.linalg.Vectors
import org.apache.spark.mllib.regression.LabeledPoint
import org.apache.spark.rdd.RDD
import de.unihamburg.vsis.sddf.SddfContext.SymPairSim
imp... | numbnut/sddf | src/main/scala/de/unihamburg/vsis/sddf/classification/PipeClassificationSvm.scala | Scala | gpl-3.0 | 1,158 |
package ttfi
import shapeless.Poly1
trait IntroHOIF {
sealed trait Var[-Env, +T]
case class VZ[Env, T]() extends Var[(T, Env), T]
case class VS[Env, T, A](prev: Var[Env, T]) extends Var[(A, Env), T]
def mkVZ[Env, T]: Var[(T, Env), T] = VZ[Env, T]()
def mkVS[Env, T, A](prev: Var[Env, T]): Var[(A, Env), T] =... | mjhopkins/ttfi | src/scala/ttfi/IntroHOIF.scala | Scala | apache-2.0 | 2,305 |
/*
* Copyright 2014–2020 SlamData Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agr... | slamdata/quasar | foundation/src/main/scala/quasar/fp/ski/package.scala | Scala | apache-2.0 | 1,611 |
package io.udash.web.commons.styles
import io.udash.css.CssBase
import io.udash.web.commons.styles.utils._
import scalacss.internal.{Attr, Literal}
import scala.language.postfixOps
trait DefaultStyles extends CssBase {
import dsl._
style(
unsafeRoot( """
|html, body, div, span, applet, obj... | UdashFramework/udash-core | guide/shared/src/main/scala/io/udash/web/commons/styles/DefaultStyles.scala | Scala | apache-2.0 | 4,687 |
/*
* Copyright 2012 Tumblr 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... | chang2394/zipkin | zipkin-redis/src/test/scala/com/twitter/zipkin/storage/redis/RedisHashSpec.scala | Scala | apache-2.0 | 2,335 |
package org.jetbrains.plugins.scala
package lang
package parser
package parsing
package base
import org.jetbrains.plugins.scala.lang.lexer.ScalaTokenTypes
import org.jetbrains.plugins.scala.lang.parser.parsing.builder.ScalaPsiBuilder
import org.jetbrains.plugins.scala.lang.parser.parsing.expressions.ArgumentExprs
impo... | triggerNZ/intellij-scala | src/org/jetbrains/plugins/scala/lang/parser/parsing/base/Constructor.scala | Scala | apache-2.0 | 1,297 |
/**
* 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... | gf53520/kafka | core/src/test/scala/unit/kafka/server/ReplicationQuotaManagerTest.scala | Scala | apache-2.0 | 4,366 |
/*
* 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 ... | jkbradley/spark | sql/core/v1.2/src/test/scala/org/apache/spark/sql/execution/datasources/orc/OrcFilterSuite.scala | Scala | apache-2.0 | 20,315 |
package scala.slick.ast
abstract class ColumnOption[+T]
object ColumnOption {
case object NotNull extends ColumnOption[Nothing]
case object Nullable extends ColumnOption[Nothing]
case object PrimaryKey extends ColumnOption[Nothing]
case class Default[T](val defaultValue: T) extends ColumnOption[T]
case clas... | boldradius/slick | src/main/scala/scala/slick/ast/ColumnOption.scala | Scala | bsd-2-clause | 433 |
/*
* 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 n... | Chasego/kafka | core/src/test/scala/unit/kafka/coordinator/transaction/TransactionCoordinatorTest.scala | Scala | apache-2.0 | 57,977 |
package forcomp
import org.scalatest.FunSuite
import org.junit.runner.RunWith
import org.scalatest.junit.JUnitRunner
import Anagrams._
@RunWith(classOf[JUnitRunner])
class AnagramsSuite extends FunSuite {
test("wordOccurrences: abcd") {
assert(wordOccurrences("abcd") === List(('a', 1), ('b', 1), ('c', 1), ('... | mateusduboli/coursera-progfun | forcomp/src/test/scala/forcomp/AnagramsSuite.scala | Scala | unlicense | 3,851 |
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... | scalameta/scalameta | tests/jvm/src/test/scala/scala/meta/tests/semanticdb/TargetedSuite.scala | Scala | bsd-3-clause | 6,137 |
object ObjectApply {
def apply(x: Int) = x
def apply(x: Double, y: Int) = x/y
}
ObjectApply(<caret>)
/*
x: Double, y: Int
x: Int
*/ | ilinum/intellij-scala | testdata/parameterInfo/functionParameterInfo/apply/ObjectApply.scala | Scala | apache-2.0 | 136 |
/*
* 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 ... | rekhajoshm/spark | core/src/main/scala/org/apache/spark/SparkContext.scala | Scala | apache-2.0 | 120,810 |
package models
import play.api.libs.json.Json
/**
* Created by jyothi on 25/6/17.
*/
case class TextModel(
_id: String,
text: String,
views: Int,
//language: Option[String],
tags: List[String],
... | vachin/web | app/models/TextModel.scala | Scala | mit | 1,519 |
/*
* Copyright (c) 2014-2018 by The Monix Project Developers.
* See the project homepage at: https://monix.io
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache... | Wogan/monix | monix-execution/jvm/src/main/scala/monix/execution/atomic/AtomicNumber.scala | Scala | apache-2.0 | 2,431 |
package co.ledger.wallet.web.ripple.components
import biz.enef.angulate.Module.RichModule
import biz.enef.angulate.{Component, ComponentDef}
import scala.scalajs.js
/**
*
* ProgressBar
* ledger-wallet-ripple-chrome
*
* Created by Pierre Pollastri on 10/05/2016.
*
* The MIT License (MIT)
*
* Copyrig... | LedgerHQ/ledger-wallet-ripple | src/main/scala/co/ledger/wallet/web/ripple/components/ProgressBar.scala | Scala | mit | 2,294 |
package org.opencommercesearch.bson
import java.util.Date
import reactivemongo.bson._
/**
* Some implicit conversions
*
* @author rmerizalde
*/
object BSONFormats {
implicit object BSONDateTimeHandler extends BSONHandler[BSONDateTime, Date] {
def read(date: BSONDateTime) = new Date(date.value)
def writ... | madickson/opencommercesearch | opencommercesearch-api/app/org/opencommercesearch/bson/BSONFormats.scala | Scala | apache-2.0 | 1,261 |
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.