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 ... | bwsw/sj-platform | core/sj-common/src/main/scala/com/bwsw/sj/common/engine/core/managment/CommonTaskManager.scala | Scala | apache-2.0 | 4,536 |
package liang.don.dzimageconverter.log
/**
* Log level.<br>
* Level priority:
* Fatal > Error > Info > Debug
*
* @author Don Liang
* @Version 0.1, 22/09/2011
*/
object LogLevel extends Enumeration {
val Debug = Value(0)
val Info = Value(1)
val Error = Value(2)
val Fatal = Value(3)
}
| dl2k84/DeepZoomImageConverter | src/liang/don/dzimageconverter/log/LogLevel.scala | Scala | mit | 302 |
/**
* 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 | cassandra/src/test/scala/com/stratio/crossdata/connector/cassandra/CassandraFunctionIT.scala | Scala | apache-2.0 | 1,680 |
package collins.solr
import java.util.Collections
import java.util.Date
import java.util.concurrent.ConcurrentHashMap
import java.util.concurrent.atomic.AtomicBoolean
import java.util.concurrent.atomic.AtomicReference
import scala.collection.JavaConverters.asScalaSetConverter
import play.api.Logger
import play.api.l... | discordianfish/collins | app/collins/solr/SolrUpdater.scala | Scala | apache-2.0 | 2,516 |
/*
* 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/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/FileTable.scala | Scala | apache-2.0 | 2,788 |
/**
* This file is part of the TA Buddy project.
* Copyright (c) 2013-2014 Alexey Aksenov [email protected]
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Affero General Global License version 3
* as published by the Free Software Foundation with the addition... | digimead/digi-TABuddy-desktop | part-core-ui/src/main/scala/org/digimead/tabuddy/desktop/core/ui/definition/widget/VComposite.scala | Scala | agpl-3.0 | 4,737 |
package implicits
class Implicits {
implicit def listToString[T](l: List[T]): String = {
l.mkString("List(", " ", ")")
}
val str: String = List(1,2,3) /*<*/
println(List(1,2): String) /*<*/
} | Kwestor/scala-ide | org.scala-ide.sdt.core.tests/test-workspace/implicits-highlighting/src/implicit-highlighting/Implicits.scala | Scala | bsd-3-clause | 206 |
package blended.streams.dispatcher.cbe
import java.util.Date
import blended.streams.transaction.{EventSeverity, FlowTransactionStateStarted}
import blended.testsupport.scalatest.LoggingFreeSpec
import blended.util.XMLSupport
import org.scalatest.matchers.should.Matchers
import scala.concurrent.duration._
class CbeE... | woq-blended/blended | blended.streams.dispatcher/src/test/scala/blended/streams/dispatcher/cbe/CbeTransactionEventSpec.scala | Scala | apache-2.0 | 2,959 |
import org.specs._
import com.redis._
import org.specs.mock.Mockito
import org.mockito.Mock._
import org.mockito.Mockito._
import org.mockito.Mockito.doNothing
object SortedSetOperationsSpec extends Specification with Mockito {
"Redis Client Sorted Set Operations" should {
var client: RedisTestClient = null
... | acrosa/scala-redis | src/test/scala/com/redis/operations/SortedSetOperationsSpec.scala | Scala | mit | 2,495 |
package com.nexelem.graph.gremlins
import com.ansvia.graph.BlueprintsWrapper._
import com.ansvia.graph.annotation.Persistent
import com.tinkerpop.blueprints.Direction.{IN, OUT}
class HelloGodsSpec extends GraphSpec {
"blueprints-scala simple access" should {
"properly store & read simple classes" in {
val... | nexelem/graphs-gremlins | src/test/scala/com/nexelem/graph/gremlins/HelloGodsSpec.scala | Scala | apache-2.0 | 3,214 |
package immortan.utils
import fr.acinq.bitcoin.Crypto.PublicKey
import fr.acinq.bitcoin.DeterministicWallet.ExtendedPublicKey
import fr.acinq.bitcoin.{ByteVector32, Satoshi}
import fr.acinq.eclair.MilliSatoshi
import fr.acinq.eclair.blockchain.electrum.db.{ChainWalletInfo, SigningWallet, WatchingWallet}
import fr.acin... | btcontract/wallet | app/src/main/java/immortan/utils/ImplicitJsonFormats.scala | Scala | apache-2.0 | 13,474 |
/**
* Copyright (C) 2009-2014 Typesafe Inc. <http://www.typesafe.com>
*/
package akka.zeromq
import scala.collection.immutable
import akka.util.ByteString
/**
* Deserializes ZeroMQ messages into an immutable sequence of frames
*/
class ZMQMessageDeserializer extends Deserializer {
def apply(frames: immutable.Se... | Fincore/org.spark-project.akka | zeromq/src/main/scala/akka/zeromq/ZMQMessageDeserializer.scala | Scala | mit | 370 |
import java.net.URI
import scala.tools.nsc.doc.base._
import scala.tools.nsc.doc.model._
import scala.tools.partest.ScaladocModelTest
object Test extends ScaladocModelTest {
override def code = """
package scala.test.scaladoc.T8857
/**
* A link:
*
* [[scala.Option$ object Option]... | scala/scala | test/scaladoc/run/t8557.scala | Scala | apache-2.0 | 1,660 |
/* Copyright 2009-2017 EPFL, Lausanne */
import leon.annotation._
import leon.lang._
object Functions7 {
def index(xs: Array[Int]): Unit = {
var i = 0
(while (i < xs.length) {
xs(i) = i + 1
i += 1
}) invariant (0 <= i && i <= xs.length)
}
def apply(fun: Array[Int] => Unit, xs: Array[In... | epfl-lara/leon | src/test/resources/regression/genc/valid/Functions7.scala | Scala | gpl-3.0 | 532 |
/* Copyright (C) 2016 Tomáš Janoušek
* This file is a part of locus-rflkt-addon.
* See the COPYING and LICENSE files in the project root directory.
*/
package cz.nomi.locusRflktAddon
object Formatters {
import RflktApi.Str
private val timeFormat = new java.text.SimpleDateFormat("HH:mm:ss")
def formatString... | liskin/locus-rflkt-addon | src/main/scala/cz/nomi/locusRflktAddon/Formatters.scala | Scala | gpl-3.0 | 1,666 |
package com.mfglabs.stream
import akka.NotUsed
import akka.stream._
import akka.stream.scaladsl._
import akka.stream.stage._
import akka.util.ByteString
import scala.concurrent._
import scala.concurrent.duration._
import akka.stream.scaladsl._
trait FlowExt {
/**
* Create a Flow which debounce messages with s... | MfgLabs/akka-stream-extensions | commons/src/main/scala/FlowExt.scala | Scala | apache-2.0 | 11,481 |
package byteR.cfg
import toplev.GenericPrintable
case class BBPred(val preds: List[BBStart]) extends GenericPrintable {
def prettyPrint = preds.mkString(", ")
}
| j-c-w/mlc | src/main/scala/byteR/cfg/BBPred.scala | Scala | gpl-3.0 | 165 |
/**
* Copyright (C) 2014-2015 Really Inc. <http://really.io>
*/
package io.really.model.loader
import java.io.{ File, FileInputStream }
import java.nio.file.{ Path, Paths }
import java.util
import java.util.LinkedHashMap
import akka.actor.ActorSystem
import _root_.io.really.model._
import _root_.io.really.R
import ... | reallylabs/really | modules/really-core/src/main/scala/io/really/model/loader/ModelLoader.scala | Scala | apache-2.0 | 10,148 |
/*
* Copyright 2016 Dennis Vriend
*
* 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... | dnvriend/akka-http-test | app/com/github/dnvriend/component/highlevelserver/marshaller/Marshaller.scala | Scala | apache-2.0 | 1,003 |
package dao
import com.google.inject.ImplementedBy
import dao.impl.ComputerDAOImpl
import model.{Computer, ComputerState, ConnectedUser}
import services.state.ActionState
import scala.concurrent.Future
/**
* Performs Computer database actions.
*
* @author Camilo Sampedro <[email protected]>
*/
@Imp... | ProjectAton/AtonLab | app/dao/ComputerDAO.scala | Scala | gpl-3.0 | 1,481 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | maropu/spark | resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s/features/ExecutorKubernetesCredentialsFeatureStep.scala | Scala | apache-2.0 | 1,934 |
/*
* 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 ... | spark-test/spark | core/src/main/scala/org/apache/spark/scheduler/SparkListener.scala | Scala | apache-2.0 | 14,025 |
package breeze.optimize.linear
import collection.mutable.ArrayBuffer
import breeze.linalg._
import org.apache.commons.math3.optim.linear._
import org.apache.commons.math3.optim.nonlinear.scalar._
import scala.collection.JavaConverters._
/**
* DSL for LinearPrograms. Not thread-safe per instance. Make multiple instan... | wavelets/breeze | src/main/scala/breeze/optimize/linear/LinearProgram.scala | Scala | apache-2.0 | 10,954 |
package org.bitcoins.core.protocol.script
import org.bitcoins.core.script.bitwise.OP_EQUALVERIFY
import org.bitcoins.core.script.constant._
import org.bitcoins.core.script.crypto.{OP_CHECKSIG, OP_HASH160}
import org.bitcoins.core.script.stack.OP_DUP
import org.bitcoins.core.util.BitcoinScriptUtil
import org.bitcoins.c... | bitcoin-s/bitcoin-s | core-test/src/test/scala/org/bitcoins/core/protocol/script/ScriptPubKeyTest.scala | Scala | mit | 3,376 |
/*
* 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 ... | gioenn/xSpark | core/src/test/scala/org/apache/spark/deploy/history/FsHistoryProviderSuite.scala | Scala | apache-2.0 | 15,635 |
package io.rout
import com.twitter.finagle.http.Request
import com.twitter.util.{Await, Future}
import io.rout.items._
import org.scalatest.{FlatSpec, Matchers}
import org.junit.runner.RunWith
import org.scalatest.junit.JUnitRunner
@RunWith(classOf[JUnitRunner])
class ReqReadCompanionSpec extends FlatSpec with Matche... | teodimoff/rOut | core/test/scala/io/rout/RequestReaderCompanionSpec.scala | Scala | apache-2.0 | 1,405 |
package io.skysail.domain.resources
import akka.actor.ActorContext
trait ActorContextAware {
var actorContext: ActorContext = null
def setActorContext(context: ActorContext) = this.actorContext = context
def getSender() = this.actorContext.sender
def getSystem() = this.actorContext.system
}
| evandor/skysail-server | skysail.domain/src/io/skysail/domain/resources/ActorContextAware.scala | Scala | apache-2.0 | 302 |
package com.joypeg.scamandrill.models
/**
* The export information
* @param key - a valid API key
* @param id - an export job identifier
*/
case class MExportInfo(key: String = DefaultConfig.defaultKeyFromConfig,
id: String) extends MandrillRequest
/**
* The export notify info
* @param ke... | dzsessona/scamandrill | src/main/scala/com/joypeg/scamandrill/models/MandrillExportsRequests.scala | Scala | apache-2.0 | 1,743 |
package main
import org.scalajs.dom._
import org.scalajs.dom
import scala.scalajs.js
import scala.scalajs.js.annotation.JSExport
import japgolly.scalajs.react.vdom.prefix_<^.{<, ^, _}
import japgolly.scalajs.react._
import diode.react.ModelProxy
import main.components.ReqBox
import main.components.SideViewTopHeader
i... | reqT/reqT-webapp | client/src/main/scala/main/webApp.scala | Scala | apache-2.0 | 11,084 |
package com.arcusys.valamis.web.portlet
import javax.portlet.{RenderRequest, RenderResponse}
import com.arcusys.valamis.web.portlet.base.{OAuthPortlet, PortletBase}
class AchievedCertificatesView extends OAuthPortlet with PortletBase {
override def doView(request: RenderRequest, response: RenderResponse) {
im... | igor-borisov/JSCORM | valamis-portlets/src/main/scala/com/arcusys/valamis/web/portlet/AchievedCertificatesView.scala | Scala | gpl-3.0 | 632 |
package com.searchlight.khronus.cluster
import akka.actor.ActorRef
import com.searchlight.khronus.model.Metric
import com.searchlight.khronus.util.Settings
import com.searchlight.khronus.util.log.Logging
import scala.util.hashing.MurmurHash3
class AffinityConsistentHashRing extends Logging {
private val tokens = c... | despegar/khronus | khronus-core/src/main/scala/com/searchlight/khronus/cluster/AffinityConsistentHashRing.scala | Scala | apache-2.0 | 2,274 |
/*
* Copyright 2012 Eike Kettner
*
* 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... | eikek/publet | publet/src/main/scala/org/eknet/publet/vfs/fs/FileResource.scala | Scala | apache-2.0 | 3,390 |
package jsky.app.ot.visitlog
import edu.gemini.pot.sp.SPObservationID
import edu.gemini.spModel.obsrecord.ObsVisit
import javax.swing.table.AbstractTableModel
import java.util.Date
object VisitTableModel {
sealed abstract class Column[+T <% AnyRef : Manifest](val name: String) {
def value(visit: ObsVisit): T
... | arturog8m/ocs | bundle/jsky.app.ot.visitlog/src/main/scala/jsky/app/ot/visitlog/VisitTableModel.scala | Scala | bsd-3-clause | 2,093 |
/*
* Copyright (c) 2015 Snowplow Analytics Ltd. All rights reserved.
*
* This program is licensed to you under the Apache License Version 2.0,
* and you may not use this file except in compliance with the Apache License Version 2.0.
* You may obtain a copy of the Apache License Version 2.0 at http://www.apache.org... | snowplow/huskimo | src/main/scala/com.snowplowanalytics/huskimo/channels/singular/Singular.scala | Scala | apache-2.0 | 4,025 |
/*
* Copyright 2014 IBM Corp.
*
* 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... | malcolmgreaves/spark-kernel | protocol/src/main/scala/com/ibm/spark/kernel/protocol/v5/SparkKernelInfo.scala | Scala | apache-2.0 | 1,686 |
package com.kodekutters.czml
import java.awt.Color
import com.kodekutters.czml.CzmlImplicits._
import com.kodekutters.czml.czmlCore._
import com.kodekutters.czml.czmlProperties._
import com.kodekutters.czml.czmlCustom.{CustomBasic, CustomInterval, CustomList, CustomMap}
import play.api.libs.json.Json
import scala.co... | workingDog/scalaczml | src/main/scala/com/kodekutters/czml/ExampleCustom.scala | Scala | bsd-3-clause | 2,521 |
/**
* Created by Xavier on 2016/8/19.
*/
object AnonymousFunction {
var inc = (x : Int) => x + 1
}
| xydaxia0/scala-gradle | src/main/scala/AnonymousFunction.scala | Scala | apache-2.0 | 107 |
/**
* Copyright 2015 Devon Miller
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in... | aappddeevv/scala-vdom | shared/src/main/scala/im/vdom/Patch.scala | Scala | apache-2.0 | 3,348 |
/*
* 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 ... | bdrillard/spark | sql/core/src/test/scala/org/apache/spark/sql/streaming/sources/StreamingDataSourceV2Suite.scala | Scala | apache-2.0 | 15,534 |
/*
* Copyright 2014 Aurel Paulovic ([email protected]) (aurelpaulovic.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
* ... | AurelPaulovic/crdt | src/test/scala/com/aurelpaulovic/crdt/TestSpec.scala | Scala | apache-2.0 | 811 |
/*
* Copyright 2016 Frugal Mechanic (http://frugalmechanic.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... | frugalmechanic/fm-common | js/src/main/scala/fm/common/rich/RichNodeSelector.scala | Scala | apache-2.0 | 2,362 |
// Copyright (C) 2014 Dmitry Yakimenko ([email protected]).
// Licensed under the terms of the MIT license. See LICENCE for details.
package net.detunized.iteratorz
class ZippingIterator[A](i1: Iterator[A], i2: Iterator[A])
(takeFirst: (A, A) => Boolean) extends Iterator[A] {
private[this]... | detunized/iteratorz | src/main/scala/ZippingIterator.scala | Scala | mit | 1,059 |
/* - Coeus web framework -------------------------
*
* Licensed under the Apache License, Version 2.0.
*
* Author: Spiros Tzavellas
*/
package com.tzavellas.coeus.validation.bean
import org.junit.Test
import org.junit.Assert._
import javax.validation.{ Validation => JValidation }
import javax.validation.constrain... | sptz45/coeus | src/test/scala/com/tzavellas/coeus/validation/bean/BeanValidatorTest.scala | Scala | apache-2.0 | 1,360 |
/***********************************************************************
* Copyright (c) 2013-2020 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... | aheyne/geomesa | geomesa-convert/geomesa-convert-avro/src/main/scala/org/locationtech/geomesa/convert/avro/AvroPath.scala | Scala | apache-2.0 | 4,571 |
import java.awt.datatransfer._
import scala.collection.JavaConversions.asScalaBuffer
import scala.collection.mutable.Buffer
val flavors = SystemFlavorMap.getDefaultFlavorMap().asInstanceOf[SystemFlavorMap]
val natives:Buffer[String] = flavors.getNativesForFlavor(DataFlavor.imageFlavor)
println(natives.mkString(", "))... | Gerhut/scala-for-the-impatient | Chapter3/10.scala | Scala | unlicense | 321 |
import eu.inn.binders.value._
import org.scalatest.{FlatSpec, Matchers}
case class Mixed(a: Int, b: String, extra: Value)
class TestMixJsonSerializer extends FlatSpec with Matchers {
import eu.inn.binders.json._
"Json " should " serialize Mixed" in {
val t = Mixed(1, "ha", ObjV(
"f" -> 555
))
... | InnovaCo/binders-json | src/test/scala/TestMixJsonSerializer.scala | Scala | bsd-3-clause | 932 |
package rexstream
import java.lang.annotation.Annotation
import scala.annotation.StaticAnnotation
import scala.collection.parallel._
import scala.reflect.runtime.universe._
import rexstream.util._
trait MetadataProvider extends Iterable[MetadataObject] {
def get(name : String) : Option[Any]
def apply(name : ... | GregRos/Rexstream | ScalaFBL/src/rexstream/MetadataProvider.scala | Scala | mit | 1,535 |
/*
* 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/computations/CPAux2.scala | Scala | apache-2.0 | 1,159 |
///*
// * (C) 2014 Jacob Lorensen, [email protected]
// */
//
//package org.zapto.jablo.myml
//
//import org.junit._
//import Assert._
//import TestHelper.calc
//import TestHelper.e
//import TestHelper.check
//import TestHelper.reparse
//
//class IfExprTest {
// @Before
// def setUp: Unit = {
// }
//
// @Afte... | jablo/myml | src/test/scala/org/zapto/jablo/myml_later/IfExprTest.scala | Scala | artistic-2.0 | 2,531 |
package com.lateralthoughts.points.controllers
import com.lateralthoughts.mocked.MockedRepositoryConfig
import com.lateralthoughts.points.PointsServlet
import org.scalatra.test.scalatest.ScalatraFlatSpec
trait InitServlet extends ScalatraFlatSpec {
addServlet(new PointsServlet(MockedRepositoryConfig), "/*")
}
| vincentdoba/points | points-server/src/test/scala/com/lateralthoughts/points/controllers/InitServlet.scala | Scala | mit | 318 |
/*
*
* * Copyright (C) 2009-2013 Typesafe Inc. <http://www.typesafe.com>
*
*/
package play.api.libs.ws.ssl
import play.api.libs.ws.WSClientConfig
import java.security.{ Security, PrivilegedExceptionAction }
/**
* Configures global system properties on the JSSE implementation, if defined.
*
* WARNING: This cla... | jyotikamboj/container | pf-framework/src/play-ws/src/main/scala/play/api/libs/ws/ssl/SystemConfiguration.scala | Scala | mit | 2,924 |
/*
* 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 ... | chuckchen/spark | mllib/src/test/scala/org/apache/spark/ml/source/image/ImageFileFormatSuite.scala | Scala | apache-2.0 | 6,014 |
/*
* Copyright 2001-2008 Artima, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agre... | JimCallahan/Graphics | external/scalatest/src/test/scala/org/scalatest/matchers/ShouldBeMatcherSpec.scala | Scala | apache-2.0 | 13,901 |
package com.Alteryx.sparkGLM
import org.scalatest.FunSuite
import org.apache.spark.sql.test.TestSQLContext
import com.Alteryx.testUtils.data.testData._
class utils$Test extends FunSuite {
val sqlCtx = TestSQLContext
test("matchCols") {
val df = modelMatrix(dummyDF)
val dfWithMissingCategory = modelMatrix... | dputler/sparkGLM | src/test/scala/com/Alteryx/sparkGLM/utils$Test.scala | Scala | apache-2.0 | 879 |
// Copyright (c) 2011-2015 ScalaMock Contributors (https://github.com/paulbutcher/ScalaMock/graphs/contributors)
//
// 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, in... | hypertino/ScalaMock | examples/shared/src/test/scala/com/example/function/HigherOrderFunctionsTest.scala | Scala | mit | 2,458 |
package scalaz.stream
import Cause._
import scala.annotation.tailrec
import scala.concurrent.duration.Duration
import scalaz.\\/._
import scalaz.concurrent.{Actor, Strategy, Task}
import scalaz.stream.Process._
import scalaz.stream.ReceiveY._
import scalaz.stream.Util._
import scalaz.stream.process1.Await1
import scal... | djspiewak/scalaz-stream | src/main/scala/scalaz/stream/wye.scala | Scala | mit | 33,124 |
package services.aws
import com.amazonaws.auth.BasicAWSCredentials
import com.amazonaws.services.sqs.AmazonSQSClient
import com.amazonaws.services.sqs.model.GetQueueUrlRequest
import play.api.{Logger, Play}
import collection.JavaConversions._
trait MigrationDependencyMonitor{
def isOverloaded : Boolean
def hangb... | guardian/flex-content-migrator | app/services/aws/monitors.scala | Scala | mit | 3,392 |
package org.webant.worker.console
import java.io.File
import java.util
import javax.management.remote.{JMXConnector, JMXConnectorFactory, JMXServiceURL}
import javax.management.{JMX, MBeanServerConnection, ObjectName}
import org.apache.commons.io.FileUtils
object WorkerJmxClient {
private var connector: JMXConnect... | sutine/webant | webant-worker/src/main/scala/org/webant/worker/console/WorkerJmxClient.scala | Scala | apache-2.0 | 6,907 |
package org.jetbrains.plugins.scala
package project.template
import java.io.File
import com.intellij.openapi.roots.libraries.NewLibraryConfiguration
import com.intellij.openapi.roots.ui.configuration.libraryEditor.LibraryEditor
import com.intellij.openapi.roots.{JavadocOrderRootType, OrderRootType}
import org.jetbrai... | triggerNZ/intellij-scala | src/org/jetbrains/plugins/scala/project/template/ScalaSdkDescriptor.scala | Scala | apache-2.0 | 3,676 |
package com.twitter.finagle.memcached.unit.protocol.text.client
import com.twitter.finagle.memcached.protocol.text.client.AbstractCommandToBuf
import com.twitter.io.BufByteWriter
import java.nio.charset.StandardCharsets
import org.scalacheck.Gen
import org.scalatest.FunSuite
import org.scalatest.prop.GeneratorDrivenPr... | mkhq/finagle | finagle-memcached/src/test/scala/com/twitter/finagle/memcached/unit/protocol/text/client/CommandToBufTest.scala | Scala | apache-2.0 | 1,048 |
/*
* 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 ... | alvsanand/spark-generic-connector | sgc-ftp/src/main/scala/es/alvsanand/sgc/ftp/FTPCredentials.scala | Scala | apache-2.0 | 1,127 |
package amailp.intellij.robot.psi
import com.intellij.psi._
import com.intellij.lang.ASTNode
import com.intellij.extapi.psi.ASTWrapperPsiElement
import amailp.intellij.robot.findUsage.UsageFindable
import amailp.intellij.robot.psi.reference.KeywordToDefinitionReference
import amailp.intellij.robot.psi.utils.RobotPsiUt... | puhnastik/robot-plugin | src/main/scala/amailp/intellij/robot/psi/Keyword.scala | Scala | gpl-3.0 | 1,240 |
package com.thoughtworks.binding.regression
import com.thoughtworks.binding.Binding._
import com.thoughtworks.binding._
import org.scalatest.freespec.AnyFreeSpec
import org.scalatest.matchers.should.Matchers
import scala.collection.mutable.ArrayBuffer
/** @author
* 杨博 (Yang Bo) <[email protected]>
*/
fi... | ThoughtWorksInc/Binding.scala | Binding/src/test/scala/com/thoughtworks/binding/regression/FlatMapRemove.scala | Scala | mit | 1,280 |
/*
* 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 ... | kl0u/flink | flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/plan/rules/physical/batch/BatchPhysicalSinkRule.scala | Scala | apache-2.0 | 4,647 |
package org.zalando.jsonapi.json
import org.scalatest.{ MustMatchers, WordSpec }
import org.zalando.jsonapi.json.sprayjson.SprayJsonJsonapiProtocol
import org.zalando.jsonapi.model.JsonApiObject.StringValue
import org.zalando.jsonapi.model.RootObject.ResourceObject
import org.zalando.jsonapi.model.{ Attribute, Links, ... | RavelLaw/scala-jsonapi | src/test/scala/org/zalando/jsonapi/json/ExampleSpec.scala | Scala | mit | 2,903 |
package com.twitter.finagle.filter
import com.twitter.concurrent.AsyncSemaphore
import com.twitter.finagle.stats.InMemoryStatsReceiver
import com.twitter.finagle._
import com.twitter.util.{Await, Future}
import org.junit.runner.RunWith
import org.scalatest.FunSuite
import org.scalatest.junit.JUnitRunner
@RunWith(clas... | suls/finagle | finagle-core/src/test/scala/com/twitter/finagle/filter/RequestSemaphoreFilterTest.scala | Scala | apache-2.0 | 2,056 |
/*
* 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 ... | jiangxb1987/spark | sql/core/src/test/scala/org/apache/spark/sql/CsvFunctionsSuite.scala | Scala | apache-2.0 | 14,133 |
package org.apache.spark.mllib
import org.specs._
import org.specs.runner.{ConsoleRunner, JUnit4}
class MySpecTest extends JUnit4(MySpec)
//class MySpecSuite extends ScalaTestSuite(MySpec)
object MySpecRunner extends ConsoleRunner(MySpec)
object MySpec extends Specification {
"This wonderful system" should {
"... | yinmingyang/spark-ml | src/test/scala/org/apache/spark/mllib/MySpec.scala | Scala | apache-2.0 | 398 |
package org.jetbrains.plugins.scala.components
import java.io.{File, IOException}
import java.lang.reflect.Field
import java.net.URLEncoder
import java.util.concurrent.TimeUnit
import javax.swing.event.HyperlinkEvent
import com.intellij.ide.plugins._
import com.intellij.ide.util.PropertiesComponent
import com.intell... | advancedxy/intellij-scala | src/org/jetbrains/plugins/scala/components/ScalaPluginUpdater.scala | Scala | apache-2.0 | 14,713 |
import java.io.{File, FileOutputStream}
import scala.tools.partest.DirectTest
import scala.tools.partest.nest.StreamCapture
import scala.tools.asm
import asm.{ClassWriter, Handle, Opcodes}
import Opcodes._
// This test ensures that we can read JDK 7 (classfile format 51) files, including those
// with invokeDynamic i... | lrytz/scala | test/files/run/classfile-format-51.scala | Scala | apache-2.0 | 4,983 |
object Test1 {
trait T[A]
def foo[S[_], A](using ev: T[A] ?=> T[S[A]]): Unit = ()
implicit def bar[A](using ev: T[A]): T[List[A]] = ???
foo[List, Int]
}
object Test2 {
trait T
trait S
def foo(using ev: T ?=> S): Unit = ()
implicit def bar(using ev: T): S = ???
foo
}
| som-snytt/dotty | tests/pos/i4725.scala | Scala | apache-2.0 | 290 |
package com.yetu.play.authenticator.utils
import java.util.UUID
import com.google.inject.{AbstractModule, Guice}
import com.google.inject.util.Modules
import com.mohiva.play.silhouette.api.{LoginInfo, Environment}
import com.mohiva.play.silhouette.impl.authenticators.SessionAuthenticator
import com.mohiva.play.silhoue... | yetu/yetu-play-authenticator | test/com/yetu/play/authenticator/utils/FakeGlobal.scala | Scala | apache-2.0 | 3,039 |
/**
* Ephedra Food Alerts
* Copyright (C) 2013-2014 Philippe Sam-Long aka pulsation
*
* 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 ... | pulsation/ephedra-android | src/eu/pulsation/ephedra/AlertNotifications/EphedraBootReceiver.scala | Scala | gpl-3.0 | 1,054 |
package chandu0101.scalajs.react.components.demo.components.materialui.svgicons
import chandu0101.scalajs.react.components.materialui.MuiSvgIcon
import japgolly.scalajs.react._
import japgolly.scalajs.react.vdom.all.svg._
import japgolly.scalajs.react.vdom.prefix_<^._
object ActionHome {
val component = ReactCom... | coreyauger/scalajs-react-components | demo/src/main/scala/chandu0101/scalajs/react/components/demo/components/materialui/svgicons/ActionHome.scala | Scala | apache-2.0 | 512 |
package models
import play.api.libs.json._
case class Person(name: String, surname: String, datatype: String = "person")
object Persons {
implicit val fmt = Json.format[Person]
}
| ReactiveCouchbase/ReactiveCouchbase-play | samples/scala/n1ql/app/models/Person.scala | Scala | apache-2.0 | 184 |
/*
* ____ ____ _____ ____ ___ ____
* | _ \\ | _ \\ | ____| / ___| / _/ / ___| Precog (R)
* | |_) | | |_) | | _| | | | | /| | | _ Advanced Analytics Engine for NoSQL Data
* | __/ | _ < | |___ | |___ |/ _| | | |_| | Copyright (C) 2010 - 2013 SlamData, In... | precog/platform | accounts/src/main/scala/com/precog/accounts/AccountManager.scala | Scala | agpl-3.0 | 5,436 |
/*
* Copyright 2015 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 agreed t... | rspieldenner/atlas | atlas-core/src/test/scala/com/netflix/atlas/core/norm/NormalizeValueFunctionSuite.scala | Scala | apache-2.0 | 5,535 |
//: ----------------------------------------------------------------------------
//: Copyright (C) 2016 Verizon. All Rights Reserved.
//:
//: 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 Licen... | oncue/mesos-scheduler | core/src/main/scala/ReconcileState.scala | Scala | apache-2.0 | 2,361 |
package zzb.domain.plane
import zzb.rest._
import akka.actor.Props
import zzb.rest.util.StatableActor
import spray.http.StatusCodes._
/**
* Created by Simon on 2014/6/13
*/
class PlaneSvcActor extends RestServiceActor {
override def receive: Receive = runRoute(route)
implicit def childByName(name: String) = ... | stepover/zzb | zzb-domain/src/test/scala/zzb/domain/plane/PlaneSvcActor.scala | Scala | mit | 622 |
import scala.scalajs.js
import scala.scalajs.js.annotation.*
@js.native
trait NativeJSTrait extends js.Any
trait NonNativeJSTrait extends js.Any
object Test {
def test(x: Any): Unit = {
x.isInstanceOf[NativeJSTrait] // error
x.isInstanceOf[NonNativeJSTrait] // error
}
}
| dotty-staging/dotty | tests/neg-scalajs/isinstanceof-js-type.scala | Scala | apache-2.0 | 286 |
package org.openmole.tool.cache
import collection.JavaConverters._
object WithInstance {
/**
* Get an instance of an object given a constructor, either pooled or new.
* @param f
* @param pooled
* @param close
* @tparam T
* @return
*/
def apply[T](f: () ⇒ T)(pooled: Boolean, close: T ⇒ Unit =... | openmole/openmole | openmole/third-parties/org.openmole.tool.cache/src/main/scala/org/openmole/tool/cache/Pool.scala | Scala | agpl-3.0 | 1,505 |
package mesosphere.util
import akka.actor.{ Props, Status }
import akka.testkit.{ TestActorRef, TestProbe }
import mesosphere.marathon.MarathonSpec
import mesosphere.marathon.test.MarathonActorSupport
import org.scalatest.{ BeforeAndAfterAll, Matchers }
import scala.concurrent.duration._
import scala.concurrent.{ Awa... | yp-engineering/marathon | src/test/scala/mesosphere/util/PromiseActorTest.scala | Scala | apache-2.0 | 2,192 |
import org.scalatest._
import hyperion._
import akka.actor._
import akka.testkit._
import akka.pattern.{ask, pipe}
import akka.util.Timeout
import java.util.concurrent.TimeUnit
import scala.concurrent.duration._
import scala.util._
import scala.concurrent.Await
import scala.concurrent.ExecutionContext.Implicits.global
... | talien/hyperion | test/testcreator.scala | Scala | lgpl-3.0 | 12,561 |
package org.jetbrains.plugins.scala
package codeInspection.collections
import org.jetbrains.plugins.scala.codeInspection.InspectionBundle
/**
* Nikolay.Tropin
* 2014-05-07
*/
class NotIsEmptyTest extends OperationsOnCollectionInspectionTest {
val hint = InspectionBundle.message("not.isEmpty.hint")
def test_1()... | consulo/consulo-scala | test/org/jetbrains/plugins/scala/codeInspection/collections/NotIsEmptyTest.scala | Scala | apache-2.0 | 767 |
package rxgpio.examples
import rxgpio._
import rxgpio.pigpio.PigpioLibrary
import scala.concurrent.duration.DurationInt
import scala.io.StdIn
import scala.util.Success
/**
*
*/
object ButtonPushed extends App {
import rxgpio.Gpio.Implicits._
DefaultInitializer.gpioInitialise() match {
case Success... | jw3/pigpio4s | examples/src/main/scala/rxgpio/examples/ButtonPushed.scala | Scala | apache-2.0 | 725 |
/*
* 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 ... | mkolod/incubator-spark | core/src/test/scala/org/apache/spark/rdd/SortingSuite.scala | Scala | apache-2.0 | 4,958 |
package org.scalarules.engine
import org.scalarules.facts.SingularFact
import org.scalatest.{FlatSpec, Matchers}
class FactTest extends FlatSpec with Matchers {
val context: Context = Map(SingularFact("naamAanwezig") -> 42, SingularFact("onverwachtObject") -> "String")
it should "return a Some(Bedrag) when given... | scala-rules/rule-engine | engine-core/src/test/scala/org/scalarules/engine/FactTest.scala | Scala | mit | 879 |
package de.leanovate.swaggercheck.schema.gen
import de.leanovate.swaggercheck.schema.model.{IntegerDefinition, ArrayDefinition}
import org.scalacheck.Properties
object GeneratableArraySpecification extends Properties("GeneratableArray") with DefinitionChecks {
property("any generates are valid") = {
val definit... | leanovate/swagger-check | json-schema-gen/src/test/scala/de/leanovate/swaggercheck/schema/gen/GeneratableArraySpecification.scala | Scala | mit | 886 |
/*
* Copyright 2012 Eike Kettner
*
* 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... | eikek/publet | web/src/main/scala/org/eknet/publet/web/RequestUrl.scala | Scala | apache-2.0 | 4,153 |
package Arithmetic.P36
import scala.language.implicitConversions
class P36(val num: Int) {
def primeFactorMultiplicity: List[(Int, Int)] = {
import Arithmetic.P35.P35._
import WorkingWithLists.P09.P09._
pack(num.primeFactors) map {l => (l.head, l.length)}
}
def primeFactorMultiplicity_Direct: List[... | ihac/Ninety-Nine-Scala-Problems | src/main/scala/Arithmetic/P36/P36.scala | Scala | gpl-3.0 | 1,049 |
/*
* 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 ... | shaoxuan-wang/flink | flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/plan/metadata/FlinkRelMdColumnOriginNullCount.scala | Scala | apache-2.0 | 5,120 |
/*
* Copyright (c) 2015.
* All rights reserved by you.meng@chinacache
*
*/
package com.robin.grouping.computation
import java.io.PrintWriter
import com.robin.grouping.model.{Batch, BoltSlot, DispatchByW, TopicSlot}
import kafka.utils.Logging
import scala.collection.mutable.{ArrayBuffer, HashMap}
import scala.io... | mengyou0304/scala_simple_work | src/main/scala/com/robin/grouping/computation/SizeComputation.scala | Scala | apache-2.0 | 7,564 |
package scife
package enumeration
package lazytraversal
import scife.enumeration.dependent._
import memoization._
import scife.{ enumeration => e }
import scife.util._
import scife.util.logging._
import scife.util.structures._
import LazyBSTrees._
import scalaz.LazyTuple2
import benchmarks._
import org.scalatest.... | kaptoxic/SciFe | src/bench/test/scala/scife/enumeration/lazytraversal/BinarySearchTree.scala | Scala | gpl-2.0 | 6,038 |
/*
* This file is part of EasyForger which is released under GPLv3 License.
* See file LICENSE.txt or go to http://www.gnu.org/licenses/gpl-3.0.en.html for full license details.
*/
package com.easyforger.samples.misc
import com.easyforger.base.EasyForger
import net.minecraftforge.fml.common.Mod
import net.minecraft... | easyforger/easyforger-samples | src/main/scala/com/easyforger/samples/misc/DungeonsMod.scala | Scala | gpl-3.0 | 901 |
/*
* 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 ... | shuangshuangwang/spark | core/src/main/scala/org/apache/spark/scheduler/cluster/StandaloneSchedulerBackend.scala | Scala | apache-2.0 | 9,872 |
/* scala-stm - (c) 2009-2010, Stanford University, PPL */
package scala.concurrent.stm
import java.util.concurrent.CyclicBarrier
import org.scalatest.FunSuite
/** This test uses the transactional retry mechanism to pass a token around a
* ring of threads. When there are two threads this is a ping-pong test. A
... | djspiewak/scala-stm | src/test/scala/scala/concurrent/stm/TokenRingSuite.scala | Scala | bsd-3-clause | 3,151 |
package sml.instructions
/**
* Extends Instruction, adds fields required for a typical
* math operation on the sml machine
*/
trait MathInstruction extends Instruction {
/**
* Register address where the result of the math operation
* will be stored
*/
val result: Int
/**
* First operand of... | BBK-PiJ-2015-67/sdp-portfolio | coursework/cw-one/src/main/scala/sml/instructions/MathInstruction.scala | Scala | unlicense | 436 |
package com.twitter.concurrent
import com.twitter.util.{Await, Future, Promise, Return, Throw}
import java.io.EOFException
import org.specs.SpecificationWithJUnit
import scala.collection.mutable.ArrayBuffer
import Spool.{*::, **::, seqToSpool}
class SpoolSpec extends SpecificationWithJUnit {
"Empty Spool" should {... | mosesn/util | util-core/src/test/scala/com/twitter/concurrent/SpoolSpec.scala | Scala | apache-2.0 | 8,020 |
/*
* Copyright 2006-2011 WorldWide Conferencing, 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 required by applica... | lzpfmh/framework-2 | persistence/record/src/main/scala/net/liftweb/record/ProtoUser.scala | Scala | apache-2.0 | 12,165 |
package frameless
import scala.annotation.implicitNotFound
/** Types that can be added, subtracted and multiplied by Catalyst. */
@implicitNotFound("Cannot do numeric operations on columns of type ${A}.")
trait CatalystNumeric[A]
object CatalystNumeric {
private[this] val theInstance = new CatalystNumeric[Any] {}
... | adelbertc/frameless | core/src/main/scala/frameless/CatalystNumeric.scala | Scala | apache-2.0 | 916 |
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.