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 sbtrelease
import org.specs2.mutable.Specification
object VersionSpec extends Specification {
def version(v: String) = Version(v) match {
case Some(parsed) => parsed
case None => sys.error("Can't parse version " + v)
}
"Version bumping" should {
def bump(v: String) = version(v).bump.string... | xuwei-k/sbt-release | src/test/scala/VersionSpec.scala | Scala | apache-2.0 | 2,829 |
package water.app
import org.apache.spark.{SparkContext, SparkConf}
/**
* Publish useful method to configure Spark context.
*/
trait SparkContextSupport {
def configure(appName:String = "Sparkling Water Demo"):SparkConf = {
val conf = new SparkConf()
.setAppName(appName)
conf.setIfMissing("spark.ma... | nvoron23/sparkling-water | core/src/main/scala/water/app/SparkContextSupport.scala | Scala | apache-2.0 | 571 |
package nl.svanwouw.trending.types
/**
* Syntactic sugar for a slope integer.
* Represents the slope of the frequency of occurence of a certain topic in a certain period.
* @param v The value with run time value type.
*/
class Slope(val v: Double) extends AnyVal with Serializable {
override def toString = v.toSt... | stefanvanwouw/spark-based-trending-topics-extraction | src/main/scala/nl/svanwouw/trending/types/Slope.scala | Scala | mit | 328 |
package com.ecfront.common
import org.scalatest.FunSuite
class ShellSpec extends FunSuite {
test("Shell测试") {
//use linux
assert(ShellHelper.sync("echo hello",returnResult = true)=="echo hello")
}
}
| gudaoxuri/ez-common | src/test/scala/com/ecfront/common/ShellSpec.scala | Scala | apache-2.0 | 221 |
package dotty.tools.dotc
package transform
import core._
import DenotTransformers.SymTransformer
import Contexts.Context
import SymDenotations.SymDenotation
import Types._
import Symbols._
import SymUtils._
import Constants._
import TreeTransforms._
import Flags._
import Decorators._
import ValueClasses._
/** Perform... | densh/dotty | src/dotty/tools/dotc/transform/Getters.scala | Scala | bsd-3-clause | 2,478 |
/**
* 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... | MyPureCloud/kafka | core/src/test/scala/unit/kafka/utils/TestUtils.scala | Scala | apache-2.0 | 66,152 |
package katas.scala.fizzbuzz
import org.scalatest.Matchers
import org.junit.Test
class FizzBuzz extends Matchers {
@Test def given_number_one_should_produce_one() {
fizzBuzz(1) should equal("1")
}
@Test def given_number_two_should_produce_two() {
fizzBuzz(2) should equal("2")
}
@Test def given_number_thre... | dkandalov/katas | scala/src/katas/scala/fizzbuzz/FizzBuzz.scala | Scala | unlicense | 2,505 |
/*
* 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 ... | starpit/openwhisk | tests/src/test/scala/org/apache/openwhisk/core/entity/test/MigrationEntities.scala | Scala | apache-2.0 | 3,102 |
package bc
import factory.VirtualMachineFactory
import org.scalatest.FunSuite
import bc.byteCodes.IConst
class PublicByteCodeParserSuite extends FunSuite with ByteCodeValues {
val bcp: ByteCodeParser = VirtualMachineFactory.byteCodeParser
test("[5] byte code parser should parse a single bytecode") {
val code... | BBK-PiJ-2015-67/sdp-portfolio | coursework/cw-two/src/test/scala/bc/PublicByteCodeParserSuite.scala | Scala | unlicense | 1,417 |
package io.getquill.context.jdbc.h2
import io.getquill.context.sql.EncodingSpec
class JdbcEncodingSpec extends EncodingSpec {
val context = testContext
import testContext._
"encodes and decodes types" in {
testContext.run(delete)
testContext.run(liftQuery(insertValues).foreach(p => insert(p)))
ver... | getquill/quill | quill-jdbc/src/test/scala/io/getquill/context/jdbc/h2/JdbcEncodingSpec.scala | Scala | apache-2.0 | 374 |
package org.knora.webapi.messages.v1.store.triplestoremessages
import akka.http.scaladsl.marshallers.sprayjson.SprayJsonSupport
import org.knora.webapi.util.ErrorHandlingMap
import org.knora.webapi.{IRI, InconsistentTriplestoreDataException, TriplestoreResponseException}
import spray.json.{DefaultJsonProtocol, NullOpt... | nie-ine/Knora | webapi/src/main/scala/org/knora/webapi/messages/v1/store/triplestoremessages/TriplestoreMessages.scala | Scala | agpl-3.0 | 7,197 |
package io.reactivecqrs.core.eventbus
import io.reactivecqrs.api.AggregateVersion
import io.reactivecqrs.api.id.AggregateId
import io.reactivecqrs.core.eventbus.PostgresEventBusState.CacheValue
import io.reactivecqrs.core.projection.OptimisticLockingFailed
import org.postgresql.util.PSQLException
import scalikejdbc._
... | marpiec/ReactiveCQRS | core/src/main/scala/io/reactivecqrs/core/eventbus/EventBusState.scala | Scala | apache-2.0 | 5,663 |
/*
* 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 ... | rekhajoshm/spark | sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/PruningSuite.scala | Scala | apache-2.0 | 6,738 |
package org.denigma.nlp
import org.denigma.binding.views.BindableView
import org.scalajs.dom
import org.scalajs.dom.Element
import org.scalajs.dom.raw._
import rx.Var
import org.denigma.binding.extensions._
class ContentManager() extends BindableView
{
override lazy val id: String = "main"
lazy val elem: Element... | antonkulaga/bio-nlp | chrome-bio/src/main/scala/org/denigma/nlp/ContentManager.scala | Scala | mpl-2.0 | 1,002 |
/*
* 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 ... | aljoscha/flink | flink-table/flink-table-planner-blink/src/test/scala/org/apache/flink/table/planner/catalog/CatalogTableITCase.scala | Scala | apache-2.0 | 32,152 |
package com.typesafe.sbt.packager
import sbt._
import sbt.Keys.TaskStreams
import java.io.File
import com.typesafe.sbt.packager.Compat._
object Stager {
/**
* create a cache and sync files if needed
*
* @param config - create a configuration specific cache directory
* @param cacheDirectory - e.g. ... | sbt/sbt-native-packager | src/main/scala/com/typesafe/sbt/packager/Stager.scala | Scala | bsd-2-clause | 1,552 |
package org.apache.spark.sql
import org.apache.spark.sql.snowflake.{SFQueryTest, SFTestData, SFTestSessionBase}
class SFDataFrameWindowFunctionsSuite
extends DataFrameWindowFunctionsSuite
with SFTestSessionBase
with SFQueryTest
with SFTestData {
override def spark: SparkSession = getSnowflakeSessio... | snowflakedb/spark-snowflakedb | src/it/scala/org/apache/spark/sql/SFDataFrameWindowFunctionsSuite.scala | Scala | apache-2.0 | 816 |
/*
* Copyright 2011-2021 Asakusa Framework Team.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable ... | asakusafw/asakusafw-spark | extensions/iterativebatch/compiler/core/src/main/scala/com/asakusafw/spark/extensions/iterativebatch/compiler/graph/DirectOutputPrepareForIterativeCompiler.scala | Scala | apache-2.0 | 2,221 |
/**
* Copyright (c) 2016 Intel Corporation
*
* 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 applicabl... | dmsuehir/spark-tk | sparktk-core/src/main/scala/org/trustedanalytics/sparktk/graph/internal/ops/TriangleCount.scala | Scala | apache-2.0 | 1,664 |
// Copyright (C) 2011-2012 the original author or authors.
// See the LICENCE.txt file distributed with this work for additional
// information regarding copyright ownership.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You ... | firebase/scalastyle | src/main/scala/org/scalastyle/Directory.scala | Scala | apache-2.0 | 1,984 |
/*
* MIT License
*
* Copyright (c) 2016 Gonçalo Marques
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, ... | gonmarques/slick-repo | src/test/scala/com/byteslounge/slickrepo/test/sqlserver/SQLServerJodaTimeVersionedRepositoryTest.scala | Scala | mit | 1,391 |
package org.apress.prospark
import org.apache.spark.SparkConf
import org.apache.spark.SparkContext
import org.apache.spark.streaming.Seconds
import org.apache.spark.streaming.StreamingContext
import org.json4s.DefaultFormats
import org.json4s.JField
import org.json4s.jvalue2extractable
import org.json4s.jvalue2monadic... | ZubairNabi/prosparkstreaming | Chap5/src/main/scala/org/apress/prospark/L5-18Http.scala | Scala | apache-2.0 | 1,595 |
/*
* 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... | wangyixiaohuihui/spark2-annotation | core/src/main/scala/org/apache/spark/api/python/WriteInputFormatTestDataGenerator.scala | Scala | apache-2.0 | 6,994 |
package com.twitter.finagle.redis.util
import com.twitter.finagle.redis.protocol._
import java.nio.charset.Charset
import org.jboss.netty.buffer.{ChannelBuffer, ChannelBuffers}
import org.jboss.netty.util.CharsetUtil
import com.twitter.finagle.redis.protocol.Commands.trimList
trait ErrorConversion {
def getExceptio... | firebase/finagle | finagle-redis/src/main/scala/com/twitter/finagle/redis/util/Conversions.scala | Scala | apache-2.0 | 4,619 |
package mesosphere.util.state.zk
import java.util.UUID
import com.fasterxml.uuid.impl.UUIDUtil
import com.google.protobuf.{ ByteString, InvalidProtocolBufferException }
import com.twitter.util.{ Future => TWFuture }
import com.twitter.zk.{ ZNode, ZkClient }
import mesosphere.marathon.{ Protos, StoreCommandFailedExcep... | spacejam/marathon | src/main/scala/mesosphere/util/state/zk/ZKStore.scala | Scala | apache-2.0 | 5,599 |
package monocle.function
import monocle.{Iso, Optional}
import scala.util.Try
import cats.data.Validated
/** Typeclass that defines an [[Optional]] from a monomorphic container `S` to a possible value `A`. There must be at
* most one `A` in `S`.
* @tparam S
* source of the [[Optional]]
* @tparam A
* ta... | julien-truffaut/Monocle | core/shared/src/main/scala/monocle/function/Possible.scala | Scala | mit | 1,929 |
package jp.ijufumi.openreports.service.settings
import java.sql.SQLException
import jp.ijufumi.openreports.model.{RMemberGroup, TGroup, TMember}
import jp.ijufumi.openreports.service.HashKey
import jp.ijufumi.openreports.service.enums.StatusCode
import jp.ijufumi.openreports.service.support.{ConnectionFactory, Hash}
... | ijufumi/openreports_scala | src/main/scala/jp/ijufumi/openreports/service/settings/MemberSettingsService.scala | Scala | mit | 3,760 |
package controllers
import play.api.mvc._, Results._
import lila.app._
import views._
object Donation extends LilaController {
def index = Open { implicit ctx =>
OptionFuOk(Prismic.getBookmark("donate")) {
case (doc, resolver) => Env.donation.api.list(100) zip
Env.donation.api.top(10) zip
... | JimmyMow/lila | app/controllers/Donation.scala | Scala | mit | 1,291 |
package org.apache.datacommons.prepbuddy.smoothers
import org.apache.spark.rdd.RDD
abstract class SmoothingMethod extends Serializable {
def prepare(rdd: RDD[String], windowSize: Int): RDD[Double] = {
val duplicateRDD: RDD[(Int, String)] = rdd.mapPartitionsWithIndex((index: Int, iterator: Iterator[String]... | blpabhishek/prep-buddy | src/main/scala/org/apache/datacommons/prepbuddy/smoothers/SmoothingMethod.scala | Scala | apache-2.0 | 821 |
package models.billing
import scalaz._
import Scalaz._
import scalaz.effect.IO
import scalaz.Validation
import scalaz.Validation.FlatMap._
import scalaz.NonEmptyList._
import cache._
import db._
import models.Constants._
import io.megam.auth.funnel.FunnelErrors._
import com.datastax.driver.core.{ ResultSet, Row }
im... | megamsys/verticegateway | app/models/billing/Subscriptions.scala | Scala | mit | 4,621 |
package com.twitter.finagle.redis.protocol.commands
import com.twitter.finagle.redis.protocol._
import com.twitter.io.Buf
case class BAdd(key: Buf, field: Buf, value: Buf) extends StrictKeyCommand {
def name: Buf = Command.BADD
override def body: Seq[Buf] = Seq(key, field, value)
}
case class BRem(key: Buf, fiel... | mkhq/finagle | finagle-redis/src/main/scala/com/twitter/finagle/redis/protocol/commands/BtreeSortedSet.scala | Scala | apache-2.0 | 1,483 |
/*
* 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/keras/autograd/CustomLoss.scala | Scala | apache-2.0 | 4,689 |
/*
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 not use this f... | mandar2812/DynaML | dynaml-core/src/main/scala/io/github/tailhq/dynaml/kernels/NeuralNetworkKernel.scala | Scala | apache-2.0 | 2,107 |
package ch.wsl.fireindices.app.ui
import javax.swing.JPanel
import scala.swing.Component
import scala.swing.LayoutContainer
import scala.swing.Panel
class MigPanel(layoutConstraints:String="",columnConstraints:String="",rowConstraints:String="") extends Panel with LayoutContainer {
// import BorderPanel._
import... | Insubric/fire-calculator | fireindicesui/src/main/scala/ch/wsl/fireindices/app/ui/MigPanel.scala | Scala | gpl-2.0 | 912 |
/*
* Copyright 2001-2013 Artima, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agre... | scalatest/scalatest | jvm/freespec-test/src/test/scala/org/scalatest/freespec/FixtureAsyncFreeSpecLikeSpec2.scala | Scala | apache-2.0 | 31,102 |
package bowhaus
import com.twitter.bijection._
import org.jboss.netty.buffer.{ ChannelBuffer, ChannelBuffers }
object Bijections extends StringInjections {
// this is in bijection (0.4.0)
object ChannelBufferBijection extends Bijection[ChannelBuffer, Array[Byte]] {
override def apply(cb: ChannelBuffer) = {
... | softprops/bowhaus | src/main/scala/bijection.scala | Scala | mit | 891 |
package forimpatient.chapter11
/**
* Created by Iryna Kharaborkina on 8/9/16.
*
* Solution to the Chapter 11 Exercise 08 'Scala for the Impatient' by Horstmann C.S.
*
* Provide a class Matrix—you can choose whether you want to implement 2 × 2 matrices, square matrices of any size,
* or m × n matrices. Sup... | Kiryna/Scala-for-the-Impatient | src/forimpatient/chapter11/Exercise08.scala | Scala | apache-2.0 | 1,893 |
/*
* 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 ... | ahnqirage/spark | core/src/main/scala/org/apache/spark/scheduler/AccumulableInfo.scala | Scala | apache-2.0 | 3,222 |
package pl.edu.agh.mplt.parser.AMPL.statements.lexpr
import org.scalatest.{Matchers, FlatSpec}
import pl.edu.agh.mplt.parser.{KeywordAMPLParser, IntercodeImplicits}
import pl.edu.agh.mplt.parser.phrase.logical._
import pl.edu.agh.mplt.parser.member.{SetMember, MemberAMPLParser}
import pl.edu.agh.mplt.parser.phra... | marek1840/MPLT | src/test/scala/pl/edu/agh/mplt/parser/AMPL/statements/lexpr/LogicalExpressionTest.scala | Scala | mit | 6,459 |
package scala
package reflect.io
import scala.reflect.internal.util.Statistics
// Due to limitations in the Statistics machinery, these are only
// reported if this patch is applied.
//
// --- a/src/reflect/scala/reflect/internal/util/Statistics.scala
// +++ b/src/reflect/scala/reflect/internal/util/Statistics.scala
... | felixmulder/scala | src/reflect/scala/reflect/io/IOStats.scala | Scala | bsd-3-clause | 1,182 |
package hr.element.etb
/*
* Copyright (c) 2008-2009, Matthias Mann
*
* 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 copyrig... | melezov/etb | util/src/main/scala/hr/element/etb/Profiling.scala | Scala | unlicense | 2,335 |
// Copyright (c) 2016 PSForever.net to present
package net.psforever.packet.control
import net.psforever.packet.{ControlPacketOpcode, Marshallable, PlanetSideControlPacket}
import scodec.Codec
import scodec.bits._
import scodec.codecs._
final case class ServerStart(clientNonce : Long, serverNonce : Long)
extends Pl... | Fate-JH/PSF-Server | common/src/main/scala/net/psforever/packet/control/ServerStart.scala | Scala | gpl-3.0 | 719 |
import java.util.concurrent.Executors
import cats.effect.{Blocker, IO}
import org.scalacheck.Arbitrary
import org.scalatest._
import rpm4s.codecs.IndexData.StringData
import rpm4s.data.{Architecture, Name, RpmPrimaryEntry, Version}
import scodec.bits.BitVector
import scodec.{Attempt, Codec}
import fs2.Stream
import org... | lucidd/rpm4s | repo-utils/jvm/src/test/scala/GzipSpec.scala | Scala | mit | 1,498 |
package xitrum.handler.inbound
import java.io.File
import io.netty.channel.{ChannelHandler, SimpleChannelInboundHandler, ChannelHandlerContext}
import io.netty.handler.codec.http.{HttpMethod, HttpResponseStatus}
import ChannelHandler.Sharable
import HttpMethod._
import HttpResponseStatus._
import xitrum.Config
impo... | georgeOsdDev/xitrum | src/main/scala/xitrum/handler/inbound/PublicFileServer.scala | Scala | mit | 2,160 |
/**
* __________ .__ __ .__
* \____ /____ ____ |__|/ |_| |__
* / // __ \ / \| \ __\ | \
* / /\ ___/| | \ || | | Y \
* /_______ \___ >___| /__||__| |___| /
* \/ \/ \/ \/
*/
import sbt.Keys._
import sbt._
import sbtrelease.Re... | sungiant/zenith | project/build.scala | Scala | mit | 4,683 |
package com.ponkotuy.restype
import com.netaporter.uri.Uri
import com.ponkotuy.parser.Query
import com.ponkotuy.util.Log
import org.json4s._
import scala.util.matching.Regex
/**
*
* @author ponkotuy
* Date: 14/02/19.
*/
abstract class ResType {
def regexp: Regex
def postables(q: Query): Seq[Result]
implici... | b-wind/MyFleetGirls | client/src/main/scala/com/ponkotuy/restype/ResType.scala | Scala | mit | 1,951 |
import sbt._
import java.io._
import Keys._
import com.typesafe.sbteclipse.plugin.EclipsePlugin.EclipseKeys
import org.seacourt.build._
import sbt.Process._
object RootConfig {
def libraries: Seq[String] = {
val output: String = (Process("root-config" :: "--libs" :: "--noldflags" :: Nil) !!)
output... | ayllon/raw-root | project/Build.scala | Scala | agpl-3.0 | 2,414 |
package org.apache.mesos.chronos.scheduler.api
import com.fasterxml.jackson.core.JsonGenerator
import com.fasterxml.jackson.databind.{JsonSerializer, SerializerProvider}
import org.apache.commons.math3.stat.descriptive.DescriptiveStatistics
/**
* Serializes a subset of the fields of DescriptiveStatistics
* @author ... | tony-kerz/chronos | src/main/scala/org/apache/mesos/chronos/scheduler/api/DescriptiveStatisticsSerializer.scala | Scala | apache-2.0 | 1,198 |
package blended.security.ssl
import java.security.{KeyPair, SignatureException}
import blended.testsupport.scalatest.LoggingFreeSpec
import org.scalacheck.Gen
import org.scalatest.matchers.should.Matchers
import org.scalatestplus.scalacheck.ScalaCheckPropertyChecks
import scala.util.{Success, Try}
class Certificate... | woq-blended/blended | blended.security.ssl/src/test/scala/blended/security/ssl/CertificateHolderSpec.scala | Scala | apache-2.0 | 2,125 |
/*
* 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 | test/model/command/GeneralDetailsExamples.scala | Scala | apache-2.0 | 1,800 |
package controllers
import play.api.mvc._
import views.html
import helper.utils.{SynonymSyntaxValidator, AuthenticatedAction}
import play.api.data.Form
import models.{InputTopListEntry, Synonyms}
import play.api.data.Forms._
import scala.Some
import helper.services.SynonymService
import esclient.Elasticsearch
import p... | MeiSign/Fillable | app/controllers/Synonym.scala | Scala | apache-2.0 | 3,228 |
/*
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... | twitter/scalding | scalding-date/src/main/scala/com/twitter/scalding/DateParser.scala | Scala | apache-2.0 | 3,391 |
package acceptance.support
import cucumber.api.scala.ScalaDsl
trait Env extends ScalaDsl {
val db = Mongo("authorization-acceptance-tests")
val authCollection = db.createCollection("authorization")
val host = "http://localhost:9000"
Before {
s =>
db.removeCollection(authCollection)
println(... | tvlive/tv-auth | test/acceptance/support/Env.scala | Scala | apache-2.0 | 585 |
/*
* 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 ... | hequn8128/flink | flink-table/flink-table-planner-blink/src/test/scala/org/apache/flink/table/planner/runtime/stream/table/CorrelateITCase.scala | Scala | apache-2.0 | 12,143 |
package dotty.tools.dotc
package core
import Symbols._, Types._, util.Positions._, Contexts._, Constants._, ast.tpd._
object Annotations {
abstract class Annotation {
def tree(implicit ctx: Context): Tree
def symbol(implicit ctx: Context): Symbol = tree.tpe.typeSymbol
def matches(cls: Symbol)(implicit ... | DarkDimius/dotty | src/dotty/tools/dotc/core/Annotations.scala | Scala | bsd-3-clause | 2,532 |
/*
* Copyright 2001-2013 Artima, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agre... | scalatest/scalatest | jvm/funspec-test/src/test/scala/org/scalatest/funspec/FixtureAsyncFunSpecLikeSpec2.scala | Scala | apache-2.0 | 31,206 |
/**
* Copyright 2015 Mohiva Organisation (license at mohiva dot 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 req... | cemcatik/play-silhouette | silhouette/test/com/mohiva/play/silhouette/impl/util/BCryptPasswordHasherSpec.scala | Scala | apache-2.0 | 1,829 |
/*
*
* * Copyright (c) 2014-2016. National Institute of Advanced Industrial Science and Technology (AIST)
* * All rights reserved.
*
*/
package jp.go.aist.cspe
import jp.go.aist.cspe.CSPE._
private[cspe] class ParamPrefixRelaxed(f0: PartialFunction[AbsEvent, Process], id0 : Int) extends Process {
val id = id... | yoriyuki/cspe | src/main/scala/jp/go/aist/cspe/ParamPrefixRelaxed.scala | Scala | bsd-3-clause | 814 |
package org.globalnames
package matcher
class MatcherSpec extends SpecConfig {
val matcher = Matcher(Seq("Aaadonta angaurana",
"Aaadonta constricta",
"Aaadonta constricta babelthuapi",
"Abacetus cyclomous",
... | GlobalNamesArchitecture/gnmatcher | matcher/src/test/scala/org/globalnames/matcher/MatcherSpec.scala | Scala | mit | 1,049 |
package reopp.common.benchmarks
import reopp.common.guardedcommands.dataconnectors.ConstraintGen._
import z3.scala.{Z3AST, Z3Config, Z3Context}
import reopp.common.guardedcommands.z3.Z3
import choco.kernel.model.variables.integer.IntegerExpressionVariable
import choco.Choco
import reopp.common.guardedcommands.Formula
... | joseproenca/ip-constraints | code/src/main/scala/reopp/common/benchmarks/AllNewTemp.scala | Scala | mit | 8,997 |
/*
* 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 t... | willCode2Surf/zipkin | zipkin-cassandra/src/test/scala/com/twitter/zipkin/storage/cassandra/CassieSpanStoreTest.scala | Scala | apache-2.0 | 1,405 |
/* sbt -- Simple Build Tool
* Copyright 2011 Mark Harrah
*/
package sbt
import java.io.File
import KeyRanks.DSetting
import sbt.io.{ GlobFilter, Path }
import sbt.internal.util.AttributeKey
object BuildPaths {
val globalBaseDirectory = AttributeKey[File](
"global-base-directory",
"The base directory for ... | Duhemm/sbt | main/src/main/scala/sbt/BuildPaths.scala | Scala | bsd-3-clause | 5,442 |
package s {
sealed trait C[+A]
case class C00[+A]() extends C[A]
case class C10[+A](x: A) extends C[A]
case class C20[+A](x: A, y: A) extends C[A]
case class C01[+A](xs: A*) extends C[A]
case class C11[+A](x: A, ys: A*) extends C[A]
case class C21[+A](x: A, y: A, zs: A*) extends C[A]
object E00 { def ... | felixmulder/scala | test/files/run/patmat-behavior.scala | Scala | bsd-3-clause | 9,573 |
package mesosphere.mesos
import java.time.Clock
import mesosphere.marathon.RichClock
import mesosphere.marathon.state.Timestamp
import org.apache.mesos.Protos.{DurationInfo, Offer}
import scala.concurrent.duration._
object Availability {
def offerAvailable(offer: Offer, drainingTime: FiniteDuration)(implicit clo... | gsantovena/marathon | src/main/scala/mesosphere/mesos/Availability.scala | Scala | apache-2.0 | 1,409 |
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2015-2021 Andre White.
*
* 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
*
* https://www.apache.org/licenses/LICENSE... | adarro/ddo-calc | subprojects/common/ddo-core/src/main/scala/io/truthencode/ddo/model/feats/EpicFeat.scala | Scala | apache-2.0 | 7,645 |
package net.fwbrasil.smirror
trait Dummy
class SFieldSpecTestClass[X <: Dummy](val m1: String) {
val m2 = "b"
var m3 = 1
var x: Option[X] = None
}
class SFieldSpec extends SMirrorSpec {
"SClass" should "return its fields" in
test[SFieldSpecTestClass[_]] { (sClass, jClass) =>
sCla... | fwbrasil/smirror | src/test/scala/net/fwbrasil/smirror/SFieldSpec.scala | Scala | lgpl-2.1 | 1,933 |
package roller_coaster
// Read inputs from System.in, Write outputs to use print.
// Your class name has to be Solution
object Solution {
def main(args: Array[String]) {
// Lecture des données
val t = readLine.split(" ").map((e) => e.toInt)
val (l, c, n) = (t(0), t(1), t(2))
val file = new Array[Int... | bvaudour/codingame | level3/Roller_Coaster.scala | Scala | gpl-2.0 | 734 |
package org.scalatra
trait MacrosCompat extends Internal210 {
type Context = scala.reflect.macros.blackbox.Context
def freshName(name: String): String = c.freshName(name)
def typeName(name: String): c.universe.TypeName = c.universe.TypeName(name)
def termName(name: String): c.universe.TermName = c.univers... | dozed/scalatra | core/src/main/scala-2.11/org/scalatra/MacrosCompat.scala | Scala | bsd-2-clause | 498 |
package sbt
import java.io.{ File, FileNotFoundException, IOException }
object exit {
def main(args: Array[String]) {
System.exit(java.lang.Integer.parseInt(args(0)))
}
}
object cat {
def main(args: Array[String]) {
try {
if (args.length == 0)
IO.transfer(System.in, System.out)
else
... | niktrop/sbt | util/process/src/test/scala/TestedProcess.scala | Scala | bsd-3-clause | 1,174 |
package com.typesafe.slick.testkit.tests
import org.junit.Assert
import org.junit.Assert._
import slick.jdbc.GetResult
import com.typesafe.slick.testkit.util.{JdbcTestDB, AsyncTest}
class PlainSQLTest extends AsyncTest[JdbcTestDB] {
import tdb.profile.api._
implicit val getUserResult = GetResult(r => new User(r.... | nmartynenko/slick | slick-testkit/src/main/scala/com/typesafe/slick/testkit/tests/PlainSQLTest.scala | Scala | bsd-2-clause | 4,723 |
package nsmc.conversion.types
import org.apache.spark.sql.types._
import scala.collection.immutable.HashMap
class InternalAndSchema {
}
object InternalAndSchema {
def toSchema(it: ConversionType) : DataType = {
it match {
case AtomicType(dt: DataType) => dt
case SequenceType(et) => ArrayType(to... | shotishu/spark-mongodb-connector | src/main/scala/nsmc/conversion/types/InternalAndSchema.scala | Scala | apache-2.0 | 1,208 |
package hu.frankdavid.ranking.gui
import javafx.event.EventHandler
import javafx.scene.control.ButtonBar.ButtonData
import javafx.scene.control.{ButtonType, Dialog, DialogEvent}
import hu.frankdavid.ranking.TournamentStrategy
import hu.frankdavid.ranking.gui.configs._
import scalafx.Includes._
import scalafx.applica... | frankdavid/ranking | src/main/scala/hu/frankdavid/ranking/gui/StrategyDialog.scala | Scala | apache-2.0 | 2,886 |
package com.twitter.finagle
import com.twitter.logging.{HasLogLevel, Level}
import com.twitter.util.Duration
import java.net.SocketAddress
/**
* A trait for exceptions that have a source. The name of the source is
* specified as a `serviceName`. The "unspecified" value is used if no
* `serviceName` is provided by ... | liamstewart/finagle | finagle-core/src/main/scala/com/twitter/finagle/Exceptions.scala | Scala | apache-2.0 | 15,877 |
/*
* Copyright (c) 2013, Scodec
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions a... | scodec/scodec | unitTests/src/test/scala/scodec/codecs/CipherCodecTest.scala | Scala | bsd-3-clause | 2,440 |
package com.searchlight.khronus.service
import akka.actor.Props
import com.searchlight.khronus.model.MetricBatch
import com.searchlight.khronus.store.CassandraMetricMeasurementStore._
import com.searchlight.khronus.store.MetricMeasurementStoreSupport
import com.searchlight.khronus.util.{ConcurrencySupport, JacksonJson... | despegar/khronus | khronus-core/src/main/scala/com/searchlight/khronus/service/KhronusEnpoint.scala | Scala | apache-2.0 | 2,283 |
import zio._
object layers {
trait Service1
trait Service2
trait Service3
trait Service4
val service1 = ZLayer.succeed(new Service1 {})
val service2 = ZLayer.succeed(new Service2 {})
val service3 = ZLayer.fromService { (_: Service1) => new Service3 {} }
val service4 = ZLayer.succeed(new Service4 {... | tek/splain | core/src/test/resources-2.13.7+/latest/splain/plugin/ZIOSpec/zlayer/code.scala | Scala | mit | 475 |
package org.gedanken.farley.parser
/**
*
* parser/Parser.scala
*
* Copyright 2013, 2014, 2015 Logan O'Sullivan Bruns
*
* 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
*
... | loganbruns/farley | parser/src/main/scala/org/gedanken/farley/parser/Parser.scala | Scala | apache-2.0 | 3,033 |
package app
import util.{LockUtil, CollaboratorsAuthenticator, JGitUtil, ReferrerAuthenticator, Notifier, Keys}
import util.Directory._
import util.Implicits._
import util.ControlUtil._
import service._
import org.eclipse.jgit.api.Git
import jp.sf.amateras.scalatra.forms._
import org.eclipse.jgit.transport.RefSpec
imp... | michaelpnash/gitbucket | src/main/scala/app/PullRequestsController.scala | Scala | apache-2.0 | 20,126 |
package com.timeout.docless.swagger
case class Paths(get: Seq[Path])
| timeoutdigital/docless | src/main/scala/com/timeout/docless/swagger/Paths.scala | Scala | mit | 70 |
/*
* Copyright (C) 2009-2017 Lightbend Inc. <https://www.lightbend.com>
*/
package play.sbt.routes
import play.routes.compiler.RoutesCompiler.GeneratedSource
import sbt._
import xsbti.{ Maybe, Position }
import scala.language.implicitConversions
/**
* Fix compatibility issues for RoutesCompiler. This is the versi... | zaneli/playframework | framework/src/sbt-plugin/src/main/scala-sbt-0.13/play/sbt/routes/RoutesCompilerCompat.scala | Scala | apache-2.0 | 1,577 |
package org.pgscala.converters
package test
import org.junit.runner.RunWith
import org.scalatest.junit.JUnitRunner
import org.scalatest.FeatureSpec
import org.scalatest.GivenWhenThen
import org.scalatest.Matchers
@RunWith(classOf[JUnitRunner])
class BooleanTest extends FeatureSpec with GivenWhenThen with Matchers {
... | melezov/pgscala | converters-java/src/test/scala/org/pgscala/converters/test/BooleanTest.scala | Scala | bsd-3-clause | 1,713 |
package pl.newicom.dddd.office
import pl.newicom.dddd.{BusinessEntity, Eventsourced}
import pl.newicom.dddd.aggregate.{Command, EntityId}
import pl.newicom.dddd.cluster.DefaultDistributionStrategy
import scala.reflect.ClassTag
trait OfficeId extends BusinessEntity with Eventsourced {
def messageClass: Option[Clas... | pawelkaczor/akka-ddd | akka-ddd-protocol/src/main/scala/pl/newicom/dddd/office/OfficeId.scala | Scala | mit | 1,038 |
/**
* This file is part of SensApp [ http://sensapp.modelbased.net ]
*
* Copyright (C) 2011- SINTEF ICT
* Contact: SINTEF ICT <[email protected]>
*
* Module: net.modelbased.sensapp
*
* SensApp is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public L... | SINTEF-9012/sensapp | net.modelbased.sensapp.backyard.apm2import/src/main/scala/net/modelbased/sensapp/backyard/apm2import/datasets/EBike1.scala | Scala | lgpl-3.0 | 3,843 |
/*
* 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 ... | databricks/spark-tfocs | src/test/scala/org/apache/spark/mllib/optimization/tfocs/ProxCapableFunctionSuite.scala | Scala | apache-2.0 | 6,209 |
package io.buoyant.linkerd
package admin
import com.twitter.finagle._
import com.twitter.finagle.buoyant.DstBindingFactory
import com.twitter.finagle.naming.NameInterpreter
import com.twitter.server.handler.{ResourceHandler, SummaryHandler => _}
import io.buoyant.admin.Admin.{Handler, NavItem}
import io.buoyant.admin.... | hhtpcd/linkerd | linkerd/admin/src/main/scala/io/buoyant/linkerd/admin/LinkerdAdmin.scala | Scala | apache-2.0 | 3,402 |
/*
* Copyright 2017-2022 John Snow Labs
*
* 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... | JohnSnowLabs/spark-nlp | src/test/scala/com/johnsnowlabs/ml/crf/TestDatasets.scala | Scala | apache-2.0 | 1,554 |
package practice
object ArrayTricks extends App {
/**
* We have our lists of orders sorted numerically already, in arrays. Write
* a function to merge our arrays of orders into one sorted array.
*
* For example:
* my_array = [3,4,6,10,11,15]
* alices_array = [1,5,8,12,14,19]
*
* print merge_... | mitochon/hexercise | src/practice/src/main/scala/practice/ArrayTricks.scala | Scala | mit | 3,146 |
package model
import play.api.libs.json._
/**
* Represents the Swagger definition for QueueItemImpl.
* @param additionalProperties Any additional properties this model may have.
*/
@javax.annotation.Generated(value = Array("org.openapitools.codegen.languages.ScalaPlayFrameworkServerCodegen"), date = "2022-02-13... | cliffano/swaggy-jenkins | clients/scala-play-server/generated/app/model/QueueItemImpl.scala | Scala | mit | 1,548 |
package com.arcusys.valamis.settings.service
import com.arcusys.valamis.settings.model.LRSToActivitySetting
trait LRSToActivitySettingService {
def getAll: Seq[LRSToActivitySetting]
def getByCourseId(courseId: Int): Seq[LRSToActivitySetting]
def create(courseId: Int, title: String, mappedActivity: Option[String... | ViLPy/Valamis | valamis-core/src/main/scala/com/arcusys/valamis/settings/service/LRSToActivitySettingService.scala | Scala | lgpl-3.0 | 531 |
package concrete
import bitvectors.BitVector
import com.typesafe.scalalogging.LazyLogging
import concrete.constraint.{Constraint, StatefulConstraint}
import concrete.util.{IdentityMap, Interval}
import cspom.UNSATException
import scala.annotation.tailrec
import scala.collection.immutable
import scala.collection.immut... | concrete-cp/concrete | src/main/scala/concrete/ProblemState.scala | Scala | lgpl-2.1 | 13,956 |
package sylvestris.core
import scalaz.Equal
object Tag {
implicit val eqInstance = Equal.equalA[Tag]
}
case class Tag(v: String)
| drostron/sylvestris | core/src/main/scala/sylvestris/core/Tag.scala | Scala | mit | 134 |
/*
* 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-actorregistry/src/main/scala/org/squbs/actorregistry/ActorRegistry.scala | Scala | apache-2.0 | 4,687 |
/*
* Copyright 2001-2012 Artima, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agre... | hubertp/scalatest | src/main/scala/org/scalatest/EncodedOrdering.scala | Scala | apache-2.0 | 823 |
//
// author: Cosmin Basca
//
// Copyright 2010 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
//
// Unless r... | cosminbasca/jvmrdftools | src/main/scala/com/rdftools/Rdf2RdfConverter.scala | Scala | apache-2.0 | 846 |
package generator
import com.bryzek.apidoc.generator.v0.models.File
import org.scalatest.{FunSpec, ShouldMatchers}
class ServiceFileNamesSpec extends FunSpec with ShouldMatchers {
describe("ServiceFileNames.toFile") {
def toFile(
languages: String,
version: String = "0.0.1"
): File = {
S... | krschultz/apidoc-generator | lib/src/test/scala/generator/ServiceFileNamesSpec.scala | Scala | mit | 1,921 |
package cz.kamenitxan.jakon.utils
import cz.kamenitxan.jakon.core.database.DBHelper
import cz.kamenitxan.jakon.core.model.JakonObject
import cz.kamenitxan.jakon.core.service.EmailTemplateService
import cz.kamenitxan.jakon.logging.Logger
import cz.kamenitxan.jakon.utils.mail.EmailTemplateEntity
import java.io.{Buffere... | kamenitxan/Jakon | modules/backend/src/main/scala/cz/kamenitxan/jakon/utils/Utils.scala | Scala | bsd-3-clause | 4,472 |
/*
* 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/plan/nodes/physical/stream/StreamExecExpand.scala | Scala | apache-2.0 | 3,995 |
package streaming
import java.io.File
import org.apache.spark.streaming._
import org.apache.spark.{SparkConf, SparkContext}
import streaming.util.CSVFileStreamGenerator
import scala.util.Random
//
// File based streaming requires files to be atomically created in
// the source directory -- in practice this entail... | chocolateBlack/LearningSpark | src/main/scala/streaming/FileBased.scala | Scala | mit | 2,152 |
package spatutorial.client.modules
import japgolly.scalajs.react._
import japgolly.scalajs.react.extra.OnUnmount
import japgolly.scalajs.react.vdom.prefix_<^._
import rx._
import rx.ops._
import spatutorial.client.components.Icon._
import spatutorial.client.components._
import spatutorial.client.services._
import spat... | zoosky/eispoc | js/src/main/scala/spatutorial/client/modules/MainMenu.scala | Scala | agpl-3.0 | 1,923 |
/*
* Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH
* under one or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information regarding copyright
* ownership. Camunda licenses this file to you under the Apache License,
* Version 2.0; y... | camunda/feel-scala | src/main/scala/org/camunda/feel/context/VariableProvider.scala | Scala | apache-2.0 | 2,577 |
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.