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 poker.core.handanalyzer
import org.scalatest.FunSuite
import poker.TestHelpers._
import poker.core.{HandStatus, HandType, Kickers}
final class HighCardAnalyzerTest extends FunSuite {
test("analyze") {
val highCardAnalyzer = new HighCardAnalyzer
assert(highCardAnalyzer.analyze(royalFlushHand) === Ha... | kyuksel/poker | src/test/scala/poker/core/handanalyzer/HighCardAnalyzerTest.scala | Scala | mit | 808 |
package me.reminisce.gameboard.questions
import java.util.concurrent.TimeUnit
import akka.testkit.{TestActorRef, TestProbe}
import me.reminisce.database.MongoCollections
import me.reminisce.database.MongoDBEntities.{FBLocation, FBPlace, FBPost}
import me.reminisce.database.MongoDBFormats._
import me.reminisce.gameboa... | reminisceme/game-creator | src/test/scala/me/reminisce/gameboard/questions/WhichCoordinatesWereYouAtSpec.scala | Scala | apache-2.0 | 3,528 |
package dog
package autodoc
import httpz._
import argonaut._, Argonaut._
object AutodocTest extends DogAutodoc with Assert {
def str(value: String) = new ByteArray(value.getBytes())
def interpreter(value: String, status: Int, headers: Map[String, List[String]] = Map()) =
FakeInterpreter(str(value), status, ... | scala-kennel/dog-autodoc | autodoc/src/test/scala/dog/autodoc/AutodocTest.scala | Scala | mit | 3,937 |
package circumflex
package web
import core._
import collection.mutable.Map
import collection.Iterator
import collection.JavaConversions._
import java.util.{Enumeration => JEnumeration}
import javax.servlet.http.{HttpSession => ServletSession}
import java.io.Serializable
class HttpSession
extends Map[String, Seria... | inca/circumflex | web/src/main/scala/session.scala | Scala | bsd-2-clause | 1,399 |
/**
* Copyright (c) 2013 Saddle Development 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 ... | jyt109/saddle | saddle-core/src/main/scala/org/saddle/stats/SeriesExpandingStats.scala | Scala | apache-2.0 | 2,442 |
package scala.scalanative
package util
import scala.language.implicitConversions
trait Show[T] { def apply(t: T): Show.Result }
object Show {
sealed abstract class Result {
override def toString = {
val sb = new StringBuilder
var indentation = 0
def nl(res: Result) = {
sb.appe... | cedricviaccoz/scala-native | util/src/main/scala/scala/scalanative/util/Show.scala | Scala | bsd-3-clause | 3,012 |
package org.jetbrains.plugins.scala.lang.typeInference
import org.jetbrains.plugins.scala.base.ScalaLightCodeInsightFixtureTestAdapter
class SingletonTypesConformanceTest extends ScalaLightCodeInsightFixtureTestAdapter {
def testSCL11192(): Unit = checkTextHasNoErrors(
"""
|trait HList
|trait Second... | JetBrains/intellij-scala | scala/scala-impl/test/org/jetbrains/plugins/scala/lang/typeInference/SingletonTypesConformanceTest.scala | Scala | apache-2.0 | 2,046 |
/*
* Copyright 2014-2021 Netflix, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agr... | brharrington/atlas | atlas-lwcapi/src/test/scala/com/netflix/atlas/lwcapi/SubscribeApiSuite.scala | Scala | apache-2.0 | 4,857 |
import scala.reflect.runtime.universe._
import scala.tools.reflect.Eval
object O {
type A = Unit
}
object Test extends App {
val expr = reify {
import O.{A => X}
val a: X = ()
object P {
type B = Unit
}
import P.{B => Y}
val b: Y = ()
}
println(expr.eval)
} | felixmulder/scala | test/files/run/reify_renamed_type_local_to_reifee.scala | Scala | bsd-3-clause | 302 |
package com.aristocrat.mandrill.requests.Exports
import com.aristocrat.mandrill.requests.MandrillRequest
import org.joda.time.DateTime
case class Activity(
key: String,
notifyEmail: Option[String] = None,
dateFrom: Option[DateTime] = None,
dateTo: Option[DateTime] = None,
tags: Seq[String] = Seq()... | aristocratic/mandrill | src/main/scala/com/aristocrat/mandrill/requests/Exports/Activity.scala | Scala | mit | 447 |
/**
* 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
* distributed ... | KevinLiLu/kafka | core/src/test/scala/integration/kafka/api/BaseQuotaTest.scala | Scala | apache-2.0 | 14,574 |
package org.joda.time.convert
import org.joda.time.Chronology
object LongConverter {
val INSTANCE = new LongConverter()
}
class LongConverter
extends AbstractConverter()
with InstantConverter
with PartialConverter
with DurationConverter {
override def getInstantMillis(`object`: AnyRef, chrono: C... | mdedetrich/soda-time | shared/src/main/scala/org/joda/time/convert/LongConverter.scala | Scala | bsd-2-clause | 544 |
/*
* Copyright 2012 Comcast Cable Communications Management, LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless require... | Comcast/money | money-core/src/main/scala/com/comcast/money/core/logging/TraceLogging.scala | Scala | apache-2.0 | 1,025 |
package scalacopts
import scala.reflect.macros.blackbox
import scala.language.experimental.macros
object Macros {
def hello: String = macro macroSettings
def macroSettings(c: blackbox.Context): c.Expr[String] = {
import c.universe._
// c.settings are the values from scalac's -Xmacro-settings
val s = ... | bazelbuild/rules_scala | test/scalacopts/A.scala | Scala | apache-2.0 | 374 |
/*
* Copyright (c) 2016-2018 Snowplow Analytics Ltd. All rights reserved.
*
* This program is licensed to you under the Apache License Version 2.0,
* and you may not use this file except in compliance with the Apache License Version 2.0.
* You may obtain a copy of the Apache License Version 2.0 at http://www.apach... | snowplow/iglu | 0-common/schema-ddl/src/main/scala/com.snowplowanalytics/iglu.schemaddl/jsonschema/JsonPointer.scala | Scala | apache-2.0 | 4,851 |
package com.twitter.concurrent
import org.junit.runner.RunWith
import org.scalatest.WordSpec
import org.scalatest.junit.JUnitRunner
import com.twitter.common.objectsize.ObjectSizeCalculator
import com.twitter.util.{Await, Return}
@RunWith(classOf[JUnitRunner])
class BrokerTest extends WordSpec {
"Broker" should {... | stremlenye/util | util-core/src/test/scala/com/twitter/concurrent/BrokerTest.scala | Scala | apache-2.0 | 3,681 |
/*
* Copyright (c) 2017 Andrzej Jozwik
*
* 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, copy, modify, merge, publ... | ajozwik/akka-smtp-server | akka-smtp/src/test/scala/pl/jozwik/smtp/server/FakeSmtpActor.scala | Scala | mit | 1,798 |
/*
* Copyright 2017 Sumo Logic
*
* 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 i... | SumoLogic/epigraph | java/codegen/src/main/scala/ws/epigraph/java/service/projections/req/output/ReqOutputEntityProjectionGen.scala | Scala | apache-2.0 | 5,217 |
// 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.workflow.builder
import ducttape.syntax.AbstractSyntaxTree.BranchGraftElement
import ducttape.workflow.Br... | jhclark/ducttape | src/test/scala/ducttape/workflow/builder/BranchGraftGlobTest.scala | Scala | mpl-2.0 | 3,139 |
//: ----------------------------------------------------------------------------
//: Copyright (C) 2015 Verizon. All Rights Reserved.
//:
//: Licensed under the Apache License, Version 2.0 (the "License");
//: you may not use this file except in compliance with the License.
//: You may obtain a copy of the Licen... | runarorama/quiver | core/src/test/scala/GraphGen.scala | Scala | apache-2.0 | 1,990 |
/***********************************************************************
* Copyright (c) 2017 IBM
* 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 ... | nagavallia/geomesa | geomesa-cassandra/geomesa-cassandra-datastore/src/main/scala/org/locationtech/geomesa/cassandra/index/CassandraZ3Layout.scala | Scala | apache-2.0 | 2,900 |
/*
* 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 viper.silicon.supporters.functions
import viper.silver.ast
import viper.silver.ast.{Field, P... | sccblom/vercors | viper/silicon/src/main/scala/supporters/functions/FunctionRecorder.scala | Scala | mpl-2.0 | 6,242 |
package com.malaska.spark.training.streaming.structured
import org.apache.log4j.{Level, Logger}
import org.apache.spark.sql.SparkSession
import org.apache.spark.sql.streaming.{GroupState, GroupStateTimeout}
object CountingInAStreamMapWithState {
Logger.getLogger("org").setLevel(Level.OFF)
Logger.getLogger("akka")... | TedBear42/spark_training | src/main/scala/com/malaska/spark/training/streaming/structured/CountingInAStreamMapWithState.scala | Scala | apache-2.0 | 2,366 |
package org.openurp.edu.eams.teach.grade.course.web.action
import org.beangle.commons.collection.Collections
import org.openurp.edu.teach.code.CourseTakeType
import org.openurp.edu.teach.code.ExamStatus
import org.openurp.edu.teach.code.GradeType
import org.openurp.edu.eams.teach.code.industry.ScoreMarkStyle
import ... | openurp/edu-eams-webapp | grade/src/main/scala/org/openurp/edu/eams/teach/grade/course/web/action/TeacherGaAction.scala | Scala | gpl-3.0 | 3,537 |
case class Check[A](val value: A)
case class C2(checks: Check[_]*);
object C {
def m(x : C2): Any = (null: Any) match {
case C2(_, rest : _*) => {
rest.map(_.value)
}
}
}
///////////////////
object Container {
trait Exp[+T]
abstract class FuncExp[-S, +T]
sealed abstract class FoundNode[T, R... | yusuke2255/dotty | tests/pending/pos/t3577.scala | Scala | bsd-3-clause | 799 |
var occupations = [
"Malcolm": "Captain",
"Kaylee": "Mechanic",
]
occupations["Jayne"] = "Public Relations"
| leverich/swiftislikescala | comparisons/collections/maps/swift.scala | Scala | mit | 116 |
/*
* 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... | SRGOM/scalatest | scalatest-test/src/test/scala/org/scalatest/ShouldBeSortedLogicalAndSpec.scala | Scala | apache-2.0 | 19,641 |
package com.github.simonedeponti.play26lettuce
import java.time.Instant
import java.util.Date
import java.util.concurrent.{Callable, CompletionStage}
import akka.Done
import org.specs2.mutable._
import org.specs2.concurrent.ExecutionEnv
import play.api.PlayException
import play.api.cache.{AsyncCacheApi, SyncCacheApi}... | simonedeponti/play26-lettuce | src/test/scala/com/github/simonedeponti/play26lettuce/LettuceSpec.scala | Scala | bsd-3-clause | 20,642 |
package org.five11
import scala.xml.XML
import scalaj.http._
class Api(token: String) {
private val endpoints = new Endpoints(token)
def agencies(): Seq[Agency] = {
val req = endpoints.agencies.asString
val body = XML.loadString(req.body)
(body \\ "Agency").map{ agencyNode =>
val name = (agen... | jnfeinstein/scala-511 | src/main/scala/org/five11/Api.scala | Scala | mit | 4,538 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | chuckchen/spark | core/src/main/scala/org/apache/spark/executor/CoarseGrainedExecutorBackend.scala | Scala | apache-2.0 | 22,170 |
package julienrf.example
import julienrf.endpoints.RequestCodec.{MethodPathQueryStringCodec, MethodPathCodec}
import julienrf.endpoints._
import julienrf.formats.FormatValue.Implicits._
import julienrf.schema.Schema
import play.api.libs.json.Json
import play.twirl.api.{Html, StringInterpolation}
object Demo {
def ... | julienrf/play-endpoints | src/main/scala/julienrf/example/Demo.scala | Scala | mit | 2,203 |
package net.xylophones.planetoid.game
import net.xylophones.planetoid.game.maths.Vector2D
import net.xylophones.planetoid.game.model.{GamePhysics, PlayerIdentifier, Rocket}
class RocketFactory {
def getRocketAtInitialPosition(playerType: PlayerIdentifier.Value, phys: GamePhysics): Rocket = {
val rotation = ini... | wjsrobertson/planetoid | game/src/main/scala/net/xylophones/planetoid/game/RocketFactory.scala | Scala | apache-2.0 | 1,249 |
package com.datastax.spark.connector.mapper
import com.datastax.oss.driver.api.core.DefaultProtocolVersion.V4
import com.datastax.oss.driver.api.core.ProtocolVersion
import com.datastax.spark.connector.ColumnRef
import com.datastax.spark.connector.cql._
import com.datastax.spark.connector.datasource.CassandraSourceUti... | datastax/spark-cassandra-connector | connector/src/main/scala/com/datastax/spark/connector/mapper/DataFrameColumnMapper.scala | Scala | apache-2.0 | 1,823 |
package org.jetbrains.plugins.scala.codeInspection.collections
import org.jetbrains.plugins.scala.codeInspection.InspectionBundle
/**
* @author Nikolay.Tropin
*/
class ZeroIndexToHeadTest extends OperationsOnCollectionInspectionTest {
override val inspectionClass: Class[_ <: OperationOnCollectionInspection] = cla... | triggerNZ/intellij-scala | test/org/jetbrains/plugins/scala/codeInspection/collections/ZeroIndexToHeadTest.scala | Scala | apache-2.0 | 1,064 |
import sbt._
import sbt.Keys._
import sbt.Project.Initialize
import scala.xml.{ XML, NodeSeq }
/** Manage publishing to Sonatype repos */
object Publish {
lazy val developers = SettingKey[Seq[Developer]]("developers", "Project's developers")
lazy val checkPom = TaskKey[Unit]("check-pom", "Checks if pom contains e... | nevang/play-uid | project/Publish.scala | Scala | bsd-2-clause | 2,461 |
package slamdata.engine.std
import scalaz._
import Scalaz._
import slamdata.engine.{Data, Func, Type, Mapping, SemanticError}
import SemanticError._
import Validation.{success, failure}
import NonEmptyList.nel
trait StringLib extends Library {
private def stringApply(f: (String, String) => String): Func.Typer = {... | sellout/slamengine-old | src/main/scala/slamdata/engine/std/string.scala | Scala | agpl-3.0 | 2,016 |
/*
// Note: This is an example Build.scala for a Play project
import sbt._
import Keys._
import play.Project._
object ApplicationBuild extends Build {
val appName = "activator-template-template"
val appVersion = "1.0-SNAPSHOT"
val appDependencies = Seq(
// Select Play modules
//jdbc, ... | freefry/furniture-factory | project/Build.scala | Scala | apache-2.0 | 901 |
package lila.shutup
/**
* - words are automatically pluralized. "tit" will also match "tits"
* - words are automatically leetified. "tit" will also match "t1t", "t-i-t", and more.
* - words do not partial match. "anal" will NOT match "analysis".
*/
private object Dictionary {
def en: List[String] = dict("""
(c|... | clarkerubber/lila | modules/shutup/src/main/Dictionary.scala | Scala | agpl-3.0 | 1,787 |
package com.mehmetakiftutuncu.muezzinapi.controllers
import com.github.mehmetakiftutuncu.errors.{CommonError, Errors}
import com.mehmetakiftutuncu.muezzinapi.models.{City, Country, District}
import com.mehmetakiftutuncu.muezzinapi.services._
import com.mehmetakiftutuncu.muezzinapi.utilities.ControllerExtras
import jav... | mehmetakiftutuncu/MuezzinAPI | app/com/mehmetakiftutuncu/muezzinapi/controllers/PlaceController.scala | Scala | mit | 2,793 |
package scalaz.stream.mongodb.filesystem
import com.mongodb.{DB, DBObject}
import scala.language.implicitConversions
import scala.language.postfixOps
import com.mongodb.gridfs.GridFS
import org.bson.types.ObjectId
import scalaz.stream.mongodb.channel.ChannelResult
import scalaz.stream.Process
import scalaz.stream.pr... | Spinoco/scalaz-stream-mongodb | core/src/main/scala/scalaz/stream/mongodb/filesystem/FileSystemSyntax.scala | Scala | mit | 1,947 |
/*
* 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... | analytically/phantom | phantom-dsl/src/test/scala/com/websudos/phantom/tables/TimeSeriesTable.scala | Scala | bsd-2-clause | 2,281 |
package org.jetbrains.plugins.scala.lang.psi.light
import com.intellij.openapi.util.Key
import com.intellij.psi.impl.light.LightModifierList
import com.intellij.psi.{PsiClass, PsiMethod, PsiModifierList}
import org.jetbrains.plugins.scala.ScalaFileType
import org.jetbrains.plugins.scala.lang.psi.impl.ScalaPsiManager
... | whorbowicz/intellij-scala | src/org/jetbrains/plugins/scala/lang/psi/light/StaticPsiMethodWrapper.scala | Scala | apache-2.0 | 2,065 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | chuckchen/spark | sql/hive/src/main/scala/org/apache/spark/sql/hive/client/HiveClientImpl.scala | Scala | apache-2.0 | 53,954 |
//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
/** @author John Miller
* @version 1.2
* @date Tue Jan 5 16:14:38 EST 2010
* @see LICENSE (MIT style license file).
*/
package scalation.scala2d
import scala.math.{atan, cos, Pi, sin}
import scalation.scala2d.Colors._
i... | NBKlepp/fda | scalation_1.2/src/main/scala/scalation/scala2d/Arrow.scala | Scala | mit | 5,960 |
package net.aicomp.terraforming.entity
import org.specs2.mutable.SpecificationWithJUnit
class PointSpec extends SpecificationWithJUnit {
"Point" should {
"calculate additions" in {
Point(1, 1) + Point(2, -1) must_== Point(3, 0)
}
"calculate subtractions" in {
Point(1, 3) - Point(-1, -1) must... | AI-comp/Terraforming | src/test/scala/net/aicomp/terraforming/entity/PointSpec.scala | Scala | apache-2.0 | 6,136 |
package org.hatdex.hat.she.mappers
import java.util.UUID
import org.hatdex.hat.api.models.{
EndpointQuery,
EndpointQueryFilter,
PropertyQuery
}
import org.hatdex.hat.api.models.applications.{
DataFeedItem,
DataFeedItemContent,
DataFeedItemLocation,
DataFeedItemMedia,
DataFeedItemTitle,
LocationAddre... | Hub-of-all-Things/HAT2.0 | hat/app/org/hatdex/hat/she/mappers/FacebookMappers.scala | Scala | agpl-3.0 | 12,928 |
package frameless
import scala.annotation.implicitNotFound
/**
* When summing Spark doesn't change these types:
* - Long -> Long
* - BigDecimal -> BigDecimal
* - Double -> Double
*
* For other types there are conversions:
* - Int -> Long
* - Short -> Long
*/
@implicitNotFound("... | adelbertc/frameless | core/src/main/scala/frameless/CatalystSummable.scala | Scala | apache-2.0 | 1,168 |
package at.logic.gapt.prooftool
/**
* Created by IntelliJ IDEA.
* User: mrukhaia
* Date: 2/3/11
* Time: 4:24 PM
*/
import scala.swing._
import BorderPanel._
import event._
import java.awt.Font._
import at.logic.gapt.proofs.proofs._
import java.awt.event.{ MouseMotionListener, MouseEvent }
import at.logic.gapt.pr... | gisellemnr/gapt | src/main/scala/at/logic/gapt/prooftool/DrawProof.scala | Scala | gpl-3.0 | 9,106 |
package mesosphere.marathon
package api.v2
import com.wix.accord._
import com.wix.accord.dsl._
import mesosphere.{ UnitTest, ValidationTestLike }
import mesosphere.marathon.api.v2.Validation._
import mesosphere.marathon.core.pod.BridgeNetwork
import mesosphere.marathon.raml.GroupUpdate
import mesosphere.marathon.state... | janisz/marathon | src/test/scala/mesosphere/marathon/api/v2/ModelValidationTest.scala | Scala | apache-2.0 | 3,776 |
/*
* 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 ... | JingchengDu/hbase | hbase-spark/src/main/scala/org/apache/hadoop/hbase/spark/example/rdd/HBaseBulkDeleteExample.scala | Scala | apache-2.0 | 2,092 |
package com.programmaticallyspeaking.ncd.nashorn
import com.programmaticallyspeaking.ncd.host._
import com.programmaticallyspeaking.ncd.infra.IdGenerator
import com.programmaticallyspeaking.ncd.messaging.{Observable, SerializedSubject}
import org.slf4s.Logging
import scala.collection.concurrent.TrieMap
class LineBre... | provegard/ncdbg | src/main/scala/com/programmaticallyspeaking/ncd/nashorn/LineBreakpoints.scala | Scala | bsd-3-clause | 3,248 |
import sbt._
import Import._
object SingleBuild extends Build with Marker
{
override def projects = if(file("multi").exists) Seq(root, sub, sub2) else Seq(root)
lazy val root = Project("root", file("."), aggregate = if(file("aggregate").exists) Seq(sub) else Nil )
lazy val sub = Project("sub", file("sub"), aggregat... | dansanduleac/sbt | sbt/src/sbt-test/actions/aggregate/project/TestProject.scala | Scala | bsd-3-clause | 391 |
package dotty.tools.dotc
package transform
import core.Contexts._
/** Utility class for lazy values whose evaluation depends on a context.
* This should be used whenever the evaluation of a lazy expression
* depends on some context, but the value can be re-used afterwards
* with a different context.
*
* A ty... | dotty-staging/dotty | compiler/src/dotty/tools/dotc/transform/CtxLazy.scala | Scala | apache-2.0 | 741 |
package org.jetbrains.plugins.scala
package lang
package psi
package impl
package expr
import types.{Bounds, Nothing}
import lexer.ScalaTokenTypes
import psi.ScalaPsiElementImpl
import api.expr._
import com.intellij.psi.util.PsiTreeUtil
import com.intellij.lang.ASTNode
import types.result.{TypingContext, Success, Fai... | consulo/consulo-scala | src/org/jetbrains/plugins/scala/lang/psi/impl/expr/ScIfStmtImpl.scala | Scala | apache-2.0 | 2,632 |
package ml.wolfe.util
import scala.collection.mutable
import cc.factorie.app.nlp.coref.CorefFeatures.True
/**
* Implementation of Powell's method for derivative free optimisation
* The main idea is the algorithm 9.3 from Numerical Optimization by Wright and Nocedal.
* Following as closely as possible the scipy ver... | wolfe-pack/wolfe | wolfe-util/src/main/scala/ml/wolfe/util/Powell.scala | Scala | apache-2.0 | 3,882 |
// date: Oct 26, 2011
/* CREATE CLASS
The Server system has created notecard objects and has built
a network of link lists connecting these objects. The system
passes the link lists in '.struct' files to the 'Notecard' program.
The link list physical addresses, held in the list's 'next'
variable, are con... | hangle/Notecard | src/CreateClass.scala | Scala | apache-2.0 | 10,720 |
/*
* Copyright 2015 Heiko Seeberger
*
* 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... | hseeberger/reactive-flows | src/test/scala/de/heikoseeberger/reactiveflows/AkkaSpec.scala | Scala | apache-2.0 | 1,118 |
package com.twitter.util.lint
import java.util.regex.Pattern
/**
* A single lint rule, that when [[Rule.apply() run]] evaluates
* whether or not there are any issues.
*/
trait Rule {
/**
* Runs this lint check.
*
* @return An empty `Seq` if no issues are found.
*/
def apply(): Seq[Issue]
/** Th... | BuoyantIO/twitter-util | util-lint/src/main/scala/com/twitter/util/lint/Rule.scala | Scala | apache-2.0 | 1,309 |
/*
* Copyright 2011-2022 GatlingCorp (https://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... | gatling/gatling | gatling-commons/src/test/scala/io/gatling/commons/util/StringHelperSpec.scala | Scala | apache-2.0 | 2,719 |
import sbt._
import Keys._
import org.scalajs.sbtplugin.ScalaJSPlugin
import org.scalajs.sbtplugin.ScalaJSPlugin.autoImport._
import scalajsbundler.sbtplugin.ScalaJSBundlerPlugin
import scalajsbundler.sbtplugin.ScalaJSBundlerPlugin.autoImport._
object ScalaJSReactMdl {
object Versions {
val scala = "2.11.8"
... | eldis/scalajs-react-mdl | project/Build.scala | Scala | mit | 4,341 |
package sample
import akka.actor._
import akka.pattern.ask
import akka.util.Timeout
import scala.concurrent.Await
import scala.concurrent.duration._
class SampleActor extends Actor {
def receive = {
case message: String => sender ! ("hello " + message)
}
}
object Sample extends App {
val system = ActorSyst... | digimead-specific/sbt-aop | src/sbt-test/weave/jar/src/main/scala/sample/Sample.scala | Scala | apache-2.0 | 531 |
package com.owtelse.scazelcast.hazelcast
/**
* Created by robertk on 21/10/14.
*/
trait HazelcastMultiMap {
import com.hazelcast.core.HazelcastInstance
import com.hazelcast.core.{IMap, MultiMap}
import scala.collection.convert.WrapAsScala._
import collection.mutable.{Map => MMap}
import java.util.{Map => J... | karlroberts/scazelcast | scazelcast-api/src/main/scala/com/owtelse/scazelcast/hazelcast/HazelcastMultiMap.scala | Scala | bsd-3-clause | 3,192 |
package lore.compiler.resolution
import lore.compiler.feedback.Reporter
import lore.compiler.semantics.Registry
import lore.compiler.syntax.DeclNode
object ResolutionPhase {
def process(fragmentModules: Vector[DeclNode.ModuleNode])(implicit reporter: Reporter): Registry = DeclarationResolver.resolve(fragmentModules... | marcopennekamp/lore | compiler/src/lore/compiler/resolution/ResolutionPhase.scala | Scala | mit | 324 |
/*
* Copyright 2012-2020 the original author or 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 ap... | planet42/Laika | core/shared/src/test/scala/laika/rst/ListParsersSpec.scala | Scala | apache-2.0 | 16,742 |
package org.allenai.common.guice
import org.allenai.common.Logging
import org.allenai.common.Config._
import com.google.inject.Inject
import com.google.inject.name.Named
import com.typesafe.config.{
Config,
ConfigException,
ConfigFactory,
ConfigObject,
ConfigUtil,
ConfigValueType
}
import net.codingwell.s... | ryanai3/common | guice/src/main/scala/org/allenai/common/guice/ConfigModule.scala | Scala | apache-2.0 | 7,269 |
package org.http4s.server
package blaze
import java.nio.ByteBuffer
import java.nio.charset.StandardCharsets
import java.time.Instant
import java.util.concurrent.Executors
import org.http4s.headers.{`Transfer-Encoding`, Date, `Content-Length`}
import org.http4s.{headers => H, _}
import org.http4s.blaze._
import org.ht... | ZizhengTai/http4s | blaze-server/src/test/scala/org/http4s/server/blaze/Http1ServerStageSpec.scala | Scala | apache-2.0 | 14,397 |
package day2.foldleft
/**
* Created by Niels Bokmans on 22-3-2016.
*/
object FoldLeftMain {
def list = List(1, 2, 3)
def main(args: Array[String]): Unit = {
println("List[String] to string length with fold left: " + countStringList(stringList))
println("Sum of List[Int]: " + countIntListSum(intList))... | nielsje41/7l7wScala | day2/foldleft/FoldLeftMain.scala | Scala | mit | 998 |
/*
* 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/models/bankdetails/BankDetailsSpec.scala | Scala | apache-2.0 | 17,620 |
/* Copyright 2009-2016 EPFL, Lausanne */
package leon
package termination
import purescala.Definitions._
import utils.Report
import utils.ASCIIHelpers._
import leon.purescala.PrettyPrinter
import leon.purescala.SelfPrettyPrinter
case class TerminationReport(ctx: LeonContext, program: Program, results : Seq[(FunDef,T... | regb/leon | src/main/scala/leon/termination/TerminationReport.scala | Scala | gpl-3.0 | 1,607 |
package wav.common.scalajs.macros
import scala.scalajs.js
object Test {
val optionTest = JS[Option[Int]](Some(1))
val seqTest = JS[Seq[Int]](Seq(1))
val mapTest = JS[Map[Int, Double]](Map(1 -> 1)) // Not verified.
object enum extends Enumeration {
val x = Value
}
case class Simple(s: String, t: e... | wav/scala-macros | src/test/scala/wav/common/scalajs/macros/MacroTest.scala | Scala | apache-2.0 | 1,319 |
package org.jetbrains.plugins.scala
package lang
package psi
package api
package toplevel
package typedef
import java.util
import com.intellij.lang.ASTNode
import com.intellij.openapi.progress.ProgressManager
import com.intellij.openapi.project.DumbService
import com.intellij.pom.java.LanguageLevel
import com.intelli... | jeantil/intellij-scala | src/org/jetbrains/plugins/scala/lang/psi/api/toplevel/typedef/ScTemplateDefinition.scala | Scala | apache-2.0 | 19,037 |
package freeslick.testkit
import com.typesafe.slick.testkit.util.{AsyncTest, JdbcTestDB}
class FreeslickInsertTest extends AsyncTest[JdbcTestDB] {
import tdb.profile.api._
class T(tableName: String)(tag: Tag) extends Table[(Int, String)](tag, tableName) {
def id = column[Int]("ID", O.AutoInc, O.PrimaryKey)
... | fommil/freeslick | src/it/scala/freeslick/testkit/FreeslickInsertTest.scala | Scala | lgpl-3.0 | 3,266 |
package org.broadinstitute.sting.queue.qscripts.examples
import org.broadinstitute.sting.queue.QScript
class HelloWorld extends QScript {
def script() {
add(new CommandLineFunction {
def commandLine = "echo hello world"
})
}
}
| iontorrent/Torrent-Variant-Caller-stable | public/scala/qscript/org/broadinstitute/sting/queue/qscripts/examples/HelloWorld.scala | Scala | mit | 247 |
package com.greencatsoft.d3.common
import scala.language.implicitConversions
import scala.math.{ pow, sqrt }
import scala.scalajs.js
import scala.scalajs.js.annotation.JSExportAll
import org.scalajs.dom.svg
import org.scalajs.dom.svg.{ Matrix, SVG }
@JSExportAll
case class Point(x: Double, y: Double) extends Transfo... | greencatsoft/scalajs-d3 | src/main/scala/com/greencatsoft/d3/common/Point.scala | Scala | apache-2.0 | 1,291 |
/***********************************************************************
* Copyright (c) 2013-2022 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... | locationtech/geomesa | geomesa-z3/src/main/scala/org/locationtech/geomesa/curve/NormalizedDimension.scala | Scala | apache-2.0 | 3,296 |
package com.scalableQuality.quick.surface.output
object WriteTextReportToStdout {
def apply(
textReports: List[() => List[String]]
): Unit = BufferedWriteToStdout(textReports)
}
| MouslihAbdelhakim/Quick | src/main/scala/com/scalableQuality/quick/surface/output/WriteTextReportToStdout.scala | Scala | apache-2.0 | 189 |
package org.http4s
package parser
import org.http4s.headers.{`Content-Range`, Range}
import org.http4s.headers.Range.SubRange
class RangeParserSpec extends Http4sSpec {
"RangeParser" should {
"parse Range" in {
val headers = Seq(
Range(RangeUnit.Bytes, SubRange(0, 500)),
Range(RangeUnit.... | m4dc4p/http4s | tests/src/test/scala/org/http4s/parser/RangeParserSpec.scala | Scala | apache-2.0 | 1,084 |
package cc.factorie.app.nlp.ner
import cc.factorie.app.nlp.Token
import cc.factorie.variable.CategoricalVectorVar
trait NerLexiconFeatures {
def addLexiconFeatures(tokens: IndexedSeq[Token], featureFunc : (Token => CategoricalVectorVar[String]))
}
| patverga/factorie | src/main/scala/cc/factorie/app/nlp/ner/NerLexiconFeatures.scala | Scala | apache-2.0 | 258 |
package org.mystic.consumer
trait KafkaStreamConsumer {
}
| MysterionRise/h2h-fantazy | src/main/scala/org/mystic/consumer/KafkaStreamConsumer.scala | Scala | mit | 60 |
package com.pirate.jacksparrow
import play.api.libs.ws.WSResponse
import scala.concurrent.Future
/**
* Created by pnagarjuna on 29/12/15.
*/
object PirateUtils {
def getPageHtml(link: String): Future[WSResponse] = {
HttpHelper.client.url(link)
.withHeaders("User-Agent" -> "Mozilla/5.0 (Windows NT 6.... | pamu/olx-bikes | src/main/scala/com/pirate/jacksparrow/PirateUtils.scala | Scala | apache-2.0 | 444 |
package org.orbeon.dom
/**
* `IllegalAddException` is thrown when a node is added incorrectly
* to an `Element`.
*/
class IllegalAddException(reason: String) extends IllegalArgumentException(reason) {
def this(parent: Element, node: Node, reason: String) =
this("The node \"" + node.toString + "\" could not b... | brunobuzzi/orbeon-forms | dom/src/main/scala/org/orbeon/dom/IllegalAddException.scala | Scala | lgpl-2.1 | 622 |
/** Copyright 2015 TappingStone, 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 ... | ch33hau/PredictionIO | core/src/main/scala/io/prediction/controller/IdentityPreparator.scala | Scala | apache-2.0 | 3,107 |
package com.twitter.algebird
import org.scalatest._
import org.scalatest.{ PropSpec, Matchers }
import org.scalatest.prop.PropertyChecks
import org.scalacheck.{ Gen, Arbitrary }
import java.util.Arrays
class MinHasherTest extends PropSpec with PropertyChecks with Matchers {
import BaseProperties._
implicit val... | avibryant/algebird | algebird-test/src/test/scala/com/twitter/algebird/MinHasherTest.scala | Scala | apache-2.0 | 2,226 |
package com.fijimf
import org.joda.time.LocalDate
object Main {
def main(args: Array[String]) {
val frm: FixedRateMortgage = FixedRateMortgage(500000, 360, new LocalDate(2015, 2, 5), new LocalDate(2015, 3, 1), 500000, 360, 0.045)
frm.amortize().take(365).foreach(println _)
val arm: Adjustabl... | fijimf/msfcf | msfcf-core/src/main/scala/com/fijimf/Main.scala | Scala | mit | 578 |
/*
* Copyright 2014-2022 Netflix, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agr... | Netflix/atlas | atlas-eval/src/main/scala/com/netflix/atlas/eval/graph/Grapher.scala | Scala | apache-2.0 | 18,604 |
package org.bitcoins.core.serializers.p2p.messages
import org.bitcoins.core.bloom.BloomUpdateNone
import org.bitcoins.core.number.{UInt32, UInt64}
import org.bitcoins.core.protocol.CompactSizeUInt
import org.bitcoins.core.util.BytesUtil
import org.bitcoins.testkitcore.util.BitcoinSUnitTest
/** Created by chris on 7/2... | bitcoin-s/bitcoin-s | core-test/src/test/scala/org/bitcoins/core/serializers/p2p/messages/RawFilterLoadMessageSerializerTest.scala | Scala | mit | 1,123 |
package org.jetbrains.sbt
package project
import java.io.File
import com.intellij.openapi.externalSystem.model.project._
import com.intellij.openapi.externalSystem.model.task.{ExternalSystemTaskId, ExternalSystemTaskNotificationEvent, ExternalSystemTaskNotificationListener}
import com.intellij.openapi.externalSystem.... | advancedxy/intellij-scala | src/org/jetbrains/sbt/project/SbtProjectResolver.scala | Scala | apache-2.0 | 18,507 |
import io.hydrosphere.mist.api.MistJob
object TestError extends MistJob {
/** Contains implementation of spark job with ordinary [[org.apache.spark.SparkContext]]
* Abstract method must be overridden
*
* @return result exception Test Error
*/
def execute(): Map[String, Any] = {
throw new Except... | KineticCookie/mist | examples-spark1/src/main/scala/TestError.scala | Scala | apache-2.0 | 343 |
/** Copyright 2014 TappingStone, 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 ... | TheDataShed/PredictionIO | data/src/main/scala/examples/TestHBase.scala | Scala | apache-2.0 | 1,682 |
package chat.tox.antox.utils
import android.content.{BroadcastReceiver, Context, Intent}
/**
* This Broadcast Receiver will pick up the phone booting up and will proceed to start the tox service
*/
class BootReceiver extends BroadcastReceiver {
override def onReceive(context: Context, intent: Intent): Unit = {
... | wiiam/Antox | app/src/main/scala/chat/tox/antox/utils/BootReceiver.scala | Scala | gpl-3.0 | 631 |
package org.scalameta.internal
import scala.reflect.macros.blackbox.Context
trait MacroCompat {
val c: Context
import c.universe._
val AssignOrNamedArg = NamedArg
type AssignOrNamedArg = NamedArg
}
object MacroCompat {
val productFieldNamesAvailable = true
}
object ScalaCompat {
// Removed in 2.13
tra... | scalameta/scalameta | scalameta/common/shared/src/main/scala-2.13/org/scalameta/internal/MacroCompat.scala | Scala | bsd-3-clause | 460 |
package org.amcgala.vr
import scala.concurrent.{ Promise, Future }
import org.amcgala.vr.BrainModes.BrainMode
import org.amcgala.vr.need.{ NeedManager, Need }
import org.amcgala.vr.need.Needs.NeedIDs.NeedID
object BrainModes {
sealed trait BrainMode
case object NeedMode extends BrainMode
case object JobMode ... | th-koeln/amcgala-vr | src/main/scala/org/amcgala/vr/task/TaskManagement.scala | Scala | apache-2.0 | 3,439 |
package pl.edu.agh.mplt.parser.declaration.objective
import scala.util.parsing.combinator.JavaTokenParsers
import pl.edu.agh.mplt.parser.phrase.set.Indexing
import pl.edu.agh.mplt.parser.phrase.expression.Expression
import language.postfixOps
trait ObjectiveDeclarationAMPLParser extends JavaTokenParsers {
... | marek1840/MPLT | src/main/scala/pl/edu/agh/mplt/parser/declaration/objective/ObjectiveDeclarationAMPLParser.scala | Scala | mit | 923 |
trait Foo {
def name: String
val message = "hello, " + name // error
}
class Bar extends Foo {
def name = message
}
| som-snytt/dotty | tests/init/neg/override9.scala | Scala | apache-2.0 | 125 |
/*
* 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... | scalatest/scalatest | jvm/scalatest-test/src/test/scala/org/scalatest/ShorthandShouldBeThrownBySpec.scala | Scala | apache-2.0 | 4,886 |
package service
import model.Profile._
import profile.simple._
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: (Session) => A): A = {
util.FileUtil.withTmpDir(new File(F... | tb280320889/TESTTB | src/test/scala/service/ServiceSpecBase.scala | Scala | apache-2.0 | 738 |
package model
import org.joda.time.DateTime
case class User(token: String)
case class Folder(id: Long, title: String)
case class Link(url: String, code: String)
case class Click(date: DateTime, remoteIp: String)
case class CodeInfo(url: String, idFolder: Long, var clicks: List[Click])
object Config{
val defaul... | Claus1/play-test | app/model/models.scala | Scala | mit | 336 |
package im.actor.server.group
import java.time.ZoneOffset
import im.actor.server.migrations.Migration
import slick.driver.PostgresDriver
import scala.concurrent.duration._
import scala.concurrent.{ Await, ExecutionContext, Future, Promise }
import akka.actor.{ ActorLogging, ActorSystem, Props }
import akka.pattern.p... | dsaved/africhat-platform-0.1 | actor-server/actor-core/src/main/scala/im/actor/server/group/GroupMigrator.scala | Scala | mit | 5,147 |
package charactor.core.messages
class DroppedDeadMessage(val obj: Any)
{
}
| PiotrTrzpil/charactor | src/charactor/core/messages/DroppedDeadMessage.scala | Scala | apache-2.0 | 76 |
package lonelyInteger
import scala.io.Source.stdin
object Solution {
def main(args: Array[String]) {
val lines = stdin.getLines()
println(solve(lines.next().toInt, lines.next()))
}
def solve(numberOfIntegers: Int, line: String): Int = {
line.split(" ").map(_.toInt).reduce(_ ^ _)
}
} | alexandrnikitin/HackerRank.scala | src/main/scala/lonelyInteger/Solution.scala | Scala | mit | 308 |
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.