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 ... | wangmiao1981/spark | sql/core/src/main/scala/org/apache/spark/sql/execution/ExplainUtils.scala | Scala | apache-2.0 | 10,794 |
/*
* Copyright (c) 2014 Contributor. All rights reserved.
*/
package methods
class Methods {
val foo = 1
def bar = 2
def baz() = 3
}
object Methods {
val a = new Methods
a.foo
a.bar
a.baz()
} | Kwestor/scala-ide | org.scala-ide.sdt.core.tests/test-workspace/custom-highlighting/src/custom/Methods.scala | Scala | bsd-3-clause | 214 |
/*
Copyright (c) 2013, Noel Raymond Cower
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions... | nilium/spastic | src/main/scala/graphics/ColorSpace.scala | Scala | bsd-2-clause | 5,926 |
package rere.ql.options
import rere.ql.queries.values
trait IndexTypeOptions {
sealed trait IndexMultiplicityOptions extends ComposableOptions
case object SimpleIndex extends IndexMultiplicityOptions with DefaultOption
case object MultiIndex extends IndexMultiplicityOptions with NonDefaultOption {
def vi... | pbaun/rere | modules/ql/src/main/scala/rere/ql/options/IndexTypeOptions.scala | Scala | apache-2.0 | 629 |
package demo.components
import japgolly.scalajs.react._
import scala.scalajs.js
object CallbackDebug {
trait Print[T] {
def print(t: T): String
}
trait PrintLower {
final implicit def PrintAny[T]: Print[T] =
new Print[T] {
override def print(t: T): String =
if (t == js.undefined... | aparo/scalajs-react-components | demo/src/main/scala/demo/components/CallbackDebug.scala | Scala | apache-2.0 | 2,561 |
package org.scalawiki.wlx.dto
import java.time.ZonedDateTime
import com.typesafe.config.{Config, ConfigFactory, ConfigParseOptions, ConfigResolveOptions}
import org.scalawiki.wlx.stat.RateConfig
import scala.util.Try
/**
* Represents Wiki Loves X contest
*
* @param contestType
* @param country
* @param ye... | intracer/scalawiki | scalawiki-wlx/src/main/scala/org/scalawiki/wlx/dto/Contest.scala | Scala | apache-2.0 | 3,444 |
package engine.api
import akka.actor.{ActorRef, ActorSystem, Props}
import engine.api.MapReduce.{MapReduceUpB, ReducerT}
import engine.util.EngineLogger
import akka.pattern._
import akka.util.Timeout
import scala.concurrent.Future
/**
* Entry and management class to control the engine, creating new Jobs, adding, re... | filipegmiranda/typed-mapreduce | src/main/scala/engine/api/EngineContext.scala | Scala | apache-2.0 | 1,305 |
package katas.scala
import scala.concurrent.duration.{FiniteDuration, MILLISECONDS}
object Util {
def measureDuration(f: => Unit): FiniteDuration = {
val start = System.currentTimeMillis()
f
val end = System.currentTimeMillis()
FiniteDuration(end - start, MILLISECONDS)
}
} | dkandalov/katas | scala/src/katas/scala/Util.scala | Scala | unlicense | 285 |
import com.krrrr38.play.autodoc.AutodocHelpers
object TestHelper extends AutodocHelpers {
def myhelper = "foo"
}
| krrrr38/play-autodoc | example/test/TestHelper.scala | Scala | mit | 116 |
/*
* Copyright (c) 2014-2021 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... | monix/monix | monix-tail/shared/src/test/scala/monix/tail/IterantScanSuite.scala | Scala | apache-2.0 | 2,430 |
package scala.slick.ql
import scala.slick.session.Session
/**
* A DDL object contains the SQL statements for creating and dropping
* database entities. DDLs can be combined for creating or dropping multiple
* entities together, even if they have circular dependencies.
*/
trait DDL { self =>
/** Statements to ex... | szeiger/scala-query | src/main/scala/scala/slick/ql/DDL.scala | Scala | bsd-2-clause | 1,950 |
package com.productfoundry.akka.messaging
import akka.actor.Actor
/**
* Indicates this actor handles published messages.
*/
trait MessageSubscriber extends Actor | odd/akka-cqrs | core/src/main/scala/com/productfoundry/akka/messaging/MessageSubscriber.scala | Scala | apache-2.0 | 165 |
package atto.syntax.stream
import scala.language.implicitConversions
import scalaz.syntax.Ops
import atto._
trait ParserOps[A] extends Ops[Parser[A]] {
}
trait ToParserOps {
// N.B. ensure this name doesn't shadow the one from core :-\\
implicit def toStreamParserOps[A](p: Parser[A]): ParserOps[A] =
new P... | coltfred/atto | stream/src/main/scala/atto/syntax/stream/ParserOps.scala | Scala | mit | 360 |
/***********************************************************************
* Copyright (c) 2013-2019 Commonwealth Computer Research, Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Apache License, Version 2.0
* which accompanies this distribution and... | elahrvivaz/geomesa | geomesa-hbase/geomesa-hbase-jobs/src/main/scala/org/locationtech/geomesa/hbase/jobs/HBaseIndexFileMapper.scala | Scala | apache-2.0 | 8,153 |
package scalaxy.fx
import scala.language.implicitConversions
import javafx.beans.binding._
import javafx.beans.property._
import javafx.collections._
import scala.language.experimental.macros
private[fx] trait Properties
{
/** Creates a simple property of type T. */
def newProperty
[T, J, B <: Binding[J],... | nativelibs4java/Scalaxy | Fx/src/main/scala/scalaxy/fx/Properties.scala | Scala | bsd-3-clause | 2,426 |
/*
* Copyright (C) 2016-2019 Lightbend Inc. <https://www.lightbend.com>
*/
package com.lightbend.lagom.internal.persistence.cluster
import akka.actor.ExtendedActorSystem
import akka.serialization.SerializationExtension
import com.lightbend.lagom.persistence.ActorSystemSpec
class ClusterStartupTaskSerializerSpec ex... | rstento/lagom | persistence/core/src/test/scala/com/lightbend/lagom/internal/persistence/cluster/ClusterStartupTaskSerializerSpec.scala | Scala | apache-2.0 | 980 |
package japgolly.scalajs.react
package extra
import scalaz.effect.IO
import utest._
import vdom.prefix_<^._
import test._
import ScalazReact._
object ReusabilityTest extends TestSuite {
object SampleComponent1 {
case class Picture(id: Long, url: String, title: String)
case class Props(name: String, age: Op... | elacin/scalajs-react | test/src/test/scala/japgolly/scalajs/react/extra/ReusabilityTest.scala | Scala | apache-2.0 | 5,959 |
/*
* Copyright 2016 The BigDL Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agr... | intel-analytics/BigDL | scala/dllib/src/main/scala/com/intel/analytics/bigdl/dllib/nn/Masking.scala | Scala | apache-2.0 | 3,193 |
/*
* 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 ... | ArvinDevel/onlineAggregationOnSparkV2 | core/src/test/scala/org/apache/spark/serializer/GenericAvroSerializerSuite.scala | Scala | apache-2.0 | 3,259 |
package org.kimbasoft.akka.extension
import akka.actor.{Props, Actor}
import org.kimbasoft.akka.extension.ExtensionActor.Messages.{ManualAction, ConfigAction}
/**
* Missing documentation.
*
* @author <a href="[email protected]">Steffen Krause</a>
* @since 1.0
*/
class ExtensionActor extends Actor wi... | kimba74/sandbox-scala | src/main/scala/org/kimbasoft/akka/extension/ExtensionActor.scala | Scala | gpl-3.0 | 1,244 |
/*
* Copyright 2014 Commonwealth Computer Research, 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 applicabl... | mmatz-ccri/geomesa | geomesa-core/src/main/scala/org/locationtech/geomesa/core/iterators/package.scala | Scala | apache-2.0 | 2,075 |
/*
* Copyright 2017-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 t... | akara/squbs | squbs-actorregistry/src/main/scala/org/squbs/actorregistry/japi/ActorLookup.scala | Scala | apache-2.0 | 5,235 |
/**
* 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/ZkUtils.scala | Scala | bsd-2-clause | 32,618 |
package de.leanovate.swaggercheck.fixtures.model
import java.util.UUID
import org.scalacheck.{Arbitrary, Gen}
import play.api.libs.json.Json
case class OtherBase(
id: UUID,
firstName: Option[String],
lastName: String
)
object Ot... | leanovate/swagger-check | swagger-check-core/src/test/scala/de/leanovate/swaggercheck/fixtures/model/OtherBase.scala | Scala | mit | 588 |
package com.learn.spark.mllib
import breeze.linalg.{DenseVector, DenseMatrix}
import scala.io.Source
/**
* Created by xiaojie on 17/7/27.
* 支持向量机
* 参考文档:图解机器学习 机器学习实战
* http://www.cnblogs.com/wsine/p/5180615.html
*/
object LearnSVM {
def main(args: Array[String]): Unit = {
val (xMatrix, yMatrix) =... | xiaoJacky/sparkLearning | sparkLearning/src/main/scala/com/learn/spark/mllib/LearnSVM.scala | Scala | apache-2.0 | 1,238 |
package AXIDefs
{
import Chisel._
import Literal._
import Node._
// Part I: Definitions for the actual data carried over AXI channels
// in part II we will provide definitions for the actual AXI interfaces
// by wrapping the part I types in Decoupled (ready/valid) bundles
// AXI channel data definitions
class AXIAd... | maltanar/axi-in-chisel | AXIDefs.scala | Scala | mit | 4,788 |
/**
* Created by oji on 7/11/16.
*/
/**
* A semi-functioning, purely-bodged spaghetti of code, for a pure object-oriented implementation of Integers
* DISCLAIMER, the code is a spaghetti of a mess, and may not be the most efficient or pretty, or cleaned up of tests scraps xD
**/
abstract class Integer {
d... | ojizero/random_stuff | ScalaTests/integers.scala | Scala | gpl-3.0 | 5,093 |
/*
* This file is part of CoAnSys project.
* Copyright (c) 2012-2015 ICM-UW
*
* CoAnSys 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 Foundation, either version 3 of the License, or
* (at your option) any... | pdendek/CoAnSys | citation-matching/citation-matching-coansys-code/src/main/scala/pl/edu/icm/coansys/citations/converters/BasicMetadataToEntityConverter.scala | Scala | agpl-3.0 | 2,143 |
package com.nthportal
package versions
package v2
/**
* A version of the form `major`.`minor` (such as, for example, `1.3`).
*
* @param major the major version number
* @param minor the minor version number
*/
final case class Version(major: Int, minor: Int) extends VersionBase[Version, ExtendedVersion] {
// Va... | NthPortal/versions | src/main/scala/com/nthportal/versions/v2/Version.scala | Scala | apache-2.0 | 1,336 |
package scalan.staged
import scalan.{DFunc, Nullable, Scalan}
import debox.{Buffer => DBuffer}
import scalan.util.GraphUtil
import spire.syntax.all.cfor
import scala.collection.mutable
trait ProgramGraphs extends AstGraphs { self: Scalan =>
type PGraph = ProgramGraph
/** Deboxed function to obtain usages of a ... | ScorexFoundation/sigmastate-interpreter | core/src/main/scala/scalan/staged/ProgramGraphs.scala | Scala | mit | 3,995 |
package org.plummtw.jinrou.data
import scala.xml._
import net.liftweb._
import net.liftweb.mapper._
import http._
import js._
import util._
import S._
import SHtml._
import Helpers._
import org.plummtw.jinrou.model._
import org.plummtw.jinrou.enum._
import org.plummtw.jinrou.util._
class ActionData... | Plummtw/jinrou_Lift | src/main/scala/org/plummtw/jinrou/data/ActionData.scala | Scala | apache-2.0 | 42,837 |
/* 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/lemma/WordNetLemmatizer.scala | Scala | apache-2.0 | 7,853 |
package controller
import org.scalatest._
import skinny.test._
class FileUploadControllerSpec extends FunSpec with Matchers {
def createMockController = new FileUploadController with MockServlet
describe("FileUploadController") {
it("should work with MockServlet") {
try {
val controller = createMo... | seratch/skinny-framework | example/src/test/scala/controller/FileUploadControllerSpec.scala | Scala | mit | 512 |
//
// Analysis.scala -- Scala class/trait/object Analysis
// Project OrcScala
//
// Created by amp on Jun 2, 2013.
//
// Copyright (c) 2018 The University of Texas at Austin. All rights reserved.
//
// Use and redistribution of this file is governed by the license terms in
// the LICENSE file found in the project's top... | orc-lang/orc | OrcScala/src/orc/ast/porc/Analysis.scala | Scala | bsd-3-clause | 3,525 |
// 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 ducttape.util
import collection._
object MultiSet {
// TODO: Can we make this more efficient
def empty[A] = n... | jhclark/ducttape | src/main/scala/ducttape/util/MultiSet.scala | Scala | mpl-2.0 | 1,287 |
package org.bitcoins.feeprovider
import org.bitcoins.crypto.StringFactory
sealed abstract class FeeProviderName
object FeeProviderName extends StringFactory[FeeProviderName] {
final case object BitcoinerLive extends FeeProviderName
final case object BitGo extends FeeProviderName
final case object Constant e... | bitcoin-s/bitcoin-s | fee-provider/src/main/scala/org/bitcoins/feeprovider/FeeProviderName.scala | Scala | mit | 861 |
/**
* 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... | WillCh/cs286A | dataMover/kafka/core/src/test/scala/unit/kafka/admin/AdminTest.scala | Scala | bsd-2-clause | 19,432 |
package eu.timepit.refined.scalacheck
import eu.timepit.refined.api.{RefType, Refined}
import eu.timepit.refined.collection.{NonEmpty, Size}
import eu.timepit.refined.string._
import eu.timepit.refined.types.string.TrimmedString
import org.scalacheck.Arbitrary
import shapeless.Witness
/**
* Module that provides `Arb... | fthomas/refined | modules/scalacheck/shared/src/main/scala/eu/timepit/refined/scalacheck/string.scala | Scala | mit | 3,260 |
/*
* 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... | bpburns/spark-kernel | protocol/src/main/scala/com/ibm/spark/kernel/protocol/v5/content/DisplayData.scala | Scala | apache-2.0 | 1,102 |
package org.jetbrains.plugins.scala
package annotator
import org.jetbrains.plugins.scala.base.ScalaLightPlatformCodeInsightTestCaseAdapter
import org.jetbrains.plugins.scala.lang.psi.api.base.patterns.ScPattern
import org.jetbrains.plugins.scala.extensions.toPsiElementExt
import org.junit.Assert.assertEquals
import or... | consulo/consulo-scala | test/org/jetbrains/plugins/scala/annotator/PatternAnnotatorTest.scala | Scala | apache-2.0 | 4,105 |
/* __ *\\
** ________ ___ / / ___ __ ____ Scala.js Test Suite **
** / __/ __// _ | / / / _ | __ / // __/ (c) 2013, LAMP/EPFL **
** __\\ \\/ /__/ __ |/ /__/ __ |/_// /_\\ \\ http://scala-js.org/ **
** /____/\\___/... | lrytz/scala-js | test-suite/shared/src/test/scala/org/scalajs/testsuite/javalib/math/BigDecimalTest.scala | Scala | bsd-3-clause | 5,367 |
package com.twitter.util
import org.specs.SpecificationWithJUnit
class CancellableSpec extends SpecificationWithJUnit {
"CancellableSink" should {
"cancel once" in {
var count = 0
val s = new CancellableSink { count += 1 }
s.cancel()
count must be_==(1)
s.cancel()
count must ... | mosesn/util | util-core/src/test/scala/com/twitter/util/CancellableSpec.scala | Scala | apache-2.0 | 341 |
package org.vaadin.addons.rinne
import com.vaadin.ui.Panel
import org.vaadin.addons.rinne.mixins.PanelMixin
class VPanel extends Panel with PanelMixin | LukaszByczynski/rinne | src/main/scala/org/vaadin/addons/rinne/VPanel.scala | Scala | apache-2.0 | 152 |
package com.github.j5ik2o.forseti.adaptor.validator
import com.github.j5ik2o.forseti.domain.GrantType
import com.github.j5ik2o.forseti.domain.client.Client
import com.github.j5ik2o.forseti.domain.exception.{OAuthException, UnsupportedGrantTypeException}
import com.github.j5ik2o.forseti.infrastructure.util.EitherTUtil.... | j5ik2o/forseti | server/server-use-case-port/src/main/scala/com/github/j5ik2o/forseti/adaptor/validator/GrantTypeValidator.scala | Scala | mit | 1,332 |
package cn.scala.chapter13
//全部是抽象成员,与java的interface等同
trait MySQLDAO{
def delete(id:String):Boolean
def add(o:Any):Boolean
def update(o:Any):Int
def query(id:String):List[Any]
} | Dax1n/Scala | ScalaLearning/src/main/scala/cn/scala/chapter13/MySQLDAO.scala | Scala | apache-2.0 | 211 |
import sbt._
object Version {
val akka = "2.3.11"
val scalaz = "7.1.3"
val scalatest = "2.2.5"
val scalacheck = "1.12.2"
}
object Library {
val akka = "com.typesafe.akka" %% "akka-actor" % Version.akka
val scalaz = "org.scalaz" %% "scalaz-core" % Version.scalaz
val akkates... | nikhilRP/akka_requests | project/Dependencies.scala | Scala | apache-2.0 | 570 |
package de.htwg.zeta.common.format.entity
import java.util.UUID
import de.htwg.zeta.common.models.entity.TimedTask
import play.api.libs.json.JsObject
import play.api.libs.json.Json
import play.api.libs.json.JsResult
import play.api.libs.json.JsValue
import play.api.libs.json.OFormat
/**
* Parse JsValue to TimedTask... | Zeta-Project/zeta | api/common/src/main/scala/de/htwg/zeta/common/format/entity/TimedTaskFormat.scala | Scala | bsd-2-clause | 1,381 |
package scalacookbook.chapter20
/**
* Created by liguodong on 2016/8/27.
*/
object ExpressionOrientedProgram extends App{
// understand the difference between a statement and an expression.
//Statements do not return results and are executed solely for their side effects,
//while expressions always return a... | liguodongIOT/java-scala-mix-sbt | src/main/scala/scalacookbook/chapter20/ExpressionOrientedProgram.scala | Scala | apache-2.0 | 2,981 |
package com.cloudray.scalapress.item.controller.admin
import org.scalatest.{OneInstancePerTest, FunSuite}
import org.scalatest.mock.MockitoSugar
import org.mockito.Mockito
import org.springframework.ui.ModelMap
import com.cloudray.scalapress.theme.{ThemeDao, Theme}
/** @author Stephen Samuel */
class ThemePopulatorTe... | vidyacraghav/scalapress | src/test/scala/com/cloudray/scalapress/item/controller/admin/ThemePopulatorTest.scala | Scala | apache-2.0 | 1,173 |
// cf. pos/t8300-patmat.scala
trait Universe {
type Name >: Null <: AnyRef with NameApi
trait NameApi
type TermName >: Null <: TermNameApi with Name
trait TermNameApi extends NameApi
}
object Test extends App {
val u: Universe = ???
import u._
val ScalaName: TermName = ???
locally {
??? m... | AlexSikia/dotty | tests/pending/pos/t8301b.scala | Scala | bsd-3-clause | 737 |
/*
* 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 ... | librairy/modeler-lda | src/main/scala/org/apache/spark/mllib/clustering/JSKMeans.scala | Scala | apache-2.0 | 20,898 |
/*
* Copyright 2016 Tamer AbdulRadi
*
* 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... | schemasafe/troy | troy-schema/src/test/scala/troy/schema/DeleteSpec.scala | Scala | apache-2.0 | 4,702 |
package org.scalaide.core.internal
import scala.collection.mutable
import scala.tools.nsc.settings.ScalaVersion
import org.eclipse.core.resources.IFile
import org.eclipse.core.resources.IProject
import org.eclipse.core.resources.IResourceChangeEvent
import org.eclipse.core.resources.IResourceChangeListener
import org.... | sschaef/scala-ide | org.scala-ide.sdt.core/src/org/scalaide/core/internal/ScalaPlugin.scala | Scala | bsd-3-clause | 13,566 |
// Copyright (c) 2010, Stephen D. Strowes
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// * Redistributions of source code must retain the above copyright notice,
// this list ... | sdstrowes/scala-util | BGPPathsToLinks.scala | Scala | bsd-3-clause | 3,647 |
/* Copyright (C) 2009-2010 Univ of Massachusetts Amherst, Computer Science Dept
This file is part of "FACTORIE" (Factor graphs, Imperative, Extensible)
http://factorie.cs.umass.edu, http://code.google.com/p/factorie/
This software is provided under the terms of the Eclipse Public License 1.0
as published by... | andrewmilkowski/factorie | src/main/scala/cc/factorie/Gate.scala | Scala | epl-1.0 | 3,306 |
/*
* 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 ... | BryanCutler/spark | sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/SQLMetricsSuite.scala | Scala | apache-2.0 | 2,847 |
/*
* 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 ... | aokolnychyi/spark | graphx/src/main/scala/org/apache/spark/graphx/lib/LabelPropagation.scala | Scala | apache-2.0 | 3,086 |
/**
* Copyright 2011-2017 GatlingCorp (http://gatling.io)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by appli... | MykolaB/gatling | src/sphinx/general/code/Scenario.scala | Scala | apache-2.0 | 6,373 |
package org.opendata.data
import play.api.test._
import play.api.test.Helpers._
import org.mockito.Mockito._
import org.junit._
import org.junit.Assert._
import play.api.libs.json.Json
import play.api.libs.json._
import play.api.libs.iteratee._
import org.opengraph.data._
trait TestData {
import DataFormatter._
... | mresposito/openData | test/RestControllerTest.scala | Scala | apache-2.0 | 1,526 |
package im.actor.server.api.rpc.service.sequence
import scala.util.Try
import com.typesafe.config.{ ConfigFactory, Config }
case class SequenceServiceConfig(maxDifferenceSize: Long)
object SequenceServiceConfig {
def load(config: Config): Try[SequenceServiceConfig] =
for {
maxDifferenceSize ← Try(config... | luoxiaoshenghustedu/actor-platform | actor-server/actor-rpc-api/src/main/scala/im/actor/server/api/rpc/service/sequence/SequenceServiceConfig.scala | Scala | mit | 523 |
/*
* 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... | bpburns/spark-kernel | protocol/src/test/scala/com/ibm/spark/kernel/protocol/v5/content/HistoryRequestSpec.scala | Scala | apache-2.0 | 2,396 |
package br.unb.cic.poo.gol
import scala.io.StdIn.{readInt, readLine}
/**
* Representa o componente View do GoL
*
* @author Breno Xavier (baseado na implementacao Java de [email protected]
*/
object GameView {
private final val CONWAY = 1
private final val HIGHLIFE = 2
//private final val SEEDS... | PeterTowers/TP1-022017 | GoLScala/GoLScala_ID/src/br/unb/cic/poo/gol/GameView.scala | Scala | mit | 3,463 |
/**
* Copyright 2011-2017 GatlingCorp (http://gatling.io)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by appli... | MykolaB/gatling | gatling-http/src/main/scala/io/gatling/http/action/ws2/WsClose.scala | Scala | apache-2.0 | 1,637 |
package ch.ethz.dalab.dissolve.app
import org.apache.spark.SparkConf
import org.apache.spark.SparkContext
import org.apache.spark.rdd.RDD
import breeze.linalg.Vector
import ch.ethz.dalab.dissolve.classification.StructSVMModel
import ch.ethz.dalab.dissolve.classification.StructSVMWithDBCFW
import ch.ethz.dalab.dissolv... | dalab/dissolve-struct | dissolve-struct-application/src/main/scala/ch/ethz/dalab/dissolve/app/DSApp.scala | Scala | apache-2.0 | 7,449 |
/***********************************************************************
* Copyright (c) 2013-2017 Commonwealth Computer Research, Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Apache License, Version 2.0
* which accompanies this distribution and... | ronq/geomesa | geomesa-index-api/src/main/scala/org/locationtech/geomesa/index/filters/DtgAgeOffFilter.scala | Scala | apache-2.0 | 4,558 |
/*
* 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 ... | ArvinDevel/onlineAggregationOnSparkV2 | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/windowExpressions.scala | Scala | apache-2.0 | 12,147 |
package com.lookout.borderpatrol
import java.net.URL
import com.twitter.finagle.httpx.path.Path
/**
*
* @param name
* @param path
* @param hosts List of URLs to upstream manager
*/
case class Manager(name: String, path: Path, hosts: Set[URL])
/**
*
* @param name
* @param path
* @param hosts list of URLs to ... | jamescway/borderpatrol | core/src/main/scala/com/lookout/borderpatrol/Manager.scala | Scala | mit | 569 |
package com.eigengo.lift.exercise.classifiers.workflows
import akka.stream.stage.{TerminationDirective, Directive, Context, PushPullStage}
import scala.collection.mutable
/**
* Streaming stage that buffers events and slides a window over streaming input data. Transmits each observed window
* downstream.
*
* @para... | lachatak/lift | server/exercise/src/main/scala/com/eigengo/lift/exercise/classifiers/workflows/SlidingWindow.scala | Scala | apache-2.0 | 2,695 |
/*
* Copyright 2015 University of Basel, Graphics and Vision Research Group
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unl... | unibas-gravis/scalismo | src/test/scala/scalismo/mesh/MeshLineIntersectionTests.scala | Scala | apache-2.0 | 2,691 |
package scutil.color
import scutil.color.extension._
object literals extends literals
trait literals
extends StringContextImplicits
| ritschwumm/scutil | modules/core/src/main/scala/scutil/color/literals.scala | Scala | bsd-2-clause | 136 |
package io.sqooba.oss.timeseries.stats
import org.scalatest.{FlatSpec, Matchers}
import scala.util.Random
class ThreadUnsafeDoubleUniformReservoirSpec extends FlatSpec with Matchers {
"A ThreadUnsafeDoubleUniformReservoir" should "report its size as at most the size of the underlying array" in {
val res = new... | Shastick/tslib | src/test/scala/io/sqooba/oss/timeseries/stats/ThreadUnsafeDoubleUniformReservoirSpec.scala | Scala | mit | 2,092 |
/*
* Copyright (c) 2012-2017 by its authors. Some rights reserved.
* See the project homepage at: https://github.com/monix/shade
*
* Licensed under the MIT License (the "License"); you may not use this
* file except in compliance with the License. You may obtain a copy
* of the License at:
*
* https://github.co... | lloydmeta/shade | src/main/scala/shade/memcached/Codec.scala | Scala | mit | 5,575 |
/*
* 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 ... | tejasapatil/spark | sql/core/src/test/scala/org/apache/spark/sql/execution/streaming/CheckpointFileManagerSuite.scala | Scala | apache-2.0 | 6,850 |
package at.logic.gapt.formats.tip
import at.logic.gapt.expr._
import at.logic.gapt.expr.hol.{ existentialClosure, universalClosure }
import at.logic.gapt.proofs.{ Context, Sequent }
case class TipConstructor( constr: Const, projectors: Seq[Const] ) {
val FunctionType( datatype, fieldTypes ) = constr.ty
require( f... | gebner/gapt | core/src/main/scala/at/logic/gapt/formats/tip/problem.scala | Scala | gpl-3.0 | 2,052 |
package com.github.agourlay.cornichon.steps.wrapped
import com.github.agourlay.cornichon.core._
import com.github.agourlay.cornichon.steps.StepUtilSpec
import com.github.agourlay.cornichon.steps.regular.assertStep.{ AssertStep, GenericEqualityAssertion }
import org.scalatest.{ Matchers, AsyncWordSpec }
class RepeatSt... | OlegIlyenko/cornichon | cornichon-core/src/test/scala/com/github/agourlay/cornichon/steps/wrapped/RepeatStepSpec.scala | Scala | apache-2.0 | 1,992 |
package com.twitter.finatra.validation.constraints
import com.twitter.finatra.validation.ErrorCode
import com.twitter.util.validation.constraintvalidation.TwitterConstraintValidatorContext
import jakarta.validation.{ConstraintValidator, ConstraintValidatorContext}
@deprecated("Users should prefer to use standard cons... | twitter/finatra | validation/src/main/scala/com/twitter/finatra/validation/constraints/AssertTrueConstraintValidator.scala | Scala | apache-2.0 | 846 |
package com.sksamuel.elastic4s.search.suggestions
import com.sksamuel.elastic4s.Indexable
import com.sksamuel.elastic4s.testkit.ElasticSugar
import org.elasticsearch.common.unit.Fuzziness
import org.scalatest.{Matchers, WordSpec}
class CompletionSuggestionsTest extends WordSpec with Matchers with ElasticSugar {
im... | aroundus-inc/elastic4s | elastic4s-tests/src/test/scala/com/sksamuel/elastic4s/search/suggestions/CompletionSuggestionsTest.scala | Scala | apache-2.0 | 2,810 |
/*
* Copyright (c) 2012-2017 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... | Propertyfinder/snowplow | 4-storage/rdb-loader/src/test/scala/com/snowplowanalytics/snowplow/rdbloader/config/SnowplowConfigSpec.scala | Scala | apache-2.0 | 11,919 |
package com.peterpotts.common.sample
class SampleIterable[A](iterable: Iterable[Sample[A]]) extends Sample[Iterable[A]] {
def next(): Iterable[A] = iterable.map(_.next())
}
object SampleIterable {
def apply[A](iterable: Iterable[Sample[A]]) = new SampleIterable(iterable)
def apply[A](sampleA: Sample[A], size: ... | peterpotts/mobius | src/main/scala/com/peterpotts/common/sample/SampleIterable.scala | Scala | mit | 553 |
package library
sealed trait List[+T] {
def head: T
def tail: List[T]
def zip[U](l: List[U]): List[Tuple2[T, U]] = if (this == Nil) {
Nil
} else {
new Cons[Tuple2[T, U]](
new Tuple2(
head,
l.head),
tail.zip(l.tail))
}
def zipWithIndex: List[Tuple2[T, Int]] = zipWithSta... | scala-ct/scala-ct | test/library/Library.scala | Scala | bsd-3-clause | 3,260 |
package is.hail.expr.ir
import is.hail.annotations.{Region, StagedRegionValueBuilder}
import is.hail.asm4s._
import is.hail.types.physical.{PCode, PType}
import is.hail.utils._
object StagedRegion {
def apply(
r: Value[Region],
allowSubregions: Boolean = false,
parents: Seq[ParentStagedRegion] = Seq(),
... | cseed/hail | hail/src/main/scala/is/hail/expr/ir/StagedRegion.scala | Scala | mit | 9,103 |
object Test extends App {
val emptyTuple: Tuple = Tuple()
val tuple: Tuple = ("1", "2", "3", "4", "5")
val tupleXXL: Tuple = ("11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31", "32", "33", "34", "35")
type Id[X] = X
val f: [t] => t =... | dotty-staging/dotty | tests/run/tuple-map.scala | Scala | apache-2.0 | 575 |
package io.github.shogowada.scala.jsonrpc.server
import io.github.shogowada.scala.jsonrpc.server.JSONRPCServer.RequestJSONHandler
class JSONRPCRequestJSONHandlerRepository {
private var methodNameToHandlerMap: Map[String, RequestJSONHandler] = Map.empty
def add(methodName: String, requestJSONHandler: RequestJSON... | shogowada/scala-json-rpc | shared/src/main/scala/io/github/shogowada/scala/jsonrpc/server/JSONRPCRequestJSONHandlerRepository.scala | Scala | mit | 910 |
import scala.quoted._
inline def isTrue: Boolean = true
inline def oneOf(): String = {
inline if isTrue then
"foo"
else
"bar"
}
def test1 = oneOf()
| lampepfl/dotty | tests/pos/i10107c.scala | Scala | apache-2.0 | 163 |
package mstparser
import java.io.BufferedOutputStream
import java.io.File
import java.io.FileOutputStream
import java.io.IOException
import java.io.ObjectInputStream
import java.io.ObjectOutputStream
import mstparser.io.DependencyReader
import mstparser.io.DependencyWriter
class DependencyPipe(
protected val optio... | travisbrown/mstparser | src/main/scala/mstparser/DependencyPipe.scala | Scala | epl-1.0 | 22,964 |
/* **************************************************************************
* *
* Copyright (C) 2011 Christian Krause *
* *
* Chri... | wookietreiber/scadulix | src/main/scala/organisations.scala | Scala | gpl-3.0 | 2,369 |
package io.buoyant.linkerd
package protocol
import com.twitter.conversions.time._
import com.twitter.finagle.Failure
import com.twitter.finagle.http.{Status, Request}
import io.buoyant.linkerd.protocol.TlsUtils._
import io.buoyant.test.Awaits
import org.scalatest.FunSuite
class TlsStaticValidationTest extends FunSuit... | denverwilliams/linkerd | linkerd/protocol/http/src/integration/scala/io/buoyant/linkerd/protocol/TlsStaticValidationTest.scala | Scala | apache-2.0 | 3,264 |
package functional
import org.scalatest.{FunSpec, Matchers}
class TestNoJacketWhenHot extends FunSpec with Matchers {
describe("NoJacketWhenHot") {
it("should pass if it is cold and you try to put a jacket on") {
NoJacketWhenHot(PJsOnly, PutOnJacket, COLD) should be (Pass)
}
it("should fail i... | dkettlestrings/adornment | src/test/scala/functional/TestNoJacketWhenHot.scala | Scala | mit | 588 |
package com.overviewdocs.models
import java.nio.charset.Charset
import java.time.Instant
case class CsvImport(
id: Long,
documentSetId: Long,
filename: String,
charsetName: String, // Charset isn't serializable
lang: String,
loid: Long,
nBytes: Long,
nBytesProcessed: Long,
nDocuments: Int,
cancell... | overview/overview-server | common/src/main/scala/com/overviewdocs/models/CsvImport.scala | Scala | agpl-3.0 | 818 |
package com.cloudera.hue.livy.repl
import com.cloudera.hue.livy.repl.python.PythonSession
import org.json4s.JsonAST.JValue
import org.json4s.{Extraction, DefaultFormats}
import org.scalatest.{BeforeAndAfter, FunSpec}
import org.scalatest.matchers.ShouldMatchers
import _root_.scala.concurrent.Await
import _root_.scala... | vitan/hue | apps/spark/java/livy-repl/src/test/scala/com/cloudera/hue/livy/repl/PythonSessionSpec.scala | Scala | apache-2.0 | 4,313 |
package nxt
import nxt.util.Logger
import scala.util.Try
import java.sql.ResultSet
import resource._
class TransactionQueryBuilder {
protected val sql = "SELECT * FROM transaction WHERE amount >= 0 "
private def withSuffix(suffix:String) = {
val s = this.sql
new TransactionQueryBuilder{
override p... | kushti/NxtScala | src/main/scala/nxt/TransactionQueryBuilder.scala | Scala | cc0-1.0 | 1,513 |
package controllers
import play.api.mvc.{Action, Controller}
import play.api.libs.json._
import play.api.Logger
import apidoc.models.json._
import apidoc.models.sample.SampleImpl
object Samples extends Controller {
private final val logger = Logger
def getGuid(guid: String) = Action {
logger.info(s"GUID: $gu... | riccardomerolla/activator-six-app | svc/app/controllers/Samples.scala | Scala | apache-2.0 | 411 |
package model
/**
* Created by einevea on 19/03/2014.
*/
object StoryType extends Enumeration{
class MyValue(override val id: Int, val url:String) extends Val(i=id)
object MyValue{
def apply(url: String) = new MyValue(nextId, url)
}
final def usingName(s: String): StoryType = {
withName(s) match {
... | einevea/eKanban | app/model/StoryType.scala | Scala | mit | 602 |
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2015-2021 Andre White.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE... | adarro/ddo-calc | subprojects/common/ddo-core/src/main/scala/io/truthencode/ddo/model/alignment/Alignments.scala | Scala | apache-2.0 | 2,261 |
/*
*************************************************************************************
* Copyright 2013 Normation SAS
*************************************************************************************
*
* This file is part of Rudder.
*
* Rudder is free software: you can redistribute it and/or modify
* it under the... | armeniaca/rudder | rudder-web/src/main/scala/com/normation/rudder/web/rest/RestData.scala | Scala | gpl-3.0 | 3,781 |
package svoysh.util
object Strings extends Strings
trait Strings {
/**
* Returns <code>true</code> if <code>string</code> either <code>null</code>
* or equals to <code>""</code> (empty string) or consists of white spaces
* only.
*/
def isEmpty(string: String): Boolean = (
string == null || string.trim.le... | Svoysh/svoysh-util | src/main/scala/svoysh/util/Strings.scala | Scala | apache-2.0 | 603 |
package org.openmole.buildsystem
import sbt._
import Keys._
import OMKeys._
import com.typesafe.sbt.osgi.{ OsgiKeys, SbtOsgi }
trait OsgiBundler {
self: BuildSystemDefaults ⇒
protected val bundleMap = Map("Bundle-ActivationPolicy" -> "lazy")
protected def osgiSettings = SbtOsgi.osgiSettings ++ Seq(
OsgiKe... | ISCPIF/PSEExperiments | openmole-src/build-system/src/main/scala/org/openmole/buildsystem/OsgiBundler.scala | Scala | agpl-3.0 | 3,042 |
package dotty.tools.dotc
package transform
import core._
import MegaPhase.MiniPhase
import dotty.tools.dotc.core.Contexts._
import ast._
import Flags._
import Symbols._
import ExplicitOuter.isOuterParamAccessor
import collection.mutable
object CountOuterAccesses:
val name: String = "countOuterAccesses"
val descr... | dotty-staging/dotty | compiler/src/dotty/tools/dotc/transform/CountOuterAccesses.scala | Scala | apache-2.0 | 1,989 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | ksattler/piglet | src/main/scala/dbis/pig/plan/rewriting/dsl/words/ReplaceWord.scala | Scala | apache-2.0 | 1,175 |
package org.trustedanalytics.sparktk.saveload
import org.apache.spark.SparkContext
import org.json4s.JsonAST.JValue
/**
* Trait for companion objects of classes that want to work with the SaveLoad methodology
*/
trait TkSaveableObject {
/**
*
* @param sc active spark context
* @param path the source path... | shibanis1/spark-tk | core/src/main/scala/org/trustedanalytics/sparktk/saveload/TkSaveableObject.scala | Scala | apache-2.0 | 1,203 |
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.