code stringlengths 5 1M | repo_name stringlengths 5 109 | path stringlengths 6 208 | language stringclasses 1
value | license stringclasses 15
values | size int64 5 1M |
|---|---|---|---|---|---|
/*
* Copyright 2012-2015 2ndlanguage 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... | piotrga/async-dynamo | src/test/scala/com.github.piotrga.asyncdynamo/DynamoObjectTest.scala | Scala | apache-2.0 | 1,721 |
/*
* Copyright (c) 2014 Ben Whitehead.
* 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 ... | BenWhitehead/finch-server | src/test/scala/io/github/benwhitehead/finch/FlagsTest.scala | Scala | apache-2.0 | 3,690 |
/**
* 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... | guozhangwang/kafka | core/src/main/scala/kafka/security/authorizer/AclEntry.scala | Scala | apache-2.0 | 5,917 |
/*
* Accio is a platform to launch computer science experiments.
* Copyright (C) 2016-2018 Vincent Primault <v.primault@ucl.ac.uk>
*
* Accio 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... | privamov/accio | accio/java/fr/cnrs/liris/accio/dsl/WorkflowParser.scala | Scala | gpl-3.0 | 1,099 |
package lila.user
final class GetBotIds(f: () => Fu[Set[User.ID]]) extends (() => Fu[Set[User.ID]]) {
def apply() = f()
}
final class RankingsOf(f: User.ID => lila.rating.UserRankMap) extends (User.ID => lila.rating.UserRankMap) {
def apply(u: User.ID) = f(u)
}
// permission holder
case class Holder(user: User) ... | luanlv/lila | modules/user/src/main/model.scala | Scala | mit | 358 |
package org.jetbrains.plugins.scala.lang.actions.editor
import org.jetbrains.plugins.scala.base.EditorActionTestBase
import org.jetbrains.plugins.scala.settings.ScalaApplicationSettings
/** @see [[org.jetbrains.plugins.scala.lang.actions.editor.backspace.ClosingBraceRemoveTest]] */
class ClosingBraceInsertTest extend... | JetBrains/intellij-scala | scala/scala-impl/test/org/jetbrains/plugins/scala/lang/actions/editor/ClosingBraceInsertTest.scala | Scala | apache-2.0 | 31,575 |
package org.bitcoins.core.script.interpreter.testprotocol
import org.bitcoins.core.currency.Satoshis
import org.bitcoins.core.number.Int64
import org.bitcoins.core.protocol.CompactSizeUInt
import org.bitcoins.core.serializers.script.ScriptParser
import org.bitcoins.core.protocol.script._
import org.bitcoins.core.scrip... | Christewart/bitcoin-s-core | src/test/scala/org/bitcoins/core/script/interpreter/testprotocol/CoreTestCaseProtocol.scala | Scala | mit | 6,231 |
package at.forsyte.apalache.tla.lir
import at.forsyte.apalache.tla.lir.values._
import org.junit.runner.RunWith
import org.scalatest.FunSuite
import org.scalatest.junit.JUnitRunner
/**
* Tests for the low-level intermediate representation.
*/
@RunWith(classOf[JUnitRunner])
class TestLirValues extends FunSuite {
t... | konnov/apalache | tlair/src/test/scala/at/forsyte/apalache/tla/lir/TestLirValues.scala | Scala | apache-2.0 | 880 |
package com.blinkbox.books.spray
import com.blinkbox.books.auth.UserRole.UserRole
import com.blinkbox.books.auth.{UserConstraint, User}
import com.blinkbox.books.spray.AuthDirectives._
import com.typesafe.config.ConfigFactory
import org.junit.runner.RunWith
import org.scalatest.junit.JUnitRunner
import org.scalatest.{... | blinkboxbooks/common-spray-auth.scala | src/test/scala/com/blinkbox/books/spray/AuthenticateAndAuthorizeDirectiveTest.scala | Scala | mit | 4,295 |
/* __ *\\
** ________ ___ / / ___ __ ____ Scala.js Test Suite **
** / __/ __// _ | / / / _ | __ / // __/ (c) 2013-2015, LAMP/EPFL **
** __\\ \\/ /__/ __ |/ /__/ __ |/_// /_\\ \\ http://scala-js.org/ **
** /____/\\___/... | mdedetrich/scala-js | test-suite/shared/src/test/require-jdk8/org/scalajs/testsuite/javalib/util/ComparatorTestOnJDK8.scala | Scala | bsd-3-clause | 1,307 |
/*
Deduction Tactics
Copyright (C) 2012-2015 Raymond Dodge
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This progra... | rayrobdod/deductionTactics | src/main/scala/com/rayrobdod/deductionTactics/swingView/menuBar/ElementPentagonReminderComponent.scala | Scala | gpl-3.0 | 1,636 |
/*
* 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 ... | guoxiaolongzte/spark | sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/ProgressReporter.scala | Scala | apache-2.0 | 15,240 |
package io.scalaland.chimney.examples
package colors1 {
sealed trait Color
case object Red extends Color
case object Green extends Color
case object Blue extends Color
}
package colors2 {
sealed trait Color
case object Blue extends Color
case object Green extends Color
case object Red extends Color
... | scalalandio/chimney | chimney/src/test/scala/io/scalaland/chimney/examples/Colors.scala | Scala | apache-2.0 | 641 |
package llsm.io
package object metadata {
object implicits extends MetadataImplicits
}
| keithschulze/llsm | core/src/main/scala/llsm/io/metadata/package.scala | Scala | mit | 90 |
package net.ruippeixotog.scalafbp.component.ppl.distrib
import thinkbayes.Pmf
import thinkbayes.extensions.Distributions._
import net.ruippeixotog.scalafbp.component._
import net.ruippeixotog.scalafbp.thinkbayes.Implicits._
import net.ruippeixotog.scalafbp.thinkbayes.PVar
class BinomialSpec extends ComponentSpec wit... | ruippeixotog/scalafbp | components/ppl/src/test/scala/net/ruippeixotog/scalafbp/component/ppl/distrib/BinomialSpec.scala | Scala | mit | 2,228 |
package dhg.pos.minmodel
import dhg.nlp.tag.WeightedTagDict
trait ModelMinTagEdgeScorer[Sym, Tag] {
def apply(
prevSym: Option[Sym], prevTag: Option[Tag], prevTagWeight: Option[Double],
currSym: Option[Sym], currTag: Option[Tag], currTagWeight: Option[Double]): Double
}
class CurrentWeightModelMinTagEdgeSc... | dhgarrette/low-resource-pos-tagging-2013 | src/main/scala/dhg/pos/minmodel/TagEdgeScorer.scala | Scala | apache-2.0 | 1,392 |
package sds.classfile.attribute
class ConstantValue(_value: String) extends AttributeInfo {
def value: String = _value
override def toString(): String = "ConstantValue: " + value
} | g1144146/sds_for_scala | src/main/scala/sds/classfile/attribute/ConstantValue.scala | Scala | apache-2.0 | 189 |
/*
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... | AoJ/scalding | src/test/scala/com/twitter/scalding/PackTest.scala | Scala | apache-2.0 | 2,971 |
package model
import skinny.DBSettings
import skinny.test._
import org.scalatest.fixture.FlatSpec
import org.scalatest._
import scalikejdbc._
import scalikejdbc.scalatest._
import org.joda.time._
class AccessLogGroupedGaIdSpec extends FlatSpec with Matchers with DBSettings with AutoRollback {
}
| yoshitakes/skinny-task-example | src/test/scala/model/AccessLogGroupedGaIdSpec.scala | Scala | mit | 298 |
package org.scalajs.jsenv.phantomjs
import javax.servlet.http.HttpServletRequest
import org.eclipse.jetty.server.Server
import org.eclipse.jetty.server.nio.SelectChannelConnector
import org.eclipse.jetty.websocket.{WebSocket, WebSocketHandler}
import org.eclipse.jetty.util.component.{LifeCycle, AbstractLifeCycle}
imp... | jmnarloch/scala-js | js-envs/src/main/scala/org/scalajs/jsenv/phantomjs/JettyWebsocketManager.scala | Scala | bsd-3-clause | 4,069 |
/*
* Copyright (c) 2014-2015 by its authors. Some rights reserved.
* See the project homepage at: http://www.monifu.org
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://... | sergius/monifu | monifu/js/src/main/scala/org/reactivestreams/Subscriber.scala | Scala | apache-2.0 | 989 |
package doodle
package golden
import doodle.core.Color
import doodle.syntax._
import doodle.java2d._
import munit._
class FrameBackground extends FunSuite with GoldenPicture {
testPictureWithFrame("black-background")(
Frame.fitToPicture().background(Color.black)
) {
circle[Algebra, Drawing](20).fillColor(... | underscoreio/doodle | golden/src/test/scala/doodle/golden/FrameBackground.scala | Scala | apache-2.0 | 495 |
package org.github.romanowski.streetactors.model
import org.github.romanowski.streetactors.model.cells.Cell
case class Car(driver: Driver, trip: Trip) {
private var _currentCell: Cell = trip.start
def currentCell = _currentCell
def isDone: Boolean = _currentCell == trip.end
def nextStep(city: City): Opti... | romanowski/krkStreetActor | src/main/scala/org/github/romanowski/streetactors/model/Car.scala | Scala | apache-2.0 | 503 |
package chapter05
import scala.beans.BeanProperty
// Make a class Student with read-write JavaBeans properties name (of type String) and
// id (of type Long).
// What methods are generated? (Use javap to check.)
// Can you call the JavaBeans getters and setters in Scala? Should you?
object Exercise5 extends App {
... | vsuharnikov/books-exercises | scala/scala-for-the-impatient/src/main/scala/chapter05/Exercise5.scala | Scala | mit | 1,181 |
package com.temportalist.owneremitter.server
import com.temportalist.owneremitter.common.CommonProxy
import net.minecraft.entity.player.EntityPlayer
import net.minecraft.tileentity.TileEntity
import net.minecraft.world.World
/**
*
*
* @author TheTemportalist
*/
class ServerProxy() extends CommonProxy {
override... | TheTemportalist/OwnerEmitter | src/main/scala/com/temportalist/owneremitter/server/ServerProxy.scala | Scala | apache-2.0 | 463 |
/**
* Copyright 2011-2017 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 appli... | timve/gatling | gatling-http/src/main/scala/io/gatling/http/action/async/Events.scala | Scala | apache-2.0 | 1,430 |
package com.twitter.finagle.netty3.http
import org.jboss.netty.buffer.ChannelBuffer
import org.jboss.netty.handler.codec.embedder.EncoderEmbedder
import org.jboss.netty.handler.codec.http.{HttpContentCompressor, HttpHeaders, HttpMessage}
/**
* Custom compressor that only handles text-like content-types with the defa... | mkhq/finagle | finagle-netty3-http/src/main/scala/com/twitter/finagle/netty3/http/Netty3TextualContentCompressor.scala | Scala | apache-2.0 | 929 |
// timber -- Copyright 2012-2021 -- Justin Patterson
//
// 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 l... | scalawag/timber | timber-api/src/main/scala/org/scalawag/timber/api/Level.scala | Scala | apache-2.0 | 2,918 |
package repositories
import com.byteslounge.slickrepo.repository.Repository
import javax.inject.Inject
import model.ItemTable.ItemTable
import model.{Item, PaginatedResult, PaginationParams, Pagination}
import slick.ast.BaseTypedType
import slick.jdbc.JdbcProfile
import scala.concurrent.ExecutionContext
class ItemRe... | sysgears/apollo-universal-starter-kit | modules/pagination/server-scala/src/main/scala/repositories/ItemRepository.scala | Scala | mit | 1,147 |
package pl.touk.nussknacker.engine.util
import org.scalatest.{FunSuite, Matchers}
class MathUtilsSpec extends FunSuite with Matchers {
test("min for nulls") {
MathUtils.min(null, null) shouldEqual null
MathUtils.min(null, 1) shouldEqual 1
val minForByte = MathUtils.min(null, 1.byteValue())
minForB... | TouK/nussknacker | utils/components-utils/src/test/scala/pl/touk/nussknacker/engine/util/MathUtilsSpec.scala | Scala | apache-2.0 | 1,869 |
package io.github.shogowada.scalajs.reactjs.example.todoapp
import io.github.shogowada.scalajs.reactjs.VirtualDOM._
import io.github.shogowada.scalajs.reactjs.elements.ReactElement
import io.github.shogowada.scalajs.reactjs.events.{FormSyntheticEvent, SyntheticEvent}
import io.github.shogowada.scalajs.reactjs.{React, ... | shogowada/scalajs-reactjs | example/todo-app/src/main/scala/io/github/shogowada/scalajs/reactjs/example/todoapp/Main.scala | Scala | mit | 3,235 |
/***********************************************************************
* Copyright (c) 2013-2020 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... | aheyne/geomesa | geomesa-hbase/geomesa-hbase-server/src/main/scala/org/locationtech/geomesa/hbase/server/common/HBaseVersionAggregator.scala | Scala | apache-2.0 | 2,082 |
/**
* MIT License
*
* Copyright (c) 2016-2018 James Sherwood-Jones <james.sherwoodjones@gmail.com>
*
* 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, includi... | jSherz/lsd-members | backend/src/it/scala/com/jsherz/luskydive/itest/util/DateUtil.scala | Scala | mit | 2,197 |
/**
* 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... | wuwenyu19860817/kafka | core/src/test/scala/unit/kafka/coordinator/ConsumerGroupMetadataTest.scala | Scala | apache-2.0 | 5,064 |
package org.http4s.ember.core
import cats._
import cats.effect._
import cats.implicits._
import fs2._
import fs2.io.tcp.Socket
import scala.concurrent.duration._
import scala.concurrent.duration.MILLISECONDS
import java.time.Instant
private[ember] object Util {
/**
* The issue with a normal http body is that t... | ChristopherDavenport/http4s | ember-core/src/main/scala/org/http4s/ember/core/Util.scala | Scala | apache-2.0 | 2,196 |
package com.github.gdefacci.raz
class PathOps[P](self:P) {
def / (segment:String)(implicit sgAdd:SegmentAdd[P]):sgAdd.Out = sgAdd.addSegment(self, segment)
def / [T](segment:T)(implicit sgAdd:PathVarAdd[P, T], startsWith:StartsWith[T, PathPosition.Segment]):sgAdd.Out = sgAdd.add(self, segment)
def && (p... | gdefacci/raz | raz/src/main/scala/com/github/gdefacci/raz/PathOps.scala | Scala | mit | 1,638 |
/*
* Copyright 2013 zhongl
*
* 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 w... | chosen0ne/HouseMD | src/main/scala/com/github/zhongl/housemd/misc/Utils.scala | Scala | apache-2.0 | 1,966 |
package debop4s.data.slick3.tests
import debop4s.data.slick3.TestDatabase._
import debop4s.data.slick3.TestDatabase.driver.api._
import debop4s.data.slick3.AbstractSlickFunSuite
/**
* RelationalScalarFunctionFunSuite
* @author sunghyouk.bae@gmail.com
*/
class RelationalScalarFunctionFunSuite extends AbstractSlickF... | debop/debop4s | debop4s-data-slick3/src/test/scala/debop4s/data/slick3/tests/RelationalScalarFunctionFunSuite.scala | Scala | apache-2.0 | 3,014 |
/*
* Shadowsocks - A shadowsocks client for Android
* Copyright (C) 2013 <max.c.lv@gmail.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at y... | baohaojun/shadowsocks-android | src/main/scala/com/github/shadowsocks/database/DBHelper.scala | Scala | gpl-3.0 | 5,189 |
package com.seremis.geninfusion.register
import com.seremis.geninfusion.api.GIApiInterface
import com.seremis.geninfusion.api.lib.Genes
import com.seremis.geninfusion.genetics.{Allele, Chromosome}
import net.minecraft.entity.monster.EntityZombie
object RegisterGeneDefaults extends Register {
override def regist... | Seremis/Genetic-Infusion | src/main/scala/com/seremis/geninfusion/register/RegisterGeneDefaults.scala | Scala | gpl-3.0 | 720 |
package com.twitter.scrooge.java_generator.test
object ApacheCompatibilityHelpers {
def cleanWhitespace(actual: String, cleanEmptySemicolons: Boolean) = {
val cleanTypedefMetadata = """(new FieldValueMetaData\([A-Z,a-z,0-9.]*).*?\)\)\);""".r
val randomWhitespace = """[ ]*\{""".r
val values = actual.spli... | elipoz/scrooge | scrooge-generator/src/main/scala/com/twitter/scrooge/java_generator/test/ApacheCompatibilityHelpers.scala | Scala | apache-2.0 | 766 |
/*
* Copyright 2010-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... | pbrant/framework | persistence/mongodb/src/test/scala/net/liftweb/mongodb/MongoDocumentExamplesSpec.scala | Scala | apache-2.0 | 18,065 |
/*
* Copyright 2011-2017 Chris de Vreeze
*
* 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 agree... | dvreeze/yaidom | jvm/src/test/scala/eu/cdevreeze/yaidom/integrationtest/ScalaXmlWrapperTest.scala | Scala | apache-2.0 | 25,434 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | gioenn/xSpark | core/src/main/scala/org/apache/spark/rdd/BinaryFileRDD.scala | Scala | apache-2.0 | 2,077 |
/**
* Copyright 2011-2012 eBusiness Information, Groupe Excilys (www.excilys.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
*
*... | Tjoene/thesis | Case_Programs/gatling-1.4.0/gatling-core/src/main/scala/com/excilys/ebi/gatling/core/action/SwitchAction.scala | Scala | gpl-2.0 | 957 |
package spatutorial.shared
trait Api {
// message of the day
def welcomeMsg(name: String): String
// get Todo items
def getAllTodos(): Seq[TodoItem]
// update a Todo
def updateTodo(item: TodoItem): Seq[TodoItem]
// delete a Todo
def deleteTodo(itemId: String): Seq[TodoItem]
}
| wrotki/spacommander | shared/src/main/scala/spatutorial/shared/Api.scala | Scala | apache-2.0 | 297 |
package ch12
import scala.util.Random
object ex02 extends App {
val a = Array(1, 10, 4, 7, 89, 23)
val m = a reduceLeft ((x, y) => x max y)
println(m)
}
| tuxdna/scala-for-the-impatient-exercises | src/main/scala/ch12/ex02.scala | Scala | apache-2.0 | 161 |
/*
* Copyright (c) 2012, 2013, 2014, 2015, 2016 SURFnet BV
* 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, thi... | BandwidthOnDemand/play-nsi-support | src/main/scala/nl/surfnet/nsiv2/messages/NsiMessage.scala | Scala | bsd-3-clause | 12,161 |
/*
* 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-commons/src/main/scala/io/gatling/commons/util/FastByteArrayOutputStream.scala | Scala | apache-2.0 | 5,514 |
/***********************************************************************
* 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-utils/src/test/scala/org/locationtech/geomesa/utils/stats/GroupByTest.scala | Scala | apache-2.0 | 23,904 |
package io.hydrosphere.mist.api.ml.preprocessors
import io.hydrosphere.mist.api.ml._
import org.apache.spark.SparkException
import org.apache.spark.ml.feature.StringIndexerModel
import scala.collection.mutable
class LocalStringIndexerModel(override val sparkTransformer: StringIndexerModel) extends LocalTransformer[S... | KineticCookie/mist | mist-lib/src/main/scala-2.11/io/hydrosphere/mist/api/ml/preprocessors/LocalStringIndexerModel.scala | Scala | apache-2.0 | 1,907 |
package eu.ace_design.island.util
/**
* This trait is used to introduce logging mechanisms in the Island classes. A model element wanting to log
* things must mix this trait.
*
* Runtime configuration is done in the 'resources/log4j2.xml' file. To subscribe to a given log silo, one simply need
* to create a Logg... | ace-design/island | engine/src/main/scala/eu/ace_design/island/util/Logger.scala | Scala | lgpl-3.0 | 3,805 |
package com.github.jeanadrien.evrythng.scala.rest
import com.github.jeanadrien.evrythng.scala.json.{Application, Project}
import org.specs2.concurrent.ExecutionEnv
import org.specs2.specification.BeforeAll
import org.specs2.specification.core.SpecStructure
import spray.json.JsString
import scala.concurrent.Await
impo... | jeanadrien/evrythng-scala-sdk | src/test/scala/com/github/jeanadrien/evrythng/scala/rest/ApplicationCrudSpec.scala | Scala | apache-2.0 | 3,588 |
package com.twitter.algebird
import org.scalatest.{ PropSpec, Matchers }
import org.scalatest.prop.PropertyChecks
import org.scalacheck.{ Gen, Arbitrary }
import java.lang.{ Integer => JInt, Short => JShort, Long => JLong, Float => JFloat, Double => JDouble, Boolean => JBool }
import java.util.{ List => JList, Map =>... | jinlee/algebird | algebird-test/src/test/scala/com/twitter/algebird/JavaBoxedTests.scala | Scala | apache-2.0 | 2,205 |
package org.denigma.kappa.notebook
import java.util.zip.Deflater
import better.files._
import scala.io.Codec
object extensions extends SharedExtensions{
implicit class FileExt(val file: File) {
def child(str: String): File = child(str, file)
protected def child(str: String, f: File):File = f.parentOptio... | antonkulaga/kappa-notebook | app/jvm/src/main/scala/org/denigma/kappa/notebook/extensions.scala | Scala | mpl-2.0 | 973 |
package org.openguard.core.actor
import java.io.File
import java.sql.Timestamp
import java.time.LocalDate
import java.time.format.DateTimeFormatter
import java.util.Date
import org.openguard.core.dao.ImageRefDAO
import org.openguard.core.models._
import play.api.Play
import play.api.Play.current
import java.time.{Loca... | pbolle/openvideoguard | core/src/main/scala/org/openguard/core/actor/ConverterTrait.scala | Scala | apache-2.0 | 1,628 |
package securesocial.controllers
import javax.inject.Inject
import play.api.http.HttpErrorHandler
class Assets @Inject() (errorHandler: HttpErrorHandler, metadata: controllers.AssetsMetadata)
extends controllers.AssetsBuilder(errorHandler, metadata) | jaliss/securesocial | module-code/app/securesocial/controllers/Assets.scala | Scala | apache-2.0 | 254 |
package org.scalameter
package collections
import collection._
import Key._
class MapBenchmarks extends Bench.Regression with Collections {
def persistor = new persistence.SerializationPersistor()
/* tests */
performance of "Map" in {
measure method "apply" config (
exec.minWarmupRuns -> 25,
... | kjanosz/scalameter | src/test/scala/org/scalameter/collections/MapBenchmarks.scala | Scala | bsd-3-clause | 7,426 |
package org.elasticmq.actor
import org.elasticmq.actor.queue._
import org.elasticmq.actor.reply._
import org.elasticmq.actor.test.{ActorTest, DataCreationHelpers, QueueManagerWithListenerForEachTest}
import org.elasticmq.msg._
import org.elasticmq.{MillisNextDelivery, MillisVisibilityTimeout}
class QueueEventListener... | adamw/elasticmq | core/src/test/scala/org/elasticmq/actor/QueueEventListenerTest.scala | Scala | apache-2.0 | 3,597 |
package com.twitter.finagle.memcached.protocol.text
import com.twitter.finagle.decoder.{Framer => FinagleFramer}
import com.twitter.finagle.memcached.util.ParserUtils
import com.twitter.io.{Buf, ByteReader}
import scala.collection.mutable.ArrayBuffer
private[memcached] object Framer {
private sealed trait State
... | twitter/finagle | finagle-memcached/src/main/scala/com/twitter/finagle/memcached/protocol/text/Framer.scala | Scala | apache-2.0 | 4,724 |
package app
import service.{AccountService, SystemSettingsService}
import SystemSettingsService._
import util.AdminAuthenticator
import jp.sf.amateras.scalatra.forms._
import ssh.SshServer
class SystemSettingsController extends SystemSettingsControllerBase
with AccountService with AdminAuthenticator
trait SystemSe... | oho-sugu/gitbucket | src/main/scala/app/SystemSettingsController.scala | Scala | apache-2.0 | 3,348 |
/*
* FilterWindowedInAOutA.scala
* (FScape)
*
* Copyright (c) 2001-2022 Hanns Holger Rutz. All rights reserved.
*
* This software is published under the GNU Affero General Public License v3+
*
*
* For further information, please contact Hanns Holger Rutz at
* contact@sciss.de
*/
package de.sciss.fscap... | Sciss/FScape-next | core/shared/src/main/scala/de/sciss/fscape/stream/impl/logic/FilterWindowedInOut.scala | Scala | agpl-3.0 | 2,032 |
/*
* Copyright (C) 2020 MapRoulette contributors (see CONTRIBUTORS.md).
* Licensed under the Apache License, Version 2.0 (see LICENSE).
*/
package org.maproulette.framework.model
import org.joda.time.DateTime
import play.api.libs.json.{JsValue, Json, Reads, Writes}
import play.api.libs.json.JodaWrites._
import play... | mgcuthbert/maproulette2 | app/org/maproulette/framework/model/ClusteredPoint.scala | Scala | apache-2.0 | 3,233 |
/*
* 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 ... | pronix/spark | core/src/main/scala/org/apache/spark/storage/BlockManagerMasterEndpoint.scala | Scala | apache-2.0 | 19,728 |
package com.twitter.finagle.exp
import com.twitter.conversions.time._
import com.twitter.finagle.Service
import com.twitter.finagle.thrift.{ClientId, ThriftClientRequest}
import com.twitter.util.{Future, Time}
import org.junit.runner.RunWith
import org.scalatest.FunSuite
import org.scalatest.junit.JUnitRunner
import o... | travisbrown/finagle | finagle-exp/src/test/scala/com/twitter/finagle/exp/ThriftForwardingWarmUpFilterTest.scala | Scala | apache-2.0 | 2,606 |
package moe.brianhsu.easytaipei
import android.content.Context
import android.location.Location
import android.location.LocationListener
import android.location.LocationManager
import android.os.Bundle
import android.support.design.widget.Snackbar
import android.support.v4.app.Fragment
import android.view.LayoutInflat... | brianhsu/EasyTaipei | src/main/scala/fragment/BaseFramgnet.scala | Scala | gpl-2.0 | 7,575 |
package scales.exprs
import scala.collection.mutable.Map
import scales.{Local, Log, LookupTable, Main, Pos, Scoped}
/** Tags a variable with a type. */
case class Typed(name: String, ty: String)
/** Utilities for working with Jasmin. */
object Jas {
/** Make the args of a method into a string for Jasmin. */
def... | jsnider3/Scales | src/main/scala/feature.scala | Scala | gpl-2.0 | 3,875 |
package controllers
import org.scalatestplus.play.PlaySpec
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.
*/
class ApplicationIT extends PlaySpec {
"Application" should {
"send 404 ... | metaxmx/FridayNightBeer | test/controllers/ApplicationIT.scala | Scala | apache-2.0 | 774 |
package object rtags extends Object with RTags with RStyleValue
| jawp/wicked-playground | modules/frontend/src/main/scala/rtags/package.scala | Scala | mit | 64 |
/*
* Copyright 2016 LinkedIn Corp.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to i... | nntnag17/dr-elephant-1 | app/org/apache/spark/deploy/history/SparkFSFetcher.scala | Scala | apache-2.0 | 5,129 |
/*
* Accio is a platform to launch computer science experiments.
* Copyright (C) 2016-2018 Vincent Primault <v.primault@ucl.ac.uk>
*
* Accio 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... | privamov/accio | accio/java/fr/cnrs/liris/locapriv/ops/SpatialSamplingOp.scala | Scala | gpl-3.0 | 1,569 |
import java.io.{FileNotFoundException, FileReader, IOException}
/**
* Created by ahan on 10/05/2017.
*/
object Other {
//注入方法
def apply(user: String, domain: String) = {
user + "@" + domain;
}
def unapply(str: String) : Option[(String, String)] = {
//val parts = str.split("@");
val parts = ... | AmeryHan/amery_base_java | scala/src/main/scala/advanced/Other.scala | Scala | apache-2.0 | 910 |
package de.htwg.zeta.server.model.modelValidator.validator.rules.metaModelIndependent
import java.util.UUID
import scala.collection.immutable.Seq
import de.htwg.zeta.common.models.project.concept.elements.MAttribute
import de.htwg.zeta.common.models.project.concept.elements.MClass
import de.htwg.zeta.common.models.p... | Zeta-Project/zeta | api/server/test/de/htwg/zeta/server/model/modelValidator/validator/rules/metaModelIndependent/ElementsIdUniqueTest.scala | Scala | bsd-2-clause | 2,459 |
/*
* 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/pensions-lifetime-allowance-frontend | app/controllers/PrintController.scala | Scala | apache-2.0 | 3,095 |
/***********************************************************************
* Copyright (c) 2013-2015 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 is ... | giserh/geomesa | geomesa-plugin/src/main/scala/org/locationtech/geomesa/plugin/wfs/AccumuloDataStoreFactoryInitializer.scala | Scala | apache-2.0 | 812 |
/*
* 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 ... | shaoxuan-wang/flink | flink-table/flink-table-planner/src/test/scala/org/apache/flink/table/catalog/ExternalCatalogSchemaTest.scala | Scala | apache-2.0 | 3,630 |
package org.bitcoins.chain.blockchain.sync
import org.bitcoins.chain.blockchain.ChainHandler
import org.bitcoins.core.api.chain.ChainApi
import org.bitcoins.crypto.DoubleSha256DigestBE
import org.bitcoins.testkit.chain.SyncUtil
import org.bitcoins.testkit.chain.fixture.{
BitcoindBaseVersionChainHandlerViaRpc,
Chai... | bitcoin-s/bitcoin-s | chain-test/src/test/scala/org/bitcoins/chain/blockchain/sync/ChainSyncTest.scala | Scala | mit | 5,123 |
package utils.credentials
import scala.util.Random
import org.apache.commons.codec.binary.Base64
import playground.models._
trait PasswordGenerator {
def generate(): Password
}
object RandomPassword extends PasswordGenerator {
def generate = {
val bytes = new Array[Byte](9)
Random.nextBytes(bytes)
... | ybr/PlayBootstrap | app/utils/credentials/PasswordGenerator.scala | Scala | mit | 369 |
/*
* 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/amls-frontend | test/models/businessmatching/ReviewDetailsSpec.scala | Scala | apache-2.0 | 5,079 |
package me.stojan.qap
import org.scalatest._
import org.scalamock.scalatest._
abstract class QAPSpec extends FlatSpec with Matchers with MockFactory
| hf/qap | src/test/scala/me.stojan.qap/QAPSpec.scala | Scala | mit | 151 |
/***********************************************************************
* Copyright (c) 2013-2019 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... | elahrvivaz/geomesa | geomesa-z3/src/main/scala/org/locationtech/geomesa/curve/Z3SFC.scala | Scala | apache-2.0 | 3,324 |
package com.twitter.server.handler
import com.twitter.conversions.DurationOps._
import com.twitter.finagle.http.{Request, Status}
import com.twitter.util.registry.{GlobalRegistry, SimpleRegistry}
import com.twitter.util.{Await, Awaitable}
import org.scalatest.funsuite.AnyFunSuite
class ServerInfoHandlerTest extends A... | twitter/twitter-server | server/src/test/scala/com/twitter/server/handler/ServerInfoHandlerTest.scala | Scala | apache-2.0 | 1,795 |
/*
* Copyright 2017 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... | pncampbell/ct-calculations | src/main/scala/uk/gov/hmrc/ct/ct600e/v3/E4.scala | Scala | apache-2.0 | 841 |
package org.clulab.serialization.json
trait Equivalency {
/** Custom hash used to establish equivalence */
def equivalenceHash: Int
/** string used to denote the class */
val stringCode: String
/** id encoding class info and equivalence */
def id: String = s"$stringCode:$equivalenceHash"
} | sistanlp/processors | main/src/main/scala/org/clulab/serialization/json/Equivalency.scala | Scala | apache-2.0 | 307 |
/*
* Copyright 2015 IBM 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 applicable law or agreed to ... | KimStebel/couchdb-scala | src/test/scala/com/ibm/couchdb/implicits/UpickleImplicitsSpec.scala | Scala | apache-2.0 | 2,539 |
package sbt
import sbt.internal.util.{ AttributeMap, IMap, Types }
import Def.ScopedKey
import Types.Id
import Keys.sessionVars
import sbinary.{ Format, Operations }
object SessionVar {
val DefaultDataID = "data"
// these are required because of inference+manifest limitations
final case class Key[T](key: Scop... | mdedetrich/sbt | main/src/main/scala/sbt/SessionVar.scala | Scala | bsd-3-clause | 2,740 |
package ilc
package feature
package abelianMaps
trait ToScala
extends maps.ToScala
with abelianGroups.ToScala
with Syntax
{
addLibrary("abelianMaps")
override def toScala(tau: Type): String = tau match {
case MapType(keyType, valType) =>
s"AbelianMap[${toScala(keyType)}, ${toScala(valType)}]"
... | inc-lc/ilc-scala | src/main/scala/ilc/feature/abelianMaps/ToScala.scala | Scala | mit | 645 |
package com.nulabinc.backlog.r2b.redmine.service
import com.nulabinc.backlog.r2b.redmine.domain.RedmineCustomFieldDefinition
/**
* @author uchida
*/
trait CustomFieldService {
def allCustomFieldDefinitions(): Seq[RedmineCustomFieldDefinition]
}
| nulab/BacklogMigration-Redmine | redmine/src/main/scala/com/nulabinc/backlog/r2b/redmine/service/CustomFieldService.scala | Scala | mit | 255 |
/*
* Copyright (C) 2010, 2012, 2019 Mikhail Vorozhtsov
*
* 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... | mvv/routineer | core/src/main/scala/com/github/mvv/routineer/ValuePattern.scala | Scala | apache-2.0 | 7,643 |
import scala.reflect.runtime.universe._
import scala.tools.reflect.Eval
object Test extends dotty.runtime.LegacyApp {
reify {
def sort(a: List[Int]): List[Int] = {
if (a.length < 2)
a
else {
val pivot = a(a.length / 2)
sort(a.filter(_ < pivot)) :::
a.filter(_ == p... | yusuke2255/dotty | tests/disabled/macro/run/reify_sort1.scala | Scala | bsd-3-clause | 466 |
/* __ *\\
** ________ ___ / / ___ Scala API **
** / __/ __// _ | / / / _ | (c) 2006-2013, LAMP/EPFL **
** __\\ \\/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\\___/_/... | l15k4/scala-parser-combinators | src/main/scala/scala/util/parsing/combinator/lexical/StdLexical.scala | Scala | bsd-3-clause | 3,805 |
package scorex.app.api.http
import akka.util.Timeout
import play.api.libs.json.{JsObject, JsValue}
import scorex.account.Account
import scorex.app.LagonakiApplication
import scorex.block.Block
import scorex.crypto.Base58
import scala.concurrent.duration._
trait CommonApiFunctions {
implicit val timeout = Timeout(... | benjyz/Scorex-Lagonaki | src/main/scala/scorex/app/api/http/CommonApiFunctions.scala | Scala | cc0-1.0 | 1,545 |
package adhoc
import org.scalatest.prop.GeneratorDrivenPropertyChecks._
import org.scalatest.{Matchers, WordSpecLike}
import scala.annotation.tailrec
trait SpreadSheetColumn {
def columnIndex2String(index: Int): String = {
val Base = 26
val A = 'A'.toInt
@tailrec
def toSpreadSheetBase(acc: List[C... | timothygordon32/fp-in-scala-book | src/test/scala/adhoc/SpreadsheetColumnCalculatorSpec.scala | Scala | mit | 2,309 |
package fs2
/**
* Marker trait. A `Stream[Pure,O]` can be safely cast to a `Stream[Nothing,O]`,
* but the `Stream[Pure,O]` has better type inference properties in some places.
* See usage in `[[Stream.pull]]`.
*/
sealed trait Pure[+A]
| japgolly/scalaz-stream | core/src/main/scala/fs2/Pure.scala | Scala | mit | 240 |
/*
* Copyright (C) 2009-2017 Lightbend Inc. <https://www.lightbend.com>
*/
package controllers
import play.api.mvc._
import javax.inject.Inject
class Application @Inject() (c: ControllerComponents) extends AbstractController(c) {
def index = Action {
Ok("original")
}
}
| Shruti9520/playframework | framework/src/sbt-plugin/src/sbt-test/play-sbt-plugin/dev-mode/app/controllers/Application.scala | Scala | apache-2.0 | 282 |
/*
* Copyright 2015 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... | scottcutts/ct-calculations | src/main/scala/uk/gov/hmrc/ct/ct600a/v3/A70.scala | Scala | apache-2.0 | 1,293 |
package me.reminisce.gameboard.questions
import me.reminisce.database.MongoDBEntities._
import me.reminisce.gameboard.board.GameboardEntities._
import org.scalatest.FunSuite
class QuestionGeneratorSuite extends FunSuite {
def createTestPost(message: String, story: String, postType: String,
me... | reminisceme/game-creator | src/test/scala/me/reminisce/gameboard/questions/QuestionGeneratorSuite.scala | Scala | apache-2.0 | 7,835 |
package io.reactors
package services
import io.reactors.common.IndexMap
import io.reactors.concurrent.Frame
import io.reactors.concurrent.Services
import java.util.Timer
import java.util.TimerTask
import java.util.concurrent.atomic._
import scala.annotation.tailrec
import scala.annotation.unchecked
import scala.coll... | storm-enroute/reactors | reactors-core/shared/src/main/scala/io/reactors/services/package.scala | Scala | bsd-3-clause | 9,642 |
object Scl8083 {
new <ref>JavaClass("", classOf[Object])
}
| whorbowicz/intellij-scala | testdata/resolve/failed/constructorFromJava/Scl8083.scala | Scala | apache-2.0 | 61 |
package org.rebeam.tree.view
import chandu0101.scalajs.react.components.materialui._
import japgolly.scalajs.react._
import japgolly.scalajs.react.vdom.VdomElement
import japgolly.scalajs.react.vdom.html_<^._
import scala.scalajs.js
object ToolbarIconButton {
case class Props(icon: VdomElement, onClick: Callback... | trepidacious/tree-material-ui | js/src/main/scala/org/rebeam/tree/view/ToolbarIconButton.scala | Scala | gpl-3.0 | 738 |
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.