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 |
|---|---|---|---|---|---|
trait Expr { type T }
def foo[A](e: Expr { type T = A }) = e match
case e1: Expr { type T <: Int } =>
val i: Int = ??? : e1.T | dotty-staging/dotty | tests/pos/i13820.scala | Scala | apache-2.0 | 132 |
/*
* Copyright (c) 2017 sadikovi
*
* 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, publish, d... | sadikovi/riff | format/src/test/scala/com/github/sadikovi/riff/TypeDescriptionSuite.scala | Scala | mit | 13,951 |
/*
* 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 ... | martindale/zipkin | zipkin-common/src/main/scala/com/twitter/zipkin/common/BinaryAnnotation.scala | Scala | apache-2.0 | 794 |
package repositories.storage.dao.nodes
import com.google.inject.{Inject, Singleton}
import models.storage.nodes.StorageType.RootLoanType
import models.storage.nodes._
import models.storage.nodes.dto.{StorageNodeDto, StorageUnitDto}
import no.uio.musit.MusitResults._
import no.uio.musit.functional.Implicits.futureMonad... | MUSIT-Norway/musit | service_backend/app/repositories/storage/dao/nodes/StorageUnitDao.scala | Scala | gpl-2.0 | 21,104 |
/*
* Copyright © 2015 Lukas Rosenthaler, Benjamin Geer, Ivan Subotic,
* Tobias Schweizer, André Kilchenmann, and Sepideh Alassi.
* This file is part of Knora.
* Knora is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published
* by the Free So... | nie-ine/Knora | webapi/src/test/scala/org/knora/webapi/e2e/v1/StoreRouteV1E2ESpec.scala | Scala | agpl-3.0 | 4,005 |
package net.dinkla.lbnn.spark
import com.esotericsoftware.kryo.Kryo
import net.dinkla.lbnn.utils.TextDate
import org.apache.spark.serializer.KryoRegistrator
/**
* Created by dinkla on 19/06/15.
*/
class CustomKryoRegistrator extends KryoRegistrator {
override def registerClasses(kryo: Kryo) {
kryo.register(... | jdinkla/location-based-nearest-neighbours | src/main/scala/net/dinkla/lbnn/spark/CustomKryoRegistrator.scala | Scala | apache-2.0 | 381 |
package io.getquill.context.cassandra
import io.getquill.{ CassandraMonixContext, Literal }
package object monix {
lazy val testMonixDB = new CassandraMonixContext(Literal, "testStreamDB") with CassandraTestEntities
}
| getquill/quill | quill-cassandra-monix/src/test/scala/io/getquill/context/cassandra/monix/package.scala | Scala | apache-2.0 | 221 |
/*
* Copyright (c) 2015, Nightfall Group
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of conditions a... | Nightfall/Instrumentality | core/src/main/scala/moe/nightfall/instrumentality/animations/PoseAnimation.scala | Scala | bsd-2-clause | 2,458 |
package com.codingkapoor.codingbat
import org.scalatest.{FlatSpec, Matchers}
class RecursionIISpec extends FlatSpec with Matchers {
"""Given an array of ints, method "groupSum"""" should """evaluate if it is possible to choose a group of some of the ints, such that the group sums to the given target?""" in {
R... | codingkapoor/scala-coding-bat | src/test/scala/com/codingkapoor/codingbat/RecursionIISpec.scala | Scala | mit | 4,371 |
package org.nisshiee.toban.controller.api
import org.specs2._
import play.api.test._
import play.api.test.Helpers._
import play.api.Play.current
import play.api.db._
import play.api.libs.json._, Json._
import org.nisshiee.toban.model._
import org.nisshiee.toban.test.TestHelper
class MemberApiControllerTest extends S... | nisshiee/to-ban | test/controllers/api/MemberApiControllerTest.scala | Scala | mit | 1,675 |
package com.aristocrat.mandrill.requests.Templates
import com.aristocrat.mandrill.requests.MandrillRequest
case class Update(
key: String,
name: String,
fromEmail: String,
fromName: String,
subject: String,
code: String,
text: String,
publish: Boolean,
labels: Seq[String]) extends ... | aristocratic/mandrill | src/main/scala/com/aristocrat/mandrill/requests/Templates/Update.scala | Scala | mit | 336 |
package net.sansa_stack.rdf.spark.model.ds
import net.sansa_stack.rdf.spark.utils._
import org.apache.jena.graph.{ Node, Triple }
import org.apache.spark.rdd.RDD
import org.apache.spark.sql._
import org.apache.spark.sql.types.{ StringType, StructField, StructType }
/**
* Spark based implementation of Dataset of tri... | SANSA-Stack/Spark-RDF | sansa-rdf-spark/src/main/scala/net/sansa_stack/rdf/spark/model/ds/TripleOps.scala | Scala | gpl-3.0 | 8,681 |
/**
* 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... | ijuma/kafka | core/src/main/scala/kafka/coordinator/MemberMetadata.scala | Scala | apache-2.0 | 4,643 |
/*
* 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 ... | bowenli86/flink | flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/plan/nodes/calcite/LogicalExpand.scala | Scala | apache-2.0 | 2,085 |
package org.brijest.storm.engine
package gui
import javax.media.opengl._
import javax.media.opengl.awt.GLCanvas
import javax.media.opengl.glu.GLU
import GL._
import GL2._
import GL2ES1._
import GL2ES2._
import fixedfunc.GLLightingFunc._
import fixedfunc.GLMatrixFunc._
import org.scalagl._
import model._
import colle... | axel22/scala-2d-game-editor | src/main/scala/org/brijest/storm/engine/gui/iso/package.scala | Scala | bsd-3-clause | 3,391 |
package repos.jdbc
/** Table Janitor is a process that is responsible to ensure that all index tables
* are being updated. It also populates new indexes.
*
* It is possible that one of the repo users is running an old binary that does not
* write to some index on insert. Table Janitor can ensure that everythi... | trueaccord/repos | src/main/scala/repos/jdbc/TableJanitor.scala | Scala | apache-2.0 | 13,355 |
/* 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 write_model
import java.util.UUID
import cqrs.command.{EventBus, AggregateRootFactory}
import write_model... | cqrs-endeavour/cqrs-framework-sample | src/main/scala/write_model/AccountFactory.scala | Scala | mpl-2.0 | 718 |
package com.twitter.finagle.exp
import com.twitter.finagle._
import com.twitter.finagle.client.{StackClient, StdStackClient, DefaultPool}
import com.twitter.finagle.exp.mysql._
import com.twitter.finagle.exp.mysql.transport.{MysqlTransporter, Packet}
import com.twitter.finagle.param.ProtocolLibrary
import com.twitter.... | travisbrown/finagle | finagle-mysql/src/main/scala/com/twitter/finagle/Mysql.scala | Scala | apache-2.0 | 5,706 |
final class X
final class Y
object Test1 {
trait Test {
type Type
// This is testing that both permutations of the types in a &
// are taken into account by the intersection test
val i: Bar[Y & Type] = 1 // error
}
type Bar[A] = A match {
case X & Y => String
case Y => Int
}
}
object ... | som-snytt/dotty | tests/neg/6314.scala | Scala | apache-2.0 | 1,870 |
package org.scalamu
import org.scalamu.core.api._
package object core {
def die(failure: RemoteProcessFailure): Nothing = die(failure.exitCode)
def die(exitValue: Int): Nothing = sys.exit(exitValue)
}
| sugakandrey/scalamu | core/src/main/scala/org/scalamu/core/package.scala | Scala | gpl-3.0 | 222 |
package pipelines
import org.scalatest.Suite
import org.scalatest.BeforeAndAfterEach
import org.apache.spark.SparkContext
// TODO: delete this file and use the version from Spark once SPARK-750 is fixed.
/** Manages a local `sc` {@link SparkContext} variable, correctly stopping it after each test. */
trait LocalSpa... | concretevitamin/keystone | src/test/scala/pipelines/LocalSparkContext.scala | Scala | apache-2.0 | 1,029 |
package org.jetbrains.plugins.scala
package lang
package parser
package parsing
package params
import org.jetbrains.plugins.scala.lang.lexer.ScalaTokenTypes
import org.jetbrains.plugins.scala.lang.parser.parsing.builder.ScalaPsiBuilder
import org.jetbrains.plugins.scala.lang.parser.util.ParserUtils
/**
* @author Alex... | loskutov/intellij-scala | src/org/jetbrains/plugins/scala/lang/parser/parsing/params/TypeParamClause.scala | Scala | apache-2.0 | 1,641 |
/*
* 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 ... | michalsenkyr/spark | sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/continuous/WriteToContinuousDataSourceExec.scala | Scala | apache-2.0 | 2,977 |
/*
* The MIT License
*
* Copyright (c) 2011 Vladimir Kirichenko <vladimir.kirichenko@gmail.com>
*
* 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 wit... | vladimirk/butter4s | http/src/butter4s/net/Url.scala | Scala | mit | 1,299 |
/*
* Copyright (c) 2002-2018 "Neo Technology,"
* Network Engine for Objects in Lund AB [http://neotechnology.com]
*
* This file is part of Neo4j.
*
* Neo4j 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 Foundatio... | HuangLS/neo4j | community/cypher/cypher/src/test/scala/org/neo4j/cypher/RunWithConfigTestSupport.scala | Scala | apache-2.0 | 1,275 |
/*
* Copyright (c) 2002-2018 "Neo Technology,"
* Network Engine for Objects in Lund AB [http://neotechnology.com]
*
* This file is part of Neo4j.
*
* Neo4j 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 Foundatio... | HuangLS/neo4j | community/cypher/cypher-compiler-2.3/src/main/scala/org/neo4j/cypher/internal/compiler/v2_3/commands/expressions/ReduceFunction.scala | Scala | apache-2.0 | 2,536 |
package suzaku.ui
trait ComponentBlueprint extends Blueprint {
def create: Component[_ <: ComponentBlueprint, _]
def sameAs(that: this.type): Boolean = equals(that)
}
| suzaku-io/suzaku | core-app/shared/src/main/scala/suzaku/ui/ComponentBlueprint.scala | Scala | apache-2.0 | 173 |
/*
* Copyright 2001-2009 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... | yyuu/scalatest | src/test/scala/org/scalatest/junit/junit4helpers/TestWasCalledSuite.scala | Scala | apache-2.0 | 2,964 |
import enumeratum.values.{LongEnum, LongEnumEntry}
import pl.iterators.kebs.json.{KebsEnumFormats, KebsSpray}
import spray.json._
import org.scalatest.funsuite.AnyFunSuite
import org.scalatest.matchers.should.Matchers
class SprayValueEnumJsonFormatTests extends AnyFunSuite with Matchers {
sealed abstract class LongG... | theiterators/kebs | spray-json/src/test/scala/SprayValueEnumJsonFormatTests.scala | Scala | mit | 1,291 |
package com.daodecode.scalaj.collection.test
import java.util
import java.util.Arrays.asList
import scala.collection.immutable.{Seq => ImSeq}
import scala.collection.mutable.{Buffer => MBuffer, Map => MMap, Set => MSet}
import scala.reflect.ClassTag
import com.daodecode.scalaj.collection._
import org.scalatest.{Matc... | jozic/scalaj | scalaj-collection/src/test/scala_2.13-/com/daodecode/scalaj/collection/test/SimpleSConvertersTest.scala | Scala | bsd-3-clause | 10,704 |
/*
* 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 | sql/core/src/test/scala/org/apache/spark/sql/execution/TestShuffleMemoryManager.scala | Scala | apache-2.0 | 1,920 |
/*
* Copyright 2017-2018 47 Degrees, LLC. <http://www.47deg.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless require... | frees-io/freestyle | modules/integrations/doobie/src/main/scala/free/doobie.scala | Scala | apache-2.0 | 1,324 |
import scala.util.TupledFunction
object Test {
def main(args: Array[String]): Unit = {
type T
type R
summon[TupledFunction[Nothing, ((T, T, T)) => R]] // error
summon[TupledFunction[Any, ((T, T, T)) => R]] // error
summon[TupledFunction[Tuple1[Int], ((T, T, T)) => R]] // error
summon[Tupled... | dotty-staging/dotty | tests/disabled/neg/tupled-function-instances.scala | Scala | apache-2.0 | 878 |
/*
* Copyright (c) 2013 Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Fou... | tesendic/Relite | src/generated/scala/UnsupervisedTrainingSet.scala | Scala | agpl-3.0 | 1,084 |
/*
* 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 ... | brad-kaiser/spark | sql/core/src/test/scala/org/apache/spark/sql/GeneratorFunctionSuite.scala | Scala | apache-2.0 | 10,773 |
package core.modules
import com.google.inject.AbstractModule
import com.sksamuel.elastic4s.{ElasticClient, ElasticsearchClientUri}
import models.SiteSchema
import org.elasticsearch.common.settings.ImmutableSettings
import play.api.{Logger, Environment, Configuration}
import com.sksamuel.elastic4s.ElasticDsl._
import c... | moatra/stagert | app/core/modules/PlayModule.scala | Scala | mit | 2,045 |
// diversity-maximization: Diversity maximization in Streaming and MapReduce
// Copyright (C) 2016 Matteo Ceccarello <ceccarel@dei.unipd.it>
//
// 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... | Cecca/diversity-maximization | core/src/bench/scala/it/unipd/dei/diversity/FarthestHeuristicBench.scala | Scala | gpl-3.0 | 1,848 |
/*
* 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 | resource-managers/kubernetes/core/src/main/scala/org/apache/spark/scheduler/cluster/k8s/ExecutorPodsSnapshot.scala | Scala | apache-2.0 | 4,863 |
/**
* 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... | ijuma/kafka | core/src/main/scala/kafka/consumer/ZookeeperConsumerConnector.scala | Scala | apache-2.0 | 46,619 |
package com.typesafe.sbt.packager.archetypes
package jlink
import scala.sys.process.{BasicIO, Process, ProcessBuilder}
import sbt._
import sbt.Keys._
import com.typesafe.sbt.SbtNativePackager.{Debian, Universal}
import com.typesafe.sbt.packager.Keys.{bundledJvmLocation, packageName}
import com.typesafe.sbt.packager.Co... | Sciss/sbt-native-packager | src/main/scala/com/typesafe/sbt/packager/archetypes/jlink/JlinkPlugin.scala | Scala | bsd-2-clause | 10,985 |
package concrete
import org.scalatest.FlatSpec
import org.scalatest.Matchers
import org.scalacheck.Gen
import org.scalatestplus.scalacheck.ScalaCheckPropertyChecks
final class IntDomainTest extends FlatSpec with Matchers with ScalaCheckPropertyChecks {
"IntDomain" should "find next/prev" in {
val b = IntDomain... | concrete-cp/concrete | src/test/scala/concrete/IntDomainTest.scala | Scala | lgpl-2.1 | 5,586 |
package ca.uqam.euler.nicolas
import scala.collection.immutable.SortedMap
object Problem031 {
object CoinMap {
val coins = List(200, 100, 50, 20, 10, 5, 2, 1)
val empty = CoinMap(coins.map(_ -> 0).toMap)
}
case class CoinMap(m: Map[Int, Int]) {
val sum = m.map(e => e._1 * e._2).sum
def add(coin... | nicolaspayette/project-euler | src/main/scala/ca/uqam/euler/nicolas/Problem031.scala | Scala | mit | 1,064 |
package dotty.communitybuild
import java.nio.file.Paths
import java.nio.file.Path
import java.nio.file.Files
import scala.sys.process._
import CommunityBuildRunner.run
object Main:
private def generateDocs(project: CommunityProject): Seq[Path] =
val name = project.project
try
project.doc()
val... | lampepfl/dotty | community-build/src/scala/dotty/communitybuild/Main.scala | Scala | apache-2.0 | 4,225 |
package test
import org.specs2.mutable.Specification
import java.io.IOException
import java.net.InetSocketAddress
import java.lang.reflect.Proxy
import org.apache.avro.specific.SpecificData
import org.apache.avro.ipc.netty.NettyServer
import org.apache.avro.ipc.netty.NettyTransceiver
import org.apache.avro.ipc.Serve... | julianpeeters/sbt-avrohugger | src/sbt-test/avrohugger/SpecificVectorSerializationTests/src/test/scala/specific/SpecificRPCTest.scala | Scala | apache-2.0 | 2,218 |
/* Copyright 2009-2016 EPFL, Lausanne */
object CaseObject1 {
abstract sealed class A
case class B(size: Int) extends A
case object C extends A
def foo(): A = {
C
}
def foo1(a: A): A = a match {
case C => a
case B(s) => a
}
def foo2(a: A): A = a match {
case c @ C => c
case B(s... | regb/leon | src/test/resources/regression/verification/purescala/valid/CaseObject1.scala | Scala | gpl-3.0 | 334 |
package sql
import scala.virtualization.lms.common._
trait QueryAST {
type Table
type Schema = Vector[String]
// relational algebra ops
sealed abstract class Operator
case class Scan(name: Table, schema: Schema, delim: Char, extSchema: Boolean) extends Operator
case class PrintCSV(parent: Operator) e... | RomanTsegelskyi/lms-truffle | src/main/scala/sql/QueryAST.scala | Scala | gpl-2.0 | 1,189 |
package jinesra.vkMessageHistory
import scalax.file.Path
object IO {
def readFromFile(path: String) = {
Path.fromString(path).lines(includeTerminator = true).
dropWhile { _.isEmpty }.
takeWhile { _.nonEmpty }.
fold("")((wholeString, newLine) => wholeString ++ newLine)
}
def writeToFi... | arsenij-solovjev/vkMessageHistory | src/main/scala/jinesra/vkMessageHistory/IO.scala | Scala | apache-2.0 | 504 |
package lila.event
import org.joda.time.DateTime
import play.api.data._
import play.api.data.Forms._
import play.api.i18n.Lang
import lila.common.Form.stringIn
import lila.common.Form.UTCDate._
import lila.i18n.LangList
import lila.user.User
object EventForm {
object icon {
val default = ""
val broadcas... | luanlv/lila | modules/event/src/main/EventForm.scala | Scala | mit | 3,574 |
package se.meldrum.machine.http.routes
import akka.http.scaladsl.server.Directives._
import se.meldrum.machine.dao.TaskDao
import se.meldrum.machine.db.models.Task
import slick.driver.PostgresDriver.api._
import scala.concurrent.{ExecutionContext, Future}
import scala.util.{Failure, Success}
class TaskRoute(implicit ... | Max-Meldrum/machine | src/main/scala/se/meldrum/machine/http/routes/TaskRoute.scala | Scala | apache-2.0 | 947 |
/*
* Artificial Intelligence for Humans
* Volume 2: Nature Inspired Algorithms
* Java Version
* http://www.aifh.org
* http://www.jeffheaton.com
*
* Code repository:
* https://github.com/jeffheaton/aifh
*
* Copyright 2014 by Jeff Heaton
*
* Licensed under the Apache License, Version 2.0 (the "License");
* y... | PeterLauris/aifh | vol2/vol2-scala-examples/src/main/scala/com/heatonresearch/aifh/genetic/crossover/SpliceNoRepeat.scala | Scala | apache-2.0 | 3,678 |
/**
* Copyright (C) 2011 Orbeon, Inc.
*
* This program is free software; you can redistribute it and/or modify it under the terms of the
* GNU Lesser General Public License as published by the Free Software Foundation; either version
* 2.1 of the License, or (at your option) any later version.
*
* This prog... | orbeon/orbeon-forms | xforms-runtime/shared/src/main/scala/org/orbeon/oxf/xforms/event/events/XXFormsSetindexEvent.scala | Scala | lgpl-2.1 | 1,191 |
package edu.uchicago.cs.encsel.dataset.feature
import java.io.File
import edu.uchicago.cs.encsel.dataset.column.Column
import edu.uchicago.cs.encsel.model.DataType
import org.junit.Assert.assertEquals
import org.junit.Test
class AvgRunLengthTest {
@Test
def testExtract: Unit = {
val col = new Column(null, -... | harperjiang/enc-selector | src/test/scala/edu/uchicago/cs/encsel/dataset/feature/AvgRunLengthTest.scala | Scala | apache-2.0 | 667 |
/*
* Copyright (c) 2014-2016
* nonblocking.at gmbh [http://www.nonblocking.at]
*
* This file is part of Cliwix.
*
* Cliwix is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the... | nonblocking/cliwix | cliwix-core/src/main/scala/at/nonblocking/cliwix/core/util/ResourceAwareCollectionFactory.scala | Scala | agpl-3.0 | 2,548 |
/**
* Copyright 2009 Jorge Ortiz
*
* 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... | mamdouhweb/nscala-time | src/main/scala/com/github/nscala_time/time/RichLocalDateTime.scala | Scala | apache-2.0 | 2,402 |
/*
* 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... | chipsenkbeil/incubator-toree | plugins/src/test/scala-2.11/org/apache/toree/plugins/dependencies/ClassLoaderHelper.scala | Scala | apache-2.0 | 1,155 |
/*
* Copyright (C) 2013 Alcatel-Lucent.
*
* See the NOTICE file distributed with this work for additional
* information regarding copyright ownership.
* Licensed 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 cop... | molecule-labs/molecule | molecule-benchmarks/src/main/scala/molecule/benchmarks/comparison/molecule/executors/TrampolineTPExecutorLog.scala | Scala | apache-2.0 | 4,088 |
package org.jetbrains.plugins.scala
package codeInspection
package typeChecking
import com.intellij.codeInspection.LocalInspectionTool
import com.intellij.testFramework.EditorTestUtil.{SELECTION_END_TAG => END, SELECTION_START_TAG => START}
/**
* Nikolay.Tropin
* 9/26/13
*/
abstract class ComparingUnrelatedType... | loskutov/intellij-scala | test/org/jetbrains/plugins/scala/codeInspection/typeChecking/ComparingUnrelatedTypesInspectionTest.scala | Scala | apache-2.0 | 14,697 |
/**
* (c) Copyright 2014 WibiData, Inc.
*
* See the NOTICE file distributed with this work for additional
* information regarding copyright ownership.
*
* 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... | kijiproject/kiji-express | kiji-express/src/test/scala/org/kiji/express/flow/EntityIdSuite.scala | Scala | apache-2.0 | 19,093 |
trait D {
trait Manifest {
class Entry
}
val M: Manifest
def m: M.Entry = ???
}
object D1 extends D {
object M extends Manifest
}
object D2 extends D {
val M: Manifest = ???
}
object Hello {
def main(args: Array[String]) {
// 2.10.3 - ok
// 2.11.0-M7 - type mismatch; found : Seq[DB1.MANI... | loskutov/intellij-scala | testdata/scalacTests/pos/t8054.scala | Scala | apache-2.0 | 481 |
package com.outr.arango.collection
import com.outr.arango.core.ArangoDBCollection
import com.outr.arango.{CollectionType, Document, DocumentModel, Graph}
import fabric.Value
class DocumentCollection[D <: Document[D]](protected[arango] val graph: Graph,
protected[arango] val ... | outr/scarango | driver/src/main/scala/com/outr/arango/collection/DocumentCollection.scala | Scala | mit | 974 |
package org.atnos.eff.syntax
import org.atnos.eff._
import org.atnos.eff.concurrent.Scheduler
import scala.concurrent.duration.FiniteDuration
import scala.concurrent.{ExecutionContext, Future}
trait future {
implicit final def toFutureOps[R, A](e: Eff[R, A]): FutureOps[R, A] = new FutureOps[R, A](e)
}
object fu... | etorreborre/eff-cats | shared/src/main/scala/org/atnos/eff/syntax/future.scala | Scala | mit | 1,541 |
package com.github.cuzfrog.webdriver
import org.openqa.selenium.{WebDriver, WebElement}
private[webdriver] sealed trait Container {
val driver: Driver
}
private[webdriver] case class DriverContainer(driver: Driver, seleniumDriver: WebDriver) extends Container {
val elements = scala.collection.mutable.ArrayBuffer.... | cuzfrog/WebDriverServ | server/src/main/scala/com/github/cuzfrog/webdriver/Container.scala | Scala | apache-2.0 | 619 |
package org.machine.engine.graph.commands
import reflect.runtime.universe._
// import scala.collection._
// import scala.collection.generic._
import scala.collection.mutable.{ArrayBuffer, ListBuffer, Map}
import org.machine.engine.exceptions._
import org.machine.engine.graph.nodes.PropertyDefinitions
object GraphCo... | sholloway/graph-engine | src/main/scala/org/machine/engine/graph/commands/GraphCommandOptions.scala | Scala | mit | 5,152 |
package app.board.utils
import com.typesafe.config.ConfigFactory
trait Config {
private val config = ConfigFactory.load()
private val httpConfig = config.getConfig("http")
private val databaseConfig = config.getConfig("database")
val httpHost = httpConfig.getString("interface")
val httpPort = httpConfig.ge... | hwshim0810/scalable-board | src/main/scala/app/board/utils/Config.scala | Scala | gpl-3.0 | 488 |
/*
* Copyright (C) 2011 Mikhail Vorozhtsov
*
* 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... | mvv/sawoko | src/Fork.scala | Scala | apache-2.0 | 2,074 |
/*
* Copyright 2015 Dmitriy Yefremov
*
* 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... | dmitriy-yefremov/sleipnir | sample-data/src/test/scala/scala/net/yefremov/sleipnir/test/map/MapTest.scala | Scala | apache-2.0 | 3,757 |
/*
* (c) Copyright 2016 Hewlett Packard Enterprise Development LP
*
* 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 b... | hpe-cct/cct-core | src/main/scala/cogdebugger/ui/fieldvisualizations/scalar/ScatterPlot.scala | Scala | apache-2.0 | 4,313 |
package io.iohk.ethereum.jsonrpc
import akka.actor.ActorSystem
import akka.testkit.{TestKit, TestProbe}
import io.iohk.ethereum._
import io.iohk.ethereum.blockchain.sync.regular.RegularSync.NewCheckpoint
import io.iohk.ethereum.consensus.Consensus
import io.iohk.ethereum.consensus.ethash.EthashConfig
import io.iohk.et... | input-output-hk/etc-client | src/test/scala/io/iohk/ethereum/jsonrpc/QAServiceSpec.scala | Scala | mit | 4,155 |
package io.escalante.quickstarts.lift.jpa
import org.jboss.logging.Logger
/**
* Logging interface.
*
* @author Galder Zamarreño
* @since 1.0
*/
trait Log {
private lazy val log = Logger.getLogger(getClass.getPackage.getName)
def error(t: Throwable, msg: => String) {
log.errorf(t, msg)
}
}
| escalante/escalante-quickstart | library-lift-jpa/src/main/scala/io/escalante/quickstarts/lift/jpa/Log.scala | Scala | apache-2.0 | 316 |
package com.delprks.productservicesprototype.client
import java.sql.Timestamp
import com.delprks.productservicesprototype.config.Config
import com.delprks.productservicesprototype.domain.{Offer, OfferEvent, Status}
import org.joda.time.DateTime
import slick.driver.PostgresDriver.api._
import scala.language.implicitC... | delprks/product-services-prototype | src/main/scala/com/delprks/productservicesprototype/client/OfferClient.scala | Scala | mit | 6,221 |
/*
* 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 ... | aosagie/spark | core/src/main/scala/org/apache/spark/scheduler/EventLoggingListener.scala | Scala | apache-2.0 | 16,057 |
package im.tox.antox.callbacks
import android.content.{SharedPreferences, Context}
import android.net.ConnectivityManager
import android.preference.PreferenceManager
import im.tox.antox.data.{State, AntoxDB}
import im.tox.antox.tox.{MessageHelper, Reactive, ToxSingleton}
import im.tox.antox.utils.{ConnectionTypeChange... | Ansa89/Antox | app/src/main/scala/im/tox/antox/callbacks/AntoxOnConnectionStatusCallback.scala | Scala | gpl-3.0 | 2,353 |
/*
* 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 ... | jackylk/incubator-carbondata | examples/spark/src/main/scala/org/apache/carbondata/benchmark/ConcurrentQueryBenchmark.scala | Scala | apache-2.0 | 18,374 |
package io.zengin.telegrambot.types
import java.io.{FileInputStream, InputStream, File => JFile}
trait InputFile {
val name: String
val mimeType: String = "application/octet-stream"
val bytes: Array[Byte]
}
object InputFile {
def apply(filePath: String): InputFile = apply(new JFile(filePath))
def apply(f... | hzengin/telegrambot | src/main/scala/io/zengin/telegrambot/types/InputFile.scala | Scala | mit | 616 |
/*
* Copyright (c) 2002-2018 "Neo Technology,"
* Network Engine for Objects in Lund AB [http://neotechnology.com]
*
* This file is part of Neo4j.
*
* Neo4j 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 Foundatio... | HuangLS/neo4j | community/cypher/frontend-2.3/src/test/scala/org/neo4j/cypher/internal/frontend/v2_3/ast/HexIntegerLiteralTest.scala | Scala | apache-2.0 | 2,278 |
/*
* Copyright (c) 2014-2018 by The Monix Project Developers.
* See the project homepage at: https://monix.io
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache... | Wogan/monix | monix-execution/jvm/src/test/scala/monix/execution/schedulers/TracingSchedulerServiceSuite.scala | Scala | apache-2.0 | 2,394 |
package org.bitcoins.testkit.node.fixture
import org.bitcoins.node.{NeutrinoNode, Node, SpvNode}
import org.bitcoins.rpc.client.common.BitcoindRpcClient
/** Gives us a fixture that has a SPV node connected with the bitcoind instance */
trait NodeConnectedWithBitcoind {
def node: Node
def bitcoind: BitcoindRpcClie... | bitcoin-s/bitcoin-s-core | testkit/src/main/scala/org/bitcoins/testkit/node/fixture/NodeConnectedWithBitcoind.scala | Scala | mit | 597 |
package com.twitter.finagle.exp
import com.twitter.conversions.time._
import com.twitter.finagle.{Service, SimpleFilter, NoStacktrace}
import com.twitter.finagle.stats.StatsReceiver
import com.twitter.util.{Future, Return, Throw, Duration, Timer}
/**
* Issue a backup request after `delay` time has elapsed. This is
... | foursquare/finagle | finagle-core/src/main/scala/com/twitter/finagle/exp/BackupRequestFilter.scala | Scala | apache-2.0 | 1,434 |
package com.twitter.inject.thrift
import com.twitter.conversions.DurationOps._
import com.twitter.finagle.http.Status.Ok
import com.twitter.finatra.http.{EmbeddedHttpServer, HttpTest}
import com.twitter.finatra.thrift.EmbeddedThriftServer
import com.twitter.greeter.thriftscala.Greeter
import com.twitter.inject.server.... | twitter/finatra | inject/inject-thrift-client/src/test/scala/com/twitter/inject/thrift/DoEverythingReqRepThriftMethodBuilderClientModuleFeatureTest.scala | Scala | apache-2.0 | 5,657 |
package io.vamp.pulse
import akka.actor.Actor
import io.vamp.common.ClassMapper
import io.vamp.common.akka.IoC
import io.vamp.common.vitals.{ InfoRequest, StatsRequest }
import io.vamp.model.resolver.NamespaceValueResolver
import io.vamp.pulse.Percolator.{ GetPercolator, RegisterPercolator, UnregisterPercolator }
impo... | magneticio/vamp | nats/src/main/scala/io/vamp/pulse/NatsPulseActor.scala | Scala | apache-2.0 | 1,677 |
/*
* This file is part of Evo2DSim.
*
* Evo2DSim is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Evo2DSim is distrib... | vchuravy/Evo2DSim | core/src/main/scala/org/vastness/evo2dsim/core/environment/mixins/foodSources/BlueTestSource.scala | Scala | mit | 1,061 |
package sclack.ui
import swing._
import scala.swing._
import swing.event._
import javax.swing.border.EmptyBorder
import sclack.ui.factories.{TextFieldFactory, TextAreaFactory}
/**
* The Credits dialog to respect the artists (and ego whoring :D)
* @author Simon Symeonidis
*/
class Credits extends Dialog {
val... | psyomn/sclack | src/main/scala/ui/Credits.scala | Scala | gpl-3.0 | 1,484 |
package com.twitter.finagle.http
import com.twitter.finagle.CancelledRequestException
import com.twitter.finagle.Failure
import com.twitter.finagle.context.Contexts
import com.twitter.finagle.context.RemoteInfo
import com.twitter.finagle.transport.Transport
import com.twitter.finagle.util.DefaultTimer
import com.twitt... | twitter/finagle | finagle-base-http/src/main/scala/com/twitter/finagle/http/GenStreamingSerialServerDispatcher.scala | Scala | apache-2.0 | 6,456 |
package org.openurp.edu.eams.teach.program.major.web.action
import java.util.Date
import java.util.Locale
import org.beangle.commons.collection.Collections
import org.beangle.data.jpa.dao.OqlBuilder
import org.beangle.commons.text.seq.SeqPattern
import org.openurp.edu.eams.teach.program.Program
import org.openurp.ed... | openurp/edu-eams-webapp | plan/src/main/scala/org/openurp/edu/eams/teach/program/major/web/action/ProgramDocAction.scala | Scala | gpl-3.0 | 5,032 |
package controllers.cadmin
import play.api._
import play.api.mvc._
import play.api.data._
import play.api.data.Forms._
import format.Formats._
import com.alibaba.fastjson.serializer._
import com.alibaba.fastjson.{JSON => FJSON}
import views._
import loom.models._
import loom.models.admin.{Role, APermission}
import co... | chaosky/loom | app/controllers/cadmin/Roles.scala | Scala | mit | 4,323 |
package net.hangyas.moss
import java.io.FileOutputStream
import scala.collection.mutable
/**
* Created by hangyas on 15-5-23
*/
object LexicalParser {
var char: Char = ' ';
var index = -1;
var str: String = null;
def parse(code: String): List[Token] = {
val r = new mutable.MutableList[Token]();
... | hangyas/moss | mossc/src/net/hangyas/moss/LexicalParser.scala | Scala | mit | 1,441 |
package io.citrine.lolo.validation
import io.citrine.lolo.TestUtils
import io.citrine.lolo.learners.RandomForest
import io.citrine.lolo.stats.functions.Friedman
import org.junit.Test
import scala.util.Random
class CrossValidationTest {
val rng = new Random(92486L)
/**
* Test that CV results are consistent w... | CitrineInformatics/lolo | src/test/scala/io/citrine/lolo/validation/CrossValidationTest.scala | Scala | apache-2.0 | 1,296 |
package io.prediction.controller
import org.scalatest.FunSuite
import org.scalatest.Inside
import org.scalatest.Matchers._
import org.scalatest.Inspectors._
import org.apache.spark.SparkContext
import org.apache.spark.SparkContext._
import org.apache.spark.SparkConf
import org.apache.spark.rdd.RDD
import io.predicti... | nvoron23/PredictionIO | core/src/test/scala/controller/FastEvalEngineTest.scala | Scala | apache-2.0 | 6,281 |
/*
* ____ ____ _____ ____ ___ ____
* | _ \\ | _ \\ | ____| / ___| / _/ / ___| Precog (R)
* | |_) | | |_) | | _| | | | | /| | | _ Advanced Analytics Engine for NoSQL Data
* | __/ | _ < | |___ | |___ |/ _| | | |_| | Copyright (C) 2010 - 2013 SlamData, In... | precog/platform | ingest/src/main/scala/com/precog/ingest/kafka/KafkaEventServer.scala | Scala | agpl-3.0 | 3,572 |
/**
* Created by Variant on 16/4/7.
*/
import scala.reflect.runtime.universe._
object Scala
class Java1
class JVM{def method1:this.type = this}
class JVM_Language extends JVM {def method2 : this.type = this}
object Singleton_Type {
def main(args: Array[String]) {
println(Scala.getClass)
println(typeOf[... | sparkLiwei/ProgrammingNote | scalaLearning/scalaInSpark/Singleton_Type.scala | Scala | cc0-1.0 | 704 |
package com.eharmony.aloha.models
/**
* Created by ryan on 1/18/17.
*/
case class Subvalue[+B, +N](audited: B, natural: Option[N]) {
def fold[A](fail: => A, success: N => A): A = natural.fold(fail)(success)
}
| eHarmony/aloha | aloha-core/src/main/scala/com/eharmony/aloha/models/Subvalue.scala | Scala | mit | 216 |
package im.actor.server.db
import com.github.tminglei.slickpg._
trait ActorPostgresDriver extends ExPostgresDriver
with PgDate2Support
with PgArraySupport
with PgLTreeSupport {
override val api = new API with ArrayImplicits with LTreeImplicits with DateTimeImplicits
}
object ActorPostgresDriver extends Acto... | yangchaogit/actor-platform | actor-server/actor-persist/src/main/scala/im/actor/server/db/ActorPostgresDriver.scala | Scala | mit | 335 |
package com.twitter.hello
import com.twitter.finagle.http.Status._
import com.twitter.finatra.http.test.EmbeddedHttpServer
import com.twitter.inject.server.FeatureTest
class HelloWorldFeatureTest extends FeatureTest {
override val server = new EmbeddedHttpServer(new HelloWorldServer)
"Server" should {
"Say ... | kaushik94/finatra | examples/finatra-hello-world/src/test/scala/com/twitter/hello/HelloWorldFeatureTest.scala | Scala | apache-2.0 | 450 |
package com.krux.hyperion.activity
import com.typesafe.config.ConfigFactory
import org.scalatest.WordSpec
import com.krux.hyperion.common.{PipelineObjectId, S3Uri}
import com.krux.hyperion.common.S3Uri._
import com.krux.hyperion.database.RedshiftDatabase
import com.krux.hyperion.HyperionContext
import com.krux.hyperi... | hoangelos/hyperion | contrib/activity/definition/src/test/scala/com/krux/hyperion/activity/RedshiftUnloadActivitySpec.scala | Scala | apache-2.0 | 2,072 |
object SCL8242 {
def foo(x: Float) = {
val t: Double = 56
if (true) x + t
else /*start*/x/*end*/
}
}
//Double | whorbowicz/intellij-scala | testdata/typeInference/bugs5/SCL8242.scala | Scala | apache-2.0 | 126 |
/**
* Copyright (C) 2009-2011 Scalable Solutions AB <http://scalablesolutions.se>
*/
package akka.util
import java.util.concurrent.TimeUnit
import TimeUnit._
import java.lang.{ Long => JLong, Double => JDouble }
object Duration {
def apply(length: Long, unit: TimeUnit): Duration = new FiniteDuration(length, unit... | felixmulder/scala | test/disabled/presentation/akka/src/akka/util/Duration.scala | Scala | bsd-3-clause | 14,619 |
package planstack.anml.model.concrete
import java.util
import planstack.anml.model.abs.AbstractDecomposition
import planstack.anml.model.concrete.statements.{BindingConstraint, Statement}
import planstack.anml.model.{AnmlProblem, Context}
import scala.collection.JavaConversions._
class Decomposition(
val contex... | planstack/anml | src/main/scala/planstack/anml/model/concrete/Decomposition.scala | Scala | apache-2.0 | 1,149 |
/* __ *\\
** ________ ___ / / ___ Scala API **
** / __/ __// _ | / / / _ | (c) 2003-2010, LAMP/EPFL **
** __\\ \\/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\\___/_/... | cran/rkafkajars | java/scala/collection/mutable/ArraySeq.scala | Scala | apache-2.0 | 3,428 |
package wallet
//import wallet.UserController
import org.springframework.boot.SpringApplication
object Application{
def main(args: Array[String]){
SpringApplication.run(classOf[UserController])
}
}
| shreedhar22/Restful-Digital-Wallet | src/main/scala/wallet/Application.scala | Scala | mit | 207 |
package codacy.plugins.test.multiple
import java.nio.file.Paths
import scala.xml.Elem
import com.codacy.analysis.core.model.{FileError, Issue, LineLocation, Parameter, Pattern, ToolResult}
import com.codacy.plugins.api
import com.codacy.plugins.api.results.Result.Level
import com.fasterxml.jackson.core.JsonParseExce... | codacy/codacy-plugins-test | src/main/scala/codacy/plugins/test/multiple/CheckstyleFormatParser.scala | Scala | mit | 3,553 |
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.