code stringlengths 5 1M | repo_name stringlengths 5 109 | path stringlengths 6 208 | language stringclasses 1
value | license stringclasses 15
values | size int64 5 1M |
|---|---|---|---|---|---|
/**
* Copyright (c) 2015, Cloudera, Inc. All Rights Reserved.
*
* Cloudera, Inc. 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/LIC... | superwaiwjia/spark-timeseries | src/main/scala/com/cloudera/sparkts/TimeSeriesRDD.scala | Scala | apache-2.0 | 20,839 |
//**************************************************************************
//--------------------------------------------------------------------------
// ercesiMIPS Single Cycle Processor Control path
//
// Meng zhang
// version 0.1
//--------------------------------------------------------------------------
//*****... | zavs/ercesiMIPS | src/main/scala/SingleCycle/CtlPath.scala | Scala | gpl-3.0 | 3,636 |
/* Title: Pure/Isar/keyword.scala
Author: Makarius
Isar keyword classification.
*/
package isabelle
object Keyword
{
/** keyword classification **/
/* kinds */
val DIAG = "diag"
val DOCUMENT_HEADING = "document_heading"
val DOCUMENT_BODY = "document_body"
val DOCUMENT_RAW = "document_raw... | larsrh/libisabelle | modules/pide/2018/src/main/scala/Isar/keyword.scala | Scala | apache-2.0 | 6,450 |
package com.codingkapoor.codingbat
object WarmupI {
def sleepIn(weekday: Boolean, vacation: Boolean): Boolean = {
!weekday || vacation
}
def monkeyTrouble(aSmile: Boolean, bSmile: Boolean): Boolean = {
(aSmile && bSmile) || (!aSmile && !bSmile)
}
def sumDouble(a: Int, b: Int): Int = {
if (a ==... | codingkapoor/scala-coding-bat | src/main/scala/com/codingkapoor/codingbat/WarmupI.scala | Scala | mit | 3,302 |
import org.apache.spark.mllib.clustering.{HierarchicalClustering, KMeans}
import org.apache.spark.mllib.linalg.Vectors
import org.apache.spark.mllib.linalg.Vector
import org.apache.spark.{SparkContext, SparkConf}
import org.apache.spark.rdd.RDD
import scala.util.parsing.json.JSONObject
object CompareWithKMeansApp {
... | yu-iskw/hierarchical-clustering-with-spark | src/main/scala/CompareWithKMeansApp.scala | Scala | apache-2.0 | 2,914 |
package controllers
package actions
package asset
import actors._
import forms._
import models.{Asset, AssetLifecycle, Status => AStatus, Truthy}
import util.{ApiTattler, UserTattler}
import util.concurrent.BackgroundProcessor
import util.config.Feature
import util.plugins.SoftLayer
import play.api.data._
import play... | sysbot/collins | app/controllers/actions/asset/ProvisionUtil.scala | Scala | apache-2.0 | 10,358 |
package org.scaladebugger.api.lowlevel.breakpoints
import com.sun.jdi.{Location, VirtualMachine}
import com.sun.jdi.request.{BreakpointRequest, EventRequest, EventRequestManager}
import org.scalamock.scalatest.MockFactory
import org.scalatest.{FunSpec, Matchers, ParallelTestExecution}
import org.scaladebugger.api.lowl... | chipsenkbeil/scala-debugger | scala-debugger-api/src/test/scala/org/scaladebugger/api/lowlevel/breakpoints/StandardBreakpointManagerSpec.scala | Scala | apache-2.0 | 21,684 |
package shred.man.cuda.cumath.tensor.matrix.ops
import shred.man.cuda.cumath.tensor.matrix.CuMatrix
import shred.man.cuda.driver.CuContext
import shred.man.cuda.cumath.operators.Assigner
import shred.man.cuda.cumath.CuValue
trait BitwiseImplicits
{
implicit def CuMatrixBitwiseOps(mat: CuMatrix) = new CuMatrixBitwis... | shredzzz/shredman | cuda/src/main/scala/shred/man/cuda/cumath/tensor/matrix/ops/bitwise.scala | Scala | apache-2.0 | 5,652 |
/*
* 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 ... | practice-vishnoi/dev-spark-1 | mllib/src/test/scala/org/apache/spark/mllib/random/RandomDataGeneratorSuite.scala | Scala | apache-2.0 | 5,263 |
package com.karasiq.torrentstream.frontend.components
import scala.scalajs.js.URIUtils
import scalatags.JsDom.all._
import rx._
import com.karasiq.bootstrap.{Bootstrap, BootstrapComponent}
import com.karasiq.bootstrap.BootstrapImplicits._
import com.karasiq.torrentstream.shared.TorrentInfo
final class TorrentInfoPa... | Karasiq/torrentstream | frontend/src/main/scala/com/karasiq/torrentstream/frontend/components/TorrentInfoPanel.scala | Scala | apache-2.0 | 1,468 |
package com.twitter.finagle.httpx
import com.twitter.conversions.storage._
import com.twitter.finagle._
import com.twitter.finagle.httpx.codec._
import com.twitter.finagle.httpx.filter.{DtabFilter, HttpNackFilter}
import com.twitter.finagle.stats.StatsReceiver
import com.twitter.finagle.tracing._
import com.twitter.fi... | lysu/finagle | finagle-httpx/src/main/scala/com/twitter/finagle/httpx/Codec.scala | Scala | apache-2.0 | 13,221 |
/*
* Copyright 2016 The BigDL Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agr... | psyyz10/BigDL | spark/dl/src/main/scala/com/intel/analytics/bigdl/nn/SoftMarginCriterion.scala | Scala | apache-2.0 | 3,931 |
/*
* Copyright (c) 2013-2014 Telefónica Investigación y Desarrollo S.A.U.
*
* 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
*
* Unles... | telefonicaid/fiware-cosmos-platform | cosmos-api/app/es/tid/cosmos/api/controllers/storage/InfinityConnection.scala | Scala | apache-2.0 | 1,519 |
/*
* 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 ... | gioenn/xSpark | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/basicLogicalOperators.scala | Scala | apache-2.0 | 27,289 |
package japgolly.scalajs.react
import japgolly.microlibs.compiletime.*
import japgolly.scalajs.react.internal.CompileTimeConfig
import japgolly.scalajs.react.util.Util.identityFn
trait ScalaJsReactConfig {
def automaticComponentName(name: String): String
def modifyComponentName(name: String): String
def reusabi... | japgolly/scalajs-react | coreGeneric/src/main/scala-3/japgolly/scalajs/react/ScalaJsReactConfig.scala | Scala | apache-2.0 | 4,937 |
/*
* 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 ... | Aegeaner/spark | sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/FallbackOrcDataSourceV2.scala | Scala | apache-2.0 | 2,247 |
package controllers
import play.api._
import play.api.mvc._
import models.Entry
import models.EntryFormat._
import models.EntryStatus._
object Snapshot extends Controller {
def posts() = Action {
val entries = Entry.findAllByFormat(Post, Published, 0, 10000)
Ok(views.html.snapshots.posts.render(entries.to... | zeroviscosity/snapp-stack-blog | final/app/controllers/Snapshot.scala | Scala | mit | 725 |
/**
* Copyright 2014 Getty Imges, 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... | Tecsisa/akka-http-swagger | src/main/scala/com/tecsisa/akka/http/swagger/AkkaHttpApiScanner.scala | Scala | apache-2.0 | 1,614 |
/*
* Copyright (C) Lightbend Inc. <https://www.lightbend.com>
*/
package com.lightbend.lagom.scaladsl.api.deser
import akka.util.ByteString
import com.lightbend.lagom.scaladsl.api.deser.MessageSerializer._
import com.lightbend.lagom.scaladsl.api.transport.DeserializationException
import com.lightbend.lagom.scaladsl... | lagom/lagom | service/scaladsl/api/src/test/scala/com/lightbend/lagom/scaladsl/api/deser/MessageSerializerSpec.scala | Scala | apache-2.0 | 3,185 |
/*
* Copyright 2018 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/paac-frontend | test/controllers/SelectSchemeControllerSpec.scala | Scala | apache-2.0 | 16,255 |
package com.arcusys.valamis.web.servlet.lesson
import com.arcusys.valamis.gradebook.model.Statistic
import com.arcusys.valamis.lesson.model.Lesson
import com.arcusys.valamis.web.servlet.course.CourseResponse
case class LessonWithAverageGradeResponse(lesson: Lesson,
course: Co... | igor-borisov/valamis | valamis-portlets/src/main/scala/com/arcusys/valamis/web/servlet/lesson/LessonWithAverageGradeResponse.scala | Scala | gpl-3.0 | 516 |
package com.sksamuel.scapegoat
import com.sksamuel.scapegoat.inspections.AnyUse
import org.scalatest.{ FreeSpec, Matchers, OneInstancePerTest }
import scala.reflect.internal.util.NoPosition
import scala.tools.nsc.reporters.StoreReporter
/** @author Stephen Samuel */
class FeedbackTest
extends FreeSpec
with M... | jasonchaffee/scalac-scapegoat-plugin | src/test/scala/com/sksamuel/scapegoat/FeedbackTest.scala | Scala | apache-2.0 | 1,356 |
package com.ing.baker.runtime.scaladsl
import com.ing.baker.runtime.common
import com.ing.baker.runtime.javadsl
import com.ing.baker.runtime.common.LanguageDataStructures.ScalaApi
case class RecipeEventMetadata(recipeId: String, recipeName: String, recipeInstanceId: String) extends common.RecipeEventMetadata with Sca... | ing-bank/baker | core/baker-interface/src/main/scala/com/ing/baker/runtime/scaladsl/RecipeEventMetadata.scala | Scala | mit | 514 |
/*
* Copyright 2013 http4s.org
*
* 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... | rossabaker/http4s | core/shared/src/main/scala/org/http4s/headers/Upgrade.scala | Scala | apache-2.0 | 1,465 |
/*
* 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/test/scala/com/asakusafw/spark/compiler/graph/JobCompilerSpec.scala | Scala | apache-2.0 | 77,067 |
/*
* Copyright (C) 2016 Department for Business, Energy and Industrial Strategy
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) an... | UKGovernmentBEIS/rifs-frontend-play | src/main/scala/forms/DateTimeFormats.scala | Scala | gpl-3.0 | 1,456 |
package fr.eurecom.dsg.treelib.id3
import org.apache.spark.rdd.RDD
import org.apache.spark.SparkContext._
import fr.eurecom.dsg.treelib.core._
import scala.Array.canBuildFrom
import scala.math.BigInt.int2bigInt
import scala.collection.mutable.HashMap
import scala.util.Random
class ID3TreeBuilder
extends TreeBuild... | bigfootproject/treelib | src/main/scala/fr/eurecom/dsg/treelib/id3/ID3TreeBuilder.scala | Scala | apache-2.0 | 26,292 |
package fr.lium
package api
import fr.lium.util.FileUtils
import org.apache.commons.io.{FileUtils => ApacheFileUtils}
import java.io.File
import scala.util.{ Try, Success, Failure }
import scala.slick.session.Database
import scala.slick.driver.SQLiteDriver.simple._
import Database.threadLocalSession
case class Aud... | bsalimi/speech-recognition-api | app/api/AudioFileApi.scala | Scala | mit | 416 |
package controllers
import play.api._
import play.api.mvc._
object Application extends Controller {
def index = Action {
Ok(views.html.index("Fulano de tal", 45))
}
} | w2srobinho/ine5646 | demo1/app/controllers/Application.scala | Scala | mit | 178 |
package akka.persistence.cassandra.compaction
import com.typesafe.config.Config
import scala.collection.JavaConverters._
/*
* Based upon https://github.com/apache/cassandra/blob/cassandra-2.2/src/java/org/apache/cassandra/db/compaction/SizeTieredCompactionStrategy.java
*/
class SizeTieredCompactionStrategy(config:... | krasserm/akka-persistence-cassandra | src/main/scala/akka/persistence/cassandra/compaction/SizeTieredCompactionStrategy.scala | Scala | apache-2.0 | 2,692 |
package aecor.schedule.process
import java.util.UUID
import aecor.data.{ Committable, ConsumerId, EntityEvent, EventTag }
import aecor.runtime.akkapersistence.readside.CommittableEventJournalQuery
import aecor.schedule.{ ScheduleBucketId, ScheduleEvent }
import aecor.util.effect._
import akka.stream.Materializer
impo... | notxcain/aecor | modules/schedule/src/main/scala/aecor/schedule/process/DefaultScheduleEventJournal.scala | Scala | mit | 1,524 |
package com.hanip.ssr.controllers
import javax.inject._
import com.hanip.ssr.dao.AbstractBaseDAO
import com.hanip.ssr.dao.ItemDAO.ItemTable
import com.hanip.ssr.models.Item
import play.api.libs.json.{Json, Writes}
import play.api.mvc._
import scala.concurrent.{ExecutionContext, Future}
/**
* Created by hanip on 4/... | irfanhanip/simple-scala-rest | app/com/hanip/ssr/controllers/ItemController.scala | Scala | gpl-3.0 | 1,460 |
import scala.annotation.implicitNotFound
sealed trait State
final class On extends State
final class Off extends State
@implicitNotFound("State must be Off")
class IsOff[S <: State]
object IsOff {
implicit def isOff: IsOff[Off] = {
println("isOff")
new IsOff[Off]
}
}
@implicitNotFound("State must be On")... | som-snytt/dotty | tests/run-custom-args/erased/erased-machine-state.scala | Scala | apache-2.0 | 1,110 |
package dao
import anorm._
import anorm.SqlParser._
import org.joda.time.DateTime
import common.AnormExtension._
import model._
trait EntryGroupDao {
def insert(group: EntryGroup): EntryGroup
def listForUser(account: Account): Seq[EntryGroup]
def getById(id: Long): Option[EntryGroup]
}
class PsqlEntryGroupDao... | mikegirkin/papersheet | src/app/dao/EntryGroupDao.scala | Scala | mit | 1,235 |
package name.vybornov.tools.metrics
import org.scalatest.FlatSpec
/**
* @author vvv
*/
class BKTreeTest extends FlatSpec {
"BKTree" should "pass basic tests" in {
import LDistanceOptimized._
val testSet = List("apples", "oranges", "pineapples")
val t = BKTree.of(testSet: _*)
assertResult(So... | vvvy/metrics-tools | src/test/scala/name/vybornov/tools/metrics/BKTreeTest.scala | Scala | apache-2.0 | 815 |
package com.lleggieri
/**
* Adds these extensions to a Number.
*/
private[lleggieri] trait Thousand { n: N =>
private def calc(add: Long) = compute(v, 1000, add)
def thousand(t: Tenth) = new N(calc(t.value)) with Tenth with Hundred[Final]
def thousand(e: Extensible) = new N(calc(e.value)) with Hundred[Final]... | lukiano/numbers | src/main/scala/com/lleggieri/Thousand.scala | Scala | mit | 378 |
/***********************************************************************
* Copyright (c) 2013-2017 Commonwealth Computer Research, Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Apache License, Version 2.0
* which accompanies this distribution and... | ronq/geomesa | geomesa-fs/geomesa-fs-storage-parquet/src/main/scala/org/locationtech/geomesa/parquet/AttributeWriter.scala | Scala | apache-2.0 | 7,260 |
package validations
import com.wunder.pets.validations.DuplicateValue
import org.postgresql.util.{PSQLException, ServerErrorMessage}
import org.scalatest.{MustMatchers, WordSpec}
class DuplicateValueSpec extends WordSpec with MustMatchers {
"message" should {
"extract field and value" in {
val errorMessag... | wunderteam/battle-pets-api | test/validations/DuplicateValueSpec.scala | Scala | mit | 846 |
package fr.laas.fape.anml.model.abs.time
import fr.laas.fape.anml.parser.RelativeTimepoint
case class AbstractRelativeTimePoint(timepoint:AbsTP, delta:Int) {
override def toString =
if(delta == 0)
timepoint.toString
else if(delta >= 0)
"%s+%s".format(timepoint, delta)
else
timepoint.toString... | athy/fape | anml-parser/src/main/scala/fr/laas/fape/anml/model/abs/time/AbstractRelativeTimePoint.scala | Scala | bsd-2-clause | 576 |
/*
* Copyright 2010 Roman Naumann
*
* This file is part of SMed.
*
* SMed is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
*... | rumpelstilzchen/SMed | src/main/scala/com/fmh/smed/MedBox.scala | Scala | gpl-3.0 | 4,075 |
package org.jetbrains.plugins.scala
package format
import java.{lang, util}
import org.jetbrains.plugins.scala.extensions._
import org.jetbrains.plugins.scala.lang.psi.types.api.designator.ScDesignatorType
import org.jetbrains.plugins.scala.lang.psi.types.{ScLiteralType, ScType}
/**
* Pavel Fatin
*/
object Types ... | JetBrains/intellij-scala | scala/scala-impl/src/org/jetbrains/plugins/scala/format/Types.scala | Scala | apache-2.0 | 1,484 |
/*
* Copyright (C) 2012-2013 Age Mooij (http://scalapenos.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 required by a... | agemooij/riak-scala-client | src/test/scala/com/scalapenos/riak/internal/RiakServerInfoSpec.scala | Scala | apache-2.0 | 3,032 |
package org.jetbrains.plugins.scala
package lang
package psi
package stubs
import com.intellij.psi.stubs.PsiClassHolderFileStub
import org.jetbrains.plugins.scala.lang.psi.api.ScalaFile
/**
* @author ilyas
*/
trait ScFileStub extends PsiClassHolderFileStub[ScalaFile] {
def packageName: String
def sourceName: ... | ilinum/intellij-scala | src/org/jetbrains/plugins/scala/lang/psi/stubs/ScFileStub.scala | Scala | apache-2.0 | 380 |
package com.github.cuzfrog.webdriver
private[webdriver] case class Driver(_id: Long, name: String)
private[webdriver] sealed trait WebBody {val _id: Long ;val driver: Driver}
private[webdriver] sealed trait Element extends WebBody
private[webdriver] case class CommonElement(_id: Long, driver: Driver) extends Element... | cuzfrog/WebDriverServ | shared/src/main/scala/com/github/cuzfrog/webdriver/Bodies.scala | Scala | apache-2.0 | 647 |
// Testing that isEmpty and get are viewed with `memberType` from `Casey1`.
trait T[A, B >: Null] { def isEmpty: A = false.asInstanceOf[A]; def get: B = null}
class Casey1() extends T[Boolean, String]
object Casey1 { def unapply(a: Casey1) = a }
object Test {
def main(args: Array[String]): Unit = {
val c @ Casey... | lrytz/scala | test/files/run/t7850c.scala | Scala | apache-2.0 | 369 |
/**
* 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... | TiVo/kafka | core/src/main/scala/kafka/common/InconsistentClusterIdException.scala | Scala | apache-2.0 | 1,177 |
/*
* Copyright 2015 IBM Corp.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed ... | yeghishe/spark-kernel | communication/src/main/scala/com/ibm/spark/communication/actors/RouterSocketActor.scala | Scala | apache-2.0 | 1,667 |
/*
* Copyright (C) 2007-2008 Artima, Inc. 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 License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless requir... | peachyy/scalastu | extractors/Twice.scala | Scala | apache-2.0 | 1,041 |
package debop4s.data.slick3.tests
import debop4s.data.slick3.TestDatabase._
import debop4s.data.slick3.TestDatabase.driver.api._
import debop4s.data.slick3.AbstractSlickFunSuite
import scala.language.existentials
/**
* RelationalMapperFunSuite
* @author sunghyouk.bae@gmail.com
*/
class RelationalMapperFunSuite ex... | debop/debop4s | debop4s-data-slick3/src/test/scala/debop4s/data/slick3/tests/RelationalMapperFunSuite.scala | Scala | apache-2.0 | 5,452 |
package score.noupdate
import jeqa.types.Sentence
import text.similarity.{AverageOverlapCalculator, OverlapCalculator}
import text.vector._
import scala.collection.mutable.ListBuffer
/**
* <pre>
* Created on 2016/12/09.
* </pre>
* @param summarySentences summary sentences
* @author K.Sakamoto
*/
class En... | ktr-skmt/FelisCatusZero | src/main/scala/score/noupdate/EntailmentScorer.scala | Scala | apache-2.0 | 1,354 |
/* ____ __ ____ ____ ____ ___ ____ __ __ ____
* ( _ \\ /__\\ (_ )(_ _)( ___)/ __) ( _ \\( )( )( _ \\ Read
* ) / /(__)\\ / /_ _)(_ )__) \\__ \\ )___/ )(__)( ) _ < README.txt
* (_)\\_)(__)(__)(____)(____)(____)(___/ (__) (______)(____/ LICENSE.txt
*/
package ... | razie/diesel-hydra | diesel/src/main/scala/razie/diesel/engine/DomEngineV1.scala | Scala | apache-2.0 | 65,777 |
package gapt.proofs.expansion
import gapt.expr._
import gapt.expr.formula.Formula
import gapt.expr.subst.Substitution
import gapt.proofs.Sequent
import scala.annotation.tailrec
import scala.collection.mutable
private class MutableSubstitution {
var subst = Substitution()
def add( v: Var, by: Expr ): Unit =
i... | gapt/gapt | core/src/main/scala/gapt/proofs/expansion/merge.scala | Scala | gpl-3.0 | 5,553 |
package som;
import som.Dictionary._
class IdentityDictionary[K <: CustomHash, V <: AnyRef](
size: Int = INITIAL_CAPACITY)
extends Dictionary[K, V](size) {
class IdEntry[K, V](hash: Int, key: K, value: V, next: Entry[K, V])
extends Entry[K, V](hash, key, value, next) {
override def match_(hash: ... | cedricviaccoz/scala-native | benchmarks/src/main/scala/som/IdentityDictionary.scala | Scala | bsd-3-clause | 503 |
package scala.slick.test.jdbc
import org.junit.Test
import org.junit.Assert._
import scala.slick.testutil._
import scala.slick.testutil.TestDBs._
import com.typesafe.slick.testkit.util.JdbcTestDB
import scala.slick.jdbc.{ResultSetType, ResultSetHoldability, ResultSetConcurrency}
object StatementParametersTest extends... | retronym/slick | slick-testkit/src/test/scala/scala/slick/test/jdbc/StatementParametersTest.scala | Scala | bsd-2-clause | 2,433 |
package security
sealed trait LWMRole {
def label: String
}
object LWMRole {
sealed trait CourseRelatedRole extends LWMRole
sealed trait BasicRole extends LWMRole
case object God extends BasicRole {
override val label = "God"
}
case object Admin extends BasicRole {
override val label = "Admini... | THK-ADV/lwm-reloaded | app/security/LWMRole.scala | Scala | mit | 1,094 |
/* __ *\
** ________ ___ / / ___ __ ____ Scala.js Test Suite **
** / __/ __// _ | / / / _ | __ / // __/ (c) 2013-2015, LAMP/EPFL **
** __\ \/ /__/ __ |/ /__/ __ |/_// /_\ \ http://scala-js.org/ **
** /____/\___/_/ |_/... | mdedetrich/scala-js | test-suite/shared/src/test/scala/org/scalajs/testsuite/javalib/util/CollectionsOnCheckedListTest.scala | Scala | bsd-3-clause | 3,242 |
/*
Copyright 2014 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... | zirpins/scalding | scalding-core/src/main/scala/com/twitter/scalding/ExecutionApp.scala | Scala | apache-2.0 | 2,209 |
package org.scalatra
import java.util.Locale.ENGLISH
import javax.servlet.http.{ HttpServletRequest, HttpServletResponse }
import grizzled.slf4j.Logger
import org.scalatra.util.RicherString._
import scala.collection.JavaConverters._
object CorsSupport {
val OriginHeader: String = "Origin"
val AccessControlRequ... | seratch/scalatra | core/src/main/scala/org/scalatra/CORSSupport.scala | Scala | bsd-2-clause | 9,012 |
/*
* Copyright (C) 2015 Romain Reuillon
*
* 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 Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This progra... | ISCPIF/PSEExperiments | openmole-src/openmole/core/org.openmole.core.dsl/src/main/scala/org/openmole/core/dsl/package.scala | Scala | agpl-3.0 | 3,279 |
package org.bitcoins.spvnode.block
import org.bitcoins.core.crypto.DoubleSha256Digest
import org.bitcoins.spvnode.gen.MerkleGenerator
import org.scalacheck.{Prop, Properties}
/**
* Created by chris on 8/12/16.
*/
class PartialMerkleTreeSpec extends Properties("PartialMerkleTreeSpec") {
property("must be able t... | bitcoin-s/bitcoin-s-spv-node | src/test/scala/org/bitcoins/spvnode/block/PartialMerkleTreeSpec.scala | Scala | mit | 1,044 |
/*
* Copyright (c) 2012 Crown Copyright
* Animal Health and Veterinary Laboratories Agency
*
* 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.apach... | tearne/Sampler | sampler-core/src/main/scala/sampler/r/script/NamedSeq.scala | Scala | apache-2.0 | 1,866 |
package zoey
import org.scalatest.{ BeforeAndAfterAll, FunSpec }
import scala.concurrent.duration._
import scala.concurrent.Await
import scala.concurrent.ExecutionContext.Implicits.global
import scala.util.control.NonFatal
import java.net.InetSocketAddress
class RoundRobinConnectorSpec extends FunSpec
with BeforeAn... | softprops/zoey | zoey-core/src/test/scala/RoundRobinConnectorSpec.scala | Scala | mit | 1,084 |
/*
* Licensed to Intel Corporation under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* Intel Corporation licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use t... | SeaOfOcean/BigDL | dl/src/main/scala/com/intel/analytics/bigdl/dataset/image/GreyImgToBatch.scala | Scala | apache-2.0 | 3,253 |
/*
* Copyright (C) 2014 AyaIB Developers (http://github.com/fauu/ayaib)
*
* This software is licensed under the GNU General Public License
* (version 3 or later). See the COPYING file in this distribution.
*
* You should have received a copy of the GNU Library General Public License
* along with this software. I... | fauu/AyaIB-old | app/Global.scala | Scala | gpl-3.0 | 844 |
package colang.tokens
import colang.LexerUnitSpec
class WhitespaceStrategySpec extends LexerUnitSpec {
describe("Whitespace lexer strategy") {
it("should match longest sequence of spaces, tabs, and line breaks") {
Whitespace.strategy shouldSucceedOn " \t\t \n\t \n " withoutIssues() andInProduced { token ... | merkispavel/colang | src/test/scala/colang/tokens/WhitespaceStrategySpec.scala | Scala | mit | 740 |
package scommons.client.ui.tab
import scommons.nodejs.test.TestSpec
class TabPanelPropsSpec extends TestSpec {
it should "fail if selectedIndex is out of items range" in {
def assertFailedProps(props: => TabPanelProps, selectedIndex: Int): Unit = {
val e = the[IllegalArgumentException] thrownBy {
... | viktor-podzigun/scommons | ui/src/test/scala/scommons/client/ui/tab/TabPanelPropsSpec.scala | Scala | apache-2.0 | 1,066 |
object Test {
def f[A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T](table: Tuple20[A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T])(fun: (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T) => Unit) {
}
def g[A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U](table: Tup... | loskutov/intellij-scala | testdata/scalacTests/pos/t4545.scala | Scala | apache-2.0 | 889 |
import sbt._
import Keys._
object Dependencies {
lazy val scala282 = "2.8.2"
lazy val scala292 = "2.9.2"
lazy val scala293 = "2.9.3"
lazy val scala210 = "2.10.5"
lazy val scala211 = "2.11.6"
lazy val jline = "jline" % "jline" % "2.11"
lazy val ivy = "org.scala-sbt.ivy" % "ivy" % "2.3.0-sbt-c5d1b95fdcc1e... | corespring/sbt | project/Dependencies.scala | Scala | bsd-3-clause | 3,388 |
package v1.post
import javax.inject.Inject
import pl.why.common.SuccessResult
import pl.why.common.auth.AuthorizedAction
import pl.why.common.lookup.SimpleResponse
import play.api.data.Form
import play.api.i18n.I18nSupport
import play.api.libs.json.Json
import play.api.mvc._
import scala.concurrent.{ExecutionContext... | pieczkus/whyblog | app/v1/post/PostController.scala | Scala | mit | 6,127 |
// 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/test/scala/it/unipd/dei/diversity/MatchingHeuristicTest.scala | Scala | gpl-3.0 | 3,406 |
package io.circe
import cats.data.{ Validated, Xor }
/**
* [[Decoder]] and [[Encoder]] instances for disjunction types with reasonable names for the sides.
*/
object disjunctionCodecs {
private[this] val leftKey: String = "Left"
private[this] val rightKey: String = "Right"
private[this] val failureKey: String... | groz/circe | core/shared/src/main/scala/io/circe/disjunctionCodecs.scala | Scala | apache-2.0 | 1,319 |
class A {
val x: Int = 1
}
class B extends A {
override lazy val x: Int = 2 // error
}
| som-snytt/dotty | tests/neg-custom-args/ovlazy.scala | Scala | apache-2.0 | 91 |
package com.eclipsesource.schema.internal.draft7.constraints
import com.eclipsesource.schema.{SchemaResolutionContext, SchemaType, SchemaValue}
import com.eclipsesource.schema.internal.Keywords
import com.eclipsesource.schema.internal.constraints.Constraints.{AnyConstraints, HasAnyConstraint, StringConstraints}
import... | eclipsesource/play-json-schema-validator | src/main/scala/com/eclipsesource/schema/internal/draft7/constraints/StringConstraints7.scala | Scala | apache-2.0 | 1,927 |
package net.gree.aurora.scala.domain.cluster
import scala.language.implicitConversions
import net.gree.aurora.domain.cluster.{TaggedClusterIdResolver => JTaggedClusterIdResolver, TaggedClusterIdResolverFactory, TaggedClusterIdResolverIdFactory}
import org.sisioh.dddbase.core.model.Entity
trait TaggedClusterIdResolver... | gree/aurora | aurora-scala/src/main/scala/net/gree/aurora/scala/domain/cluster/TaggedClusterIdResolver.scala | Scala | mit | 1,083 |
package org.jetbrains.plugins.scala.lang.resolve2
/**
* Pavel.Fatin, 02.02.2010
*/
class InheritanceTraitTest extends ResolveTestBase {
override def folderPath: String = {
super.folderPath + "inheritance/trait/"
}
//TODO abstractoverride
// def testAbstractOverrideExtendsClass = doTest
def testAbstra... | ilinum/intellij-scala | test/org/jetbrains/plugins/scala/lang/resolve2/InheritanceTraitTest.scala | Scala | apache-2.0 | 945 |
package net.liftmodules.staticsitemap.path
import org.scalatest.FunSpec
import org.scalatest.matchers.ShouldMatchers
import net.liftweb.sitemap.*
import net.liftmodules.staticsitemap.path.PathBuilder._
class TestPathBuilder extends FunSpec with ShouldMatchers {
describe("PathBuilder") {
describe("when extract... | jeffmay/lift-staticsitemap | src/test/scala/net/liftmodules/staticsitemap/path/TestPathBuilder.scala | Scala | apache-2.0 | 3,604 |
/*
Copyright 2013 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... | sengt/summingbird-batch | summingbird-core/src/main/scala/com/twitter/summingbird/Producer.scala | Scala | apache-2.0 | 12,927 |
package org.javachannel.implicits.service
import java.util.UUID
import org.javachannel.implicits.model.Ontology
import org.neo4j.graphdb.DynamicLabel
import org.neo4j.graphdb.factory.GraphDatabaseFactory
trait GraphService {
def findOntologyById(id: UUID): Option[Ontology]
def findOntologyByName(name: String): ... | jottinger/conceptmodel | src/main/scala/org/javachannel/implicits/service/GraphService.scala | Scala | apache-2.0 | 597 |
package org.apache.spark.asyspark.core.models.server
import org.apache.spark.asyspark.core.messages.server.request.{PullVector, PushVectorFloat}
import org.apache.spark.asyspark.core.messages.server.response.ResponseFloat
import org.apache.spark.asyspark.core.partitions.Partition
import spire.implicits._
/**
* Creat... | CASISCAS/asyspark | src/main/scala/org/apache/spark/asyspark/core/models/server/PartialVectorFloat.scala | Scala | mit | 764 |
package assets.mustache.forces
import uk.gov.gds.ier.test._
import uk.gov.gds.ier.transaction.forces.previousAddress.PreviousAddressManualMustache
class PreviousAddressManualTemplateTest
extends TemplateTestSuite
with WithMockForcesControllers
with PreviousAddressManualMustache {
it should "properly render a... | alphagov/ier-frontend | test/assets/mustache/forces/PreviousAddressManualTemplateTest.scala | Scala | mit | 4,108 |
trait F[T] { def apply(s: T): Int }
object NeedsNiceError {
def bar(x: F[_ >: String]) = ???
bar(_.parseInt)
}
| felixmulder/scala | test/files/neg/sammy_error_exist_no_crash.scala | Scala | bsd-3-clause | 116 |
/*
* Copyright (C) 2020 MapRoulette contributors (see CONTRIBUTORS.md).
* Licensed under the Apache License, Version 2.0 (see LICENSE).
*/
package org.maproulette.framework.repository
import java.sql.Connection
import scala.concurrent.duration.FiniteDuration
import scala.collection.mutable
import anorm.SqlParser.... | mgcuthbert/maproulette2 | app/org/maproulette/framework/repository/TaskReviewRepository.scala | Scala | apache-2.0 | 15,258 |
/*
Copyright 2012 Twitter, Inc.
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 under the License is distributed on an "AS IS" BASIS,
WIT... | sriramkrishnan/scalding | scalding-core/src/main/scala/com/twitter/scalding/GroupBuilder.scala | Scala | apache-2.0 | 14,033 |
package info.rkuhn.bootstrap
object BootStrap {
}
// vim: set ts=4 sw=4 et:
| rkuhn/BootStrap | src/main/scala/info/rkuhn/bootstrap/BootStrap.scala | Scala | lgpl-2.1 | 79 |
package org.trustedanalytics.sparktk.frame.internal.rdd
import breeze.linalg.{ DenseVector => BDV }
import org.apache.spark.SparkException
import org.apache.spark.mllib.linalg.{ Vectors, Vector, DenseVector }
import org.apache.spark.mllib.regression.LabeledPoint
import org.apache.spark.mllib.org.trustedanalytics.spark... | shibanis1/spark-tk | core/src/main/scala/org/trustedanalytics/sparktk/frame/internal/rdd/RowWrapperFunctions.scala | Scala | apache-2.0 | 3,511 |
def h(_,_) = 0 | hmemcpy/milewski-ctfp-pdf | src/content/2.2/code/scala/snippet12.scala | Scala | gpl-3.0 | 14 |
/***********************************************************************
* Copyright (c) 2013-2018 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... | jahhulbert-ccri/geomesa | geomesa-convert/geomesa-convert-json/src/main/scala/org/locationtech/geomesa/convert/json/JsonSimpleFeatureConverter.scala | Scala | apache-2.0 | 11,809 |
/**********************************************************************************************************************
* This file is part of Scrupal, a Scalable Reactive Web Application Framework for Content Management *
* ... | scrupal/scrupal | scrupal-storage/src/test/scala/scrupal/storage/impl/StorageConfigHelperSpec.scala | Scala | apache-2.0 | 5,620 |
/* ___ _ ___ _ _ *\\
** / __| |/ (_) | | Your SKilL scala Binding **
** \\__ \\ ' <| | | |__ generated: 01.02.2019 ... | skill-lang/skill | src/main/scala/de/ust/skill/sir/api/internal/PoolSingleBaseTypeContainer.scala | Scala | bsd-3-clause | 5,935 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | bravo-zhang/spark | mllib/src/main/scala/org/apache/spark/ml/r/IsotonicRegressionWrapper.scala | Scala | apache-2.0 | 4,515 |
/*
* Copyright 2016 The BigDL Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agr... | JerryYanWan/BigDL | spark/dl/src/test/scala/com/intel/analytics/bigdl/optim/ValidationSpec.scala | Scala | apache-2.0 | 5,871 |
package ingraph.ire
import ingraph.ire.datatypes.Tuple
import org.scalatest.FunSuite
class TckEngineTest extends FunSuite {
val log = true
def run(createQuery: String, readQuery: String): Iterable[Tuple] = {
val indexer = new Indexer()
if (createQuery.nonEmpty) {
val createAdapter = new OneTimeQu... | FTSRG/ingraph | ire-adapter/src/test/scala/ingraph/ire/TckEngineTest.scala | Scala | epl-1.0 | 22,352 |
package im.actor
import sbt._
object Dependencies {
object V {
val akka = "2.3.11"
val akkaExperimental = "1.0"
val scalaz = "7.1.1"
val slick = "3.0.0"
val scalatest = "2.2.4"
}
object Compile {
val akkaActor = "com.typesafe.akka" %% "akka-actor" ... | ketoo/actor-platform | actor-server/project/Dependencies.scala | Scala | mit | 8,628 |
// Wei Chen - LSVM - linear Support Vector Machine
// 2015-12-09
package com.scalaml.algorithm
import com.scalaml.general.MatrixFunc._
// LinearSVM = linear Support Vector Machine
// This core function only support dual classification cus linear
// classifier is only good at dual classification problems
class LinearS... | Wei-1/Scala-Machine-Learning | src/main/scala/algorithm/classification/LinearSVM.scala | Scala | mit | 4,856 |
package com.joshcough.minecraft
import org.nlogo.agent.{Agent, Patch, Turtle}
import org.nlogo.headless.HeadlessWorkspace
import org.bukkit.entity.Player
import org.bukkit.event.{EventHandler, Listener}
import org.bukkit.{Location, Material, World}
import Material._
import BukkitEnrichment._
import com.joshcough.remot... | joshcough/NetLogoMinecraft | netlogoPlugin/src/main/scala/com/joshcough/minecraft/NetLogoPlugin.scala | Scala | mit | 8,916 |
package scalariform.astselect
import scalariform.lexer._
import scalariform.parser._
import scalariform.utils.Range
import scala.util.control.Exception._
import scalariform.ScalaVersions
object AstSelector {
/**
* Expands the given selection in the source to the range of the closest appropriate
* enclosing A... | gawkermedia/scalariform | scalariform/src/main/scala/scalariform/astselect/AstSelector.scala | Scala | mit | 7,106 |
package scavlink.link.channel
import org.scalatest.{Matchers, WordSpec}
import scavlink.message.common.RcChannelsOverride
import scavlink.message.{ComponentId, SystemId}
class ChannelSpec extends WordSpec with Matchers {
val targetSystem = SystemId.zero
val targetComponent = ComponentId.zero
"rcMessage" shoul... | nickolasrossi/scavlink | src/test/scala/scavlink/link/channel/ChannelSpec.scala | Scala | mit | 1,318 |
/* 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 cqrs.command
import java.util.UUID
import cqrs.command.AggregateRoot.Removed
/**
* A wrapper for the a... | cqrs-endeavour/cqrs-endeavour | cqrs-framework/src/main/scala/cqrs/command/AggregateRootActorState.scala | Scala | mpl-2.0 | 2,678 |
/*
* Copyright (c) <2015-2016>, see CONTRIBUTORS
* 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... | amanjpro/languages-a-la-carte | tiny/src/main/scala/types/types.scala | Scala | bsd-3-clause | 2,389 |
/*
* Copyright (c) 2014-2017 by its authors. Some rights reserved.
* 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.a... | monix/monix-nio | src/main/scala/monix/nio/internal/ExecutorServiceWrapper.scala | Scala | apache-2.0 | 3,286 |
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.