code
stringlengths
5
1M
repo_name
stringlengths
5
109
path
stringlengths
6
208
language
stringclasses
1 value
license
stringclasses
15 values
size
int64
5
1M
package com.rainysoft.bayesian.inference import com.rainysoft.bayesian.network.{NetworkNode, Network} /** Implements enumeration ask algorithm. * * Implements enumeration ask algorithm from "Artificial Intelligence: A Modern Approach" * by Russel, Stuart and Norvig, Peter. * * @author mikael.ohman * ...
MikaelUmaN/BayesianNetwork
src/main/scala/com/rainysoft/bayesian/inference/Enumerate.scala
Scala
mit
2,523
/* * Scala (https://www.scala-lang.org) * * Copyright EPFL and Lightbend, Inc. * * Licensed under Apache License 2.0 * (http://www.apache.org/licenses/LICENSE-2.0). * * See the NOTICE file distributed with this work for * additional information regarding copyright ownership. */ package scala.tools.nsc packag...
scala/scala
src/compiler/scala/tools/nsc/ast/DocComments.scala
Scala
apache-2.0
23,411
package com.yetu.oauth2provider.signature.models case class SignatureSyntaxException(msg: String) extends Exception case class SignatureException(msg: String) extends Exception
yetu/oauth2-provider
app/com/yetu/oauth2provider/signature/models/Exceptions.scala
Scala
mit
178
package org.catapult.sa.fulgurite.geotiff import javax.imageio.metadata.IIOMetadata import com.github.jaiimageio.impl.plugins.tiff.{TIFFIFD, TIFFImageMetadata} import com.github.jaiimageio.plugins.tiff.{BaselineTIFFTagSet, GeoTIFFTagSet, TIFFField, TIFFTag} import collection.JavaConversions._ /** * Help...
SatelliteApplicationsCatapult/fulgurite
fulgurite-core/src/main/scala/org/catapult/sa/fulgurite/geotiff/GeoTiffMetaHelper.scala
Scala
lgpl-3.0
7,054
package spire.laws.shadows import cats.kernel.Comparison import spire.algebra.Order trait ShadowOrder[A, S] extends ShadowPartialOrder[A, S] with Order[Shadow[A, S]] { implicit def A: Order[A] implicit def S: Order[S] override def eqv(x: Shadow[A, S], y: Shadow[A, S]): Boolean = super[ShadowPartialOrder].eqv(x...
non/spire
laws/src/main/scala/spire/laws/shadows/ShadowOrder.scala
Scala
mit
1,775
/** * Copyright 2011-2016 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...
GabrielPlassard/gatling
gatling-commons/src/main/scala/io/gatling/commons/validation/package.scala
Scala
apache-2.0
1,447
/* * 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/amls-frontend
test/utils/FeeHelperSpec.scala
Scala
apache-2.0
3,473
/* * Copyright (c) 2017. Yuriy Stul */ package com.stulsoft.scala.math.assessment.integration import com.stulsoft.scala.math.integration.{Integration,IntegrationMethod} /** * Assessments for interpolation methods * * @author Yuriy Stul */ private object IntegrationAssessment extends App { private def sin...
ysden123/ys-scala-math
src/test/scala/com/stulsoft/scala/math/assessment/integration/IntegrationAssessment.scala
Scala
mit
1,334
package actors import java.net.URI import akka.actor.{Actor, ActorLogging, AddressFromURIString} import akka.cluster.Cluster import akka.cluster.ClusterEvent._ import akka.cluster.pubsub.{DistributedPubSub, DistributedPubSubMediator} import mousio.etcd4j.EtcdClient import mousio.etcd4j.responses.EtcdException import ...
JetChat/JetChat
app/actors/ClusterListener.scala
Scala
apache-2.0
4,633
/* This file is part of Intake24. Copyright 2015, 2016 Newcastle University. 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 appl...
digitalinteraction/intake24
FoodDataXML/src/main/scala/uk/ac/ncl/openlab/intake24/foodxml/scripts/ParseNewPhotosGuide.scala
Scala
apache-2.0
3,026
package endpoints.akkahttp.server import akka.http.scaladsl.model.{HttpResponse, StatusCodes} import akka.http.scaladsl.server.Directives import endpoints.algebra trait OptionalResponses extends algebra.OptionalResponses with Endpoints { /** * A response encoder that maps `None` to an empty HTTP result with st...
Krever/endpoints
akka-http/server/src/main/scala/endpoints/akkahttp/server/OptionalResponses.scala
Scala
mit
512
package dawn.flow.trajectory import dawn.flow._ import io.circe.generic.JsonCodec import breeze.linalg.{max => _, min => _, _ => _} import spire.math.{Real => _, _ => _} import spire.implicits._ case class TrajInit(a: Acceleration, v: Velocity, p: Position, q: Quat) trait Trajectory extends Model { def tf: Timefr...
rubenfiszel/scala-flow
core/src/main/scala/trajectory/Trajectory.scala
Scala
mit
3,462
/* * 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 ...
akrabat/openwhisk
common/scala/src/main/scala/org/apache/openwhisk/core/entity/InstanceId.scala
Scala
apache-2.0
6,523
/* * 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 ...
yew1eb/flink
flink-libraries/flink-table/src/test/scala/org/apache/flink/table/factories/utils/TestTableFormatFactory.scala
Scala
apache-2.0
2,995
/* * 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 ...
jinglining/flink
flink-table/flink-table-planner/src/test/scala/org/apache/flink/table/api/batch/sql/GroupingSetsTest.scala
Scala
apache-2.0
6,628
/* * 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 ...
GJL/flink
flink-table/flink-table-planner-blink/src/test/scala/org/apache/flink/table/planner/plan/batch/table/GroupWindowTest.scala
Scala
apache-2.0
5,152
//https://www.hackerrank.com/contests/lambda-calculi-apr14/challenges/jumping-bunnies import java.io._; import scala.collection.mutable._; object Solution { def main(args: Array[String]) { //Input var N: Byte = readLine().toByte; var J: Array[Int] = new Array[Int](N); var...
hongyegong/hackerrank
contests/lambda-calculi-apr14/jumping-bunnies.scala
Scala
mit
2,455
package core import com.datastax.driver.core.{ProtocolVersion, Row} import util.ReflectionUtil import scala.reflect.runtime.universe._ /** * @author instcode */ class Mapper[T: TypeTag] { val columnNames = ReflectionUtil.constructorParams[T].map(_._1) def map(r: Row)(implicit protocolVersion: ProtocolVersion...
instcode/cassandra-mapper
src/main/scala/core/Mapper.scala
Scala
apache-2.0
703
/* * 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 ...
manuzhang/incubator-gearpump
experiments/akkastream/src/main/scala/org/apache/gearpump/akkastream/task/DropWithinTask.scala
Scala
apache-2.0
1,863
package com.karasiq.shadowcloud.config import com.typesafe.config.Config case class BuffersConfig(rootConfig: Config, readChunks: Long, repair: Long) extends WrappedConfig object BuffersConfig extends WrappedConfigFactory[BuffersConfig] { override def apply(config: Config): BuffersConfig = { BuffersConfig( ...
Karasiq/shadowcloud
core/src/main/scala/com/karasiq/shadowcloud/config/BuffersConfig.scala
Scala
apache-2.0
439
package com.peterpotts.common.util import scala.concurrent.{ExecutionContext, Future} object FutureDecorator { implicit class DecoratedFutureOption[T](futureOption: Future[Option[T]]) { def mapGetOrThrow(exception: => Exception)(implicit executionContext: ExecutionContext): Future[T] = futureOption.map(_...
peterpotts/mobius
src/main/scala/com/peterpotts/common/util/FutureDecorator.scala
Scala
mit
356
package com.datastax.spark.connector.rdd.partitioner import java.net.InetAddress import com.datastax.spark.connector.ColumnSelector import com.datastax.spark.connector.cql.{CassandraConnector, Schema} import com.datastax.spark.connector.writer.RowWriterFactory import org.apache.spark.{Partition, Partitioner} import ...
ponkin/spark-cassandra-connector
spark-cassandra-connector/src/main/scala/com/datastax/spark/connector/rdd/partitioner/ReplicaPartitioner.scala
Scala
apache-2.0
3,949
package scala.collection import scala.language.higherKinds /** * Trait that overrides operations on sequences in order * to take advantage of strict builders. */ trait StrictOptimizedSeqOps [+A, +CC[_], +C] extends Any with SeqOps[A, CC, C] with StrictOptimizedIterableOps[A, CC, C] { override def d...
rorygraves/perf_tester
corpus/scala-library/src/main/scala/collection/StrictOptimizedSeqOps.scala
Scala
apache-2.0
1,592
package root /** * Created by adixith on 5/20/15. */ object ActionReturnValues { val serverError:Integer = -1 val oneBitcoinSold:Integer = 1 val bitcoinBought:Integer = 2 val takingNoAction:Integer = 3 val multipleBitcoinsSold:Integer = 4 }
anoopdixith/SmartBCT
src/main/scala/ActionReturnValues.scala
Scala
mit
263
package com.twitter.finagle.loadbalancer /** * The behavior the load balancer should take when none * of its nodes have a [[com.twitter.finagle.Status]] of * [[com.twitter.finagle.Status.Open Open]]. * * The default behavior is [[WhenNoNodesOpen.PickOne]] * and can be customized on a client through [[LoadBalance...
luciferous/finagle
finagle-core/src/main/scala/com/twitter/finagle/loadbalancer/WhenNoNodesOpen.scala
Scala
apache-2.0
1,512
package au.com.dius.pact.consumer import java.io.{File, PrintWriter} import au.com.dius.pact.model.Pact import au.com.dius.pact.model.Pact.{MergeConflict, MergeSuccess} import au.com.dius.pact.com.typesafe.scalalogging.StrictLogging /** * Globally accumulates Pacts, merges by destination file, and allows writing to...
sangohan/pact-jvm
pact-jvm-consumer/src/main/scala/au/com/dius/pact/consumer/PactGenerator.scala
Scala
apache-2.0
2,719
/*********************************************************************** * 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-common/src/main/scala/org/locationtech/geomesa/convert2/transforms/TransformerFunctionFactory.scala
Scala
apache-2.0
598
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not u...
SnappyDataInc/spark
sql/core/src/main/scala/org/apache/spark/sql/DataFrameReader.scala
Scala
apache-2.0
22,846
package org.improving.scalify import Scalify._ import org.eclipse.jdt.core._ import org.eclipse.jdt.core.dom // import scalaz.OptionW._ import org.eclipse.jdt.core.dom.Modifier.ModifierKeyword._ import scala.collection.mutable.HashMap // Programming in Scala p129: // // In Scala, every auxiliary constructor must invo...
mbana/scalify
src/main/ast/STD.scala
Scala
isc
7,526
package web import java.util.concurrent.TimeUnit import akka.actor.{Actor, ActorLogging, ActorRef, ActorSystem, Props} import akka.stream.Materializer import akka.util.Timeout import dataset.DatasetActor.Active import dataset.DsInfo import play.api.libs.json.Json import play.api.libs.streams.ActorFlow import play.api...
delving/narthex
app/web/WebSocketController.scala
Scala
apache-2.0
1,204
package com.karasiq.shadowcloud.index.utils import com.karasiq.shadowcloud.model.File import com.karasiq.shadowcloud.utils.MergeUtil.SplitDecider final case class FolderDecider(files: SplitDecider[File], folders: SplitDecider[String]) object FolderDecider { val createWins = FolderDecider(SplitDecider.keepLeft, S...
Karasiq/shadowcloud
model/src/main/scala/com/karasiq/shadowcloud/index/utils/FolderDecider.scala
Scala
apache-2.0
519
/* * 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...
kevinwheeler/geomesa
geomesa-core/src/test/scala/org/locationtech/geomesa/core/index/AttributeTableTest.scala
Scala
apache-2.0
3,789
package de.leanovate.swaggercheck.generators import org.scalacheck.Prop.forAllNoShrink import org.scalacheck.Properties object GenRegexMatchSpecification extends Properties("GenRegexMatch") { property("Any match") = checkRegex(".*") property("Email like match") = checkRegex("[a-zA-Z0-9\\\\.]+@[a-z]+\\\\.[a-z]+")...
leanovate/swagger-check
json-schema-gen/src/test/scala/de/leanovate/swaggercheck/generators/GenRegexMatchSpecification.scala
Scala
mit
2,003
/*********************************************************************** * 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/main/scala/org/locationtech/geomesa/accumulo/index/legacy/JoinIndexV6.scala
Scala
apache-2.0
3,066
/* * 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...
cjwebb/play-filters
src/main/scala/uk/gov/hmrc/play/filters/DefaultToNoCacheFilter.scala
Scala
apache-2.0
1,330
/* * 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 ...
foryou2030/incubator-carbondata
integration/spark/src/main/scala/org/apache/carbondata/spark/rdd/CarbonDataRDDFactory.scala
Scala
apache-2.0
48,121
/* * Author: Manish Gupta */ package com.guptam.spark.dba.hdfsutil import com.guptam.spark.dba.common._ trait HDFSStringUtil { // fix the path string def removeLastSlash(url: String): String = { if (url.endsWith("/")) { url.substring(0, url.lastIndexOf("/")) } else { url } } // Gen...
guptam/spark-dba
src/com/guptam/spark/dba/hdfsutil/HDFSStringUtil.scala
Scala
apache-2.0
598
/* * ScalaRay - Ray tracer based on pbrt (see http://pbrt.org) written in Scala * Copyright (C) 2009, 2010, 2011 Jesper de Jong * * 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 ve...
jesperdj/scalaray
src/main/scala/org/jesperdj/scalaray/spectrum/package.scala
Scala
gpl-3.0
1,404
package spatutorial.shared import upickle.default._ sealed trait TodoPriority case object TodoLow extends TodoPriority case object TodoNormal extends TodoPriority case object TodoHigh extends TodoPriority case class TodoItem(id: String, timeStamp: Int, content: String, priority: TodoPriority, completed: Boolean) ...
drdozer/shoppinglist
web-shared/src/main/scala/spatutorial/shared/TodoItem.scala
Scala
apache-2.0
565
/** * Copyright (c) 2013, The National Archives <[email protected]> * http://www.nationalarchives.gov.uk * * 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://mozi...
digital-preservation/dali
src/test/scala/uk/gov/tna/dri/jassh/testJSON.scala
Scala
mpl-2.0
2,455
package amailp.intellij.robot.findUsage import com.intellij.usages.impl.rules.UsageType object UsageTypes { val KeywordUsage = new UsageType(() => "Keyword usage") }
AmailP/robot-plugin
src/main/scala/amailp/intellij/robot/findUsage/UsageTypes.scala
Scala
gpl-3.0
170
/* * 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 ...
tophua/spark1.52
core/src/main/scala/org/apache/spark/FutureAction.scala
Scala
apache-2.0
14,266
/* * Part of NDLA learningpath-api. * Copyright (C) 2016 NDLA * * See LICENSE * */ package no.ndla.learningpathapi.controller import java.util.UUID import javax.servlet.http.HttpServletRequest import no.ndla.learningpathapi.LearningpathApiProperties import no.ndla.learningpathapi.model.api.ImportReport import ...
NDLANO/learningpath-api
src/main/scala/no/ndla/learningpathapi/controller/InternController.scala
Scala
gpl-3.0
4,031
package controllers import javax.inject.{Inject, Singleton} import constraints.FormConstraints import controllers.NeedLogin.Authenticated import helpers.ItemInquiryMail import models.{LocaleInfoRepo, SiteItemRepo, ShoppingCartItemRepo} import play.api.db.Database import play.api.mvc.MessagesControllerComponents @Sin...
ruimo/store2
app/controllers/ItemInquiryReserve.scala
Scala
apache-2.0
745
/* * 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 * distrib...
fusepoolP3/p3-silk
silk-workbench-outdated/src/main/scala/de/fuberlin/wiwiss/silk/workbench/lift/snippet/LearnResetButton.scala
Scala
apache-2.0
1,175
package lr2 import org.apache.spark.SparkContext import org.apache.spark.SparkContext._ import org.apache.spark.rdd.RDD import classification._ import classification.OptimizerType._ import classification.RegularizerType._ import utilities.SparseMatrix import utilities.SparseVector import Optimizers._ class MEM ( ...
XianXing/bdl
src/main/scala/bdl/lr2/MEM.scala
Scala
apache-2.0
870
package io.scalac.slack.common import akka.actor.{Actor, ActorLogging} import io.scalac.slack.api.Ok import io.scalac.slack.models.{DirectChannel, Presence, SlackUser} import scala.language.{implicitConversions, postfixOps} /** * Maintainer: @marioosh */ class UsersStorage extends Actor with ActorLogging { var ...
ScalaConsultants/scala-slack-bot-core
src/main/scala/io/scalac/slack/common/UsersStorage.scala
Scala
mit
1,737
//package service // //import scala.slick.session.Database //import util.ControlUtil._ //import java.sql.DriverManager //import org.apache.commons.io.FileUtils //import scala.util.Random //import java.io.File // //trait ServiceSpecBase { // // def withTestDB[A](action: => A): A = { // util.FileUtil.withTmpDir(new F...
campolake/gitbucketV2.1
src/test/scala/service/ServiceSpecBase.scala
Scala
apache-2.0
747
/* Copyright 2016 Douglas Myers-Turnbull 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 agree...
dmyersturnbull/atom-tin
core/src/main/scala/com/github/dmyersturnbull/atomtin/core/AtomTin.scala
Scala
apache-2.0
2,806
package io.abacus.pipeline import java.util.concurrent.atomic.AtomicLong import scala.{specialized => spec} class CountingPipeline[@spec (Int) T]() extends Pipeline[T,Long,Long] { val count = new AtomicLong(0) override def results: Long = { count.get } override def process(elem: T): Long = count.increm...
socrata-platform/palamedes
src/main/scala/io/abacus/pipeline/CountingPipeline.scala
Scala
mit
335
/* * 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 ...
vinodkc/spark
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/orc/OrcOutputWriter.scala
Scala
apache-2.0
2,362
/** * Copyright (C) 2009-2014 Typesafe Inc. <http://www.typesafe.com> */ package akka.routing import scala.collection.immutable import akka.actor.ActorContext import akka.actor.Props import akka.dispatch.Dispatchers import com.typesafe.config.Config import akka.actor.SupervisorStrategy import akka.japi.Util.immutabl...
Fincore/org.spark-project.akka
actor/src/main/scala/akka/routing/ConsistentHashing.scala
Scala
mit
24,344
/* * Scala (https://www.scala-lang.org) * * Copyright EPFL and Lightbend, Inc. * * Licensed under Apache License 2.0 * (http://www.apache.org/licenses/LICENSE-2.0). * * See the NOTICE file distributed with this work for * additional information regarding copyright ownership. */ package scala package collecti...
scala/scala
src/library/scala/collection/ArrayOps.scala
Scala
apache-2.0
67,010
import stainless.lang._ object TypeParams3 { abstract class Test[A] { def something: A } case class FooBar[Foo, Bar, Baz](foo: Foo, bar: Bar, baz: Baz) extends Test[Bar] { def something: Bar = bar } def foo[Toto](toto: Toto, y: BigInt): Test[Toto] = { require(y == 0) def bar[Str](fooStr: St...
epfl-lara/stainless
frontends/benchmarks/extraction/valid/TypeParams3.scala
Scala
apache-2.0
476
/* * Copyright 2015 Databricks Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed ...
levyx/spark-sql-perf
src/main/scala/com/databricks/spark/sql/perf/tpcds/TPCDS_1_4_Queries.scala
Scala
apache-2.0
206,322
package org.http4s.client.blaze import scalaz.concurrent.Task import org.http4s._ import org.specs2.mutable.After // TODO: this should have a more comprehensive test suite class ExternalBlazeHttp1ClientSpec extends Http4sSpec { private val simpleClient = SimpleHttp1Client() "Blaze Simple Http1 Client" should ...
hvesalai/http4s
blaze-client/src/test/scala/org/http4s/client/blaze/ExternalBlazeHttp1ClientSpec.scala
Scala
apache-2.0
1,185
package keystoneml.nodes.stats import breeze.linalg._ import org.scalatest.FunSuite import org.scalatest.matchers.ShouldMatchers import keystoneml.pipelines.Logging class RandomSignNodeSuite extends FunSuite with Logging with ShouldMatchers { test("RandomSignNode") { val signs = DenseVector(1.0, -1.0, 1.0) ...
amplab/keystone
src/test/scala/keystoneml/nodes/stats/RandomSignNodeSuite.scala
Scala
apache-2.0
660
/* * Copyright 2011-2021 Asakusa Framework Team. * * 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 ...
asakusafw/asakusafw-spark
compiler/src/main/scala/com/asakusafw/spark/compiler/operator/core/ProjectionOperatorsCompiler.scala
Scala
apache-2.0
5,333
/* * Copyright 2014 Philip L. McMahon * * Philip L. McMahon licenses this file to you under the Apache License, * version 2.0 (the "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at: * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless ...
rascql/rascql
src/main/scala/rascql/postgresql/protocol/package.scala
Scala
apache-2.0
26,892
/** * Copyright (C) 2012 LShift Ltd. * * 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...
aprescott/diffa
kernel/src/main/scala/net/lshift/diffa/kernel/hooks/HookManager.scala
Scala
apache-2.0
2,065
package org.clulab.twitter4food.struct /** * Stores information about an individual tweet * User: mihais * Date: 12/14/15 */ class Tweet (val text: String, val id: Long, val lang: String, val createdAt: java.util.Date, val handle: String, val url...
clulab/twitter4food
src/main/scala/org/clulab/twitter4food/struct/Tweet.scala
Scala
apache-2.0
1,730
/* * 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 ...
tophua/spark1.52
core/src/main/scala/org/apache/spark/SparkContext.scala
Scala
apache-2.0
152,192
package com.atanana import java.io.PrintWriter import scala.io.Source import scala.util.Try class FsHandler { def readFile(filename: String): Try[String] = { Try { val source = Source.fromFile(filename) try { source.getLines().mkString } finally { source.close() } } ...
atanana/rating-bot
src/main/scala/com/atanana/FsHandler.scala
Scala
mit
518
package com.landoop.avro4sui import java.util.Scanner import com.sksamuel.avro4s.json.JsonToAvroConverter import javax.servlet.http.{HttpServletResponse, HttpServletRequest, HttpServlet} import com.sksamuel.avro4s.{TemplateGenerator, ModuleGenerator} import org.eclipse.jetty.server.Server import org.eclipse.jetty.ser...
Landoop/avro4s-ui
src/main/scala/com.landoop.avro4sui/App.scala
Scala
mit
3,513
package org.openmole.plugin.method.evolution import org.openmole.core.dsl._ import org.openmole.core.dsl.extension._ import org.openmole.tool.types.ToDouble object DeltaTask { def apply(objective: Delta*)(implicit name: sourcecode.Name, definitionScope: DefinitionScope) = Task("DeltaTask") { p ⇒ import p....
openmole/openmole
openmole/plugins/org.openmole.plugin.method.evolution/src/main/scala/org/openmole/plugin/method/evolution/DeltaTask.scala
Scala
agpl-3.0
1,566
package lore.compiler.poem import lore.compiler.semantics.NamePath case class PoemFunctionInstance(name: NamePath, typeArguments: Vector[PoemType]) { override def toString: String = s"$name[${typeArguments.mkString(", ")}]" }
marcopennekamp/lore
compiler/src/lore/compiler/poem/PoemFunctionInstance.scala
Scala
mit
230
/* Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this f...
mandar2812/DynaML
dynaml-core/src/main/scala/io/github/tailhq/dynaml/models/lm/SparkLogisticGLM.scala
Scala
apache-2.0
3,159
package com.ponkotuy.proxy import io.netty.buffer.{ByteBuf, CompositeByteBuf} import io.netty.channel.ChannelHandlerContext import io.netty.handler.codec.http.{HttpContent, HttpObject, HttpRequest, HttpResponse, HttpResponseStatus} import org.littleshoot.proxy.HttpFiltersAdapter abstract class AggregateContentFilters...
ttdoda/MyFleetGirls
client/src/main/scala/com/ponkotuy/proxy/AggregateContentFilters.scala
Scala
mit
2,015
//############################################################################ // Lisp interpreter (revived as an optimizer test.) //############################################################################ //############################################################################ // Lisp Scanner class LispTok...
som-snytt/dotty
tests/pos/t4579.scala
Scala
apache-2.0
16,698
package com.typesafe.slick.testkit.tests import slick.driver.H2Driver import com.typesafe.slick.testkit.util.{RelationalTestDB, AsyncTest} class NewQuerySemanticsTest extends AsyncTest[RelationalTestDB] { import tdb.profile.api._ def testNewComposition = { class SuppliersStd(tag: Tag) extends Table[(Int, St...
seebcioo/slick
slick-testkit/src/main/scala/com/typesafe/slick/testkit/tests/NewQuerySemanticsTest.scala
Scala
bsd-2-clause
22,027
package utils.pageobjects.save_for_later import utils.WithJsBrowser import utils.pageobjects._ final class GSaveForLaterSavePage(ctx:PageObjectsContext) extends ClaimPage(ctx, GSaveForLaterSavePage.url) { } object GSaveForLaterSavePage { val url = "/save" def apply(ctx:PageObjectsContext) = new GSaveForLaterSa...
Department-for-Work-and-Pensions/ClaimCapture
c3/test/utils/pageobjects/save_for_later/GSaveForLaterSavePage.scala
Scala
mit
523
package org.jetbrains.plugins.scala package codeInsight.intentions.booleans import codeInsight.intentions.ScalaIntentionTestBase import codeInsight.intention.booleans.FlipComparisonInMethodCallExprIntention /** * @author Ksenia.Sautina * @since 4/20/12 */ class FlipComparisonInMethodCallExprIntentionTest extends ...
consulo/consulo-scala
test/org/jetbrains/plugins/scala/codeInsight/intentions/booleans/FlipComparisonInMethodCallExprIntentionTest.scala
Scala
apache-2.0
2,180
/* 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...
oeddyo/scalding
scalding-core/src/main/scala/com/twitter/scalding/FileSource.scala
Scala
apache-2.0
15,182
package io.buoyant.linkerd package examples import io.buoyant.config.Parser import java.io.{FilenameFilter, File} import org.scalatest.FunSuite import scala.io.Source class ExamplesTest extends FunSuite { val examplesDir = new File("linkerd/examples") val files = examplesDir.listFiles(new FilenameFilter { ov...
linkerd/linkerd
linkerd/examples/src/test/scala/io/buoyant/linkerd/examples/ExamplesTest.scala
Scala
apache-2.0
1,101
package se.citerus.dddsample.domain.shared ; /** * AND specification, used to create a new specifcation that is the AND of two other specifications. */ class AndSpecification[T](val spec1: Specification[T], val spec2: Specification[T]) extends AbstractSpecification[T] { /** * { @inheritDoc } */ ...
oluies/ddd-sample-scala
src/main/scala/se/citerus/dddsample/domain/shared/AndSpecification.scala
Scala
mit
432
/* * @author Philip Stutz * * Copyright 2014 University of Zurich * * 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....
jacqueslk/triplerush-filter
src/main/scala/com/signalcollect/triplerush/sparql/DistinctIterator.scala
Scala
apache-2.0
1,627
import scala.collection.mutable.Stack object Solution { def main(args: Array[String]) = { val it = scala.io.Source.stdin.getLines val q = it.next.toInt val state = Stack[String]() var i = 0 while(i < q) { val op = it.next.split(" ") op.length match { case 1 => state.pop() //u...
marcos-sb/hacker-rank
data-structures/stacks/simple-text-editor/Solution.scala
Scala
apache-2.0
625
package com.guanghua.kafka.input import com.guanghua.Tool.kafkaProductorTool /** * Created by admin2 on 2017/10/16. */ object YWHBASE_TASK_APPOINTMENT_RESULT extends Runnable{ override def run(): Unit ={ val topic = "YWHBASE_TASK_APPOINTMENT_RESULT_TOPIC" val sql = """ |select t1.RESULT_ID...
androidbestcoder/hadoop_own_exercise
src/main/scala/com/guanghua/kafka/input/YWHBASE_TASK_APPOINTMENT_RESULT.scala
Scala
apache-2.0
3,300
/** * Copyright 2015 Zaradai * * 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 writ...
zaradai/snowy
src/test/scala/com/zaradai/snowy/SolverTest.scala
Scala
apache-2.0
4,387
package uk.ac.ncl.openlab.intake24.services.systemdb.pairwiseAssociations import uk.ac.ncl.openlab.intake24.errors.{UnexpectedDatabaseError, UpdateError} import uk.ac.ncl.openlab.intake24.pairwiseAssociationRules.PairwiseAssociationRules import scala.concurrent.{Future, Promise} /** * Created by Tim Osadchiy on 02...
digitalinteraction/intake24
SystemDataServices/src/main/scala/uk/ac/ncl/openlab/intake24/services/systemdb/pairwiseAssociations/PairwiseAssociationsDataService.scala
Scala
apache-2.0
680
/** * 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...
MyPureCloud/kafka
core/src/test/scala/unit/kafka/admin/AddPartitionsTest.scala
Scala
apache-2.0
9,857
package controllers import javax.inject._ import play.api._ import play.api.mvc._ import play.api.libs.json._ import scala.concurrent.Future import scala.concurrent.ExecutionContext.Implicits.global import com.github.tototoshi.play2.scalate._ import models.JsonFormatsTemplate._ import models._ import daos._ import ...
Viva-con-Agua/dispenser
app/controllers/TemplateController.scala
Scala
gpl-3.0
1,975
/** * Copyright (C) 2019 Inera AB (http://www.inera.se) * * This file is part of statistik (https://github.com/sklintyg/statistik). * * statistik 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 v...
sklintyg/statistik
gatling/src/test/scala/se/inera/statistics/gatling/InloggadSjukskrivningsgrad.scala
Scala
lgpl-3.0
1,084
package com.twitter.finagle.netty4.channel import com.twitter.finagle.Stack import com.twitter.finagle.decoder.Decoder import com.twitter.finagle.netty4.codec.BufCodec import com.twitter.finagle.netty4.decoder.DecoderHandler import io.netty.channel._ private[netty4] object Netty4ClientChannelInitializer { val BufCo...
mkhq/finagle
finagle-netty4/src/main/scala/com/twitter/finagle/netty4/channel/Netty4ClientChannelInitializer.scala
Scala
apache-2.0
1,518
/******************************************************************************* * Copyright (c) 2019. Carl Minden * * 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 ...
carlminden/anathema-roguelike
src/com/anathema_roguelike/entities/characters/player/perks/abilities/potions/SlowingPoison.scala
Scala
gpl-3.0
1,154
package edu.gemini.model.p1.immutable trait MichelleBlueprintBase extends GeminiBlueprintBase { def instrument = Instrument.Michelle }
arturog8m/ocs
bundle/edu.gemini.model.p1/src/main/scala/edu/gemini/model/p1/immutable/MichelleBlueprintBase.scala
Scala
bsd-3-clause
137
package beam.experiment import java.io.IOException import java.nio.file.{Files, Path, Paths} import beam.sim.BeamHelper class RunExperiments extends App with BeamHelper { val dirPath: String = args(0) val maxDepth = 2 var stream: java.util.stream.Stream[Path] = _ try { stream = Files.find(Paths.get(dirPa...
colinsheppard/beam
src/main/scala/beam/experiment/RunExperiments.scala
Scala
gpl-3.0
676
package out object Out { def println(string: String) { System.out.println(string) } }
wiiam/IrcBot
src/main/scala/out/Out.scala
Scala
agpl-3.0
97
package kofre.dotbased import kofre.IdUtil.Id import kofre.dotbased.DotStore.* import kofre.causality.{CausalContext, Dot} import kofre.dotbased.AddWinsSet import kofre.{IdUtil, Lattice} case class AddWinsSet[A](store: Map[A, Set[Dot]], context: CausalContext) { // (updatesCurrent[Set[(id, dot)], knownPast[Set[dot]...
guidosalva/REScala
Code/Extensions/Kofre/src/main/scala/kofre/dotbased/AddWinsSet.scala
Scala
apache-2.0
3,290
package org.orbeon.oxf.xml import javax.xml.transform.{Result, Source} import org.orbeon.saxon.event._ import org.orbeon.saxon.trans.XPathException import org.orbeon.saxon.{Configuration, Controller} import org.xml.sax.SAXParseException // Custom version of Saxon's IdentityTransformer which hooks up a `ComplexConten...
orbeon/orbeon-forms
src/main/scala/org/orbeon/oxf/xml/IdentityTransformerWithFixup.scala
Scala
lgpl-2.1
2,119
package part2 import org.scalatest.flatspec.AnyFlatSpec import org.scalatest.matchers.should.Matchers class Exercise11IntListSpec extends AnyFlatSpec with Matchers { // def pair(h: Int, t: IntList): IntPair = // IntPair(h, t) // val nil: IntList = // IntNil() // val numbers1: IntList = // pair(1, ...
underscoreio/essential-scala-code
src/test/scala/part2/Exercise11IntListSpec.scala
Scala
apache-2.0
1,789
package chandu0101.scalajs.react.components.popovers import chandu0101.scalajs.react.components.all._ import chandu0101.scalajs.react.components.util.DomUtil import chandu0101.scalajs.react.components.util.DomUtil.ClientRect import japgolly.scalajs.react._ import japgolly.scalajs.react.vdom.prefix_<^._ import org.sca...
mproch/scalajs-react-components
core/src/main/scala/chandu0101/scalajs/react/components/popovers/ReactPopOver.scala
Scala
apache-2.0
6,427
package gateway import configuration.Environment import infrastructure.{BadRequestDownstreamException, InternalServerErrorDownstreamException} import models.{Authorization, Token} import play.api.Logger import play.api.libs.json.Json import play.api.libs.ws.WS import scala.concurrent.ExecutionContext.Implicits.global...
tvlive/tv-api
app/gateway/AuthGateway.scala
Scala
apache-2.0
1,407
/* * 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 ...
nehabhardwaj01/incubator-carbondata
examples/spark2/src/main/scala/org/apache/carbondata/examples/AlterTableExample.scala
Scala
apache-2.0
3,579
package controllers import com.mohiva.play.silhouette.api.{ LoginEvent, LoginInfo, SignUpEvent } import com.mohiva.play.silhouette.impl.providers.{ CommonSocialProfile, CredentialsProvider } import models.user.{ RegistrationData, UserForms } import play.api.i18n.{ Messages, MessagesApi } import play.api.libs.concurren...
rynmccrmck/thunderdome
app/controllers/RegistrationController.scala
Scala
apache-2.0
3,124
/* __ *\ ** ________ ___ / / ___ Scala API ** ** / __/ __// _ | / / / _ | (c) 2002-2013, LAMP/EPFL ** ** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ ** ** /____/\___/_/ |_/...
felixmulder/scala
src/library/scala/Tuple5.scala
Scala
bsd-3-clause
1,260
/** * */ package org.duffqiu.rest.test.actor import scala.actors.Actor import scala.actors.Actor.State.Terminated import scala.actors.Exit import scala.actors.TIMEOUT /** * @author macbook * * Jun 7, 2014 */ object RestClientMasterActor { private final val DEFAULT_INTERVAL = 5000 } class RestClientMasterA...
duffqiu/rest-test-dsl
src/main/scala/org/duffqiu/rest/test/actor/RestClientMasterActor.scala
Scala
apache-2.0
3,495
package org.scaladebugger.api.lowlevel.watchpoints /** * Represents an exception that occurred when attempting to create a watchpoint * request and the desired class or field was not found on the remote JVM. * * @param className The name of the class containing the field * @param fieldName The name of the field t...
ensime/scala-debugger
scala-debugger-api/src/main/scala/org/scaladebugger/api/lowlevel/watchpoints/NoFieldFound.scala
Scala
apache-2.0
464
package agni import cats.syntax.either._ import com.datastax.oss.driver.api.core.ProtocolVersion import com.datastax.oss.driver.api.core.cql.Row import com.datastax.oss.driver.api.core.data.{TupleValue, UdtValue} trait RowDeserializer[A] { def apply(row: Row, i: Int, version: ProtocolVersion): Either[Throwable, A] ...
tkrs/agni
core/src/main/scala/agni/RowDeserializer.scala
Scala
mit
1,795
import scala.language.implicitConversions object Test { abstract class Unit object NoUnit extends Unit object Hour extends Unit { override def toString = "Hour" } case class Measure(scalar: Double, unit: Unit) { def *(newUnit: Unit) = Measure(scalar, newUnit) } implicit def double2Measure(scalar: Dou...
lampepfl/dotty
tests/run/impconvtimes.scala
Scala
apache-2.0
477