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 |
|---|---|---|---|---|---|
/*
* Copyright (C) 2016 Academic Medical Center of the University of Amsterdam (AMC)
*
* This program is semi-free software: you can redistribute it and/or modify it
* under the terms of the Rosemary license. You may obtain a copy of this
* license at:
*
* https://github.com/AMCeScience/Rosemary-Vanilla/blob/... | AMCeScience/Rosemary-Vanilla | app/nl/amc/ebioscience/rosemary/services/processing/ProcessingStatusCheckDaemon.scala | Scala | agpl-3.0 | 1,762 |
package nodes.util
import breeze.linalg.DenseVector
import org.apache.spark.rdd.RDD
import pipelines.FunctionNode
/**
* This transformer splits the input vector into a number of blocks.
*/
class VectorSplitter(
blockSize: Int,
numFeaturesOpt: Option[Int] = None)
extends FunctionNode[RDD[DenseVector[Doubl... | o0neup/keystone | src/main/scala/nodes/util/VectorSplitter.scala | Scala | apache-2.0 | 1,212 |
package latis.reader.tsml
import java.io.{File, FileNotFoundException}
import scala.annotation.tailrec
import scala.collection.Searching._
import scala.collection.mutable
import latis.dm._
import latis.data.Data
import latis.data.seq.DataSeq
import latis.ops.Operation
import latis.ops.filter.Selection
import latis.r... | dlindhol/latis-netcdf | src/main/scala/latis/reader/tsml/NetcdfAdapterSSI.scala | Scala | epl-1.0 | 10,395 |
/*
* 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 | sql/core/src/test/scala/org/apache/spark/sql/execution/command/v1/AlterTableRecoverPartitionsSuite.scala | Scala | apache-2.0 | 5,795 |
/*
* 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... | zhangxiaoli73/BigDL | spark/dl/src/test/scala/com/intel/analytics/bigdl/integration/torch/MeanSpec.scala | Scala | apache-2.0 | 3,048 |
/***********************************************************************
* Copyright (c) 2013-2016 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 is ... | MutahirKazmi/geomesa | geomesa-utils/src/test/scala/org/locationtech/geomesa/utils/geotools/ConverterFactoriesTest.scala | Scala | apache-2.0 | 10,865 |
/*
* 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... | hmrc/api-gateway | test/it/uk/gov/hmrc/apigateway/stubs/ThirdPartyApplicationStub.scala | Scala | apache-2.0 | 2,274 |
/***********************************************************************
* Copyright (c) 2013-2019 Commonwealth Computer Research, Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Apache License, Version 2.0
* which accompanies this distribution and... | elahrvivaz/geomesa | geomesa-accumulo/geomesa-accumulo-datastore/src/test/scala/org/locationtech/geomesa/accumulo/data/AccumuloDataStoreAuthTest.scala | Scala | apache-2.0 | 9,655 |
package com.github.ponkin.bloom.server
import com.github.ponkin.bloom.Filter
case class FilterEntity(descriptor: FilterDescriptor, filter: Filter)
| ponkin/bloom | server/src/main/scala/com/github/ponkin/bloom/server/FilterEntity.scala | Scala | apache-2.0 | 149 |
package zoey
import org.apache.zookeeper.{ CreateMode, KeeperException, WatchedEvent, ZKUtil }
import org.apache.zookeeper.common.PathUtils
import org.apache.zookeeper.data.{ ACL, Stat }
import scala.collection.JavaConverters._
import scala.concurrent.{ ExecutionContext, Future, Promise }
import scala.util.Try
trait ... | softprops/zoey | zoey-core/src/main/scala/ZNode.scala | Scala | mit | 9,338 |
/**
* Copyright 2015 ICT.
*
* 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
... | DataSysLab/netflow | load/src/main/scala/cn/ac/ict/acs/netflow/load/worker/parser/loadTestFile.scala | Scala | apache-2.0 | 2,827 |
/**
* 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... | logzio/camel | components/camel-swagger/src/main/scala/org/apache/camel/component/swagger/DefaultCamelSwaggerServlet.scala | Scala | apache-2.0 | 2,246 |
/*
* Copyright 2009-2015 LinkedIn, 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 ... | linkedin/norbert | network/src/main/scala/com/linkedin/norbert/network/partitioned/PartitionedNetworkClientFactory.scala | Scala | apache-2.0 | 2,702 |
package org.scalaide.ui.editor
import org.eclipse.jface.text.source.Annotation
import org.eclipse.jface.text.source.IAnnotationModel
import org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitDocumentProvider.ProblemAnnotation
import scala.collection.breakOut
import org.eclipse.jdt.core.compiler.IProblem
import org.... | romanowski/scala-ide | org.scala-ide.sdt.core/src/org/scalaide/ui/editor/DecoratedInteractiveEditor.scala | Scala | bsd-3-clause | 2,493 |
/*******************************************************************************
Copyright (c) 2012-2014, S-Core, KAIST.
All rights reserved.
Use is subject to license terms.
This distribution may include materials developed by third parties.
***************************************************... | darkrsw/safe | src/main/scala/kr/ac/kaist/jsaf/analysis/visualization/DomainPrinter.scala | Scala | bsd-3-clause | 6,125 |
/* __ *\\
** ________ ___ / / ___ __ ____ Scala.js Benchmarks **
** / __/ __// _ | / / / _ | __ / // __/ Adam Burmister **
** __\\ \\/ /__/ __ |/ /__/ __ |/_// /_\\ \\ 2012, Google, Inc **
** /____/\\___/... | cedricviaccoz/scala-native | benchmarks/src/main/scala/tracer/Color.scala | Scala | bsd-3-clause | 1,942 |
package fpinscala.localeffects
import fpinscala.monads._
object Mutable {
def quicksort(xs: List[Int]): List[Int] = if (xs.isEmpty) xs else {
val arr = xs.toArray
def swap(x: Int, y: Int) = {
val tmp = arr(x)
arr(x) = arr(y)
arr(y) = tmp
}
def partition(l: Int, r: Int, pivot: Int) ... | fpinscala-muc/fpinscala-abo64 | exercises/src/main/scala/fpinscala/localeffects/LocalEffects.scala | Scala | mit | 4,683 |
package skuber
import java.beans.Expression
/**
* @author David O'Riordan
*/
case class LabelSelector(val requirements: LabelSelector.Requirement*) {
override def toString=requirements.mkString(",")
override def equals(o: Any) = o match {
case that: LabelSelector => that.requirements.sortBy(r => r.key).... | coryfklein/skuber | client/src/main/scala/skuber/LabelSelector.scala | Scala | apache-2.0 | 2,700 |
package katas.scala.coins
import org.scalatest.Matchers
import org.junit.Test
/**
* @author DKandalov
*/
class CountChange1 extends Matchers {
@Test def shouldCountNumberOfWaysToChangeAmountOfMoney() {
countChangeVariants(100) should equal(292)
}
def countChangeVariants(amount: Int, coinType: Int = 4): ... | dkandalov/katas | scala/src/katas/scala/coins/CountChange1.scala | Scala | unlicense | 830 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | goldmedal/spark | mllib/src/test/scala/org/apache/spark/ml/classification/DecisionTreeClassifierSuite.scala | Scala | apache-2.0 | 18,581 |
package skinny.assets
import scala.sys.process._
import java.io.{ IOException, ByteArrayInputStream }
import skinny.util.LoanPattern._
import skinny.exception.AssetsPrecompileFailureException
import org.slf4j.LoggerFactory
/**
* Sass Compiler
*
* @see https://github.com/jlitola/play-sass
*/
class SassCompiler {
... | Kuchitama/skinny-framework | assets/src/main/scala/skinny/assets/SassCompiler.scala | Scala | mit | 2,673 |
package com.mesosphere.cosmos.rpc.v1.model
case class PackageRepositoryAddResponse(repositories: Seq[PackageRepository])
| movicha/cosmos | cosmos-model/src/main/scala/com/mesosphere/cosmos/rpc/v1/model/PackageRepositoryAddResponse.scala | Scala | apache-2.0 | 122 |
package com.tvunetworks.test
import org.apache.spark.SparkConf
import org.apache.spark.streaming.StreamingContext
import org.apache.spark.streaming.Seconds
import org.apache.spark.streaming.dstream.DStream.toPairDStreamFunctions
import com.tvunetworks.scala.xml.XmlAnalysis
import org.apache.spark.storage.StorageLevel
... | richard-yao/ScalaTest | ScalaTest/src/main/scala/com/tvunetworks/test/SparkStreaming.scala | Scala | apache-2.0 | 1,175 |
/*
* 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 ... | yelshater/hadoop-2.3.0 | spark-core_2.10-1.0.0-cdh5.1.0/src/main/scala/org/apache/spark/storage/BlockId.scala | Scala | apache-2.0 | 3,908 |
package com.booking.sql
import scala.language.postfixOps
import scala.util.matching.Regex
import scala.util.parsing.combinator.JavaTokenParsers
case class MySQLPrecision(precision: Int, scale: Option[Int])
case class MySQLDataType(typename: String, enumeration: Seq[String], precision: Option[MySQLPrecision], qualifie... | mysql-time-machine/hbase-snapshotter | src/main/scala/com/booking/sql/DataTypeParser.scala | Scala | apache-2.0 | 2,808 |
package akka.persistence.cassandra.journal
import java.util.UUID
import scala.concurrent.duration._
import akka.actor._
import akka.persistence._
import akka.persistence.cassandra.CassandraLifecycle
import akka.testkit._
import com.typesafe.config.ConfigFactory
import org.scalatest._
object CassandraIntegrationSp... | krasserm/akka-persistence-cassandra | src/test/scala/akka/persistence/cassandra/journal/CassandraIntegrationSpec.scala | Scala | apache-2.0 | 12,525 |
/* Copyright 2009-2016 EPFL, Lausanne */
import leon.annotation._
import leon.lang._
object ListWithSize {
sealed abstract class List
case class Cons(head: Int, tail: List) extends List
case class Nil() extends List
sealed abstract class IntPairList
case class IPCons(head: IntPair, tail: IntPairL... | epfl-lara/leon | src/test/resources/regression/termination/valid/ListWithSize.scala | Scala | gpl-3.0 | 4,383 |
package zzb.srvbox
import org.scalatest.WordSpec
import org.scalatest.MustMatchers
import com.typesafe.config.ConfigException._
/**
* Created with IntelliJ IDEA.
* User: Simon Xiao
* Date: 13-9-4
* Time: 下午4:53
* Copyright baoxian.com 2012~2020
*/
class ConfigCheckTest extends WordSpec with MustMatchers {
"B... | stepover/zzb | zzb-box/src/test/scala/zzb/srvbox/ConfigCheckTest.scala | Scala | mit | 3,202 |
/*
* 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-output-streaming-engine/src/main/scala/com/bwsw/sj/engine/output/processing/JdbcOutputProcessor.scala | Scala | apache-2.0 | 3,797 |
/*
* 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 ... | bravo-zhang/spark | core/src/test/scala/org/apache/spark/partial/SumEvaluatorSuite.scala | Scala | apache-2.0 | 3,070 |
package models
import skinny.DBSettings
import skinny.test._
import org.scalatest.fixture.FlatSpec
import org.scalatest._
import scalikejdbc._
import scalikejdbc.scalatest._
import org.joda.time._
class TagsSpec extends FlatSpec with Matchers with DBSettings with AutoRollback {
}
| yamitzky/nonplay-play | test/models/TagsSpec.scala | Scala | cc0-1.0 | 283 |
package clasp.core.remoting
import java.text.SimpleDateFormat
import java.util.Date
import java.util.TimeZone
import java.util.UUID
import org.hyperic.sigar.CpuPerc
import org.slf4j.LoggerFactory
import akka.actor.ActorRef
import clasp.core.EmulatorActor.EmulatorDescription
import clasp.core.EmulatorManager.Structured... | hamiltont/clasp | src/clasp/core/remoting/json_encoding.scala | Scala | mit | 7,275 |
/*
* Copyright 2013-2015 Websudos, Limited.
*
* 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 c... | levinson/phantom | phantom-thrift/src/test/scala/com/websudos/phantom/thrift/suites/ThriftMapColumnTest.scala | Scala | bsd-2-clause | 5,970 |
/*
* Copyright (C) 2016 Christopher Batey and Dogan Narinc
*
* 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... | mikefero/cpp-driver | gtests/src/integration/scassandra/server/server/src/test/scala/org/scassandra/server/e2e/CurrentTest.scala | Scala | apache-2.0 | 2,696 |
/*
* 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 ... | ueshin/apache-spark | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/PullOutNondeterministic.scala | Scala | apache-2.0 | 3,232 |
package spinoco.protocol.kafka.codec
import java.util.Date
import scodec.{Attempt, Codec, Err}
import scodec.codecs._
import shapeless.{::, HNil}
import shapeless.tag.@@
import spinoco.protocol.kafka.{PartitionId, ProtocolVersion, TopicName}
import spinoco.protocol.kafka.Request.OffsetsRequest
import spinoco.protocol... | Spinoco/protocol | kafka/src/main/scala/spinoco/protocol/kafka/codec/OffsetCodec.scala | Scala | mit | 3,493 |
package io.getquill.postgres
import io.getquill.context.ZioJdbc._
import io.getquill.{ Prefix, ZioSpec }
import zio.{ Task, ZIO, ZLayer }
import javax.sql.DataSource
class ZioJdbcUnderlyingContextSpec extends ZioSpec {
override def prefix: Prefix = Prefix("testPostgresDB")
val context = testContext.underlying
... | getquill/quill | quill-jdbc-zio/src/test/scala/io/getquill/postgres/ZioJdbcUnderlyingContextSpec.scala | Scala | apache-2.0 | 3,134 |
package com.mentatlabs.nsa
package scalac
package options
/* -Yno-adapted-args
* =================
* 2.10.0 - 2.12.0: Do not adapt an argument list (either by inserting () or creating a tuple) to match the receiver.
*/
case object ScalacYNoAdaptedArgs
extends ScalacOptionBoolean("-Yno-adapted-args", ScalacVer... | mentat-labs/sbt-nsa | nsa-core/src/main/scala/com/mentatlabs/nsa/scalac/options/private/ScalacYNoAdaptedArgs.scala | Scala | bsd-3-clause | 336 |
package org.sisioh.aws4s.eb.model
import com.amazonaws.services.elasticbeanstalk.model.S3Location
import org.sisioh.aws4s.PimpedType
object S3LocationFactory {
def create(): S3Location = new S3Location()
}
class RichS3Location(val underlying: S3Location)
extends AnyVal with PimpedType[S3Location] {
def s3... | everpeace/aws4s | aws4s-eb/src/main/scala/org/sisioh/aws4s/eb/model/RichS3Location.scala | Scala | mit | 832 |
package sampler.cluster.abc.actor
import org.scalatest.FreeSpec
import org.scalatest.Matchers
import sampler.cluster.abc.Scored
import sampler.cluster.abc.Weighted
class MessagesTest extends FreeSpec with Matchers {
"ScoredParticles classes should" - {
val p1 = Tagged(Scored(1, Seq(0.5)), 111111)
val p2 = Tagged... | tsaratoon/Sampler | sampler-cluster/src/test/scala/sampler/cluster/abc/actor/MessagesTest.scala | Scala | apache-2.0 | 3,465 |
/*
* 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... | liquidarmour/ct-calculations | src/main/scala/uk/gov/hmrc/ct/accounts/frs102/boxes/loansToDirectors/AC309A.scala | Scala | apache-2.0 | 1,167 |
package com.etsy.scalding.jobs.conjecture
import com.twitter.scalding.{Args, Job, Mode, SequenceFile, Tsv}
import com.etsy.conjecture.scalding.evaluate.BinaryEvaluator
import com.etsy.conjecture.data.{BinaryLabeledInstance, BinaryLabel}
import com.etsy.conjecture.model.UpdateableLinearModel
import com.google.gson.Gso... | zviri/Conjecture | src/main/scala/com/etsy/scalding/jobs/conjecture/AdHocPredictor.scala | Scala | mit | 1,951 |
/*
* 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 | scalactic/src/main/scala/org/scalactic/PrettyMethods.scala | Scala | apache-2.0 | 1,728 |
package decoupledwithfactory
object HelloWorldDecoupledWithFactory extends App {
val mr: MessageRenderer = MessageSupportFactory.getInstance.getMessageRenderer
val mp: MessageProvider = MessageSupportFactory.getInstance.getMessageProvider
mr.setMessageProvider(mp)
mr.render
}
| BBK-PiJ-2015-67/sdp-portfolio | exercises/week02/di-scala/src/decoupledwithfactory/HelloWorldDecoupledWithFactory.scala | Scala | unlicense | 286 |
package com.twitter.finagle.util
import org.scalactic.Tolerance
import org.scalatest.funsuite.AnyFunSuite
class EmaTest extends AnyFunSuite {
import Tolerance._
test("updates are time invariant") {
val a, b = new Ema(1000)
assert(a.update(10, 10) == 10)
assert(a.update(20, 10) == 10)
assert(a.upd... | twitter/finagle | finagle-core/src/test/scala/com/twitter/finagle/util/EmaTest.scala | Scala | apache-2.0 | 955 |
package com.twitter.scrooge.backend
import com.twitter.scrooge._
import com.twitter.scrooge.testutil.EvalHelper
import com.twitter.scrooge.testutil.JMockSpec
import org.apache.thrift.protocol.TProtocol
import scala.reflect.ClassTag
import scala.reflect.ManifestFactory
import scala.reflect.classTag
class CodecRetrieva... | twitter/scrooge | scrooge-generator-tests/src/test/scala/com/twitter/scrooge/backend/CodecRetrievalSpec.scala | Scala | apache-2.0 | 3,900 |
package HackerRank
import java.io.{ByteArrayInputStream, IOException, InputStream, PrintWriter}
import java.util.InputMismatchException
import scala.collection.generic.CanBuildFrom
import scala.language.higherKinds
/**
* Copyright (c) 2017 A. Roberto Fischer
*
* @author A. Roberto Fischer <a.robertofischer@gma... | robertoFischer/hackerrank | src/main/scala/HackerRank/TEMPLATE.scala | Scala | mit | 8,359 |
/*
* 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 ... | mohammadshahidkhan/incubator-carbondata | integration/spark-common/src/main/scala/org/apache/carbondata/spark/util/GlobalDictionaryUtil.scala | Scala | apache-2.0 | 31,283 |
package models
/** message data model.
* Created by calvin-pc on 7/6/2015.
*/
package object message {
}
| calvinsadewa/backend | app/models/message/package.scala | Scala | apache-2.0 | 109 |
package org.shapelogic.sc.script
import org.shapelogic.sc.io.LoadImage
import org.shapelogic.sc.io.BufferedImageConverter
import org.shapelogic.sc.util.Args
import org.shapelogic.sc.operation.ThresholdOperation
import org.shapelogic.sc.numeric.NumberPromotion
import org.shapelogic.sc.numeric.PrimitiveNumberPromoters
i... | sami-badawi/shapelogic-scala | src/main/scala/org/shapelogic/sc/script/Threshold.scala | Scala | mit | 2,612 |
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* *
* Copyright © 2012 Christian Krause *
* ... | wookietreiber/ckit | core/main/scala/StateCategory.scala | Scala | gpl-3.0 | 3,372 |
package org.jetbrains.plugins.scala.failed.typeInference
import org.jetbrains.plugins.scala.base.ScalaLightCodeInsightFixtureTestAdapter
/**
* Created by Anton Yalyshev on 06/02/17.
*/
class TupleTypeInfererenceTest extends ScalaLightCodeInsightFixtureTestAdapter {
override protected def shouldPass: Boolean = ... | JetBrains/intellij-scala | scala/scala-impl/test/org/jetbrains/plugins/scala/failed/typeInference/TupleTypeInfererenceTest.scala | Scala | apache-2.0 | 548 |
package upickle
import acyclic.file
import scala.annotation.switch
import scala.collection.mutable.StringBuilder
/**
* Exceptions that can be thrown by upickle; placed in the same file
* as JSON parser due to circular dependencies between exception types
* and JSON types
*/
sealed trait Invalid extends Exception
objec... | Voltir/upickle | upickle/shared/src/main/scala/upickle/Js.scala | Scala | mit | 3,199 |
/*
* Copyright 2001-2013 Artima, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agre... | travisbrown/scalatest | src/test/scala/org/scalatest/FreeSpecSpec.scala | Scala | apache-2.0 | 55,011 |
package ca.yvrsfo.tripshistory
import scala.io.Source
import scala.util.parsing.json.{JSON, JSONArray, JSONObject}
/** A [[City]] has a geographical location on a map in latitude/longitude along
* with a name.
*/
abstract class City(val name: String) {
override def equals(other: Any) = {
other.isInsta... | brettcannon/trips-history | src/main/scala/trips_history.scala | Scala | mit | 8,850 |
/*
* 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 ... | bravo-zhang/spark | core/src/main/scala/org/apache/spark/scheduler/Stage.scala | Scala | apache-2.0 | 5,292 |
package com.twitter.finagle.httpx.compat
import com.twitter.finagle.httpx.netty.Bijections
import com.twitter.finagle.httpx.{Fields, Request, Response, Method, Status, Version}
import com.twitter.finagle.netty3.BufChannelBuffer
import com.twitter.io.{Buf, BufReader, Reader}
import com.twitter.util.Await
import java.ne... | jpederzolli/finagle | finagle-httpx-compat/src/test/scala/com/twitter/finagle/httpx/compat/AdaptorsTest.scala | Scala | apache-2.0 | 5,643 |
package lila.forumSearch
import lila.forum.actorApi._
import lila.forum.{ Post, PostView, PostLiteView, PostApi }
import lila.search._
import play.api.libs.json._
final class ForumSearchApi(
client: ESClient,
postApi: PostApi) extends SearchReadApi[PostView, Query] {
def search(query: Query, from: From, s... | JimmyMow/lila | modules/forumSearch/src/main/ForumSearchApi.scala | Scala | mit | 1,469 |
package com.lvxingpai.model.geo
import javax.validation.constraints.Pattern
import com.lvxingpai.model.mixin.ObjectIdEnabled
import org.bson.types.ObjectId
import org.hibernate.validator.constraints.NotBlank
import org.mongodb.morphia.annotations.{ Embedded, Entity, Id }
import scala.beans.BeanProperty
/**
* 洲
* C... | Lvxingpai/core-model | src/main/scala/com/lvxingpai/model/geo/Continent.scala | Scala | apache-2.0 | 688 |
/***********************************************************************
* Copyright (c) 2013-2018 Commonwealth Computer Research, Inc.
* Portions Crown Copyright (c) 2017-2018 Dstl
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Apache License, Version... | jahhulbert-ccri/geomesa | geomesa-accumulo/geomesa-accumulo-tools/src/main/scala/org/locationtech/geomesa/accumulo/tools/AccumuloRunner.scala | Scala | apache-2.0 | 7,419 |
package knittings
import models.units._
import org.specs2.mutable.Specification
class SimplePulloverSpec extends Specification {
"rowsToDecrease" should {
"when decrease 2 over 30 do it at 10 and 20" in {
val decs = SimplePullover.rowsWithDecreases(30.rows, 2.stitches)
decs.size must_== 30
de... | knittery/knittery-ui | test/knittings/SimplePulloverSpec.scala | Scala | gpl-2.0 | 801 |
package im.tox.antox.activities
import java.io.{File, IOException}
import java.util.Date
import android.app.{Activity, AlertDialog}
import android.content.{CursorLoader, DialogInterface, Intent, SharedPreferences}
import android.database.Cursor
import android.net.Uri
import android.os.{Build, Bundle, Environment}
imp... | 0xPoly/Antox | app/src/main/scala/im/tox/antox/activities/ChatActivity.scala | Scala | gpl-3.0 | 13,101 |
import scala.math.max
import scala.math.{Numeric => OldNumeric, Integral, Fractional, min, max}
import scala.util.Random
import scala.testing.Benchmark
import java.io.{FileWriter, PrintWriter}
import Console.printf
import com.azavea.math.Numeric
import com.azavea.math.EasyImplicits._
//import com.azavea.math.FastImp... | azavea/numeric | perf/src/main/scala/Main.scala | Scala | mit | 39,027 |
package edu.gemini.spModel.io.impl.migration
import edu.gemini.spModel.pio.{Param, ParamSet, Container}
import edu.gemini.pot.sp.SPComponentType
import scala.collection.JavaConverters._
import edu.gemini.spModel.io.impl.SpIOTags
import edu.gemini.spModel.data.ISPDataObject
/**
* Utilities for working with the Pio s... | arturog8m/ocs | bundle/edu.gemini.spModel.io/src/main/scala/edu/gemini/spModel/io/impl/migration/Util.scala | Scala | bsd-3-clause | 1,958 |
package com.nice.zoocache
import org.scalatest.{BeforeAndAfterAll, FunSpec}
import com.netflix.curator.test.TestingServer
import akka.testkit.{TestKit, TestActorRef, TestActor}
import com.netflix.curator.framework.{CuratorFramework, CuratorFrameworkFactory}
import com.netflix.curator.retry.ExponentialBackoffRetry
impo... | NiceSystems/zcache | src/test/scala/com/nice/zoocache/ScavengerSpec.scala | Scala | apache-2.0 | 5,692 |
package models
import play.api.Play.current
import play.api.db.slick.Config.driver.simple._
import play.api.db.slick.DB
class Fortunes extends Table[Fortune]("Fortune") {
def id = column[Long]("id", O.PrimaryKey)
def message = column[String]("message")
def * = id ~ message <> (Fortune.apply _, Fortune.unapply ... | Ocramius/FrameworkBenchmarks | play-slick/app/models/Fortune.scala | Scala | bsd-3-clause | 502 |
/*
* Copyright 2016-2020 Daniel Urban and contributors listed in 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... | durban/seals | circe/src/main/scala/dev/tauri/seals/circe/Wires.scala | Scala | apache-2.0 | 1,174 |
/*
* The MIT License (MIT)
*
* Copyright (c) 2014 Heiko Blobner
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use... | windelknecht/stup-utils | src/test/scala/de/windelknecht/stup/utils/io/pack/archive/UnArchiverSpec.scala | Scala | mit | 2,230 |
package ru.maizy.dislk.app
import java.nio.file.{ Path, Paths }
import scala.io.Source
import pushka.annotation._
import pushka.json._
import pushka.PushkaException
/**
* Copyright (c) Nikita Kovaliov, maizy.ru, 2017
* See LICENSE.txt for details.
*/
@pushka
case class AutosetStatus(
@key("text") text: String... | maizy/dislk | dislk-app/src/main/scala/ru/maizy/dislk/app/AppParams.scala | Scala | apache-2.0 | 1,578 |
/*
* 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/yarn/src/main/scala/org/apache/spark/deploy/yarn/config.scala | Scala | apache-2.0 | 15,503 |
package pl.touk.nussknacker.ui.util
import akka.actor.ActorSystem
import com.typesafe.config.ConfigValueFactory._
import com.typesafe.config.{Config, ConfigFactory}
import org.apache.commons.io.FileUtils
import pl.touk.nussknacker.engine.api.deployment.{DeployedScenarioData, ProcessingTypeDeploymentService}
import pl.... | TouK/nussknacker | ui/server/src/main/scala/pl/touk/nussknacker/ui/util/LocalNussknackerWithSingleModel.scala | Scala | apache-2.0 | 3,510 |
package wandou.math.fastmath
/**
* Utility class for loading tabulated data used by {@link FastMath}.
*
* Ported by Caoyuan Deng from Java version at org.apache.commons.math3.util
*/
protected object FastMathLiteralArrays {
/**
* Exponential evaluated at integer values,
* exp(x) = expIntTableA[x + EXP_INT... | wandoulabs/wandou-math | wandou-math/src/main/scala/wandou/math/fastmath/FastMathLiteralArrays.scala | Scala | apache-2.0 | 230,694 |
package models.game.mask
import controllers.game.GamesRequestorController
import models.game.Game
import models.support.{QuestionId, GameId, QuizId, UserId}
import models.user.{Users, User}
import play.api.db.slick.Config.driver.simple.Session
object GameMask {
val numberOfQuestions = 3
}
trait GameSetup {
val g... | kristiankime/web-education-games | app/models/game/mask/GameMask.scala | Scala | mit | 12,736 |
package com.twitter.lsh.stores
import com.twitter.lsh.hashing.CosineHashFamily
import com.twitter.lsh.vector.LshVector
import com.twitter.util.Await
import org.scalatest.{Matchers, WordSpec}
class HashTableStoreTest extends WordSpec with Matchers {
"Hash Table Store" should {
val vector = LshVector(Array(1.0))
... | richwhitjr/DistributedLSH | src/test/scala/com/twitter/lsh/stores/HashTableStoreTest.scala | Scala | apache-2.0 | 834 |
/*
* Copyright 2015 Data Artisans GmbH
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or ag... | StephanEwen/flink-demos | streaming-state-machine/src/main/scala/com/dataartisans/flink/example/eventpattern/EventsGeneratorSource.scala | Scala | apache-2.0 | 2,347 |
package com.mentatlabs.nsa
package scalac
package options
/* -Xdisable-assertions
* ====================
* 2.6.0 - 2.8.2: Generate no assertions and assumptions
* 2.9.0 - 2.12.0: Generate no assertions or assumptions.
*/
case object ScalacXDisableAssertions
extends ScalacOptionBoolean("-Xdisable-asserti... | mentat-labs/sbt-nsa | nsa-core/src/main/scala/com/mentatlabs/nsa/scalac/options/advanced/ScalacXDisableAssertions.scala | Scala | bsd-3-clause | 350 |
package models
import play.api.libs.json.Json
import play.api.libs.functional.syntax.functionalCanBuildApplicative
import play.api.libs.functional.syntax.toFunctionalBuilderOps
import reactivemongo.bson.BSONDocument
import reactivemongo.bson.BSONDocumentReader
import reactivemongo.bson.BSONDocumentWriter
import reacti... | yurkom/garage48 | app/models/Event.scala | Scala | gpl-3.0 | 1,751 |
/*******************************************************************************
* Copyright (c) 2014 Łukasz Szpakowski.
*
* 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/MP... | luckboy/Purfuncor | src/main/scala/pl/luckboy/purfuncor/frontend/SelectConstructInstance.scala | Scala | mpl-2.0 | 909 |
package org.scalaide.ui.internal.reconciliation
import org.eclipse.core.runtime.IProgressMonitor
import org.eclipse.core.runtime.NullProgressMonitor
import org.scalaide.logging.HasLogger
import org.eclipse.jface.text._
import org.eclipse.jface.text.reconciler.IReconcilingStrategy
import org.eclipse.jface.text.reconcil... | Kwestor/scala-ide | org.scala-ide.sdt.core/src/org/scalaide/ui/internal/reconciliation/ScalaReconcilingStrategy.scala | Scala | bsd-3-clause | 2,734 |
package net.liftmodules
import net.liftweb._
import util.Props
import http._
import common._
import org.specs2._
class FoBoAJSSpec extends mutable.Specification {
"FoBoAJSToolkitSpec Specification".title
sequential
//OBS! using 'test-only' instead of 'test' will fail some test as 'test-only'
//is treated as ... | karma4u101/FoBo | Angular/AngularJS/src/test/scala/net/liftmodules/fobotb/FoBoAJSSpec.scala | Scala | apache-2.0 | 24,414 |
package bot
import java.util.Scanner
import collection.immutable.IndexedSeq
import main.Region
import move.PlaceArmiesMove
import move.AttackTransferMove
class BotParser(bot: Bot) {
val scan = new Scanner(System.in)
var currentState: BotState = new BotState
def run() {
while (scan.hasNextLine) {
... | ramn/warlight-starterbot-scala | src/main/scala/bot/BotParser.scala | Scala | apache-2.0 | 1,759 |
/*
* UndirectedBrowserTransmitterImpl.scala
* (ScalaOSC)
*
* Copyright (c) 2008-2021 Hanns Holger Rutz. All rights reserved.
*
* This software is published under the GNU Lesser General Public License v2.1+
*
*
* For further information, please contact Hanns Holger Rutz at
* contact@sciss.de
*/
package de.sc... | Sciss/ScalaOSC | js/src/main/scala/de/sciss/osc/impl/UndirectedBrowserTransmitterImpl.scala | Scala | lgpl-2.1 | 1,061 |
package com.nthportal.euler
package h0.t4
import com.nthportal.euler.maths.streams
import scala.annotation.tailrec
object Problem45 extends ProjectEulerProblem {
override def apply(): Long = {
val triangles = dropSmall(streams.triangleNumbers())
val pentagonals = dropSmall(streams.pentagonalNumbers())
... | NthPortal/euler-n-scala | src/main/scala/com/nthportal/euler/h0/t4/Problem45.scala | Scala | mit | 864 |
/**
* Angles
* Copyright (C) 2015 Jakob Hendeß, Niklas Wolber
*
* 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.
... | nwolber/angles | src/main/scala/io/ssc/angles/pipeline/explorers/HelperUtils.scala | Scala | gpl-3.0 | 1,794 |
package ir.xamin.packet
import scala.xml._
import org.jivesoftware.smackx.pubsub.Item
/** this class will be used to provide inner xml of pubsub item
* that will be published
*/
case class ApplianceItem(version:String) extends Item()
{
/** creates the inner xml of item
*/
override def toXML = <item>
<a... | XaminProject/peace | src/main/scala/ir/xamin/packet/ApplianceItem.scala | Scala | mit | 467 |
package dotty.tools.dotc
package typer
import transform._
import core._
import config._
import Symbols._, SymDenotations._, Types._, Contexts._, Decorators._, Flags._, Names._, NameOps._
import StdNames._, Denotations._, Scopes._, Constants.Constant, SymUtils._
import Annotations._
import util.Positions._
import scala... | VladimirNik/dotty | src/dotty/tools/dotc/typer/RefChecks.scala | Scala | bsd-3-clause | 67,571 |
/* *\\
** \\ \\ / _) \\ \\ / \\ | **
** \\ \\ / | __ \\ _ \\ __| \\ \\ / |\\/ | **
** \\ \\ / | | | __/ | \\ \\ / | | **
** \\_/ _| .__/ \\___| _| \\_/ _| _| **
** _| ... | hsyl20/Scala_ViperVM | src/main/scala/org/vipervm/bindings/starpu/Wrapper.scala | Scala | gpl-3.0 | 3,127 |
/*
* 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/gmp-frontend | app/controllers/EqualiseController.scala | Scala | apache-2.0 | 2,766 |
package com.robocubs4205.util
import java.time.{LocalDate, Year}
import com.netaporter.uri.Uri
import play.api.libs.json._
import scala.collection.Seq
import scala.concurrent.{ExecutionContext, Future}
import scala.util.{Failure, Success, Try}
import scala.language.implicitConversions
trait Util {
implicit val l... | robocubs4205/cubscout-server | common/src/main/scala/com/robocubs4205/util/Util.scala | Scala | mit | 1,975 |
/*
* Copyright 2016 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/main/scala/scalismo/mesh/MeshSurfaceCorrespondence.scala | Scala | apache-2.0 | 1,660 |
/*
Copyright 2012 Twitter, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distr... | twitter/chill | chill-scala/src/main/scala/com/twitter/chill/EitherSerializer.scala | Scala | apache-2.0 | 1,199 |
package filodb.jmh
import filodb.spark.FiloDriver
import org.apache.spark.sql.{DataFrame, SaveMode, SQLContext}
import org.apache.spark.{SparkContext, SparkException, SparkConf}
/**
* Creates Cassandra test data for the SparkReadBenchmark. Note that only 1 partition
* is created for the test data, so that forces r... | markhamstra/FiloDB | jmh/src/main/scala/filodb.jmh/CreateCassTestData.scala | Scala | apache-2.0 | 1,628 |
package org.bitcoins.core.script.crypto
import org.scalatest.{MustMatchers, FlatSpec}
/**
* Created by chris on 1/8/16.
*/
class CryptoOperationsFactoryTest extends FlatSpec with MustMatchers {
"CryptoOperationsFactory" must "match strings with crypto operations" in {
CryptoOperation.fromString("OP_CHECKSIG"... | SuredBits/bitcoin-s-sidechains | src/test/scala/org/bitcoins/core/script/crypto/CryptoOperationsFactoryTest.scala | Scala | mit | 554 |
import java.io._
import scala.collection.mutable.ListBuffer
val results_dir = "/big/livejournal/full_results/user_studies/";
val text_dir = "/big/livejournal/full_results_text/user_studies/"
val top = 1000;
var svecs = Array(
Array("neighbor"),
Array("neighbor in my building"),
Array("next door neighbor"),
A... | BIDS-collaborative/destress | word2vec/inspect_query_full.scala | Scala | isc | 2,791 |
package com.twitter.finagle.codec
import com.twitter.io.Buf
import scala.reflect.ClassTag
/**
* A stateful fixed-length frame decoder.
*
* @param frameSize number of bytes in a `T` frame.
* @param decodeFrame function which decodes a [[com.twitter.io.Buf]] of
* `frameSize` bytes into a `T` val... | sveinnfannar/finagle | finagle-core/src/main/scala/com/twitter/finagle/codec/FixedLengthDecoder.scala | Scala | apache-2.0 | 1,649 |
/*
* NOTICE: The original file was changed by Philip Stutz and Sara Magliacane.
*
* This file is part of the PSL software.
* Copyright 2011-2013 University of Maryland
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You ma... | uzh/fox | src/test/scala/com/signalcollect/psl/LinearConstraintSpec.scala | Scala | apache-2.0 | 2,585 |
//======================================================================================================================
// Facsimile: A Discrete-Event Simulation Library
// Copyright © 2004-2020, Michael J Allen.
//
// This file is part of Facsimile.
//
// Facsimile is free software: you can redistribute it and/or mod... | MichaelJAllen/facsimile | facsimile-sfx/src/main/scala/org/facsim/sfx/application/JFXInitialization.scala | Scala | lgpl-3.0 | 3,793 |
/****************************************************************************
* Copyright (C) 2015 Łukasz Szpakowski. *
* *
* This software is licensed under the GNU General Public License *
* v3 ... | luckboy/IssueNotifier | src/main/scala/pl/luckboy/issuenotifier/HttpUtils.scala | Scala | gpl-3.0 | 2,972 |
/*
* 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 ... | hengyicai/OnlineAggregationUCAS | extras/kinesis-asl/src/main/scala/org/apache/spark/streaming/kinesis/KinesisCheckpointState.scala | Scala | apache-2.0 | 2,024 |
// Copyright 2014 Commonwealth Bank of Australia
//
// 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... | CommBank/maestro | maestro-core/src/test/scala/au/com/cba/omnia/maestro/core/test/Arbitraries.scala | Scala | apache-2.0 | 1,848 |
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.