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 |
|---|---|---|---|---|---|
import org.specs2.mutable._
import org.specs2.runner._
import org.junit.runner._
import play.api.test._
import play.api.test.Helpers._
/**
* You can mock out a whole application including requests, plugins etc.
* For more information, consult the wiki.
*/
@RunWith(classOf[JUnitRunner])
class ApplicationSpec extend... | Leonti/userpath | test/ApplicationSpec.scala | Scala | mit | 767 |
package odfi.server.api
import org.odfi.indesign.core.harvest.fs.HarvestedFile
import odfi.server.ODFIHarvester
import org.odfi.indesign.core.main.IndesignPlatorm
import java.io.File
import odfi.server.ODFIInstallation
import com.idyria.osi.tea.thread.ThreadLanguage
import odfi.server.ODFIManagerModule
object TestCo... | richnou/odfi-manager | server/src/test/scala/odfi/server/api/TestCommandRun.scala | Scala | lgpl-3.0 | 1,854 |
package todomvc
import preact.Preact.VNode
import preact.macros.PreactComponent
import todomvc.Model.Filter
object FilterButton {
case class Props(filter: Filter, currentFilter: Filter)
}
import todomvc.FilterButton._
@PreactComponent[Props, Unit]
class FilterButton {
import preact.dsl.symbol._
def render()... | LMnet/scala-js-preact | examples/todomvc/src/main/scala/todomvc/FilterButton.scala | Scala | mit | 576 |
/*
* 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 ... | holdenk/spark | sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetIOSuite.scala | Scala | apache-2.0 | 41,259 |
/*
* Copyright 2017 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 agreed to in ... | paypal/squbs | squbs-pattern/src/test/scala/org/squbs/pattern/orchestration/OFutureSpec.scala | Scala | apache-2.0 | 14,042 |
package org.everpeace
package object scalamata{
// Set is equivalent to member ship function.
implicit def set2func[E](set: Set[E]): E => Boolean = set.contains(_)
// Automata on alphabet is equivalent to Seq[Σ] => Boolean
implicit def automaton2func[Q, Σ](a: Automata[Q, Σ]): Seq[Σ] => Boolean = a.accept(_)... | everpeace/scalamata | core/src/main/scala/org/everpeace/package.scala | Scala | mit | 526 |
/* Title: Pure/System/command_line.scala
Author: Makarius
Support for Isabelle/Scala command line tools.
*/
package isabelle
object Command_Line
{
object Chunks
{
private def chunks(list: List[String]): List[List[String]] =
list.indexWhere(_ == "\\n") match {
case -1 => List(list... | MerelyAPseudonym/isabelle | src/Pure/System/command_line.scala | Scala | bsd-3-clause | 873 |
package com.prezi.haskell.gradle.io.packers
import java.io.File
/**
* Abstract zip unpacker interface
*/
trait Unpacker {
def unpack(zipFile: File, targetDir: File): Unit
}
| prezi/gradle-haskell-plugin | src/main/scala/com/prezi/haskell/gradle/io/packers/Unpacker.scala | Scala | apache-2.0 | 181 |
/*
* (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/compiler/codegenerator/opencl/hyperkernels/SubspaceHyperKernel.scala | Scala | apache-2.0 | 4,014 |
package com.transport.domain.protocol
import com.transport.domain.otp.OTPGraphService
import com.vividsolutions.jts.geom.Coordinate
import org.opentripplanner.routing.core.{RoutingRequest, State, TraverseMode, TraverseModeSet}
import org.opentripplanner.routing.location.StreetLocation
import org.opentripplanner.routin... | ksarath/transport-using-opentripplanner | src/test/scala/com/transport/domain/protocol/TripPlanSpec.scala | Scala | apache-2.0 | 1,277 |
package nars.logic.language
import java.util._
import nars.io.Symbols
import nars.storage.Memory
import IntersectionInt._
//remove if not needed
import scala.collection.JavaConversions._
import CompoundTerm._
object IntersectionInt {
/**
* Try to make a new compound from two components. Called by the inference ... | printedheart/opennars | nars_lab_x/nars_scala/src/main/scala/nars/language/IntersectionInt.scala | Scala | agpl-3.0 | 3,886 |
/*
* Copyright (C) 2012 Julien Letrouit
*
* 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... | jletroui/frac | src/test/scala/frac/DefaultDefinitionRepositorySpec.scala | Scala | apache-2.0 | 1,063 |
package net.ceedubs.ficus
import com.typesafe.config.Config
import net.ceedubs.ficus.readers.{AllValueReaderInstances, ValueReader}
trait FicusConfig {
def config: Config
def as[A](path: String)(implicit reader: ValueReader[A]): A = reader.read(config, path)
def getAs[A](path: String)(implicit reader: ValueRe... | ceedubs/ficus | src/main/scala/net/ceedubs/ficus/FicusConfig.scala | Scala | mit | 902 |
package mau.mauannotation
import scala.concurrent.ExecutionContext.Implicits.global
import mau._
import mau.test._
class CompoundIndexAnnotationTest extends MauRedisSpec("CompoundIndexAnnotationTest", true) {
describe("@compoundIndex class annotation") {
it("should allow to find by compoundIndex") {
val... | ExNexu/mau | mau-annotation/src/test/scala/mau/annotation/CompoundIndexAnnotationTest.scala | Scala | apache-2.0 | 1,692 |
/*
Copyright 2012 Twitter, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distr... | avibryant/algebird | algebird-core/src/main/scala/com/twitter/algebird/matrix/AdaptiveMatrix.scala | Scala | apache-2.0 | 4,434 |
/*
* 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 | dcct/src/main/scala/codegen/codegenerators.scala | Scala | bsd-3-clause | 3,495 |
package utils.silhouette
import models.{Manager, TokenManager}
import com.mohiva.play.silhouette.core.Environment
import com.mohiva.play.silhouette.contrib.authenticators.CookieAuthenticator
trait SilhouetteAdminController extends SilhouetteController[Manager, TokenManager] {
lazy val identityService = new Manager... | vtapadia/crickit | modules/admin/app/utils/silhouette/SilhouetteAdminController.scala | Scala | apache-2.0 | 611 |
/*
* Copyright (C) 2016-2019 Lightbend Inc. <https://www.lightbend.com>
*/
package com.lightbend.lagom.internal.projection
import java.net.URLEncoder
import akka.actor.ActorRef
import akka.actor.Props
import akka.cluster.ddata.DistributedData
import akka.actor.Terminated
import akka.actor.Actor
import akka.actor.A... | TimMoore/lagom | projection/core/src/main/scala/com/lightbend/lagom/internal/projection/ProjectionRegistryActor.scala | Scala | apache-2.0 | 11,440 |
package org.jetbrains.sbt.annotator.dependency.ui
import javax.swing.{Icon, JComponent}
import com.intellij.ide.wizard.Step
import com.intellij.openapi.project.Project
import com.intellij.util.ui.JBUI
import org.jetbrains.sbt.annotator.dependency.DependencyPlaceInfo
import org.jetbrains.plugins.scala.extensions
/**
... | jastice/intellij-scala | scala/scala-impl/src/org/jetbrains/sbt/annotator/dependency/ui/SbtPossiblePlacesStep.scala | Scala | apache-2.0 | 1,237 |
import atto._, Atto._
import cats.implicits._
import java.lang.String
import scala.{ Boolean, Char, Double, List, App }
import scala.Predef.charWrapper
object JsonExample extends Whitespace {
// Json AST
sealed trait JValue
case object JNull extends JValue
final case class JBoolean(value: Boolean) extends JVa... | tpolecat/atto | modules/docs/src/main/scala/json.scala | Scala | mit | 12,650 |
package com.datamountaineer.streamreactor.connect.pulsar
import com.datamountaineer.streamreactor.connect.pulsar.config.{PulsarConfigConstants, PulsarSinkConfig, PulsarSinkSettings}
import org.apache.pulsar.client.api.CompressionType
import org.apache.pulsar.client.api.ProducerConfiguration.MessageRoutingMode
import o... | datamountaineer/stream-reactor | kafka-connect-pulsar/src/test/scala/com/datamountaineer/streamreactor/connect/pulsar/ProducerConfigFactoryTest.scala | Scala | apache-2.0 | 3,171 |
package com.monsanto.arch.kamon.prometheus.converter
import com.monsanto.arch.kamon.prometheus.PrometheusSettings
import com.monsanto.arch.kamon.prometheus.metric.{Metric, MetricFamily, MetricValue, PrometheusType}
import kamon.metric.SubscriptionsDispatcher.TickMetricSnapshot
import kamon.metric.instrument._
import k... | MonsantoCo/kamon-prometheus | library/src/main/scala/com/monsanto/arch/kamon/prometheus/converter/SnapshotConverter.scala | Scala | bsd-3-clause | 12,436 |
/*
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... | rangadi/summingbird | summingbird-storm-test/src/test/scala/com/twitter/summingbird/storm/StormLaws.scala | Scala | apache-2.0 | 11,862 |
package edu.berkeley.cs.boom.bloomscala
import edu.berkeley.cs.boom.bloomscala.ast.Program
import scala.collection.{GenSeq, GenMap}
import edu.berkeley.cs.boom.bloomscala.analysis.{Stratifier, DepAnalyzer, Stratum}
// TODO: this test currently has a ton of code duplication.
// This will be eliminated once the strati... | JoshRosen/bloom-compiler | compiler/src/test/scala/edu/berkeley/cs/boom/bloomscala/StratifierSuite.scala | Scala | bsd-3-clause | 4,144 |
package eventstreams.sources.filetailer
trait FileSystemComponent {
def fileSystem: FileSystem
}
| intelix/eventstreams | es-sources/es-source-file/src/main/scala/eventstreams/sources/filetailer/FileSystemComponent.scala | Scala | apache-2.0 | 104 |
package i1202a
class Test[T] {
def testMethod: Unit =
new Foo(this)
}
class Foo[T]() {
def this(ct: Test[T]) = this()
}
| som-snytt/dotty | tests/pos/i1202a.scala | Scala | apache-2.0 | 129 |
package pl.touk.nussknacker.engine.flink.util.transformer
import cats.data.ValidatedNel
import org.apache.flink.api.common.state.ValueStateDescriptor
import org.apache.flink.api.common.typeinfo.TypeInformation
import org.apache.flink.streaming.api.functions.KeyedProcessFunction
import org.apache.flink.streaming.api.sc... | TouK/nussknacker | engine/flink/components/base/src/main/scala/pl/touk/nussknacker/engine/flink/util/transformer/UnionWithMemoTransformer.scala | Scala | apache-2.0 | 5,583 |
/*
* 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 ... | hortonworks-spark/spark-llap | src/main/scala/com/hortonworks/spark/sql/hive/llap/LlapQuery.scala | Scala | apache-2.0 | 1,915 |
package org.ensime.sexp.formats
import scala.util._
import org.ensime.sexp._
class SexpFormatUtilsSpec extends FormatSpec with SexpFormats {
import SexpFormatUtils._
describe("SexpFormatUtils") {
it("should lift writers") {
val lifted = lift(new SexpWriter[SexpString] {
def write(o: SexpString... | jacobono/ensime-server | sexpress/src/test/scala/org/ensime/sexp/formats/SexpFormatUtilsSpec.scala | Scala | gpl-3.0 | 1,945 |
/*
* Copyright 2009-2011 WorldWide Conferencing, LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applica... | lift/framework | web/webkit/src/main/scala/net/liftweb/http/provider/encoder/CookieEncoder.scala | Scala | apache-2.0 | 7,694 |
package benchmarks.simple
import java.util.concurrent.TimeUnit
import benchmarks.{EngineParam, Size, Step, Workload}
import org.openjdk.jmh.annotations._
import org.openjdk.jmh.infra.BenchmarkParams
import rescala.core.{Engine, Struct}
import rescala.reactives.{Signal, Var}
@BenchmarkMode(Array(Mode.Throughput))
@Ou... | volkc/REScala | Research/Microbenchmarks/src/main/scala/benchmarks/simple/ChainSignalHalfChange.scala | Scala | apache-2.0 | 1,172 |
package mot.dump
import java.io.OutputStream
import java.text.SimpleDateFormat
import mot.impl.Connection
object Direction extends Enumeration {
val Incoming, Outgoing = Value
}
trait Event {
val timestampMs = System.currentTimeMillis()
def direction: Direction.Value
def conn: Connection
def print(os:... | marianobarrios/mot | src/main/scala/mot/dump/Event.scala | Scala | bsd-2-clause | 748 |
package com.kodekutters.gpsd4scala.collector
import com.kodekutters.gpsd4scala.protocol.Report
/**
* Author: Ringo Wathelet
* Date: 19/04/13
* Version: 1
*/
trait Collector {
def collect(info: Report)
}
| workingDog/Gpsd4Scala | src/main/scala/com/kodekutters/gpsd4scala/collector/Collector.scala | Scala | bsd-3-clause | 213 |
/**
* @author Daniel Perez
*/
package net.javachallenge.util.settings
/**
* A general wrapper to load settings from files
*/
object SettingsLoader {
/**
* Gets the loader class name depending on the format and current settings
*/
def loadSettings: Unit = EffectiveSettings.settingsFormat match {
ca... | AI-comp/JavaChallenge2012 | src/main/scala/net/javachallenge/util/settings/SettingsLoader.scala | Scala | apache-2.0 | 1,047 |
/*
* Copyright (c) 2012-2016 Snowplow Analytics Ltd. All rights reserved.
*
* This program is licensed to you under the Apache License Version 2.0,
* and you may not use this file except in compliance with the Apache License Version 2.0.
* You may obtain a copy of the Apache License Version 2.0 at http://www.apach... | TimothyKlim/snowplow | 3-enrich/scala-common-enrich/src/main/scala/com.snowplowanalytics.snowplow.enrich/common/enrichments/registry/apirequest/Errors.scala | Scala | apache-2.0 | 1,155 |
package de.kaufhof.hajobs.testutils
import org.scalatest.concurrent.{Eventually, IntegrationPatience}
abstract class CassandraSpec extends StandardSpec with TestCassandraConnection with Eventually with IntegrationPatience {
} | MarcoPriebe/ha-jobs | ha-jobs-core/src/test/scala/de/kaufhof/hajobs/testutils/CassandraSpec.scala | Scala | apache-2.0 | 228 |
package com.twitter.finagle.netty4.http
import com.twitter.app.GlobalFlag
import com.twitter.finagle.http.{
Chunk,
Fields,
HeaderMap,
Method,
Request,
Response,
Status,
Version
}
import com.twitter.finagle.netty4.ByteBufConversion
import com.twitter.io.Reader
import io.netty.handler.codec.{http => Nett... | luciferous/finagle | finagle-netty4-http/src/main/scala/com/twitter/finagle/netty4/http/Bijections.scala | Scala | apache-2.0 | 6,722 |
/*
* Copyright 2021 HM Revenue & Customs
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or a... | hmrc/ct-calculations | src/main/scala/uk/gov/hmrc/ct/accounts/frs102/calculations/TotalCurrentAssetsCalculator.scala | Scala | apache-2.0 | 1,290 |
package cosbench_ng
import org.slf4j. { LoggerFactory }
import java.util.Date
import java.nio.file.{ FileSystems, Files, StandardOpenOption }
case class IntermediateStats (vSum_ : Double = 0, vSumSqr: Double = 0, count: Long =0, k: Option[Double] = None)
case class Metric(average: Double = 0,
min: Double = 99... | vardhanv/cosbench_ng | server/src/main/scala/SmryStats.scala | Scala | mit | 6,724 |
/***********************************************************************
* 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-tools/src/main/scala/org/locationtech/geomesa/tools/export/formats/NullExporter.scala | Scala | apache-2.0 | 913 |
package pl.touk.nussknacker.engine.api
case class ValueWithContext[T](value: T, context: Context) {
def map[N](f: T => N): ValueWithContext[N] =
copy(value = f(value))
}
| TouK/nussknacker | components-api/src/main/scala/pl/touk/nussknacker/engine/api/ValueWithContext.scala | Scala | apache-2.0 | 179 |
/*
* 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 ... | trueyao/spark-lever | core/src/main/scala/org/apache/spark/scheduler/ShuffleMapTask.scala | Scala | apache-2.0 | 3,479 |
/***********************************************************************
* Copyright (c) 2013-2022 Commonwealth Computer Research, Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Apache License, Version 2.0
* which accompanies this distribution and... | locationtech/geomesa | geomesa-redis/geomesa-redis-tools/src/main/scala/org/locationtech/geomesa/redis/tools/RedisDataStoreCommand.scala | Scala | apache-2.0 | 2,000 |
/*
* 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/entitlement/PackageCollection.scala | Scala | apache-2.0 | 6,468 |
package hr.element.beepo
package Security.postgres
import hr.ngs.patterns._
class UserRepository(
private val sessionFactory: org.pgscala.PGSessionFactory
, private val locator: IServiceLocator
) extends Security.IUserRepository {
import org.pgscala._
val createFromResultSet = (rS: PGScalaResultSet) =>
... | element-doo/beepo | code/scala/model-services-generated/src/main/scala/hr/element/beepo/Security/postgres/UserRepository.scala | Scala | bsd-3-clause | 2,232 |
package io.github.rlazoti.tictactoe.models
object Piece {
def getByType(pieceType: String): Piece =
pieceType match {
case "X" | "x" => Cross()
case _ => Nought()
}
def getOpponentPiece(playerPiece: Piece) =
playerPiece match {
case Cross() => Nought()
case _ => Cross()
}
}... | rlazoti/tictactoe-scala-react | src/main/scala/io/github/rlazoti/tictactoe/models/Player.scala | Scala | apache-2.0 | 741 |
package io.getquill.context.finagle.mysql
import io.getquill.context.sql.ProductSpec
import com.twitter.util.Await
import com.twitter.util.Future
import io.getquill.context.sql.Id
class ProductFinagleMysqlSpec extends ProductSpec {
val context = testContext
import testContext._
def await[T](r: Future[T]) = Aw... | jcranky/quill | quill-finagle-mysql/src/test/scala/io/getquill/context/finagle/mysql/ProductFinagleMysqlSpec.scala | Scala | apache-2.0 | 3,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 ... | bdrillard/spark | core/src/test/scala/org/apache/spark/network/netty/SparkTransportConfSuite.scala | Scala | apache-2.0 | 3,538 |
package mlbigbook.ml
import simulacrum._
@typeclass
trait Hashable[T] {
def hash(t: T): Int
}
object ImplicitHashable {
implicit val bIsH: Hashable[Boolean] = new Hashable[Boolean] {
@inline override def hash(t: Boolean) = if (t) 1 else 0
}
implicit val iIsH: Hashable[Int] = new Hashable[Int] {
@in... | malcolmgreaves/bigmlbook | fp4ml-main/src/main/scala/mlbigbook/ml/Hashable.scala | Scala | lgpl-3.0 | 738 |
package com.softwaremill.codebrag.rest
import com.typesafe.scalalogging.slf4j.Logging
import com.softwaremill.codebrag.service.user.Authenticator
import com.softwaremill.codebrag.domain.RepositoryStatus
import com.softwaremill.codebrag.dao.repositorystatus.RepositoryStatusDAO
import com.softwaremill.codebrag.repositor... | softwaremill/codebrag | codebrag-rest/src/main/scala/com/softwaremill/codebrag/rest/RepoStatusServlet.scala | Scala | agpl-3.0 | 1,138 |
package im.actor.server.group
import akka.pattern.ask
import akka.util.Timeout
import im.actor.api.rpc.AuthorizedClientData
import im.actor.api.rpc.groups.{ Group ⇒ ApiGroup, Member ⇒ ApiMember }
import im.actor.server.file.Avatar
import im.actor.server.sequence.{ SeqState, SeqStateDate }
import scala.concurrent.{ Ex... | berserkertdl/actor-platform | actor-server/actor-core/src/main/scala/im/actor/server/group/GroupOperations.scala | Scala | mit | 7,392 |
package shield.implicits
import com.amazonaws.auth.{AWSCredentials, AWSCredentialsProvider, AWSCredentialsProviderChain}
import org.specs2.mutable.Specification
import shield.aws.{AWSSigningConfig, AuthUtil}
import spray.http._
/**
* Created by amaffei on 3/15/16.
*/
class AuthUtilSpec extends Specification {
//S... | RetailMeNot/shield | src/test/scala/shield/implicits/AuthUtilSpec.scala | Scala | mit | 3,056 |
/*
* 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... | openmole/openmole | openmole/third-parties/org.openmole.tool.lock/src/main/scala/org/openmole/tool/lock/package.scala | Scala | agpl-3.0 | 1,614 |
package org.openurp.edu.eams.teach.program.major.web.action
import java.util.Date
import org.apache.commons.lang3.ArrayUtils
import org.beangle.commons.collection.Collections
import org.beangle.data.jpa.dao.OqlBuilder
import org.beangle.security.blueprint.User
import com.ekingstar.eams.core.CommonAuditState
import o... | openurp/edu-eams-webapp | plan/src/main/scala/org/openurp/edu/eams/teach/program/major/web/action/MajorPlanAuditAction.scala | Scala | gpl-3.0 | 5,345 |
/*
* Copyright (C) 2016-2019 Lightbend Inc. <https://www.lightbend.com>
*/
package com.lightbend.lagom.internal.scaladsl.persistence.jdbc
import java.sql.Connection
import akka.persistence.query.Offset
import akka.stream.scaladsl.Flow
import akka.{ Done, NotUsed }
import com.lightbend.lagom.internal.persistence.jd... | rstento/lagom | persistence-jdbc/scaladsl/src/main/scala/com/lightbend/lagom/internal/scaladsl/persistence/jdbc/JdbcReadSideImpl.scala | Scala | apache-2.0 | 4,136 |
/**
* Copyright (c) 2012-2013, Tomasz Kaczmarzyk.
*
* This file is part of BeanDiff.
*
* BeanDiff is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your o... | tkaczmarzyk/beandiff | src/test/scala/org/beandiff/support/ObjectSupportTest.scala | Scala | lgpl-3.0 | 2,015 |
package org.scalafmt.dynamic
import java.io.{ByteArrayOutputStream, PrintStream, PrintWriter}
import java.nio.charset.StandardCharsets
import java.nio.file.{Files, Path, Paths}
import java.nio.file.attribute.FileTime
import org.scalafmt.interfaces.{PositionException, Scalafmt, ScalafmtReporter}
import PositionSyntax.... | scalameta/scalafmt | scalafmt-dynamic/src/test/scala/org/scalafmt/dynamic/DynamicSuite.scala | Scala | apache-2.0 | 16,623 |
/*
* Copyright 2011-2018 GatlingCorp (http://gatling.io)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applic... | wiacekm/gatling | gatling-charts/src/main/scala/io/gatling/charts/stats/buffers/SessionDeltaPerSecBuffers.scala | Scala | apache-2.0 | 4,387 |
/*
* 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 ... | trueyao/spark-lever | external/twitter/src/main/scala/org/apache/spark/streaming/twitter/TwitterInputDStream.scala | Scala | apache-2.0 | 3,937 |
package hotpepper4s
/**
* @author ponkotuy
*/
trait Budget {
def code: String
def name: String
def average: String
def codeName: CodeName = CodeName(code, name)
}
object Budget {
case class NormalBudget(code: String, name: String, average: String) extends Budget
case class LimitedBudget(code: String, na... | ponkotuy/hotpepper4s | src/main/scala/hotpepper4s/Budget.scala | Scala | mit | 451 |
object main extends App {
/*
* map:
* Operation "map" takes operand List[T]
* and a function of type T => U.
* It returns the list that resuts from applying the function f
* to each list List[T] element.
*/
val x1 = List(1, 2, 3)
val x2 = x1.map(_ + 1)
println(x1)
println(x2)
val x3 = ... | arcyfelix/Courses | 18-10-18-Programming-in-Scala-by-Martin-Odersky-Lex-Spoon-and-Bill-Venners/46-Higher-OrderMethodsOnClassList/src/main.scala | Scala | apache-2.0 | 4,601 |
/*
* 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/study-category-theory | scalaz-test/src/test/scala/com/github/dnvriend/disjunction/DisjunctionTest.scala | Scala | apache-2.0 | 9,535 |
/*
* Copyright 2011-2022 GatlingCorp (https://gatling.io)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by appli... | gatling/gatling | gatling-commons/src/main/scala/io/gatling/commons/util/GzipHelper.scala | Scala | apache-2.0 | 1,235 |
/*
* Monkeyman static web site generator
* Copyright (C) 2013 Wilfred Springer
*
* 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 2
* of the License, or (at your option) an... | wspringer/monkeyman | src/main/scala/nl/flotsam/monkeyman/ClasspathResource.scala | Scala | gpl-2.0 | 1,399 |
package pdi.jwt
import java.security.spec.ECGenParameterSpec
import java.security.{KeyPairGenerator, SecureRandom}
import org.scalacheck.Gen
import org.scalacheck.Prop._
import pdi.jwt.exceptions.JwtSignatureFormatException
case class TestObject(value: String) {
override def toString(): String = this.value
}
cla... | pauldijou/jwt-scala | core/src/test/scala/JwtUtilsSpec.scala | Scala | apache-2.0 | 7,870 |
import sbt._
/**
* Generate a range of boilerplate classes that would be tedious to write and maintain by hand.
*
* Copied, with some modifications, from
* [[https://github.com/milessabin/shapeless/blob/master/project/Boilerplate.scala Shapeless]].
*
* @author Miles Sabin
* @author Kevin Wright
*/
object Boile... | tixxit/algebra | project/Boilerplate.scala | Scala | mit | 6,295 |
/* Copyright (c) 2016 Lucas Satabin
*
* 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... | satabin/lingua | lexikon/src/main/scala/lingua/lexikon/Options.scala | Scala | apache-2.0 | 2,090 |
/*
* 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 ... | bwsw/sj-platform | core/sj-regular-streaming-engine/src/test/scala/com/bwsw/sj/engine/regular/module/SjRegularModuleDestroy.scala | Scala | apache-2.0 | 2,076 |
/*
* @author Philip Stutz
*
* Copyright 2014 University of Zurich
*
* 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
*
* U... | uzh/triplerush | src/test/scala/com/signalcollect/triplerush/SparqlSpec.scala | Scala | apache-2.0 | 2,304 |
package scalax.collection
package mutable
import scala.collection.mutable.{ExtHashSet, GrowableBuilder}
import scala.collection.{IterableFactory, IterableFactoryDefaults, SortedSet, StrictOptimizedIterableOps}
import scala.util.Random
import scalax.collection.immutable.SortedArraySet
/** A basic [[ArraySet]] impleme... | scala-graph/scala-graph | core/src/main/scala/scalax/collection/mutable/SimpleArraySet.scala | Scala | apache-2.0 | 8,608 |
package reopp.common.examples
import reopp.common.guardedcommands.dataconnectors.ConnectorGen._
import reopp.common.{NoneSol, SomeSol}
/**
* Divide 100 by the input value. Shows the usage of partial functions.
* Note that several things are partial functions in Scala, including most scala sequences (lists) and maps... | joseproenca/ip-constraints | code/src/main/scala/reopp/common/examples/Divide.scala | Scala | mit | 972 |
/**
* @author Francisco Miguel Arámburo Torres - atfm05@gmail.com
*/
package engine
/** Interface to reset parameters of an object. */
trait Resettable {
/** Resets parameters of an object.
*
* @param variables that may be used.
*/
def reset (variables: Array[String]): Unit
}
| FrancoAra/census | app/engine/Resettable.scala | Scala | mit | 302 |
/*
* 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... | yiheng/BigDL | spark/dl/src/test/scala/com/intel/analytics/bigdl/utils/tf/loaders/ReciprocalSpec.scala | Scala | apache-2.0 | 1,219 |
package com.cloudray.scalapress.plugin.compatibility
import org.springframework.stereotype.Controller
import org.springframework.web.bind.annotation.{PathVariable, RequestParam, RequestMapping}
import com.cloudray.scalapress.util.UrlGenerator
import org.springframework.beans.factory.annotation.Autowired
import com.clo... | vidyacraghav/scalapress | src/main/scala/com/cloudray/scalapress/plugin/compatibility/ECRedirectController.scala | Scala | apache-2.0 | 1,177 |
package colossus
package protocols.redis
import core._
import service._
class RedisServerCodec extends Codec.ServerCodec[Command, Reply] {
private var commandParser = RedisCommandParser.command
def reset() {
commandParser = RedisCommandParser.command
}
def encode(reply: Reply) = reply.raw
def decode(da... | noikiy/colossus | colossus/src/main/scala/colossus/protocols/redis/RedisServerCodec.scala | Scala | apache-2.0 | 420 |
object Test {
def main(args: Array[String]): Unit = {
val a = Array.ofDim[Int](2,2)
test(a)
}
def test[A](t: Array[Array[A]]): Unit = {
val tmp = t(0)
t(1) = tmp
}
}
| yusuke2255/dotty | tests/run/t2005.scala | Scala | bsd-3-clause | 190 |
package io.hydrosphere.mist.master
import akka.http.scaladsl.model.{HttpRequest, HttpResponse}
import akka.stream.scaladsl.Flow
import com.typesafe.config.ConfigFactory
import scala.concurrent.duration.{Duration, FiniteDuration}
import scala.concurrent.{Await, Future, Promise}
trait TestUtils {
implicit class Awa... | Hydrospheredata/mist | mist/master/src/test/scala/io/hydrosphere/mist/master/TestUtils.scala | Scala | apache-2.0 | 2,262 |
/*
* 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/AlternatePath.scala | Scala | apache-2.0 | 4,933 |
/**
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed ... | guozhangwang/kafka | core/src/test/scala/unit/kafka/server/ControllerMutationQuotaTest.scala | Scala | apache-2.0 | 18,899 |
package org.usagram.clarify.generation.generator
object Fragments {
def ComplexValidator(n: Int) = s"ComplexValidator$n"
def Validity(n: Int) = s"Validity$n"
def Product(n: Int) = s"Product$n"
def V(n: Int) = new Fragment(n)("V" + _)
def Indefinite(n: Int) = new Fragment(n)("Indefinite[" + V(_) + "]")
... | takkkun/clarify | generation/src/main/scala/org/usagram/clarify/generation/generator/Fragments.scala | Scala | mit | 775 |
/*
* 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/reliable-http-client | rhttpc-akka-persistence/src/main/scala/rhttpc/akkapersistence/impl/StateTransitionHandler.scala | Scala | apache-2.0 | 1,969 |
package de.alog.util
import akka.actor._
import com.mongodb.casbah.Imports._
import com.typesafe.config.Config
class LogDatabaseImpl(config: Config) extends Extension {
lazy val mongoDb:MongoDB = createMongoDbConn
private def createMongoDbConn = {
import com.mongodb.casbah.commons.conversions.scala._
... | eweinell/alog | alog/src/main/scala/de/alog/util/LogDatabase.scala | Scala | apache-2.0 | 1,200 |
package fif
import algebra.Semigroup
object TestHelpers {
implicit val sg = new Semigroup[Int] {
override def combine(a: Int, b: Int) = a + b
}
}
| malcolmgreaves/abstract_data | data-tc-extra/src/test/scala/fif/TestHelpers.scala | Scala | apache-2.0 | 158 |
/*
* 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/main/scala/com/intel/analytics/bigdl/dllib/utils/tf/loaders/RandomUniform.scala | Scala | apache-2.0 | 1,766 |
package org.flowpaint.brush
import scala.xml.Node
import org.flowpaint.filters.{StrokeListener, StrokeFilter, PathProcessor}
import org.flowpaint.ink.Ink
import javax.swing.JComponent
import org.flowpaint.pixelprocessor.{PixelProcessor, ScanlineCalculator}
import org.flowpaint.property.{DataEditor, GradientSliderEdito... | zzorn/flowpaint | src/main/scala/org/flowpaint/brush/Brush.scala | Scala | gpl-2.0 | 4,714 |
package com.wavesplatform.generator
import java.net.{InetSocketAddress, URL}
import java.time.LocalDateTime
import java.time.temporal.ChronoUnit
import cats.Show
import cats.effect.concurrent.Ref
import cats.syntax.flatMap._
import com.wavesplatform.generator.Worker.{EmptyState, Settings, SkipState, State}
import com... | wavesplatform/Waves | node-generator/src/main/scala/com/wavesplatform/generator/Worker.scala | Scala | mit | 9,801 |
package com.teambytes.awsleader
import akka.actor._
import akka.cluster.ClusterEvent.{MemberRemoved, MemberUp, CurrentClusterState, ClusterDomainEvent}
import akka.cluster.{MemberStatus, Cluster, Member}
import com.teambytes.awsleader.LeaderElectionActor.{Data, State}
private[awsleader] class LeaderElectionActor(minM... | grahamar/aws-leader-election | src/main/scala/com/teambytes/awsleader/LeaderElectionActor.scala | Scala | apache-2.0 | 3,115 |
package io.neons.collector.application.guice.application.akka.actor
import akka.actor.{Actor, IndirectActorProducer}
import com.google.inject.name.Names
import com.google.inject.{Injector, Key}
class GuiceActorProducer(injector: Injector, actorName: String) extends IndirectActorProducer {
override def produce(): Ac... | NeonsIo/collector | src/main/scala/io/neons/collector/application/guice/application/akka/actor/GuiceActorProducer.scala | Scala | mit | 458 |
/*
* Copyright (C) 2009-2017 Lightbend Inc. <https://www.lightbend.com>
*/
package akka.http.play
import akka.http.impl.engine.ws._
import akka.http.scaladsl.model.HttpResponse
import akka.http.scaladsl.model.ws.UpgradeToWebSocket
import akka.stream.scaladsl._
import akka.stream.stage._
import akka.stream.{ Attribut... | wsargent/playframework | framework/src/play-akka-http-server/src/main/scala/akka/http/play/WebSocketHandler.scala | Scala | apache-2.0 | 7,934 |
package io.github.benwhitehead.finch
import com.twitter.finagle.Service
import com.twitter.finagle.httpx.Method
import com.twitter.finagle.httpx.path.{->, /, Root}
import com.twitter.util.Future
import io.finch._
import io.finch.request.RequiredBody
import io.finch.response._
import io.github.benwhitehead.finch.reques... | samklr/finch-server | src/test/scala/io/github/benwhitehead/finch/TestingServer.scala | Scala | apache-2.0 | 1,903 |
package org.shelmet.heap.model
import org.shelmet.heap.util.Misc
import org.shelmet.heap.HeapId
import org.shelmet.heap.shared.InstanceId
import scala.collection.SortedSet
/**
* Represents an object that's allocated out of the Java heap. It occupies
* memory in the VM. It can be a
* JavaClass, a JavaObjectArray,... | rorygraves/shelmet | src/main/scala/org/shelmet/heap/model/JavaHeapObject.scala | Scala | gpl-2.0 | 3,533 |
/*
* 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 swave.core.util
import scala.annotation.tailrec
import scala.collection.mutable
final class RichArra... | sirthias/swave | core/src/main/scala/swave/core/util/RichArrayBuffer.scala | Scala | mpl-2.0 | 1,049 |
/*
* Copyright (C) Lightbend Inc. <https://www.lightbend.com>
*/
package play.api
import java.io.File
import java.net.URI
import java.net.URL
import java.util.Properties
import java.time.Period
import java.time.temporal.TemporalAmount
import com.typesafe.config._
import play.twirl.api.utils.StringEscapeUtils
impor... | benmccann/playframework | core/play/src/main/scala/play/api/Configuration.scala | Scala | apache-2.0 | 18,291 |
/*
* 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 ... | cloud-fan/spark | sql/core/src/main/scala/org/apache/spark/sql/execution/adaptive/ShufflePartitionsUtil.scala | Scala | apache-2.0 | 13,867 |
/*
* Copyright 2015 MongoDB, 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 ... | jCalamari/mongo-scala-driver | driver/src/main/scala/org/mongodb/scala/MapReduceObservable.scala | Scala | apache-2.0 | 7,976 |
/**
* 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... | akosiaris/kafka | core/src/main/scala/kafka/api/OffsetFetchResponse.scala | Scala | apache-2.0 | 3,513 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | ueshin/apache-spark | resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s/features/KubernetesDriverCustomFeatureConfigStep.scala | Scala | apache-2.0 | 2,861 |
/*
* 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 ... | zohar-mizrahi/flink | flink-libraries/flink-table/src/main/scala/org/apache/flink/table/plan/nodes/dataset/DataSetAggregate.scala | Scala | apache-2.0 | 5,634 |
package debop4s.data.slick
// NOTE : SlickExampleDatabase._ 와 SlickExampleDatabase.driver.simple._ 을 꼭 import 해줘야 합니다.
import debop4s.data.slick.SlickExampleDatabase._
import debop4s.data.slick.SlickExampleDatabase.driver.simple._
import scala.util.Try
/**
* SlickComponentFunSuite
* @author sunghyouk.bae@gmail.co... | debop/debop4s | debop4s-data-slick/src/test/scala/debop4s/data/slick/SlickExampleDatabaseFunSuite.scala | Scala | apache-2.0 | 3,480 |
/* Copyright 2009-2016 EPFL, Lausanne */
import leon.lang._
import leon.lang.synthesis._
import leon.annotation._
object Complete {
sealed abstract class List
case class Cons(head: BigInt, tail: List) extends List
case object Nil extends List
def size(l: List) : BigInt = (l match {
case Nil => 0
... | regb/leon | src/test/resources/regression/synthesis/SortedList/Diff.scala | Scala | gpl-3.0 | 1,279 |
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.