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 |
|---|---|---|---|---|---|
/*
* 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/hive/src/main/scala/org/apache/spark/sql/hive/HiveSharedState.scala | Scala | apache-2.0 | 1,780 |
package me.fornever.checktimer
import java.time.format.DateTimeFormatter
import java.time.{Duration, ZoneOffset, ZonedDateTime}
object DateTimeUtils {
def now(): ZonedDateTime = ZonedDateTime.now(ZoneOffset.UTC)
def toString(zonedDateTime: ZonedDateTime): String = DateTimeFormatter.ISO_INSTANT.format(zonedDateT... | ForNeVeR/checktimer | src/main/scala/me/fornever/checktimer/DateTimeUtils.scala | Scala | mit | 533 |
package org.jetbrains.plugins.scala
package lang
package psi
package impl
package search
import com.intellij.openapi.progress.ProgressManager
import com.intellij.openapi.util.Comparing
import com.intellij.openapi.util.text.StringUtil
import com.intellij.psi.PsiClass
import com.intellij.psi.search.GlobalSearchScope
im... | LPTK/intellij-scala | src/org/jetbrains/plugins/scala/lang/psi/impl/search/ScalaDirectClassInheritorsSearcher.scala | Scala | apache-2.0 | 3,513 |
/***********************************************************************
* 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-kafka/geomesa-kafka-datastore/src/test/scala/org/locationtech/geomesa/kafka/utils/GeoMessageSerializerTest.scala | Scala | apache-2.0 | 3,717 |
/*
* Copyright 2014 Paul Horn
*
* 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... | knutwalker/rx-redis | tests/src/it/scala/rx/redis/ShutdownSpec.scala | Scala | apache-2.0 | 1,876 |
package com.cengallut.appinjection
import android.app.{Fragment, Activity}
trait AppInjection[APP <: android.app.Application] {
def app: APP = this match {
case a: Activity => a.getApplication.asInstanceOf[APP]
case f: Fragment => f.getActivity.getApplication.asInstanceOf[APP]
case _ => throw... | AliceCengal/android-app-injection | library/src/main/scala/com/cengallut/appinjection/AppInjection.scala | Scala | mit | 507 |
package com.github.kelebra.uber.stream.elements.streams
import com.github.kelebra.uber.stream.DOMAware
import com.github.kelebra.uber.stream.common.Source
import com.github.kelebra.uber.stream.elements.sidebar.ToggleButton
import scala.collection.mutable
import scalatags.JsDom.all._
object Content extends DOMAware w... | kelebra/uber-stream-app | src/main/scala/com/github/kelebra/uber/stream/elements/streams/Content.scala | Scala | mit | 1,110 |
package scodec
package codecs
import scalaz.\/
import scalaz.syntax.std.either._
import scodec.bits.BitVector
private[codecs] object BooleanCodec extends Codec[Boolean] {
override def encode(b: Boolean) =
\/.right(if (b) BitVector.high(1) else BitVector.low(1))
override def decode(buffer: BitVector) =
... | ceedubs/scodec | src/main/scala/scodec/codecs/BooleanCodec.scala | Scala | bsd-3-clause | 476 |
package org.broadinstitute.dsde.snoop
import java.io.File
import org.scalatest.{Matchers, FlatSpec}
import scala.collection.immutable.Vector
/**
* Created by dvoet on 4/5/15.
*/
class GcsOutputRepositorySpec extends FlatSpec with Matchers {
// ignored because travis does not have credentials
ignore should "li... | broadinstitute/snoop | src/test/scala/org/broadinstitute/dsde/snoop/GcsOutputRepositorySpec.scala | Scala | bsd-3-clause | 834 |
/*
* 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 ... | style95/openwhisk | tests/src/test/scala/actionContainers/ActionContainer.scala | Scala | apache-2.0 | 10,818 |
// Copyright 2017 EPFL DATA Lab (data.epfl.ch)
//
// 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... | epfldata/squid | src/main/scala/squid/spec/Bag.scala | Scala | apache-2.0 | 3,807 |
object ComplexNumbers {
def main(args: Array[String]) {
val c = new Complex(1.2, 3.4)
println("im part: " + c.im)
}
}
| grant/hello-scala | src/ComplexNumbers.scala | Scala | mit | 130 |
package org.jetbrains.plugins.scala
package project
package settings
import com.intellij.openapi.components._
import com.intellij.openapi.module.{Module, ModuleManager}
import com.intellij.openapi.project.Project
import com.intellij.openapi.roots.ProjectRootManager
import com.intellij.openapi.util.{ModificationTracker... | JetBrains/intellij-scala | scala/scala-impl/src/org/jetbrains/plugins/scala/project/settings/ScalaCompilerConfiguration.scala | Scala | apache-2.0 | 7,478 |
package org.jetbrains.plugins.scala
package lang
package psi
package api
package base
import org.jetbrains.plugins.scala.lang.psi.ScalaPsiElement
import api.base.patterns._
/**
* @author Alexander Podkhalyuzin
* Date: 22.02.2008
*/
trait ScPatternList extends ScalaPsiElement {
def patterns: Seq[ScPattern]
/**
... | consulo/consulo-scala | src/org/jetbrains/plugins/scala/lang/psi/api/base/ScPatternList.scala | Scala | apache-2.0 | 452 |
/**
* Copyright (C) 2015 Stratio (http://stratio.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 ap... | luismcl/crossdata | driver/src/main/scala/com/stratio/crossdata/driver/querybuilder/dslentities/Literal.scala | Scala | apache-2.0 | 1,113 |
/*****************************************************************************************
* Copyright 2017 Capital One Services, LLC and Bitwise, 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 ... | capitalone/Hydrograph | hydrograph.engine/hydrograph.engine.spark/src/main/scala/hydrograph/engine/spark/components/OutputOracleComponent.scala | Scala | apache-2.0 | 5,319 |
package gnieh.pp
package tests
import org.scalatest._
abstract class PpTest extends FlatSpec with ShouldMatchers {
val compact = CompactRenderer.andThen(_.layout)
val render80 = (new PrettyRenderer(80)).andThen(_.layout)
val render20 = (new PrettyRenderer(20)).andThen(_.layout)
val render10 = (new PrettyR... | gnieh/gnieh-pp | src/test/scala/gnieh/pp/tests/PpTest.scala | Scala | apache-2.0 | 354 |
/* __ *\\
** ________ ___ / / ___ Scala API **
** / __/ __// _ | / / / _ | (c) 2003-2010, LAMP/EPFL **
** __\\ \\/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\\___/_/... | cran/rkafkajars | java/scala/collection/mutable/Publisher.scala | Scala | apache-2.0 | 2,512 |
package calculator
sealed abstract class Expr
final case class Literal(v: Double) extends Expr
final case class Ref(name: String) extends Expr
final case class Plus(a: Expr, b: Expr) extends Expr
final case class Minus(a: Expr, b: Expr) extends Expr
final case class Times(a: Expr, b: Expr) extends Expr
final case clas... | tobal/scala-course | functional-program-design/calculator/src/main/scala/calculator/Calculator.scala | Scala | gpl-3.0 | 1,592 |
package examples
import transport._
import transport.tyrus._
import scala.concurrent.ExecutionContext.Implicits.global
object RawClient { /**/
val transport = new WebSocketClient()
val url = WebSocketUrl("ws://echo.websocket.org")
val futureConnectionHandle = transport.connect(url)
futureConnectionHandle.foreach... | OlivierBlanvillain/scalajs-transport | examples/report-listings/jvm/src/main/scala/examples/RawClient.scala | Scala | mit | 614 |
package omnibus.domain.topic
import akka.actor._
import omnibus.core.actors.CommonActor
import omnibus.domain.topic.PropagationDirection._
import omnibus.domain.topic.TopicProtocol._
import omnibus.domain.subscriber._
import omnibus.domain.subscriber.ReactiveCmd
class Topic(val topic: String) extends CommonActor {
... | agourlay/omnibus | src/main/scala/omnibus/domain/topic/Topic.scala | Scala | apache-2.0 | 7,463 |
package mesosphere.marathon
package core.health.impl
import akka.testkit.{TestActorRef, TestProbe}
import mesosphere.AkkaUnitTest
import mesosphere.marathon.core.event.InstanceHealthChanged
import mesosphere.marathon.core.health.impl.AppHealthCheckActor.{
AddHealthCheck,
ApplicationKey,
HealthCheckStatusChanged,... | mesosphere/marathon | src/test/scala/mesosphere/marathon/core/health/impl/AppHealthCheckActorTest.scala | Scala | apache-2.0 | 10,965 |
package cc.factorie.variable
import cc.factorie.la.GrowableSparseBinaryTensor1
import org.junit.Test
import org.scalatest.junit._
class TestCategoricalVectorVariable extends JUnitSuite with cc.factorie.util.FastLogging {
@Test
def testCategoricalVectorVariable(): Unit = {
object DocumentDomain extends Categ... | hlin117/factorie | src/test/scala/cc/factorie/variable/TestCategoricalVectorVariable.scala | Scala | apache-2.0 | 808 |
/*
* Copyright 2015 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 applicab... | arkadius/micro-burn | src/test/scala/org/github/microburn/domain/ProjectConfigUtils.scala | Scala | apache-2.0 | 928 |
package net.fwbrasil.smirror
case class SInstance[C](sClass: SType[C], instance: C) {
val methods = sClass.methods.map(SInstanceMethod(_, instance))
val vals = sClass.vals.map(SInstanceVal(_, instance))
val vars = sClass.vars.map(SInstanceVar(_, instance))
override def toString = sClass.toString + s" (... | fwbrasil/smirror | src/main/scala/net/fwbrasil/smirror/SInstance.scala | Scala | lgpl-2.1 | 1,389 |
/*
* La Trobe University - Distributed Deep Learning System
* Copyright 2016 Matthias Langer (t3l@threelights.de)
*
* 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.apa... | bashimao/ltudl | blaze/src/main/scala/edu/latrobe/blaze/modules/jvm/LocallyConnectedFilter_JVM.scala | Scala | apache-2.0 | 3,927 |
package computerdatabase
import scala.concurrent.duration._
import io.gatling.core.Predef._
import io.gatling.http.Predef._
import io.gatling.jdbc.Predef._
class Recorder1 extends Simulation {
val httpProtocol = http
.baseURL("http://sp.int3.sonata-nfv.eu:5600")
.inferHtmlResources()
.acceptHeader("*/*")
.... | DarioValocchi/son-qual | qual-stress-gtkapi/src/test/scala/0_computerdatabase/Recorder1.scala | Scala | apache-2.0 | 572 |
package gapt
import gapt.expr.VarOrConst
import gapt.expr.formula.fol.FOLConst
import gapt.expr.formula.fol.FOLVar
import gapt.expr.subst.FOLSubstitution
import gapt.expr.subst.Substitutable
import gapt.expr.subst.Substitution
import gapt.expr.util.ExpressionParseHelper
import gapt.formats.babel.BabelSignature
import ... | gapt/gapt | core/src/main/scala/gapt/expr/package.scala | Scala | gpl-3.0 | 1,441 |
package org.http4s
package server
package middleware
import scala.annotation.tailrec
import java.util.zip.{CRC32, Deflater}
import javax.xml.bind.DatatypeConverter
import fs2._
import fs2.Stream._
import fs2.compress._
import fs2.interop.cats._
import org.http4s.headers._
import org.log4s.getLogger
import scodec.bits... | ZizhengTai/http4s | server/src/main/scala/org/http4s/server/middleware/GZip.scala | Scala | apache-2.0 | 4,222 |
package scalation.linalgebra.mem_mapped
/** The `bld` package contains traits and objects for generating source code
* for out-of-core vector classes, matrix traits and matrix classes.
*/
package object bld { }
| NBKlepp/fda | scalation_1.3/scalation_mathstat/src/main/scala/scalation/linalgebra/mem_mapped/bld/package.scala | Scala | mit | 217 |
/**
* 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... | themarkypantz/kafka | core/src/test/scala/unit/kafka/admin/ListConsumerGroupTest.scala | Scala | apache-2.0 | 3,095 |
package shield.proxying
import org.specs2.mutable.Specification
import spray.http.HttpHeaders.RawHeader
import spray.http.{HttpHeaders, HttpRequest}
import shield.implicits.HttpImplicits._
class HttpProxyLogicSpec extends Specification {
"HttpProxyLogic" should {
"Use remote-address when adding to x-forwarded-f... | RetailMeNot/shield | src/test/scala/shield/proxying/HttpProxyLogicSpec.scala | Scala | mit | 2,393 |
package provingground.library
import provingground._
import HoTT._
import induction._
import implicits._
import shapeless._
import Fold._
object nat$le_refl {
lazy val value = "nat.less_than_or_equal.refl" :: piDefn(
"'c_308702732" :: "nat" :: Type)(
("nat.less_than_or_equal" :: FuncTyp("nat" :: Type,
... | siddhartha-gadgil/ProvingGround | leanlib/src/main/scala/provingground/library/definitions/nat.le_refl.scala | Scala | mit | 461 |
package com.phasmid.laScala
import com.phasmid.laScala.values.Scalar
import scala.util.Try
trait Renderable[A] {
/**
* Method to render this object in a human-legible manner.
*
* NOTE: implementations of render may invoke toString
*
* NOTE: toString may NOT call render
*
* @param indent... | rchillyard/LaScala | src/main/scala/com/phasmid/laScala/Renderable.scala | Scala | lgpl-2.1 | 6,680 |
object Test extends Application {
def foo(x: Unit): Int = {print(1); 2}
def foo(x: String): Int = {print(4); 1}
implicit def byte2string(b: Byte): String = " "
/* line: 3 */foo(3: Byte)
} | SergeevPavel/intellij-scala | testdata/resolve2/overloading/ImplicitVSValueDiscarding.scala | Scala | apache-2.0 | 197 |
/*
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... | oeddyo/scalding | scalding-core/src/main/scala/com/twitter/scalding/GroupBuilder.scala | Scala | apache-2.0 | 13,715 |
package cucumber.runtime
import snippets.Snippet
import gherkin.formatter.model.Step
import collection.JavaConverters._
import _root_.java.util.List
class ScalaSnippetGenerator extends Snippet {
def template() =
"{0}(\\"\\"\\"{1}\\"\\"\\")'{' ({3}) =>\\n" +
" //// {4}\\n" +
" throw new PendingExc... | mbellani/cucumber-jvm | scala/src/main/scala/cucumber/runtime/ScalaSnippet.scala | Scala | mit | 882 |
package jp.co.dwango.s99
import org.scalatest.{DiagrammedAssertions, FunSpec}
import P67._
import binary_trees._
class P67Spec extends FunSpec with DiagrammedAssertions {
describe("P67") {
it("represents another string representation") {
assert(
Node(
'a',
Node('b', Node('d'), ... | dwango/S99 | src/test/scala/jp/co/dwango/s99/P67Spec.scala | Scala | mit | 688 |
/*
* Copyright (c) 2014-2021 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... | monifu/monifu | monix-reactive/shared/src/test/scala/monix/reactive/internal/operators/TakeLastSuite.scala | Scala | apache-2.0 | 2,522 |
/**
* This file is part of the TA Buddy project.
* Copyright (c) 2014 Alexey Aksenov ezh@ezh.msk.ru
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Affero General Global License version 3
* as published by the Free Software Foundation with the addition of t... | digimead/digi-TABuddy-desktop | part-logic/src/main/scala/org/digimead/tabuddy/desktop/logic/command/encryption/AESAdapter.scala | Scala | agpl-3.0 | 4,424 |
package io.buoyant.linkerd
import com.twitter.conversions.DurationOps._
import com.twitter.finagle.buoyant.TotalTimeout
import com.twitter.finagle.Path
import com.twitter.util.Duration
import io.buoyant.config.Parser
import io.buoyant.test.FunSuite
class SvcTest extends FunSuite {
def parse(yaml: String): Svc =
... | linkerd/linkerd | linkerd/core/src/test/scala/io/buoyant/linkerd/SvcTest.scala | Scala | apache-2.0 | 2,087 |
package org.usagram.clarify.error
import org.usagram.clarify.{ Indefinite, Tags }
import org.scalatest._
class ShouldBeLessThanOrEqualToSpec extends FunSpec {
import Matchers._
describe("#message") {
val error = ShouldBeLessThanOrEqualTo("a value")
describe("when Tags#label is Some(string)") {
va... | takkkun/clarify | core/src/test/scala/org/usagram/clarify/error/ShouldBeLessThanOrEqualToSpec.scala | Scala | mit | 771 |
class Test {
def foo(x: Int, y: Int*) = 2
foo(/* line: 2 */x = 2)
} | ilinum/intellij-scala | testdata/resolve2/bug3/SCL4399.scala | Scala | apache-2.0 | 72 |
/**
* 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... | wangcy6/storm_app | frame/kafka-0.11.0/kafka-0.11.0.1-src/core/src/main/scala/kafka/javaapi/OffsetCommitResponse.scala | Scala | apache-2.0 | 1,522 |
package org.jetbrains.plugins.scala
package codeInspection
package unusedInspections
import com.intellij.codeInsight.FileModificationService
import com.intellij.codeInsight.daemon.QuickFixBundle
import com.intellij.codeInsight.intention.{HighPriorityAction, IntentionAction, LowPriorityAction}
import com.intellij.open... | ilinum/intellij-scala | src/org/jetbrains/plugins/scala/codeInspection/unusedInspections/ScalaOptimizeImportsFix.scala | Scala | apache-2.0 | 3,398 |
/**
* ____ __ ____ ____ ____,,___ ____ __ __ ____
* ( _ \\ /__\\ (_ )(_ _)( ___)/ __) ( _ \\( )( )( _ \\ Read
* ) / /(__)\\ / /_ _)(_ )__) \\__ \\ )___/ )(__)( ) _ < README.txt
* (_)\\_)(__)(__)(____)(____)(____)(___/ (__) (______)(____/ LICENSE.txt
*/
... | razie/diesel-rx | diesel/src/main/scala/razie/wiki/model/WikiIndex.scala | Scala | apache-2.0 | 9,568 |
package org.jetbrains.plugins.scala.lang.psi.api.base.patterns
import org.jetbrains.plugins.scala.lang.psi.api.base.ScStableCodeReferenceElement
/**
* @author Alexander Podkhalyuzin
* Date: 28.02.2008
*/
trait ScInfixPattern extends ScPattern {
def leftPattern: ScPattern = findChildByClassScala(classOf[ScPattern])... | gtache/intellij-lsp | intellij-lsp-dotty/src/org/jetbrains/plugins/scala/lang/psi/api/base/patterns/ScInfixPattern.scala | Scala | apache-2.0 | 505 |
import io.aigar.score._
import io.aigar.model.ScoreRepository
import org.scalatest._
import org.scalatest.mockito.MockitoSugar
import org.mockito.Mockito._
import org.mockito.Matchers.any
class ScoreThreadSpec extends FlatSpec with Matchers with MockitoSugar {
"saveScore" should "take a modification and save it" in... | DrPandemic/aigar.io | game/src/test/scala/io/aigar/score/ScoreThreadSpec.scala | Scala | mit | 1,478 |
package domain
import akka.actor._
import akka.persistence.fsm._
import pdi.jwt._
import domain.InstanceAggregate.{Data, State}
import domain.instance.DomainEvent
import scala.concurrent.duration._
import scala.reflect._
import com.softwaremill.tagging._
import services.SchedulerSharder
import akka.http.scaladsl.model... | dit4c/dit4c | dit4c-portal/app/domain/InstanceAggregate.scala | Scala | mit | 21,082 |
package applicant.etl
import applicant.nlp._
import applicant.ml.score._
import scala.io._
import java.io._
import scala.util._
import scala.collection.mutable.LinkedHashMap
import org.apache.spark.input.PortableDataStream
import org.apache.commons.codec.binary.{Hex, Base64}
import java.security.MessageDigest
import o... | dataworks/internship-2016 | etl/src/scala/applicant/etl/ResumeData.scala | Scala | apache-2.0 | 2,510 |
package leon
package laziness
import invariant.util._
import invariant.structure.FunctionUtils._
import purescala.ScalaPrinter
import purescala.Definitions._
import purescala.Expressions._
import purescala.ExprOps._
import HOMemUtil._
import HOMemVerificationPhase._
import utils._
import java.io._
import invariant.en... | regb/leon | src/main/scala/leon/laziness/HOInferencePhase.scala | Scala | gpl-3.0 | 8,943 |
package scalaBasics.generics
class Lion extends Animal {
} | Igerly/scalaBasics | src/scalaBasics/generics/Lion.scala | Scala | mit | 62 |
package org.jetbrains.plugins.scala.structureView
import com.intellij.icons.AllIcons
import com.intellij.ide.structureView.StructureViewTreeElement
import com.intellij.ide.util.treeView.smartTree.TreeElement
import com.intellij.openapi.project.Project
import com.intellij.psi.PsiFileFactory
import com.intellij.psi.impl... | JetBrains/intellij-scala | scala/scala-impl/test/org/jetbrains/plugins/scala/structureView/ScalaStructureViewTestBase.scala | Scala | apache-2.0 | 5,589 |
package fr.sysf.sample
import org.springframework.boot.SpringApplication
import org.springframework.boot.autoconfigure.{EnableAutoConfiguration, SpringBootApplication}
import org.springframework.context.annotation.ComponentScan
@SpringBootApplication
@EnableAutoConfiguration
@ComponentScan
class Application
object ... | fpeyron/sample-scala-camel | src/main/scala/fr/sysf/sample/Application.scala | Scala | apache-2.0 | 403 |
package ar.uba.dc.cap.conversions
import ar.uba.dc.cap._
import scala.collection.mutable.Set
import scala.collection.mutable.ArrayBuffer
/**
* Conversion of the standard type representation with µ binders to automata.
*
* The algorithm consists of two traversals over the type. The first one converts
* the type t... | juanedi/cap-typechecking | scala/src/main/scala/ar/uba/dc/cap/conversions/typeToNode.scala | Scala | gpl-3.0 | 3,872 |
import services.UserService
import dao.{GithubUserDAO, OpenWeatherCityDAO, UserCityDAO}
import org.scalatestplus.play._
import play.core.server.Server
import play.api.routing.sird._
import play.api.test._
import play.api.Application
import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.Awai... | malaman/scala-weather-app | api/test/UserServiceSpec.scala | Scala | mit | 2,808 |
/**
* Licensed to Big Data Genomics (BDG) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The BDG licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use ... | kunalgosar/gnocchi | gnocchi-cli/src/main/scala/net/fnothaft/gnocchi/cli/RegressPhenotypes.scala | Scala | apache-2.0 | 12,374 |
/**
* This file is part of mycollab-esb.
*
* mycollab-esb 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.
*
* mycollab-esb is d... | maduhu/mycollab | mycollab-esb/src/main/scala/com/esofthead/mycollab/module/project/esb/impl/InviteProjectMembersCommand.scala | Scala | agpl-3.0 | 3,988 |
package net.sansa_stack.rdf.spark.io.ntriples
/**
* The mode for parsing N-Triples.
*/
object ParseMode extends Enumeration {
type ParseMode = Value
val REGEX, SPLIT, JENA = Value
}
| SANSA-Stack/SANSA-RDF | sansa-rdf/sansa-rdf-spark/src/main/scala/net/sansa_stack/rdf/spark/io/ntriples/ParseMode.scala | Scala | apache-2.0 | 189 |
package foo
//-------object Next
trait F {
val i: Int = "3" // error line 7 (was 8)
}
| yusuke2255/dotty | tests/untried/neg/t8015-ffa.scala | Scala | bsd-3-clause | 97 |
package org.jetbrains.plugins.scala.lang.optimize
import junit.framework.TestCase
import org.jetbrains.plugins.scala.editor.importOptimizer.BufferUpdate
import org.junit.Assert
import scala.collection.mutable.ArrayBuffer
class IncrementalBufferUpdateTest extends TestCase {
private def doTest(from: Array[String], ... | JetBrains/intellij-scala | scala/scala-impl/test/org/jetbrains/plugins/scala/lang/optimize/IncrementalBufferUpdateTest.scala | Scala | apache-2.0 | 2,250 |
package com.ubirch.user.core.manager
import com.ubirch.user.config.Config
import com.ubirch.user.core.manager.testUtils.DataHelpers
import com.ubirch.user.model.db.{Context, Group, User}
import com.ubirch.user.model.rest.{UserContext, UserInfo}
import com.ubirch.user.testTools.db.mongo.MongoSpec
import com.ubirch.util... | ubirch/ubirch-user-service | core/src/test/scala/com/ubirch/user/core/manager/RegistrationManagerSpec.scala | Scala | apache-2.0 | 8,351 |
package io.youi.upload
import io.youi.History
import io.youi.ajax.AjaxManager
import io.youi.component.FileInput
import io.youi.http.{Headers, HttpMethod}
import io.youi.net._
import org.scalajs.dom.raw.{File, FormData}
import reactify.{Val, Var}
import scala.concurrent.Future
import scala.util.{Failure, Success}
imp... | outr/youi | app/js/src/main/scala/io/youi/upload/UploadManager.scala | Scala | mit | 4,659 |
/*
* Copyright 2016 agido GmbH
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to i... | agido/pageobject | core/src/main/scala/org/pageobject/core/BrowserErrorPage.scala | Scala | apache-2.0 | 1,655 |
package app
import java.security.SignatureException
import javax.crypto.Mac
import javax.crypto.spec.SecretKeySpec
import org.json4s.{DefaultFormats, Formats}
import util.{StringUtil, Keys, FileUtil}
import org.scalatra._
import org.scalatra.servlet.{HasMultipartConfig, MultipartConfig, FileUploadSupport, FileItem}
... | mqshen/gitbucketTest | src/main/scala/app/FileUploadController.scala | Scala | apache-2.0 | 4,990 |
package info.pot420.lucene
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.nio.charset.StandardCharsets;
import java.util.Date;
import org.apache.lucene.analysis.Analyzer;
import org.apache.lucene.analysis.st... | Ervii/garage-time | pajamas/taste/lucene/src/main/scala/info/pot420/lucene/Ask.scala | Scala | apache-2.0 | 1,580 |
/*
* 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 ... | ebruchez/darius-xml.js | xerces/shared/src/main/scala/org/orbeon/apache/xerces/parsers/SAXParser.scala | Scala | apache-2.0 | 1,027 |
/*
* Copyright 2022 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/fset-faststream | app/services/testdata/candidate/sift/SiftEnteredStatusGenerator.scala | Scala | apache-2.0 | 6,563 |
package org.hammerlab.bam.index
import java.io.IOException
import caseapp.{ AppName, ProgName, Recurse, Name ⇒ O }
import grizzled.slf4j.Logging
import htsjdk.samtools.util.{ RuntimeEOFException, RuntimeIOException }
import org.hammerlab.bam.iterator.{ PosStream, RecordStream, SeekablePosStream, SeekableRecordStream ... | ryan-williams/spark-bam | check/src/main/scala/org/hammerlab/bam/index/IndexRecords.scala | Scala | apache-2.0 | 2,954 |
/*
* 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 ... | hvanhovell/spark | sql/core/src/main/scala/org/apache/spark/sql/execution/aggregate/SortAggregateExec.scala | Scala | apache-2.0 | 4,282 |
/*
* 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... | intel-analytics/BigDL | scala/dllib/src/test/scala/com/intel/analytics/bigdl/dllib/nn/ops/LessSpec.scala | Scala | apache-2.0 | 3,269 |
/*
* 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 ... | Panos-Bletsos/spark-cost-model-optimizer | core/src/test/scala/org/apache/spark/rpc/netty/NettyRpcEnvSuite.scala | Scala | apache-2.0 | 1,978 |
package wandou.avpath
import wandou.avro.FromJson
import wandou.avro.ToJson
import wandou.avpath.Evaluator.Ctx
import wandou.avro.Schemas
import org.apache.avro.generic.GenericData
import org.apache.avro.generic.GenericRecord
import org.apache.avro.generic.GenericRecordBuilder
import org.scalatest.BeforeAndAfterAll
im... | wandoulabs/avpath | src/test/scala/wandou/avpath/AvPathSpec.scala | Scala | apache-2.0 | 23,276 |
trait Option[+a]
case class Some[a](x: a) extends Option[a]
case object None extends Option[Nothing]
object test {
def println(str: String): Unit = java.lang.System.out.println(str)
def print(opt: Option[String]) = opt match {
case Some(x) => println(x)
case None => println("nothing")
}
}
| yusuke2255/dotty | tests/pending/pos/patterns1.scala | Scala | bsd-3-clause | 309 |
package misc
import spire.math._
import spire.implicits._
import ammonite.ops._
object MianChowla {
@annotation.tailrec
def firstGap(set: Set[SafeLong], accum: SafeLong = 1): SafeLong = {
if (set contains (accum)) firstGap(set, accum + 1) else accum
}
def xyz(as: Iterable[SafeLong]): Set[SafeLong] = {
... | siddhartha-gadgil/ProvingGround | realfunctions/src/main/scala/misc/MianChowla.scala | Scala | mit | 1,101 |
import scala.reflect.macros.blackbox.Context
object Impls {
def foo[T: c.WeakTypeTag](c: Context)(x: c.Expr[T]) = {
import c.universe._
val body = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant(x.tree.toString))))
c.Expr[Unit](body)
}
}
object Macros {
def ... | martijnhoekstra/scala | test/files/run/macro-invalidusage-partialapplication-with-tparams/Impls_Macros_1.scala | Scala | apache-2.0 | 362 |
/*
*************************************************************************************
* Copyright 2011-2013 Normation SAS
*************************************************************************************
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affe... | Kegeruneku/rudder | rudder-web/src/main/scala/com/normation/rudder/web/comet/WorkflowInformation.scala | Scala | agpl-3.0 | 6,740 |
package se.lu.nateko.cp.data.test.services.etcfacade
import org.scalatest.funspec.AnyFunSpec
import java.time.LocalTime
import scala.concurrent.duration.DurationInt
import se.lu.nateko.cp.data.services.etcfacade.RetryLogic
class RetryLogicTests extends AnyFunSpec{
describe("timeToNextTick"){
import RetryLogic.ti... | ICOS-Carbon-Portal/data | src/test/scala/se/lu/nateko/cp/data/test/services/etcfacade/RetryLogicTests.scala | Scala | gpl-3.0 | 1,677 |
import sbt._
import Keys._
import scalaz.Scalaz.mkIdentity
import scalaz.{Success, Failure}
import com.typesafe.sbteclipse.plugin.EclipsePlugin.EclipseKeys
/**
* See README.md for high-level overview
*
* Libraries Doc Links
*
* Coursera API
* - http://support.coursera.org/customer/portal/articles/573466-progra... | albertpastrana/reactive | suggestions/project/ProgFunBuild.scala | Scala | mit | 27,814 |
/*
* 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 ... | jongwook/incubator-s2graph | s2core/src/main/scala/org/apache/s2graph/core/storage/serde/snapshotedge/tall/SnapshotEdgeDeserializable.scala | Scala | apache-2.0 | 4,444 |
package org.akoshterek.backgammon.move
class XMoveGameInfo {
/* match score BEFORE the game */
var anScore: Array[Int] = Array[Int](0, 0)
var fWinner: Int = 0
/* how many points were scored by the winner */
var nPoints: Int = 0
} | akoshterek/MultiGammonJava | multi-gammon-core/src/main/java/org/akoshterek/backgammon/move/XMoveGameInfo.scala | Scala | gpl-3.0 | 240 |
package shop
import akka.actor.Actor
import shop.ProductCatalogMessages.TopMatching
class ProductCatalogManager(catalog: ProductCatalog) extends Actor {
override def receive: Receive = {
case TopMatching(query, k) => sender() ! catalog.topMatching(query, k)
}
}
object ProductCatalogMessages {
case class T... | apisarek/reactivescala-course | src/main/scala/shop/ProductCatalogManager.scala | Scala | mit | 357 |
/*
* This software is licensed under the GNU Affero General Public License, quoted below.
*
* This file is a part of PowerAPI.
*
* Copyright (C) 2011-2016 Inria, University of Lille 1.
*
* PowerAPI is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public Lice... | Spirals-Team/powerapi | powerapi-core/src/test/scala/org/powerapi/module/extpowermeter/rapl/RAPLHelperSuite.scala | Scala | agpl-3.0 | 1,595 |
package com.harrys.hyppo.worker.data
import java.io.File
import javax.inject.Inject
import com.amazonaws.services.s3.AmazonS3Client
import com.amazonaws.services.s3.model.{PutObjectResult, S3Object}
import com.amazonaws.util.Base64
import com.google.inject.assistedinject.Assisted
import com.harrys.hyppo.config.Worker... | harrystech/hyppo-worker | worker/src/main/scala/com/harrys/hyppo/worker/data/S3DataFileHandler.scala | Scala | mit | 5,814 |
/**
* Copyright (c) 2002-2014, OnPoint Digital, Inc. All rights reserved
*
* THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS... | alexwestphal/timez | src/main/scala/timez/instances/time/DayOfWeekInstances.scala | Scala | bsd-3-clause | 1,249 |
package specs
import Generators._
class JObject extends Spec {
"The JObject value" should {
"convert toUnsafe" in {
forAll { jObject: scalajson.ast.JObject =>
val values = jObject.value.map {
case (k, v) =>
scalajson.ast.unsafe.JField(k, v.toUnsafe)
}
Utils.un... | mdedetrich/scalajson | shared/src/test/scala/specs/JObject.scala | Scala | bsd-3-clause | 646 |
package com.dmanchester.playfop.api
import org.specs2.mutable.Specification
class UnitsSpec extends Specification {
"constructor" should {
"throw an IllegalArgumentException on formatPrecision < 0" in {
new Units("mm", -1) must throwAn[IllegalArgumentException]
}
}
"format(Double)" should {
... | dmanchester/playfop | library/src/test/scala/com/dmanchester/playfop/api/UnitsSpec.scala | Scala | apache-2.0 | 1,016 |
/*
* Wire
* Copyright (C) 2016 Wire Swiss GmbH
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This progr... | wireapp/wire-android-sync-engine | zmessaging/src/main/scala/com/waz/model/AESKey.scala | Scala | gpl-3.0 | 2,190 |
package com.sfxcode.sapphire.core.showcase
import com.sfxcode.sapphire.core.application.BaseApplication
import com.sfxcode.sapphire.core.controller.BaseApplicationController
import com.sfxcode.sapphire.core.showcase.controller.ShowcaseViewController
import com.typesafe.scalalogging.LazyLogging
object Application exte... | sfxcode/sapphire-core | demos/showcase/src/main/scala/com/sfxcode/sapphire/core/showcase/Application.scala | Scala | apache-2.0 | 790 |
package net.revenj.storage
import com.fasterxml.jackson.annotation.JsonIgnore
import net.revenj.patterns.Identifiable
case class S3(
bucket: String,
key: String,
length: Long,
name: Option[String] = None,
mimeType: Option[String] = None,
metadata: Map[String, String] = Map.empty
) extends Identifiable {
... | ngs-doo/revenj | scala/revenj-storage/src/main/scala/net/revenj/storage/S3.scala | Scala | bsd-3-clause | 448 |
/*
* Copyright (C) 2016-2019 Lightbend Inc. <https://www.lightbend.com>
*/
package docs.home.scaladsl.serialization
//#registry-compressed
import com.lightbend.lagom.scaladsl.playjson.{JsonSerializer, JsonSerializerRegistry}
object RegistryWithCompression extends JsonSerializerRegistry {
override val serializers ... | rstento/lagom | docs/manual/scala/guide/cluster/code/docs/home/scaladsl/serialization/RegistryWithCompression.scala | Scala | apache-2.0 | 576 |
/*
This file is part of Intake24.
Copyright 2015, 2016 Newcastle University.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by appl... | digitalinteraction/intake24 | FoodDataXML/src/main/scala/uk/ac/ncl/openlab/intake24/foodxml/scripts/DrinkScaleDefDebug.scala | Scala | apache-2.0 | 925 |
/*
* 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 ... | adrian-ionescu/apache-spark | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/objects/objects.scala | Scala | apache-2.0 | 53,710 |
package skinny.nlp
import org.scalatest._
class SkinnyJapaneseAnalyzerSpec extends FlatSpec with Matchers {
it should "be available" in {
val analyzer = SkinnyJapaneseAnalyzer.default
analyzer.toKatanaka("東京特許許可局") should equal("トウキョウトッキョキョカキョク")
analyzer.toHiragana("東京特許許可局") should equal("とうきょうとっきょきょ... | skinny-framework/skinny-framework | common/src/test/scala/skinny/nlp/SkinnyJapaneseAnalyzerSpec.scala | Scala | mit | 507 |
/*
* (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/cogx/platform/cpumemory/FieldMemory.scala | Scala | apache-2.0 | 7,773 |
package api
import scala.concurrent.ExecutionContext
import spray.routing.Directives
import spray.http.MediaTypes.{ `application/json` }
import akka.actor.ActorRef
import akka.util.Timeout
import spray.httpx.SprayJsonSupport._
import com.redis.RedisClient
import spray.json._
import DefaultJsonProtocol._
import models.... | opyate/taximeter | src/main/scala/api/TariffService.scala | Scala | mit | 1,085 |
object Problem01 {
def myLast[A](list: List[A]): A = {
list match {
case x :: Nil => x
case x :: xs => myLast(xs)
}
}
}
| leonardi-tutorials/tutorial-scala | src/main/scala/Problem01.scala | Scala | apache-2.0 | 144 |
package mesosphere.marathon
package api.serialization
import mesosphere.marathon.state.PortDefinition
import scala.jdk.CollectionConverters._
import mesosphere.mesos.protos.Implicits._
import org.apache.mesos
object PortDefinitionSerializer {
def toProto(portDefinition: PortDefinition): mesos.Protos.Port = toProto(... | mesosphere/marathon | src/main/scala/mesosphere/marathon/api/serialization/PortDefinitionSerializer.scala | Scala | apache-2.0 | 1,483 |
/*
* This file is part of EasyForger which is released under GPLv3 License.
* See file LICENSE.txt or go to http://www.gnu.org/licenses/gpl-3.0.en.html for full license details.
*/
package com.easyforger.util
object Version {
final val version = "0.6.2-1.11.2-SNAPSHOT"
}
| easyforger/easyforger | src/main/scala/com/easyforger/util/Version.scala | Scala | gpl-3.0 | 278 |
/*
* 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 ... | prccaraujo/openwhisk | core/controller/src/main/scala/whisk/core/controller/ApiUtils.scala | Scala | apache-2.0 | 16,261 |
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.