code stringlengths 5 1M | repo_name stringlengths 5 109 | path stringlengths 6 208 | language stringclasses 1
value | license stringclasses 15
values | size int64 5 1M |
|---|---|---|---|---|---|
package com.gilt.thehand
import org.scalatest.FlatSpec
import com.gilt.thehand.test.RuleTester
/**
* This is a trait that can be used to test custom rules in a comprehensive manner. All classes that inherit from this
* trait should call the 'runTests' method with a Map of Rules to a tuple containing two lists: the ... | gilt/the-hand | src/test/scala/com/gilt/thehand/AbstractRuleSpec.scala | Scala | apache-2.0 | 979 |
/*
* 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-reactive/shared/src/test/scala/monix/reactive/internal/operators/DistinctUntilChangedByKeySuite.scala | Scala | apache-2.0 | 2,429 |
package com.arcusys.learn.scorm.manifest.sequencing.storage.impl
import com.arcusys.learn.storage.impl.{ EntityStorageExt, KeyedEntityStorageExt }
import com.arcusys.valamis.lesson.scorm.model.manifest._
import com.arcusys.valamis.lesson.scorm.storage.sequencing._
/**
* User: Yulia.Glushonkova
* Date: 09.04.13
*/
... | ViLPy/Valamis | learn-persistence-api/src/main/scala/com/arcusys/learn/scorm/manifest/sequencing/storage/impl/SequencingEntityStorage.scala | Scala | lgpl-3.0 | 5,191 |
/*
* Copyright (c) 2013 Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Fou... | relite/Relite | test-src/test2.scala | Scala | agpl-3.0 | 2,502 |
/*
* Copyright (c) 2017 Magomed Abdurakhmanov, Hypertino
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
*/
package com.hypertino.facade.filter.parser
import c... | hypertino/hyperfacade | src/main/scala/com/hypertino/facade/filter/parser/IpParser.scala | Scala | mpl-2.0 | 3,364 |
package controllers
import play.api.libs.json._
import play.api.mvc._
import lila.api.Context
import lila.app._
import lila.common.HTTPRequest
import views._
object Timeline extends LilaController {
def home = Auth { implicit ctx =>
import lila.timeline.Entry.entryWrites
val nb = getInt("nb").fold(100)(_ ... | clarkerubber/lila | app/controllers/Timeline.scala | Scala | agpl-3.0 | 984 |
/*
* 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 ... | bwsw/sj-platform | core/sj-crud-rest/src/test/scala-2.12/com/bwsw/sj/crud/rest/instance/destroyer/InstanceDestroyerMocks.scala | Scala | apache-2.0 | 3,046 |
package com.felixmilea.vorbit.main
import akka.actor.Props
import com.felixmilea.vorbit.actors.ActorManager._
import com.felixmilea.vorbit.reddit.mining.RedditMiningManager
import com.felixmilea.vorbit.reddit.mining.RedditMiner
import com.felixmilea.vorbit.utils.AppUtils
import com.felixmilea.vorbit.utils.Loggable
ob... | felixmc/Felix-Milea-Ciobanu-Vorbit | code/com/felixmilea/vorbit/main/MinerTest.scala | Scala | mit | 954 |
/*
* 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 ... | wgpshashank/spark | core/src/main/scala/spark/RDD.scala | Scala | apache-2.0 | 35,378 |
package Foos
object Outer {
class X
object x
}
| lampepfl/dotty | tests/pos-special/fatal-warnings/i2673.scala | Scala | apache-2.0 | 52 |
/**
* Copyright (C) 2009-2014 Typesafe Inc. <http://www.typesafe.com>
*/
package akka.zeromq
import org.zeromq.ZMQ.{ Socket, Poller }
import org.zeromq.{ ZMQ ⇒ JZMQ }
import akka.actor._
import scala.collection.immutable
import scala.annotation.tailrec
import scala.concurrent.{ Promise, Future }
import scala.concurr... | Fincore/org.spark-project.akka | zeromq/src/main/scala/akka/zeromq/ConcurrentSocketActor.scala | Scala | mit | 9,037 |
/**
* Copyright (C) 2010 Orbeon, Inc.
*
* This program is free software; you can redistribute it and/or modify it under the terms of the
* GNU Lesser General Public License as published by the Free Software Foundation; either version
* 2.1 of the License, or (at your option) any later version.
*
* This program i... | orbeon/orbeon-forms | xforms-runtime/shared/src/main/scala/org/orbeon/oxf/xforms/event/events/XXFormsDndEvent.scala | Scala | lgpl-2.1 | 1,274 |
/*
* Contributions:
* Jean-Francois GUENA: implement "suffixed collection name" feature (issue #39 partially fulfilled)
* ...
*/
package akka.contrib.persistence.mongodb
import akka.actor.ActorSystem
import akka.persistence.PersistentRepr
import akka.serialization.{SerializationExtension, Serialization}
import c... | alari/akka-persistence-mongo | common/src/test/scala/akka/contrib/persistence/mongodb/JournalUpgradeSpec.scala | Scala | apache-2.0 | 6,850 |
/*
* Copyright (c) 2013-2014 Plausible Labs Cooperative, Inc.
* All rights reserved.
*
* 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 limitati... | plausiblelabs/sbt-keychain | src/main/scala/coop/plausible/sbt/keychain/git/GitConfigOption.scala | Scala | mit | 1,457 |
/*
* 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/test/scala/com/intel/analytics/bigdl/dllib/nn/ops/TensorArraySplitSpec.scala | Scala | apache-2.0 | 2,361 |
package com.fang.page
import com.thoughtworks.binding.{Binding, dom}
import org.scalajs.dom.raw.{Event, Node}
import com.fang.ImplicitConvert._
import com.fang.UserSession
import com.fang.ajax.UserAPI
import com.fang.data.AjaxResult.{Error, Ok}
import com.fang.data.GlobalValue
import com.fang.page.DomUtil.{bindInputVa... | TianhaoFang/online-go | js/src/main/scala/com/fang/page/LoginPage.scala | Scala | mit | 2,501 |
package spark.examples
import scala.math.random
import spark._
import SparkContext._
/** Computes an approximation to pi */
object SparkPi {
def main(args: Array[String]) {
/*if (args.length == 0) {
System.err.println("Usage: SparkPi <master> [<slices>]")
System.exit(1)
}*/
val spark = new S... | prabeesh/Spark-Kestrel | examples/src/main/scala/spark/examples/SparkPi.scala | Scala | bsd-3-clause | 778 |
package cn.changhong.web.util
import java.util.UUID
import cn.changhong.web.init.GlobalConfigFactory
import cn.changhong.web.persistent.RedisPoolManager
import com.twitter.finagle.http.Request
import org.slf4j.LoggerFactory
/**
* Created by yangguo on 14-12-11.
*/
abstract class TokenManager{
protected def gener... | guoyang2011/myfinagle | WebTemplate/src/main/scala/cn/changhong/web/util/TokenUtil.scala | Scala | apache-2.0 | 2,623 |
/*
* Copyright 2019 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-config | src/main/scala/uk/gov/hmrc/play/config/ControllerConfig.scala | Scala | apache-2.0 | 1,647 |
package inloopio.math.indicator
/**
* Define it as a RuntimeException, because this issue should be resolved in developing
*
* @author Caoyuan Deng
*/
final class BaseSerNotSetException(message: String) extends RuntimeException(message)
| dcaoyuan/inloopio-libs | inloopio-math/src/main/scala/inloopio/math/indicator/BaseSerNotSetException.scala | Scala | bsd-3-clause | 242 |
/*
* Copyright © 2017 University of Texas at Arlington
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by appli... | fegaras/DIQL | src/main/scala/edu/uta/diql/Normalizer.scala | Scala | apache-2.0 | 4,285 |
package mesosphere.marathon.core.matcher.reconcile
import akka.event.EventStream
import mesosphere.marathon.core.base.Clock
import mesosphere.marathon.core.flow.ReviveOffersConfig
import mesosphere.marathon.core.leadership.LeadershipModule
import mesosphere.marathon.core.matcher.base.OfferMatcher
import mesosphere.mar... | timcharper/marathon | src/main/scala/mesosphere/marathon/core/matcher/reconcile/OfferMatcherReconciliationModule.scala | Scala | apache-2.0 | 1,769 |
package com.twitter.finagle.memcached
import scala.collection.{immutable, mutable}
import _root_.java.lang.{Boolean => JBoolean, Long => JLong}
import _root_.java.net.{SocketAddress, InetSocketAddress}
import _root_.java.util.{Map => JMap}
import com.twitter.concurrent.{Broker, Offer}
import com.twitter.conversions... | firebase/finagle | finagle-memcached/src/main/scala/com/twitter/finagle/memcached/Client.scala | Scala | apache-2.0 | 33,422 |
/*
* Copyright 2001-2013 Artima, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agre... | dotty-staging/scalatest | scalatest-test/src/test/scala/org/scalatest/AsyncFunSuiteSpec.scala | Scala | apache-2.0 | 26,363 |
package dotty.tools.dotc.quoted
import dotty.tools.dotc.core.Contexts._
import dotty.tools.dotc.util.Property
import dotty.tools.dotc.ast.tpd
object QuotesCache {
import tpd._
/** A key to be used in a context property that caches the unpickled trees */
private val QuotesCacheKey = new Property.Key[collection... | dotty-staging/dotty | compiler/src/dotty/tools/dotc/quoted/QuotesCache.scala | Scala | apache-2.0 | 892 |
/* sbt -- Simple Build Tool
* Copyright 2010 Mark Harrah
*/
package xsbt.api
import xsbti.api._
import scala.collection.mutable
class Visit {
private[this] val visitedStructures = new mutable.HashSet[Structure]
private[this] val visitedClassLike = new mutable.HashSet[ClassLike]
def visit(s: Source): Unit = v... | xeno-by/old-scalameta-sbt | compile/api/src/main/scala/xsbt/api/Visit.scala | Scala | bsd-3-clause | 6,149 |
// Copyright: 2010 - 2016 https://github.com/ensime/ensime-server/graphs
// License: http://www.gnu.org/licenses/gpl-3.0.en.html
package org.ensime.core
import java.io.{ File, IOException }
import java.util.jar.JarFile
import java.util.regex.Pattern
import org.apache.commons.lang.StringEscapeUtils
import scala.io.Sour... | espinhogr/ensime-server | core/src/main/scala/org/ensime/core/DocUsecaseHandling.scala | Scala | gpl-3.0 | 2,500 |
package com.twitter.util
/*
* Copyright 2011 Twitter, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License. You may obtain
* a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by ... | mosesn/util | util-codec/src/test/scala/com/twitter/util/StringEncoderSpec.scala | Scala | apache-2.0 | 2,033 |
package spark.streaming
import collection.mutable.{SynchronizedBuffer, ArrayBuffer}
import java.util.{List => JList}
import spark.streaming.api.java.{JavaPairDStream, JavaDStreamLike, JavaDStream, JavaStreamingContext}
import spark.streaming._
import java.util.ArrayList
import collection.JavaConversions._
/** Exposes... | koeninger/spark | streaming/src/test/java/spark/streaming/JavaTestUtils.scala | Scala | bsd-3-clause | 2,432 |
package chiselutils.utils
import Chisel._
/** This object allows the assignment of a dynamic section of a vector to another
* Allowing vecOut(5,1) := vecIn(6, 2), where the indexs can be dynamically specified
*/
object DynamicVecAssign {
def apply[T <: Data]( vecOut : Vec[T], hiOut : UInt, loOut : UInt, vecIn :... | da-steve101/chisel-utils | src/main/scala/chiselutils/utils/DynamicVecAssign.scala | Scala | lgpl-3.0 | 936 |
package org.skycastle.entity
/**
* A trigger that triggers at every change.
*/
class HairTrigger extends Trigger {
def init(value: Any, triggerListener : => Unit, timestamp: Long) {}
def valueChanged(newValue: Any, timestamp: Long) : Boolean = true
} | weimingtom/skycastle | src/main/scala/org/skycastle/entity/HairTrigger.scala | Scala | gpl-2.0 | 259 |
package com.jreadability.main
import java.lang.StringBuilder
import java.io._
import scala._
import scala.io.Source
/**
* Scala Porter Stemmer Implementation
*
*/
object Stemmer {
def stem (str: String): String = {
// check for zero length
if (str.length() > 3) {
// all characters must be letters
... | ifesdjeen/jReadability | src/scala/main/com/jreadability/main/Stemmer.scala | Scala | apache-2.0 | 12,259 |
package sri.sangria.web.components
import sri.core._
import sri.sangria.web.model.TodoJS
import sri.sangria.web.styles.{Theme, Colors}
import sri.universal.ReactUniversal
import sri.universal.components._
import sri.web.all._
import sri.web.styles.WebStyleSheet
import scala.scalajs.js
import scala.scalajs.js.Dynamic.{... | chandu0101/sri-sangria-example | web/src/main/scala/sri/sangria/web/components/TodoList.scala | Scala | apache-2.0 | 1,841 |
/*
* Copyright (c) 2014 Paul Bernard
*
* 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... | quantintel/spectrum | financial/src/main/scala/org/quantintel/ql/util/Observer.scala | Scala | apache-2.0 | 786 |
package spire.example
import Predef.{any2stringadd => _, intWrapper => _, _}
import spire.algebra._
import spire.std.BooleanIsRig
import spire.implicits._
import scala.reflect.ClassTag
import scala.annotation.tailrec
/**
* These examples are taken from http://r6.ca/blog/20110808T035622Z.html.
*
* The goal is to ... | lrytz/spire | examples/src/main/scala/spire/example/kleene.scala | Scala | mit | 19,596 |
/*
* Copyright 2021 HM Revenue & Customs
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or a... | hmrc/ct-calculations | src/main/scala/uk/gov/hmrc/ct/accounts/frs105/boxes/AC416.scala | Scala | apache-2.0 | 1,104 |
/*
* Copyright (C) 2016-2017 TU Delft, The Netherlands
*
* 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.
*
* Thi... | HamidMushtaq/SparkGA1 | program/src/main/scala/hmushtaq/sparkga1/utils/SamRecsReader.scala | Scala | gpl-3.0 | 3,850 |
/*
* Scala (https://www.scala-lang.org)
*
* Copyright EPFL and Lightbend, Inc.
*
* Licensed under Apache License 2.0
* (http://www.apache.org/licenses/LICENSE-2.0).
*
* See the NOTICE file distributed with this work for
* additional information regarding copyright ownership.
*/
package scala
package util.par... | scala/scala-parser-combinators | shared/src/main/scala/scala/util/parsing/combinator/token/StdTokens.scala | Scala | apache-2.0 | 1,051 |
// Generated by https://github.com/tanishiking/semanticdb-for-scala3
// Generated by the Scala Plugin for the Protocol Buffer Compiler.
// Do not edit!
//
// Protofile syntax: PROTO3
package dotty.tools.dotc.semanticdb
import dotty.tools.dotc.semanticdb.internal._
import scala.annotation.internal.sharable
@SerialVers... | dotty-staging/dotty | compiler/src/dotty/tools/dotc/semanticdb/generated/SymbolInformation.scala | Scala | apache-2.0 | 26,712 |
/*
* Part of NDLA learningpath-api.
* Copyright (C) 2016 NDLA
*
* See LICENSE
*
*/
package no.ndla.learningpathapi
import com.typesafe.scalalogging.LazyLogging
import no.ndla.learningpathapi.model.domain.Language
import no.ndla.network.{AuthUser, Domains}
import no.ndla.network.secrets.PropertyKeys
import scal... | NDLANO/learningpath-api | src/main/scala/no/ndla/learningpathapi/LearningpathApiProperties.scala | Scala | gpl-3.0 | 4,462 |
package frameless
package ml
package classification
import shapeless.test.illTyped
import org.apache.spark.ml.linalg._
import frameless.ml.params.trees.FeatureSubsetStrategy
import org.scalacheck.{Arbitrary, Gen}
import org.scalacheck.Prop._
import org.scalatest.matchers.must.Matchers
class TypedRandomForestClassifie... | imarios/frameless | ml/src/test/scala/frameless/ml/classification/TypedRandomForestClassifierTests.scala | Scala | apache-2.0 | 3,447 |
/*
* 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 ... | zuotingbing/spark | sql/core/src/test/scala/org/apache/spark/sql/streaming/StreamSuite.scala | Scala | apache-2.0 | 51,336 |
/*
* Copyright 2017 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... | pncampbell/ct-calculations | src/main/scala/uk/gov/hmrc/ct/accounts/frsse2008/micro/AC411.scala | Scala | apache-2.0 | 1,147 |
/*
* ******************************************************************************
* * Copyright (C) 2013 Christopher Harris (Itszuvalex)
* * [email protected]
* *
* * This program is free software; you can redistribute it and/or
* * modify it under the terms of the GNU General Public License
* * as p... | Itszuvalex/Femtocraft-alpha-1 | src/main/java/com/itszuvalex/femtocraft/industry/blocks/BlockFemtoRepurposer.scala | Scala | gpl-2.0 | 4,148 |
package worker
import scala.concurrent.duration._
import java.io.Serializable
import java.io.ByteArrayInputStream
import java.io.ByteArrayOutputStream
import java.io.ObjectInputStream
import java.io.ObjectOutputStream
import com.sandinh.paho.akka._
import com.sandinh.paho.akka.MqttPubSub._
object MqttConfig {
val... | oel/akka-iot-mqtt | src/main/scala/worker/MqttConfig.scala | Scala | lgpl-3.0 | 1,378 |
/*
* 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-google-cloud-platform/src/main/scala/com/spotify/scio/bigquery/BigQueryTypes.scala | Scala | apache-2.0 | 10,568 |
package com.twitter.finagle.httpx.filter
import com.twitter.finagle.{Filter, Service}
import com.twitter.finagle.httpx.{Request, Response, Status, Method}
import com.twitter.util.{Duration, Future}
/** Implements http://www.w3.org/TR/cors/ */
object Cors {
/**
* A Cross-Origin Resource Sharing policy.
*
* ... | kristofa/finagle | finagle-httpx/src/main/scala/com/twitter/finagle/httpx/filter/Cors.scala | Scala | apache-2.0 | 9,907 |
/*
* Copyright 2012-2016 Netflix, 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... | wstrucke/edda | src/main/scala/com/netflix/edda/basic/BasicServer.scala | Scala | apache-2.0 | 2,270 |
package sbt.jvmcommand
import sbt.{Plugin, Command, Keys}
import Keys._
import sbt.complete.DefaultParsers._
import java.util.Date
object JvmCommandPlugin extends Plugin {
override lazy val settings = Seq(commands += myCommand)
val SetProperty = "setProperty"
val GetProperty = "getProperty"
val GetProperties... | backuitist/jvm-command | src/main/scala/sbt/jvmcommand/JvmCommandPlugin.scala | Scala | apache-2.0 | 2,674 |
import scala.collection.mutable.Queue
object Solution extends App{
val in = io.Source.stdin.getLines()
val nodes = in.next.toInt
val tc = new TreeConstructor(new Tree(1, None, None))
(1 to nodes).foreach(_ => {
val node = in.next.split(" ").map(_.toInt)
tc.addChildren(node(0), node(1))
})
val t... | clemus90/competitive-programming | hackerRank/FunctionalProgramming/SwapNodes.scala | Scala | mit | 1,659 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | pgandhi999/spark | sql/core/src/main/scala/org/apache/spark/sql/execution/WholeStageCodegenExec.scala | Scala | apache-2.0 | 34,231 |
package specification
import _root_.java.util.Date
class Traveler(
val firstName: String,
val middleName: String,
val lastName: String,
val gender: String,
val birthday: Date, // should be in YYYY-MM-DD format when exported to XML
val travelDocType: String, // passport, driver license, EU citiz... | jwachter/travel-service | src/main/scala/specification/Traveler.scala | Scala | apache-2.0 | 837 |
package gh.test.gh2011c.payload
import gh2011c.models.IssueCommentEventPayload
import net.liftweb.json._
import org.scalatest.{Matchers, FlatSpec}
class IssueCommentEventPayloadTest extends FlatSpec with Matchers
{
"A valid IssueCommentEvent payload" must "be correctly parsed" in {
val json = parse(
... | mgoeminne/github_etl | src/test/scala/gh/test/gh2011c/payload/IssuecommentEventPayloadTest.scala | Scala | mit | 3,809 |
package Controller
import JsonHandling.ManufacturingData
import MongoConnectivity.{MongoConsumer, MongoProducer}
import org.apache.spark.SparkContext
import org.apache.spark.rdd.RDD
/**
* Created by fabian on 18.11.16.
*/
class MongoController {
private val mongoConsumer: MongoConsumer = new MongoConsumer()
... | 4lexBaum/projekt-5s-dhbw | Spark/src/main/scala/Controller/MongoController.scala | Scala | mit | 1,231 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | pgandhi999/spark | mllib/src/test/scala/org/apache/spark/mllib/linalg/VectorsSuite.scala | Scala | apache-2.0 | 18,110 |
/*
* Copyright (C) 2013 Alcatel-Lucent.
*
* See the NOTICE file distributed with this work for additional
* information regarding copyright ownership.
* Licensed to you 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 cop... | molecule-labs/molecule | molecule-net/src/main/scala/molecule/net/Socket.scala | Scala | apache-2.0 | 3,146 |
package at.forsyte.apalache.tla.bmcmt
import at.forsyte.apalache.tla.lir.{TlaEx, TlaModule}
/**
* Input to ModelChecker. We assume that this input is prepared by TransitionPass.
*
* @param rootModule a TLA+ module
* @param initTransitions a list of transitions that compute the initial states.
* ... | konnov/dach | tla-bmcmt/src/main/scala/at/forsyte/apalache/tla/bmcmt/CheckerInput.scala | Scala | apache-2.0 | 1,442 |
/*
* 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 ... | fhueske/flink | flink-table/flink-table-planner-blink/src/test/scala/org/apache/flink/table/planner/plan/rules/logical/PushPartitionIntoTableSourceScanRuleTest.scala | Scala | apache-2.0 | 3,353 |
package org.elasticmq.actor.reply
trait Replyable[T]
| adamw/elasticmq | core/src/main/scala/org/elasticmq/actor/reply/Replyable.scala | Scala | apache-2.0 | 54 |
package ohnosequences.jellyfish.api.jellyfish
import ohnosequences.jellyfish.api._, opt._
import ohnosequences.cosas._, types._, records._, fns._, klists._
import better.files._
case object dump extends AnyJellyfishCommand {
type Arguments = arguments.type
case object arguments extends RecordType(
input :×:... | ohnosequences/jellyfish-api | src/main/scala/api/commands/dump.scala | Scala | agpl-3.0 | 1,097 |
/*
* Copyright 2001-2017 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/prop/AsyncGeneratorDrivenPropertyChecksSpec.scala | Scala | apache-2.0 | 4,169 |
/*
* 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... | guardian/snowplow | 3-enrich/scala-common-enrich/src/main/scala/com.snowplowanalytics.snowplow.enrich/common/loaders/Loader.scala | Scala | apache-2.0 | 3,691 |
package com.nulabinc.backlog.r2b.exporter.convert
import javax.inject.Inject
import com.nulabinc.backlog.migration.common.convert.{Convert, Writes}
import com.nulabinc.backlog.migration.common.domain.{BacklogTextFormattingRule, BacklogWiki}
import com.nulabinc.backlog.migration.common.utils.{DateUtil, Logging}
import... | nulab/BacklogMigration-Redmine | src/main/scala/com/nulabinc/backlog/r2b/exporter/convert/NewsWrites.scala | Scala | mit | 1,586 |
package scalax.collection
import collection.mutable.ListBuffer
import GraphPredef.{EdgeLikeIn, GraphParamOut, NodeOut, EdgeOut}
/**
* Defines traversal-related algorithmic interfaces.
*
* Graph traversal means to navigate from node to node based on incident edges.
* Another kind of navigation is to itera... | opyate/scala-graph | core/src/main/scala/scalax/collection/GraphTraversal.scala | Scala | bsd-3-clause | 32,811 |
package com.toscaruntime.compiler.tosca
import com.toscaruntime.compiler.Tokens
import com.toscaruntime.tosca._
import scala.util.parsing.input.Positional
case class Csar(path: String, definitions: Map[String, Definition]) {
def csarName = definitions.values.head.name.get.value
def csarVersion = definitions.va... | vuminhkh/tosca-runtime | compiler/src/main/scala/com/toscaruntime/compiler/tosca/ToscaModels.scala | Scala | mit | 16,793 |
// code-examples/BasicOOP/scoping/scope-inheritance-wont-compile.scala
// WON'T COMPILE
package scopeA {
class Class1 {
private[scopeA] val scopeA_privateField = 1
protected[scopeA] val scopeA_protectedField = 2
private[Class1] val class1_privateField = 3
protected[Class1] val class1_protectedFie... | XClouded/t4f-core | scala/src/tmp/BasicOOP/scoping/scope-inheritance-wont-compile.scala | Scala | apache-2.0 | 1,065 |
/*
* Copyright 2017-2022 John Snow Labs
*
* 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... | JohnSnowLabs/spark-nlp | src/main/scala/com/johnsnowlabs/client/aws/AWSCredentialsProvider.scala | Scala | apache-2.0 | 2,296 |
package org.skrushingiv.repository
package mongo
import reactivemongo.bson._
import reactivemongo.bson.Producer._
object DSL {
def $and(objs: BSONDocument*) =
nameOptionValue2Producer("$and", objs.headOption.map(_ ⇒ BSONArray(objs.map(valueProducer(_)): _*)))
def $or(objs: BSONDocument*) =
nameOptionVal... | srushingiv/org.skrushingiv | src/main/scala/org/skrushingiv/repository/mongo/DSL.scala | Scala | mit | 1,960 |
package lila.perfStat
import akka.actor.ActorRef
import play.api.libs.iteratee._
import lila.db.api._
import lila.db.Implicits._
import lila.game.{ Game, Pov, Query }
import lila.hub.Sequencer
import lila.rating.PerfType
import lila.user.User
final class PerfStatIndexer(storage: PerfStatStorage, sequencer: ActorRef)... | JimmyMow/lila | modules/perfStat/src/main/PerfStatIndexer.scala | Scala | mit | 1,665 |
package scala.meta.tests
package parsers
import scala.meta.dialects.Scala211
class TokenSuite extends ParseSuite {
test("class C") {
templStat("@foo\\n//bar bar\\ndef baz = qux")
}
}
| beni55/scalameta | scalameta/parsers/src/test/scala/scala/meta/tests/parsers/TokenSuite.scala | Scala | bsd-3-clause | 191 |
/* __ *\\
** ________ ___ / / ___ __ ____ Scala.js Test Suite **
** / __/ __// _ | / / / _ | __ / // __/ (c) 2013-2015, LAMP/EPFL **
** __\\ \\/ /__/ __ |/ /__/ __ |/_// /_\\ \\ http://scala-js.org/ **
** /____/\\___/... | mdedetrich/scala-js | test-suite/shared/src/test/require-jdk8/org/scalajs/testsuite/compiler/DefaultMethodsTest.scala | Scala | bsd-3-clause | 1,195 |
package sss.db
import java.util.Date
import org.scalatest.DoNotDiscover
import sss.db.WhereOps.toWhere
import sss.db.ops.DbOps.DbRunOps
import scala.util.control.NonFatal
@DoNotDiscover
class DbV1Spec extends DbSpecSetup {
"A Db" should " allow insert into existing table " in {
val db = fixture.dbUnderTest
... | mcsherrylabs/sss.db | src/test/scala/sss/db/DbV1Spec.scala | Scala | gpl-3.0 | 10,266 |
/*
* Copyright 2014-2022 Netflix, 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... | Netflix/atlas | atlas-core/src/main/scala/com/netflix/atlas/core/model/FilterExpr.scala | Scala | apache-2.0 | 10,415 |
/*
* Copyright 2017 PayPal
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in ... | az-qbradley/squbs | squbs-zkcluster/src/test/scala/org/squbs/cluster/test/ZkClusterMultiActorSystemTestKit.scala | Scala | apache-2.0 | 5,377 |
/*
* 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 ... | zhangjunfang/eclipse-dir | spark/mllib/src/test/scala/org/apache/spark/mllib/optimization/GradientDescentSuite.scala | Scala | bsd-2-clause | 4,957 |
/*
* Copyright 2017 PayPal
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writin... | SarathChandran/squbs | squbs-unicomplex/src/test/scala/org/squbs/unicomplex/pipeline/PipelineSpec.scala | Scala | apache-2.0 | 9,894 |
package models
import play.api.libs.json.JsValue
case class LGTMResponse(val json: JsValue) {
def getSlackMessage(): String = {
return (json \\ "imageUrl").as[String]
}
}
| uqtimes/SlackBotScala | app/models/LGTMResponse.scala | Scala | mit | 181 |
package ignition.core.jobs.utils
import ignition.core.testsupport.spark.SharedSparkContext
import ignition.core.jobs.utils.RDDUtils._
import org.scalatest._
import scala.util.Random
class RDDUtilsSpec extends FlatSpec with Matchers with SharedSparkContext {
"RDDUtils" should "provide groupByKeyAndTake" in {
(... | chaordic/ignition-core | src/test/scala/ignition/core/jobs/utils/RDDUtilsSpec.scala | Scala | mit | 1,123 |
package com.twitter.finatra.http.internal.exceptions
import com.twitter.finagle.http.{Request, Response, Status}
import com.twitter.finatra.http.exceptions.{DefaultExceptionMapper, ExceptionMapper}
import com.twitter.finatra.http.response.SimpleResponse
import com.twitter.inject.Test
import com.twitter.inject.app.Test... | tempbottle/finatra | http/src/test/scala/com/twitter/finatra/http/internal/exceptions/ExceptionManagerTest.scala | Scala | apache-2.0 | 4,059 |
package edu.gemini.osgi.tools
package app
import scala.xml._
case class BundleSpec(
name: String,
version: edu.gemini.osgi.tools.Version)
object BundleSpec {
// TODO: get rid of
def apply(n: Int, s: String, v: Version): BundleSpec =
apply(s, v)
def apply(mf: java.util.jar.Manifest): BundleSpec = {
... | arturog8m/ocs | project/src/main/scala/edu/gemini/osgi/tools/app/BundleSpec.scala | Scala | bsd-3-clause | 409 |
package com.kozlowst.oms.rest.routes
import akka.http.scaladsl.model.StatusCodes
import akka.http.scaladsl.server.Directives._
import com.kozlowst.oms.common.{Order, Side}
import com.kozlowst.oms.rest.models.OrderRequest
import spray.json.DefaultJsonProtocol
import akka.http.scaladsl.marshallers.sprayjson.SprayJsonSup... | rysiekblah/oms-akka-poc | order-rest-service/src/main/scala/com/kozlowst/oms/rest/routes/OrderRoute.scala | Scala | mit | 1,018 |
/*
* 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 ... | akopich/spark | sql/core/src/main/scala/org/apache/spark/sql/execution/aggregate/RowBasedHashMapGenerator.scala | Scala | apache-2.0 | 9,204 |
/*
* Licensed to SequoiaDB (C) under one or more contributor license agreements.
* See the NOTICE file distributed with this work for additional information
* regarding copyright ownership. The SequoiaDB (C) licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use t... | SequoiaDB/spark-sequoiadb | src/main/scala/com/sequoiadb/spark/util/ConnectionUtil.scala | Scala | apache-2.0 | 2,505 |
/*
* 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 ... | ahnqirage/spark | core/src/main/scala/org/apache/spark/executor/ExecutorMetrics.scala | Scala | apache-2.0 | 2,964 |
package com.twitter.finagle.loadbalancer
import com.twitter.finagle._
import com.twitter.finagle.service.FailingFactory
import com.twitter.finagle.stats.StatsReceiver
import com.twitter.finagle.util.{OnReady, Rng, Updater}
import com.twitter.util.{Activity, Future, Promise, Time, Closable, Return, Throw}
import java.u... | lucaslanger/finagle | finagle-core/src/main/scala/com/twitter/finagle/loadbalancer/Balancer.scala | Scala | apache-2.0 | 11,452 |
package com.landoop.streamreactor.connect.hive.sink.evolution
import com.landoop.streamreactor.connect.hive.{DatabaseName, TableName}
import org.apache.hadoop.hive.metastore.IMetaStoreClient
import org.apache.kafka.connect.data.Schema
import scala.util.Try
/**
* An compile of [[EvolutionPolicy]] that peforms no ch... | datamountaineer/stream-reactor | kafka-connect-hive/src/main/scala/com/landoop/streamreactor/connect/hive/sink/evolution/NoopEvolutionPolicy.scala | Scala | apache-2.0 | 827 |
/**
* This code is generated using [[https://www.scala-sbt.org/contraband/ sbt-contraband]].
*/
// DO NOT EDIT MANUALLY
package sbt.protocol
final class SettingQuery private (
val setting: String) extends sbt.protocol.CommandMessage() with Serializable {
override def equals(o: Any): Boolean = this.eq(o.... | xuwei-k/xsbt | protocol/src/main/contraband-scala/sbt/protocol/SettingQuery.scala | Scala | apache-2.0 | 906 |
package com.arcusys.valamis.web.servlet.lrsProxy
import java.io.ByteArrayInputStream
import java.net.{URLDecoder, URLEncoder}
import java.util
import javax.servlet._
import javax.servlet.http.{HttpServletRequest, HttpServletRequestWrapper, HttpServletResponse}
import org.apache.commons.codec.CharEncoding
import org.a... | igor-borisov/valamis | valamis-portlets/src/main/scala/com/arcusys/valamis/web/servlet/lrsProxy/MethodOverrideFilter.scala | Scala | gpl-3.0 | 3,393 |
/*
* Copyright (C) 2014 GRNET S.A.
*
* 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 distrib... | grnet/cdmi-testsuite | src/main/scala/gr/grnet/cdmi/client/package.scala | Scala | gpl-3.0 | 1,349 |
package com.sksamuel.avro4s.github
import java.io.ByteArrayOutputStream
import com.sksamuel.avro4s.{AvroFixed, AvroInputStream, AvroOutputStream}
import org.scalatest.funsuite.AnyFunSuite
import org.scalatest.matchers.should.Matchers
case class Data(uuid: Option[UUID])
case class UUID(@AvroFixed(8) bytes: Array[Byte... | sksamuel/avro4s | avro4s-core/src/test/scala/com/sksamuel/avro4s/github/GithubIssue193.scala | Scala | apache-2.0 | 1,098 |
package com.jorgefigueiredo.operators
import com.jorgefigueiredo.SparkContextFactory
object FileRDDApplication {
def main(args: Array[String]) {
val sparkContext = SparkContextFactory.getContext
val countries = sparkContext.textFile("input/airports/countries.csv")
//val airports = sparkContext.textFil... | jorgeacf/apache-spark-demos | src/scala/src/main/scala/com/jorgefigueiredo/operators/FileRDDApplication.scala | Scala | apache-2.0 | 876 |
/* Copyright (C) 2008-2014 University of Massachusetts Amherst.
This file is part of "FACTORIE" (Factor graphs, Imperative, Extensible)
http://factorie.cs.umass.edu, http://github.com/factorie
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with... | patverga/factorie | src/main/scala/cc/factorie/app/nlp/hcoref/TrainingObjective.scala | Scala | apache-2.0 | 2,914 |
/*
*
* o o o o o
* | o | |\\ /| | /
* | o-o o--o o-o oo | | O | oo o-o OO o-o o o
* | | | | | | | | | | | | | | | | \\ | | \\ /
* O---oo-o o--O | o-o o-o-o o o o-o-o o o o-o o
* |
... | anskarl/LoMRF | src/main/scala/lomrf/util/opt/MasterOptionParser.scala | Scala | apache-2.0 | 2,176 |
package de.leanovate.swaggercheck.generators
import java.net.{URI, URL}
import de.leanovate.swaggercheck.schema.model.JsonPath
import de.leanovate.swaggercheck.schema.model.formats.StringFormats
import org.scalacheck.Prop.forAll
import org.scalacheck.Properties
import scala.util.Try
object GeneratorsSpecification e... | leanovate/swagger-check | json-schema-gen/src/test/scala/de/leanovate/swaggercheck/generators/GeneratorsSpecification.scala | Scala | mit | 730 |
/*
* Copyright 2015 Databricks 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 ... | wayblink/Naive | spark/spark-sql-perf/src/main/scala/com/databricks/spark/sql/perf/tpch/TPCH.scala | Scala | mit | 5,308 |
// shapeless's Lazy implemented in terms of byname implicits
trait Lazy[T] {
val value: T
}
object Lazy {
implicit def apply[T](implicit t: => T): Lazy[T] =
new Lazy[T] {
lazy val value = t
}
def unapply[T](lt: Lazy[T]): Option[T] = Some(lt.value)
}
trait Foo {
type Out
def out: Out
}
object... | scala/scala | test/files/pos/byname-implicits-8.scala | Scala | apache-2.0 | 576 |
/*
Originally Adapted from shapeless-contrib scalaz
*/
package cats.sequence
import cats.data._
import cats.instances.option._
import cats.instances.either._
import cats.instances.function._
import org.scalacheck.Arbitrary
import shapeless._, shapeless.syntax.singleton._
import cats.derived._
import org.scalacheck.... | milessabin/kittens | core/src/test/scala/cats/sequence/SequenceSuite.scala | Scala | apache-2.0 | 5,947 |
package scalan.compilation.lms.common
import scala.lms.common.{ScalaGenMiscOps, MiscOpsExp, MiscOps}
import scala.reflect.SourceContext
trait MiscOpsExt extends MiscOps {
def readline(implicit pos: SourceContext): Rep[String]
}
trait MiscOpsExtExp extends MiscOpsExt with MiscOpsExp {
case class Readline() extend... | scalan/scalan | lms-backend/core/src/main/scala/scalan/compilation/lms/common/MiscOpsExt.scala | Scala | apache-2.0 | 992 |
package com.datawizards.splot.examples
import com.datawizards.splot.api.implicits._
import com.datawizards.splot.functions.{count, mean}
import com.datawizards.splot.model.ImageFormats
import com.datawizards.splot.theme.PlotTheme
import scala.util.Random
object SaveExampleImagesToFiles extends App {
val exportPat... | piotr-kalanski/SPlot | src/main/scala/com/datawizards/splot/examples/SaveExampleImagesToFiles.scala | Scala | apache-2.0 | 5,995 |
package me.benetis
import me.benetis.compiler.Compiler
import me.benetis.model.Post
import zio.console.{Console, putStrLn}
import zio.{App, ZIO}
object MyApp extends App {
def run(args: List[String]): ZIO[zio.ZEnv, Nothing, Int] =
myAppLogic.fold(_ => 1, _ => 0)
val publishedPosts: Set[Post] = Set(
post... | benetis/benetis.me | src/main/scala/me/benetis/MyApp.scala | Scala | agpl-3.0 | 574 |
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.