code stringlengths 5 1M | repo_name stringlengths 5 109 | path stringlengths 6 208 | language stringclasses 1
value | license stringclasses 15
values | size int64 5 1M |
|---|---|---|---|---|---|
package br.gov.lexml.parser.pl.util
object Entities {
val entities = Map[String,Char](
"aacute " -> 'á',
"Aacute " -> 'Á',
"abreve " -> 'ă',
"Abreve " -> 'Ă',
"ac" -> '∾',
"acd " -> '∿',
"acirc " -> 'â',
"Acirc " -> 'Â',
"acute" -> '´',
"acy " -> 'а',
"Acy " -> 'А',
"... | lexml/lexml-parser-projeto-lei | src/main/scala/br/gov/lexml/parser/pl/util/Entities.scala | Scala | gpl-2.0 | 41,747 |
package com.pauldoo.euler.puzzle
import com.pauldoo.euler.common.Summations.sumOfSquares
import com.pauldoo.euler.common.Summations.sum
object Puzzle6 extends Puzzle {
def answer() = {
def square(n: BigInt) = n * n;
square(sum(1 to 100)) - sumOfSquares(100);
}
} | pauldoo/projecteuler | src/com/pauldoo/euler/puzzle/Puzzle6.scala | Scala | isc | 275 |
/*
* 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 ... | fhueske/flink | flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/codegen/calls/StringCallGen.scala | Scala | apache-2.0 | 27,018 |
package lila.tournament
import org.joda.time.DateTime
import reactivemongo.api.ReadPreference
import scala.concurrent.duration._
import lila.db.dsl._
import lila.user.User
import lila.memo.CacheApi._
final class TournamentShieldApi(
tournamentRepo: TournamentRepo,
cacheApi: lila.memo.CacheApi
)(implicit ec: ... | luanlv/lila | modules/tournament/src/main/TournamentShield.scala | Scala | mit | 6,468 |
package edu.gemini.pit.ui.util
import com.jgoodies.forms.factories.Borders.DLU4_BORDER
import swing.{Separator, GridBagPanel, Component, Label}
trait Rows { this: GridBagPanel =>
border = DLU4_BORDER
private var row = 0
def addRow(a: Component, b: Component, f:GridBagPanel.Fill.Value = GridBagPanel.Fill.Horizo... | arturog8m/ocs | bundle/edu.gemini.pit/src/main/scala/edu/gemini/pit/ui/util/Rows.scala | Scala | bsd-3-clause | 1,735 |
package blended.activemq.client.internal
import java.io.File
import java.util.concurrent.atomic.{AtomicBoolean, AtomicInteger}
import akka.actor.ActorSystem
import akka.testkit.TestProbe
import blended.activemq.client.{ConnectionVerifierFactory, RoundtripConnectionVerifier, VerificationFailedHandler}
import blended.a... | woq-blended/blended | blended.activemq.client/src/test/scala/blended/activemq/client/internal/SlowRoundtripSpec.scala | Scala | apache-2.0 | 7,101 |
/** Copyright 2015 TappingStone, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law ... | wenaz/PredictionIO | data/src/main/scala/io/prediction/data/webhooks/JsonConnector.scala | Scala | apache-2.0 | 1,007 |
/*
* 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 ... | maropu/spark | sql/core/src/test/scala/org/apache/spark/sql/SparkSessionExtensionSuite.scala | Scala | apache-2.0 | 38,125 |
/*
* 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 ... | shintoio/amaterasu | common/src/main/scala/org/apache/ameterasu/common/execution/actions/Notifier.scala | Scala | apache-2.0 | 1,728 |
package scala.meta.tests
package contrib
import munit.FunSuite
import scala.meta._
import scala.meta.contrib._
class SetExtensionsTest extends FunSuite {
val typeFoo = t"Foo"
val termFoo = q"Foo"
val set = Set(typeFoo, termFoo, q"Foo")
test("Reference equality holds normally") {
assert(set.size == 3)
... | scalameta/scalameta | tests/shared/src/test/scala/scala/meta/tests/contrib/SetExtensionsTest.scala | Scala | bsd-3-clause | 899 |
package metrics
import akka.actor.Actor
import com.amazonaws.services.cloudwatch.AmazonCloudWatchClient
import com.amazonaws.services.cloudwatch.model.{MetricDatum, PutMetricDataRequest, StandardUnit, StatisticSet}
import org.slf4j.{Logger, LoggerFactory}
import scala.jdk.CollectionConverters._
import play.api.{Envir... | guardian/mobile-n10n | common/src/main/scala/metrics/MetricActor.scala | Scala | apache-2.0 | 4,062 |
package org.jetbrains.sbt
package project.template
import java.awt.FlowLayout
import java.io.File
import javax.swing.border.EmptyBorder
import javax.swing._
import com.intellij.ide.util.projectWizard.{ModuleBuilder, ModuleWizardStep, SdkSettingsStep, SettingsStep}
import com.intellij.openapi.application.ApplicationMa... | triplequote/intellij-scala | scala/scala-impl/src/org/jetbrains/sbt/project/template/SbtModuleBuilder.scala | Scala | apache-2.0 | 11,784 |
package renesca.graph
import renesca.parameter.{PropertyKey, PropertyValue}
sealed trait GraphChange {
def isValid: Boolean
}
sealed trait GraphItemChange extends GraphChange {
val item: Item
}
sealed trait GraphPathChange extends GraphChange {
val path: Path
def isValid = (path.relations ++ path.nodes).fo... | renesca/renesca | shared/src/main/scala/renesca/graph/GraphChange.scala | Scala | apache-2.0 | 1,404 |
package ch.bsisa.hyperbird.db.evolution
import play.api.Logger
import play.api.libs.concurrent.Execution.Implicits._
import play.api.libs.ws.Response
import play.api.libs.ws.WS
import scala.concurrent.Future
import ch.bsisa.hyperbird.dao.ws.WSQueries
import ch.bsisa.hyperbird.Implicits._
import ch.bsisa.hyperbird.mode... | bsisa/hb-api | app/ch/bsisa/hyperbird/db/evolution/Version4To5.scala | Scala | gpl-2.0 | 2,914 |
package shared
/**
* Contains the name of a file and its size in bytes.
* <p>
* Created by Matthias Braun on 9/4/2016.
*/
case class FileData(name: String, size: Long)
| mb720/scalajsClientServer | app/shared/src/main/scala/shared/FileData.scala | Scala | bsd-2-clause | 187 |
/**
* This file is part of mycollab-web.
*
* mycollab-web 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-web is d... | uniteddiversity/mycollab | mycollab-web/src/main/scala/com/esofthead/mycollab/module/project/view/bug/BugUrlResolver.scala | Scala | agpl-3.0 | 6,040 |
/*
* This file is part of the \\BlueLaTeX project.
*
* 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 ... | tdurieux/bluelatex | blue-common/src/main/scala/gnieh/blue/common/impl/BlueCommonActivator.scala | Scala | apache-2.0 | 4,891 |
package djinni
import djinni.ast._
import djinni.generatorTools._
import djinni.meta._
class ObjcMarshal(spec: Spec) extends Marshal(spec) {
val constructProxy = "ConstructProxy"
val constructProxyHeader = headerName(constructProxy)
val constructProxyObjc = idObjc.ty(constructProxy) + "." + spec.objcppExt
... | ragnraok/djinni | src/source/ObjcMarshal.scala | Scala | apache-2.0 | 6,866 |
/*
* 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 ... | DieBauer/flink | flink-libraries/flink-table/src/main/scala/org/apache/flink/table/calcite/FlinkPlannerImpl.scala | Scala | apache-2.0 | 7,021 |
package com.github.lavenderx.springbootscala.data.domain
import java.time.LocalDateTime
import scala.beans.BeanProperty
case class Message(name: String,
age: Int,
user: User,
status: Option[Boolean]) {
@BeanProperty
val createdTime: LocalDateTime = LocalDa... | lavenderx/springboot-scala-vue | server/src/main/scala/com/github/lavenderx/springbootscala/data/domain/Message.scala | Scala | mit | 334 |
/***********************************************************************
* 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-tools/src/main/scala/org/locationtech/geomesa/tools/ConvertCommand.scala | Scala | apache-2.0 | 6,897 |
package org.unisonweb.util
import org.unisonweb.EasyTest._
import org.unisonweb._
import org.unisonweb.util.Unboxed.F1.{D_B, L_B, L_L, L_P}
import org.unisonweb.util.Unboxed.F2.{DD_D, LD_L, LL_L}
import org.unisonweb.util.Unboxed.Unboxed
object StreamTests {
val tests = suite("stream")(
suite("native")(
t... | paulp/unison | runtime-jvm/main/src/test/scala/util/StreamTests.scala | Scala | mit | 6,371 |
// Generated by the Scala Plugin for the Protocol Buffer Compiler.
// Do not edit!
//
// Protofile syntax: PROTO3
package scalapb.perf.protos
@SerialVersionUID(0L)
final case class SimpleMessage(
i: _root_.scala.Int = 0,
j: _root_.scala.Int = 0,
k: _root_.com.google.protobuf.ByteString = _root_.com.google... | scalapb/ScalaPB | docs/src/main/scala/generated/scalapb/perf/protos/SimpleMessage.scala | Scala | apache-2.0 | 9,283 |
package scalarules.test
object ClassProvider {
def dissappearingClassMethod: String = "testContents"
}
object BackgroundNoise{}
| bazelbuild/rules_scala | test_expect_failure/disappearing_class/ClassProvider.scala | Scala | apache-2.0 | 133 |
package org.denigma.gsea.views
import org.denigma.binding.views.BindableView
import org.denigma.binding.views.collections.CollectionView
import org.denigma.codemirror.Doc
import org.denigma.controls.binders.CodeBinder
import org.scalajs.dom.raw.{HTMLElement, HTMLTextAreaElement}
import rx.ops._
import rx.{Rx, Var}
im... | antonkulaga/gsea-runner | app/js/src/main/scala/org/denigma/gsea/views/CodeView.scala | Scala | mpl-2.0 | 1,691 |
package typeclass.data
import typeclass.Semigroup
import scalaprops.Gen
case class Last[A](value: Option[A])
object Last {
implicit def gen[A: Gen]: Gen[Last[A]] = Gen[Option[A]].map(Last(_))
implicit def semigroup[A]: Semigroup[Last[A]] = ???
}
| julien-truffaut/Typeclass | exercise/src/main/scala/typeclass/data/Last.scala | Scala | mit | 255 |
package com.rasterfoundry.datamodel
import io.circe.syntax._
import org.scalatest._
import java.util.UUID
class UploadTestSuite extends FunSuite with Matchers {
test(
"non-platform admins should not be able to create uploads for other users") {
val uploadCreate = Upload.Create(
UploadStatus.Uploaded... | aaronxsu/raster-foundry | app-backend/common/src/test/scala/com/UploadSpec.scala | Scala | apache-2.0 | 2,859 |
package com.karasiq.nanoboard.api
case class NanoboardCaptchaImage(index: Int, image: Array[Byte])
case class NanoboardCaptchaRequest(postHash: String, pow: Array[Byte], captcha: NanoboardCaptchaImage)
case class NanoboardCaptchaAnswer(request: NanoboardCaptchaRequest, answer: String) | Karasiq/nanoboard | shared/shared/src/main/scala/com/karasiq/nanoboard/api/NanoboardCaptchaRequest.scala | Scala | apache-2.0 | 288 |
/*
* 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 ... | esi-mineset/spark | external/kafka-0-10-sql/src/test/scala/org/apache/spark/sql/kafka010/KafkaTestUtils.scala | Scala | apache-2.0 | 15,584 |
/*
* Copyright 2015 Dennis Vriend
*
* 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 t... | Tecsisa/akka-http-test | src/test/scala/com/github/dnvriend/webservices/generic/HttpClientTest.scala | Scala | apache-2.0 | 3,768 |
package org.scaladebugger.api.profiles.java.info
import org.scaladebugger.api.lowlevel.events.misc.NoResume
import org.scaladebugger.api.profiles.java.JavaDebugProfile
import org.scaladebugger.api.profiles.traits.info.ThreadInfo
import org.scaladebugger.api.utils.JDITools
import org.scaladebugger.api.virtualmachines.D... | ensime/scala-debugger | scala-debugger-api/src/it/scala-2.10/org/scaladebugger/api/profiles/java/info/JavaObjectInfoScala210IntegrationSpec.scala | Scala | apache-2.0 | 2,280 |
/***********************************************************************
* 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-features/geomesa-feature-kryo/src/main/scala/org/locationtech/geomesa/features/kryo/KryoBufferSimpleFeature.scala | Scala | apache-2.0 | 10,503 |
package lila.analyse
import akka.actor._
import akka.pattern.pipe
import com.typesafe.config.Config
import scala.util.{ Success, Failure }
import spray.caching.{ LruCache, Cache }
import lila.common.PimpedConfig._
final class Env(
config: Config,
db: lila.db.Env,
ai: ActorSelection,
system: ActorSyst... | r0k3/lila | modules/analyse/src/main/Env.scala | Scala | mit | 1,990 |
def factorial(n:Int) = (1 to n).reduceLeft(_ * _)
println(factorial(5))
| Gerhut/scala-for-the-impatient | Chapter12/3.scala | Scala | unlicense | 73 |
package memnets.core
import memnets.model._
object Trial {
def apply(time: Int = -1, name: String = "")(implicit model: Model): Trial = {
val t = new Trial(model, model.trials.length)
model.trials += t
t.name = name
t.time = time
t
}
}
| MemoryNetworks/memnets | api/src/main/scala/memnets/core/Trial.scala | Scala | apache-2.0 | 262 |
package pureconfig
import java.util.regex.Pattern
import scala.util.matching.Regex
import org.scalactic.Equality
import org.scalactic.TypeCheckedTripleEquals._
package object equality {
implicit final val PatternEquality: Equality[Pattern] = new Equality[Pattern] {
def areEqual(a: Pattern, b: Any): Boolean =... | pureconfig/pureconfig | testkit/src/main/scala/pureconfig/equality/package.scala | Scala | mpl-2.0 | 685 |
package thangiee.riotapi.matchhistory
case class ParticipantTimeline(
ancientGolemAssistsPerMinCounts: ParticipantTimelineData = ParticipantTimelineData(),
ancientGolemKillsPerMinCounts: ParticipantTimelineData = ParticipantTimelineData(),
assistedLaneDeathsPerMinDeltas: ParticipantTimelineData = ParticipantT... | Thangiee/Riot-API-Scala | src/main/scala/thangiee/riotapi/matchhistory/ParticipantTimeline.scala | Scala | mit | 2,163 |
/*
* Copyright 2016-2020 47 Degrees Open Source <https://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 ... | scala-exercises/evaluator | server/src/test/scala/org/scalaexercises/evaluator/Implicits.scala | Scala | apache-2.0 | 1,012 |
/*
* Copyright 2014–2017 SlamData 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... | drostron/quasar | blueeyes/src/main/scala/quasar/precog/util/package.scala | Scala | apache-2.0 | 1,058 |
package gapt.examples
import java.io._
import gapt.formats.llk.short._
import gapt.formats.tptp.TptpHOLExporter
import gapt.proofs.HOLSequent
/**
* The object nTape6 generates hard problems for higher order theorem provers containing an axiomatization of
* if-then-else.
* Formulas:
* f1,f2 ... if-then-else... | gapt/gapt | examples/ntape/nTape6.scala | Scala | gpl-3.0 | 5,541 |
package poly.algebra.std
import poly.algebra._
/**
* @author Tongfei Chen
*/
object IntStructure extends EuclideanDomain[Int] with BoundedLattice[Int] with SequentialOrder[Int] with OrderedHashing[Int] {
final def hash(x: Int) = x.##
final val bot: Int = Int.MinValue
final val top: Int = Int.MaxValue
def... | ctongfei/poly-algebra | src/main/scala/poly/algebra/std/IntStructure.scala | Scala | mit | 1,383 |
/**
* License
* =======
*
* The MIT License (MIT)
*
*
* Copyright (c) 2017 Antoine DOERAENE @sherpal
*
* 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 restrictio... | sherpal/scalajs-ui | src/main/scala/gui/LayeredRegion.scala | Scala | mit | 2,711 |
package dotty.tools
package dotc
package interactive
import java.net.URI
import java.io._
import java.nio.file._
import java.nio.file.attribute.BasicFileAttributes
import java.util.zip._
import scala.collection._
import scala.io.Codec
import dotty.tools.io.{ AbstractFile, ClassPath, ClassRepresentation, PlainFile, V... | som-snytt/dotty | compiler/src/dotty/tools/dotc/interactive/InteractiveDriver.scala | Scala | apache-2.0 | 11,842 |
/**
* Copyright 2015 Thomson Reuters
*
* 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 ag... | hochgi/CM-Well | server/project/sbt-zookeeper-plugin/src/main/scala/SbtZookeeperPlugin.scala | Scala | apache-2.0 | 6,988 |
package org.lnu.is.integration.cases.partner
import java.util.UUID
import scala.concurrent.duration.DurationInt
import io.gatling.core.Predef.checkBuilder2Check
import io.gatling.core.Predef.findCheckBuilder2ValidatorCheckBuilder
import io.gatling.core.Predef.exec
import io.gatling.core.Predef.stringToExpression
imp... | ifnul/ums-backend | is-lnu-integration/src/test/scala/org/lnu/is/integration/cases/partner/PartnerIntegrationTest.scala | Scala | apache-2.0 | 2,147 |
object Initialization5 {
case class NoThis() {
val nothis1 = f()
val nothis2 = 0
def f() = g(this)
def g(nt: NoThis) = nt.nothis2
}
}
| epfl-lara/stainless | frontends/benchmarks/extraction/invalid/Initialization5.scala | Scala | apache-2.0 | 156 |
package com.twitter.finagle.mysql.protocol
object Type {
/** MySQL type codes */
val DECIMAL = 0x00;
val TINY = 0x01;
val SHORT = 0x02;
val LONG = 0x03;
val FLOAT = 0x04;
val DOUBLE = 0x05;
val NULL = 0x06;
val TIMESTAMP = 0x07;
val LONGLONG = 0x08;
... | foursquare/finagle | finagle-mysql/src/main/scala/com/twitter/finagle/mysql/protocol/Type.scala | Scala | apache-2.0 | 2,960 |
package foo
// Note: Using traits to get distinct errors
// (instead of sharing one single "')' expected but '}' found." at the end)
//// Multi-line only cases: make sure trailing commas are only supported when multi-line
trait ArgumentExprs1 { f(23, "bar", )(Ev0, Ev1) }
trait ArgumentExprs2 { f(23, "bar")(Ev0, Ev... | scala/scala | test/files/neg/trailing-commas.scala | Scala | apache-2.0 | 1,820 |
/*
* Copyright 2015 PayPal
*
* 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... | keshin/squbs | squbs-unicomplex/src/test/scala/org/squbs/unicomplex/UnicomplexBootSpec.scala | Scala | apache-2.0 | 9,346 |
/*
* 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 ... | Intel-bigdata/OAP | oap-cache/oap/src/main/scala/org/apache/spark/sql/execution/datasources/oap/index/BloomFilter.scala | Scala | apache-2.0 | 3,014 |
/*
* Copyright (C) 2013-2015 by Michael Hombre Brinkmann
*/
package net.twibs.web
import com.google.common.cache.{CacheLoader, CacheBuilder, LoadingCache}
import java.util.concurrent.TimeUnit
import net.twibs.util.{ResponseRequest, Request}
import scala.concurrent.duration._
class ExpiringCacheResponder(delegate:... | hombre/twibs | twibs-web/src/main/scala/net/twibs/web/ExpiringCacheResponder.scala | Scala | apache-2.0 | 983 |
package com.mesosphere.cosmos
import com.mesosphere.cosmos.error.CosmosException
import com.mesosphere.cosmos.error.EndpointUriConnection
import com.mesosphere.cosmos.error.EndpointUriSyntax
import com.mesosphere.cosmos.error.GenericHttpError
import com.mesosphere.cosmos.error.UnsupportedContentEncoding
import com.mes... | dcos/cosmos | cosmos-server/src/main/scala/com/mesosphere/cosmos/HttpClient.scala | Scala | apache-2.0 | 7,352 |
/* __ *\\
** ________ ___ / / ___ __ ____ Scala.js Test Suite **
** / __/ __// _ | / / / _ | __ / // __/ (c) 2013, LAMP/EPFL **
** __\\ \\/ /__/ __ |/ /__/ __ |/_// /_\\ \\ http://scala-js.org/ **
** /____/\\___/... | mdedetrich/scala-js | test-suite/js/src/test/scala/org/scalajs/testsuite/compiler/UnitJSTest.scala | Scala | bsd-3-clause | 787 |
package io.mediachain.translation
import com.fasterxml.jackson.core.JsonFactory
import io.mediachain.XorMatchers
import org.specs2.Specification
import org.json4s.{JObject, JValue, JArray, JInt}
object JsonLoaderSpec extends Specification with XorMatchers {
def is =
s2"""
Loads json from a URL into an ... | mediachain/L-SPACE | translation_engine/src/test/scala/io/mediachain/translation/JsonLoaderSpec.scala | Scala | mit | 5,668 |
package de.johoop.xplane.samples.livemap
import akka.actor.ActorSystem
import akka.stream.{KillSwitches, Materializer}
import akka.stream.scaladsl.{Keep, Sink}
import de.johoop.xplane.samples.livemap.util._
import de.johoop.xplane.util.returning
import de.johoop.xplane.samples.livemap.model.LiveMap
import de.johoop.xp... | jmhofer/xplane-udp | samples/src/main/scala/de/johoop/xplane/samples/livemap/Controller.scala | Scala | gpl-3.0 | 1,676 |
package scala.collection
import org.junit.Assert._
import org.junit.Test
import scala.collection.mutable.{ArrayBuffer, ListBuffer}
import scala.tools.testkit.AssertUtil.assertSameElements
class ViewTest {
@Test
def hasCorrectDropAndTakeMethods(): Unit = {
val iter = Iterable(1, 2, 3)
assertEquals(Itera... | scala/scala | test/junit/scala/collection/ViewTest.scala | Scala | apache-2.0 | 4,098 |
package simplez
import org.specs2.mutable._
import std.option._
import syntax._
class ApplicativeSpec extends Specification {
"An applicative builder" should {
"work for options (Some)" in {
(Option(3) |@| Option(4) |@| Option(5)) { _ + _ + _ } should beSome(12)
}
"work for options (None)" in ... | inoio/simplez | main/src/test/scala/simplez/ApplicativeSpec.scala | Scala | bsd-2-clause | 570 |
package com.github.vonnagy.service.container.security
import com.github.vonnagy.service.container.AkkaTestkitSpecs2Support
import org.specs2.mutable.SpecificationLike
class SSLContextProviderSpec extends AkkaTestkitSpecs2Support with SpecificationLike {
val sys = system
"SSLContextProvider" should {
"allow... | vonnagy/service-container | service-container/src/test/scala/com/github/vonnagy/service/container/security/SSLContextProviderSpec.scala | Scala | apache-2.0 | 971 |
/*
* 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 ... | darionyaphet/spark | sql/catalyst/src/main/scala/org/apache/spark/sql/internal/StaticSQLConf.scala | Scala | apache-2.0 | 9,534 |
package net.sansa_stack.inference.spark.backwardchaining
import net.sansa_stack.inference.rules.RuleSets
import net.sansa_stack.inference.rules.plan.SimpleSQLGenerator
import net.sansa_stack.inference.spark.backwardchaining.tree.{AndNode, OrNode}
import net.sansa_stack.inference.utils.RuleUtils._
import net.sansa_sta... | SANSA-Stack/SANSA-RDF | sansa-inference/sansa-inference-spark/src/main/scala/net/sansa_stack/inference/spark/backwardchaining/BackwardChainingReasonerDataframe.scala | Scala | apache-2.0 | 22,825 |
package com.estus.optimization
import scala.math._
case class Trace () {
private var trace = List.empty[Double]
var converged = false
var convergeStep = 0
def size: Int = trace.size
def add (node: Double): Unit = trace = (node :: trace).sorted take 2
def contains (value: Double): Boolean = trace.c... | EstusDev/Estus | estus-optimization/src/main/scala/Trace.scala | Scala | apache-2.0 | 547 |
/*
* 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 ... | apache/flink | flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/planner/plan/schema/DataStreamTable.scala | Scala | apache-2.0 | 5,906 |
package es.weso.shaclex.repl
/** A parsing result from string input */
sealed trait ParseResult
/** Parsed result is simply a newline */
case object Newline extends ParseResult
/** `ctrl-c` obtained from input string */
case object SigKill extends ParseResult
/** A command is on the format:
*
* ```none
* :comm... | labra/shaclex | src/main/scala/es/weso/shaclex/repl/ParseResult.scala | Scala | mit | 2,349 |
trait Service extends HttpService with ServiceJsonProtocol {
...
def route(model: ActorRef)(implicit askTimeout: Timeout) =
authorizeToken(verifyNotExpired && injectUser) {
user =>
get {
path("sample" / IntNumber) { id =>
onSuccess(model ? id) {
case item:... | VerkhovtsovPavel/BSUIR_Labs | Diploma/diploma-latex/src/routing.scala | Scala | mit | 900 |
import java.io.SequenceInputStream
import java.io.{File, InputStream}
import java.text.SimpleDateFormat
import java.util.Date
import scala.annotation.tailrec
//This script will strip the log files emitted from sbt into something that
//will display in the console in idea
object PRINT {def |(s: Any) = Console.println(... | benjaminjackman/looty | bin/IdeaStrip.scala | Scala | gpl-2.0 | 8,805 |
/* _____ _
* | ___| __ __ _ _ __ ___ (_) __ _ _ __
* | |_ | '__/ _` | '_ ` _ \\| |/ _` | '_ \\
* | _|| | | (_| | | | | | | | (_| | | | |
* |_| |_| \\__,_|_| |_| |_|_|\\__,_|_| |_|
*
* Copyright 2014 Pellucid Analytics
*
* Licensed under the Apache License, Version 2.0 (the "License");
*... | longcao/framian | framian-json-base/src/main/scala/framian/json/JsonModule.scala | Scala | apache-2.0 | 5,456 |
package services
import java.util.UUID
import bson.handlers._
import com.kylegalloway.evescala.{EveScala, EveScalaBuilder}
import com.kylegalloway.evescala.esi.model.CharacterID
import com.kylegalloway.evescala.xml.model._
import com.mohiva.play.silhouette.api.Logger
import com.mohiva.play.silhouette.api.exceptions.N... | pequalsnp/eve-isk-tracker | app/services/WalletJournalService.scala | Scala | mit | 6,854 |
/*
* Copyright 2016 Dennis Vriend
*
* 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 t... | dnvriend/intro-to-akka-streams | src/test/scala/com/github/dnvriend/streams/flow/SimpleFlowTest.scala | Scala | apache-2.0 | 4,138 |
package vep.app.user
import java.time.LocalDateTime
import org.mindrot.jbcrypt.BCrypt
import scalikejdbc.WrappedResultSet
import spray.json.{JsonFormat, JsonParser, RootJsonFormat}
import vep.framework.utils.JsonProtocol
case class User(
id: String,
email: String,
password: String,
role: UserRole.Value,
au... | kneelnrise/vep | src/main/scala/vep/app/user/User.scala | Scala | mit | 3,302 |
/*
* -------------------------------------------------------------------------------------------------
* - Project: Objectify -
* - Copyright: ©2014 Matygo Educational Incorporated operating as Learndot -
* - Author: ... | learndot/Objectify.scala | src/main/scala/org/objectify/resolvers/ServletContextResolver.scala | Scala | mit | 982 |
/*
* Copyright 2020 ABSA Group Limited
*
* 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... | AbsaOSS/spline | persistence/src/main/scala/za/co/absa/spline/persistence/migration/MigrationScript.scala | Scala | apache-2.0 | 1,506 |
package gitbucket.core.model
trait MilestoneComponent extends TemplateComponent { self: Profile =>
import profile.api._
import self._
lazy val Milestones = TableQuery[Milestones]
class Milestones(tag: Tag) extends Table[Milestone](tag, "MILESTONE") with MilestoneTemplate {
override val milestoneId = colu... | shiena/gitbucket | src/main/scala/gitbucket/core/model/Milestone.scala | Scala | apache-2.0 | 1,208 |
package gsd.linux
import cnf.{DimacsReader, SATBuilder, CNFParser}
import org.junit.Test
class LinuxSATTest {
def isDimacsSAT(file: String): Boolean = {
println("Reading %s...".format(file))
val (header, problem) =
(DimacsReader.readHeaderFile(file), DimacsReader.readFile(file))
val sat = new SA... | scas-mdd/linux-variability-analysis-tools.fm-translation | src/test/scala/gsd/linux/LinuxSATTest.scala | Scala | gpl-3.0 | 439 |
package library.network.rpcprotocol
import java.lang.reflect.{ParameterizedType, Type}
import java.util
class ListOfJson[T](var wrapped: Class[_]) extends ParameterizedType
{
def getActualTypeArguments: Array[Type] =
{
return Array[Type](wrapped)
}
def getRawType: Type =
{
return ... | leyyin/university | systems-for-design-and-implementation/labs/lab3/LibraryNetworking/src/library/network/rpcprotocol/ListOfJson.scala | Scala | mit | 412 |
/*
* Copyright (C) 2017 HAT Data Exchange Ltd
* SPDX-License-Identifier: AGPL-3.0
*
* This file is part of the Hub of All Things project (HAT).
*
* HAT 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 Founda... | Hub-of-all-Things/HAT2.0 | hat/app/org/hatdex/hat/utils/NamespaceUtils.scala | Scala | agpl-3.0 | 1,573 |
/**
* 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... | chirino/activemq | activemq-leveldb-store/src/main/scala/org/apache/activemq/leveldb/replicated/ReplicationSupport.scala | Scala | apache-2.0 | 4,227 |
package ml.combust.mleap.runtime.frame
import ml.combust.mleap.core.types._
import ml.combust.mleap.runtime.MleapSupport._
import org.scalatest.FunSpec
class LeapFrameConverterSpec extends FunSpec {
describe("LeapFrameConverter") {
val expectedSchema = StructType(Seq(StructField("test_string", ScalarType.Strin... | combust/mleap | mleap-runtime/src/test/scala/ml/combust/mleap/runtime/frame/LeapFrameConverterSpec.scala | Scala | apache-2.0 | 1,515 |
/*
* 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 ... | kl0u/flink | flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/plan/nodes/physical/batch/BatchPhysicalLocalSortWindowAggregate.scala | Scala | apache-2.0 | 3,327 |
package p
class X[T]
trait A {
def m(s:X[_]) {}
}
trait B extends A {
def f { super.m(null) }
}
| loskutov/intellij-scala | testdata/scalacTests/pos/t1896/D0.scala | Scala | apache-2.0 | 103 |
package org.jetbrains.plugins.scala
package annotator.quickfix
import com.intellij.codeInsight.intention.IntentionAction
import com.intellij.openapi.editor.Editor
import com.intellij.openapi.project.Project
import com.intellij.psi.PsiFile
import org.jetbrains.plugins.scala.codeInsight.intention.types.AddOnlyStrategy
i... | ilinum/intellij-scala | src/org/jetbrains/plugins/scala/annotator/quickfix/AddReturnTypeFix.scala | Scala | apache-2.0 | 1,039 |
/*
* 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 ... | jianran/spark | examples/src/main/scala/org/apache/spark/examples/mllib/PCAOnRowMatrixExample.scala | Scala | apache-2.0 | 2,100 |
package com.bot4s.telegram.models
/**
* This object represents a chat photo.
*
* @param smallFileId String File identifier of small (160x160) chat photo. This file_id can be used only for photo download.
* @param smallFileUniqueId String File unique identifier of small chat photo.
* @param bigFileId ... | mukel/telegrambot4s | core/src/com/bot4s/telegram/models/ChatPhoto.scala | Scala | apache-2.0 | 631 |
package nl.woupiestek.midi
import javax.sound.midi._
object OtherSynthesizerWrapper {
implicit object MessageInstance extends MidiMessages[Synthesizer => Unit] {
override def noteOn(channel: Int, pitch: Int, velocity: Int): (Synthesizer) => Unit =
get(channel) andThen (_.noteOn(pitch, velocity))
pri... | woupiestek/midistuff | src/main/scala/nl/woupiestek/midi/OtherSynthesizerWrapper.scala | Scala | mit | 1,189 |
package com.twitter.util
import com.twitter.conversions.time._
import java.util.concurrent.{Future => JFuture, _}
import org.junit.runner.RunWith
import org.scalatest.FunSuite
import org.scalatest.concurrent.Eventually
import org.scalatest.junit.JUnitRunner
import org.scalatest.time.{Millis, Seconds, Span}
import scal... | folone/util | util-core/src/test/scala/com/twitter/util/FuturePoolTest.scala | Scala | apache-2.0 | 6,670 |
package avrohugger.filesorter
import java.io.File
import scala.annotation.tailrec
import scala.io.Source
/**
* The order in which avsc files are compiled depends on the underlying file
* system (under OSX its is alphabetical, under some linux distros it's not).
* This is an issue when you have a record type th... | julianpeeters/avrohugger | avrohugger-filesorter/src/main/scala/com/julianpeeters/avrohugger/filesorter/AvdlFileSorter.scala | Scala | apache-2.0 | 1,725 |
package com.arcusys.learn.models
import com.arcusys.valamis.questionbank.model.{ Question, Answer }
case class QuizResponse(id: Int, title: String, description: String, logo: String, size: Int, maxDuration: Option[Int])
case class QuizPublishStatusResponse(status: Boolean)
sealed trait QuizContentResponse {
def i... | icacic/Valamis | learn-portlet/src/main/scala/com/arcusys/learn/models/QuizResponse.scala | Scala | gpl-3.0 | 2,597 |
package com.dy.templates.steps
import org.jbehave.core.annotations.{Then, When, Given}
class TestSteps {
@Given("system in default state")
def systemDefaultState() {
// Thread.sleep(5000)
println("System is in default state")
}
@When("I do something")
def userAction() {
println("Uses made some a... | Linosh/mvn-jbehave-webdriver-grid | src/test/scala/com/dy/templates/steps/TestSteps.scala | Scala | apache-2.0 | 448 |
package no.digipost.labs.items
import org.scalatra.test.scalatest._
import org.json4s._
import org.json4s.jackson.JsonMethods._
import org.json4s.jackson.Serialization
import no.digipost.labs.security.Headers
import Headers.X_CSRF_Token
import org.scalatra.test.HttpComponentsClient
import org.bson.types.ObjectId
impor... | digipost/labs | backend/src/test/scala/no/digipost/labs/items/ItemsResourceTest.scala | Scala | apache-2.0 | 14,278 |
package edu.rice.habanero.actors
import java.util.concurrent.ForkJoinPool
import java.util.concurrent.ForkJoinPool.ManagedBlocker
import java.util.concurrent.atomic.AtomicBoolean
import edu.rice.hj.runtime.config.HjSystemProperty
import edu.rice.hj.runtime.util.ModCountDownLatch
import org.jetlang.core.{BatchExecutor... | shamsmahmood/savina | src/main/scala/edu/rice/habanero/actors/JetlangActor.scala | Scala | gpl-2.0 | 4,218 |
package beamly.core.lang.extensions
import beamly.core.lang.TryToFuture
import scala.concurrent.Future
import scala.util.{Failure, Success, Try}
final class TryW[T](val underlying: Try[T]) extends AnyVal {
/**
* Converts [[scala.util.Try]] to [[scala.concurrent.Future]]
* @return Future from Try
*/
@inl... | beamly/beamly.core.lang | src/main/scala/beamly/core/lang/extensions/TryW.scala | Scala | apache-2.0 | 880 |
/**
* 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... | eljefe6a/kafka | core/src/main/scala/kafka/log/Log.scala | Scala | apache-2.0 | 39,302 |
package org.jetbrains.plugins.scala
package refactoring.rename3
import java.io.File
import java.util
import com.intellij.codeInsight.TargetElementUtil
import com.intellij.openapi.editor.Editor
import com.intellij.openapi.fileEditor.FileDocumentManager
import com.intellij.openapi.util.text.StringUtil
import com.intell... | triplequote/intellij-scala | scala/scala-impl/test/org/jetbrains/plugins/scala/refactoring/rename3/ScalaRenameTestBase.scala | Scala | apache-2.0 | 5,631 |
/*
* 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 ... | fanzhidongyzby/flink | flink-scala/src/main/scala/org/apache/flink/api/scala/hadoop/mapreduce/HadoopOutputFormat.scala | Scala | apache-2.0 | 1,287 |
package com.sksamuel.elastic4s
import org.elasticsearch.search.highlight.HighlightBuilder
import scala.language.implicitConversions
/** @author Stephen Samuel */
trait HighlightDsl {
implicit def string2highlightfield(name: String): HighlightDefinition = new HighlightDefinition(name)
def options = new Highligh... | tototoshi/elastic4s | elastic4s-core/src/main/scala/com/sksamuel/elastic4s/highlighting.scala | Scala | apache-2.0 | 3,978 |
package pirate
import pirate.internal._
sealed trait ParseError
case class ParseErrorShowHelpText(sub: Option[String]) extends ParseError
case class ParseErrorOkMessage(s: String) extends ParseError
case class ParseErrorLeftOver(s: List[String]) extends ParseError
case class ParseErrorMessage(s: String) extends Parse... | markhibberd/pirate | src/main/scala/pirate/ParseError.scala | Scala | bsd-3-clause | 526 |
package org.semagrow.sevod.scraper
import org.apache.spark.rdd.RDD
import org.apache.spark.{HashPartitioner, SparkConf, SparkContext}
import org.semagrow.sevod.scraper.io.TriplesIOOps._
import org.apache.jena.graph._
import scala.reflect.ClassTag
/**
* Created by angel on 25/7/2016.
*/
object Scraper {
impor... | semagrow/sevod-scraper | rdfdump-spark/src/main/scala/org/semagrow/sevod/scraper/Scraper.scala | Scala | apache-2.0 | 7,855 |
package services
import com.github.scribejava.core.oauth.OAuth20Service
import spray.json.RootJsonFormat
import scala.concurrent.{ExecutionContext, Future}
trait ExternalApiService {
def getUserInfo[T](code: String, userInfoUrl: String, service: OAuth20Service)(
implicit formatter: RootJsonFormat[T],
e... | sysgears/apollo-universal-starter-kit | modules/authentication/server-scala/src/main/scala/services/ExternalApiService.scala | Scala | mit | 371 |
package de.aaschmid.sbtplugin.testnotifier
import sbt.{Result, TestEvent, TestsListener}
class NotifyingTestsListener(settings: TestNotifySettings) extends TestsListener {
import scala.collection.mutable.ListBuffer
private[testnotifier] val testResults = new ListBuffer[TestResult]()
private var startMillies:... | aaschmid/sbt-test-notifier | src/main/scala/de/aaschmid/sbtplugin/testnotifier/NotifyingTestsListener.scala | Scala | apache-2.0 | 1,203 |
package app.agent
import app.server.CurrentRunStatusUpdate
import im.mange.jetboot._
import im.mange.jetpac._
case class ChecksProgressAgent() extends Renderable {
private val body = div(id = Some("checksProgress"))
private val panel = div(body).styles(marginBottom("10px"))
def render = panel.render
//TODO:... | alltonp/reprobate | src/main/scala/app/agent/ChecksProgressAgent.scala | Scala | apache-2.0 | 1,294 |
package com.twitter.finagle.loadbalancer.distributor
import com.twitter.finagle.ServiceFactory
/**
* A load balancer and its associated weight. Size refers to the
* size of the balancers backing collection. The [[Distributor]]
* operates over these.
*/
case class WeightClass[Req, Rep](
balancer: ServiceFactory[... | twitter/finagle | finagle-core/src/main/scala/com/twitter/finagle/loadbalancer/distributor/WeightClass.scala | Scala | apache-2.0 | 404 |
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.