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 mesosphere.marathon
package api.validation
import mesosphere.UnitTest
import mesosphere.marathon.api.v2.ValidationHelper
import mesosphere.marathon.core.health._
import mesosphere.marathon.core.plugin.PluginManager
import mesosphere.marathon.state._
class AppDefinitionMesosHealthCheckValidationTest extends Un... | mesosphere/marathon | src/test/scala/mesosphere/marathon/api/validation/AppDefinitionMesosHealthCheckValidationTest.scala | Scala | apache-2.0 | 3,068 |
// Copied from log4s project and licensed under Apache 2.0 license.
// See LogLevel.scala.license
// Verbatim from: https://github.com/Log4s/log4s/blob/v1.3.4/src/main/scala/org/log4s/LogLevel.scala
package org.log4s
/** A severity level that can be assigned to log statements. */
sealed trait LogLevel {
/** The nam... | indyscala/sbt-plugin-tour | mima/src/main/scala/org/log4s/LogLevel.scala | Scala | mit | 1,786 |
package pub.ayada.scala.sparkUtils.etl.read
trait ReadProps {
def taskType : String
def id : String
def propsFile : String
def printSchema : Boolean = true
def loadCount : Boolean = false
def repartition : Int = 0
def broadcast : Boolean = false
def forceNoPersist : Boolean = false
}
| k-ayada/SparkETL | pub/ayada/scala/sparkUtils/etl/read/ReadProps.scala | Scala | apache-2.0 | 318 |
package eventstore.examples
import akka.actor.{ Props, ActorSystem }
import eventstore.TransactionActor._
import eventstore.tcp.ConnectionActor
import eventstore.{ EventData, TransactionActor, EventStream, TransactionStart }
object StartTransactionExample extends App {
val system = ActorSystem()
val connection = ... | pawelkaczor/EventStore.JVM | src/main/scala/eventstore/examples/StartTransactionExample.scala | Scala | bsd-3-clause | 1,025 |
package org.tejo.iza.tests
import akka.actor.{ActorRef, ActorSystem}
import akka.testkit.{ImplicitSender, TestKit, TestProbe}
import org.scalamock.scalatest.MockFactory
import org.scalatest._
import org.tejo.iza.actor.cirkulerilo.DissenduActor.Msg.CirkuleroMsg
import org.tejo.iza.actor.cirkulerilo.redaktilo.Redaktilo
... | tomaszym/izabela | actor/src/test/scala/org/tejo/iza/tests/IzaSuite.scala | Scala | gpl-2.0 | 3,804 |
package ch.epfl.directembedding
import scala.language.experimental.macros
import scala.reflect.macros.blackbox.Context
package object test {
// For testing purposes
def persisted(x: Any): String = macro Persisted.persisted
def inline[T](x: T): T = macro Persisted.inline[T]
private object Persisted {
def p... | directembedding/directembedding | dsls/src/main/scala/ch/epfl/directembedding/test/package.scala | Scala | bsd-3-clause | 2,332 |
/*
* Copyright (c) 2014-2020 by The Monix Project Developers.
* See the project homepage at: https://monix.io
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache... | alexandru/monifu | monix-reactive/shared/src/main/scala/monix/reactive/internal/operators/BufferIntrospectiveObservable.scala | Scala | apache-2.0 | 1,202 |
package pl.writeonly.son2.vaadin.ui
import com.vaadin.ui.{Button, Component, Label, Panel}
import pl.writeonly.son2.vaadin.util.UIUtil
trait Components extends UIUtil {
val components: Seq[Component]
val inputs: Seq[Component]
val convert: Button
val output: Label
def optionsPanel(components: Seq[Component... | writeonly/scalare | scalare-adin/src/main/scala/pl/writeonly/son2/vaadin/ui/Components.scala | Scala | artistic-2.0 | 544 |
/*
* 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... | pteichman/zipkin | zipkin-collector-scribe/src/test/scala/com/twitter/zipkin/collector/processor/ScribeFilterSpec.scala | Scala | apache-2.0 | 2,257 |
package com.twitter.finagle.loadbalancer
import com.twitter.finagle._
import com.twitter.finagle.service.FailingFactory
import com.twitter.util.{Future, Time}
import java.util.concurrent.atomic.AtomicReference
import scala.annotation.tailrec
import scala.util.control.NonFatal
/**
* A specialized [[ServiceFactory]] w... | koshelev/finagle | finagle-core/src/main/scala/com/twitter/finagle/loadbalancer/EndpointFactory.scala | Scala | apache-2.0 | 4,768 |
package unfiltered.request
/** Note that extractors based on this ignore anything beyond a semicolon in a header */
class RequestHeader(val name: String) {
def unapply[T](req: HttpRequest[T]) = {
def split(raw: String) = raw.split(",") map {
_.trim.takeWhile { _ != ';' } mkString
}
def headers... | softprops/Unfiltered | library/src/main/scala/request/headers.scala | Scala | mit | 2,196 |
/*
* Copyright (c) 2014-2018 by The Monix Project Developers.
* See the project homepage at: https://monix.io
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache... | Wogan/monix | monix-reactive/js/src/main/scala/monix/reactive/observers/buffers/BatchedBufferedSubscriber.scala | Scala | apache-2.0 | 1,701 |
/*
Copyright (C) 2013-2018 Expedia 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 wri... | mikkokar/styx | system-tests/e2e-suite/src/test/scala/com/hotels/styx/admin/OriginsReloadCommandSpec.scala | Scala | apache-2.0 | 3,280 |
package zzz.akka.avionics
/**
* Kevin Ying 2015
*/
import akka.actor.{Actor, ActorSystem, Props}
import akka.testkit.{TestActorRef, TestKit, TestLatch, ImplicitSender}
import scala.concurrent.duration._
import scala.concurrent.Await
import org.scalatest.{WordSpecLike, BeforeAndAfterAll}
import org.scalatest.MustMat... | kevyin/akka-book-wyatt | src/test/scala/zzz/akka/avionics/AltimeterTest.scala | Scala | mit | 2,525 |
package at.fabricate.liftdev.common
package model
import net.liftweb.mapper.LongKeyedMapper
// This is the basic mapper entity type
// especially for use in User (without IdPK)
trait BaseEntityWithTitleDescriptionAndIcon [T <: (BaseEntityWithTitleDescriptionAndIcon[T]) ] extends BaseEntity[T] with BaseEntityWithTitl... | Fabricate/OpenthingsImplementation | src/main/scala/at/fabricate/liftdev/common/model/BaseEntityWithTitleDescriptionAndIcon.scala | Scala | lgpl-3.0 | 644 |
/*
* 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 ... | MrCodeYu/spark | core/src/main/scala/org/apache/spark/broadcast/Broadcast.scala | Scala | apache-2.0 | 7,020 |
package com.twitter.finagle.memcached.protocol.text
import com.twitter.finagle.framer.{Framer => FinagleFramer}
import com.twitter.finagle.memcached.util.ParserUtils
import com.twitter.io.Buf
import scala.collection.mutable.ArrayBuffer
private[memcached] object Framer {
private sealed trait State
private case ob... | spockz/finagle | finagle-memcached/src/main/scala/com/twitter/finagle/memcached/protocol/text/Framer.scala | Scala | apache-2.0 | 4,425 |
package com.github.acrisci.commander.errors
class ProgramParseException(message: String) extends RuntimeException {
}
| acrisci/commander-scala | src/main/scala/com/github/acrisci/commander/errors/ProgramParseException.scala | Scala | mit | 119 |
package scalakurs.basics.koans.support
import org.scalatest.Stopper
object Master extends Stopper {
var studentNeedsToMeditate = false
override def apply() = studentNeedsToMeditate
type HasTestNameAndSuiteName = {
val suiteName: String
val testName: String
}
def studentFailed (event: HasTestName... | elacin/scala-kurs | oppgaver/src/test/scala/scalakurs/basics/koans/support/Master.scala | Scala | apache-2.0 | 583 |
package scadoop
import collection._
import System._
import util.Random
import org.apache.hadoop.conf._
import org.apache.hadoop.filecache._
import org.apache.hadoop.fs.Path
import org.apache.hadoop.io._
import org.apache.hadoop.mapreduce._
import org.apache.hadoop.mapreduce.lib.input.FileInputFormat
import org.apache... | jhclark/scadoop | src/scadoop.scala | Scala | lgpl-3.0 | 10,537 |
class A {
val n = {
val z = {
lazy val bb = 1
bb
}
val a = {
lazy val cc = 2
cc
}
lazy val b = {
lazy val dd = 3
dd
}
z
}
}
class B {
locally {
lazy val ms = "as"
ms
}
}
cl... | folone/dotty | tests/untried/pos/t3670.scala | Scala | bsd-3-clause | 570 |
// Copyright 2015-2016 Ricardo Gladwell.
// Licensed under the GNU Lesser General Public License.
// See the README.md file for more information.
package microtesia.properties
import microtesia.{MicrodataString, Tag}
import scala.util.Success
private[microtesia] trait StringPropertyParsing[N] extends PropertyParsing... | rgladwell/microtesia | src/main/scala/microtesia/properties/StringPropertyParsing.scala | Scala | lgpl-3.0 | 490 |
package rta.cron
import java.util.{Arrays, Calendar, Date}
final case class CronExpression(minute: CronExpression.Value, hour: CronExpression.Value,
dayOfMonth: CronExpression.Value, month: CronExpression.Value,
dayOfWeek: CronExpression.Value, year: Option[CronExpression.Value]) {
require(minute.min >= 0 && mi... | kjanosz/RuleThemAll | utils/src/main/scala/rta/cron/CronExpression.scala | Scala | apache-2.0 | 2,816 |
package io.jfc
import cats.data.{ NonEmptyList, Validated, Xor }
import io.jfc.test.CursorSuite
class CursorTests extends CursorSuite[Cursor] {
def fromJson(j: Json): Cursor = Cursor(j)
def top(c: Cursor): Option[Json] = Some(c.top)
def focus(c: Cursor): Option[Json] = Some(c.focus)
def fromResult(result: Opt... | non/circe | core/src/test/scala/io/jfc/CursorTests.scala | Scala | apache-2.0 | 927 |
/*
* 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 ... | kevinyu98/spark | sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/PartitioningAwareFileIndex.scala | Scala | apache-2.0 | 10,869 |
import scala.reflect.macros.whitebox.Context
import scala.language.experimental.macros
import scala.annotation.StaticAnnotation
object HelloMacro {
def impl(c: Context)(annottees: c.Tree*): c.Tree = {
import c.universe._
annottees match {
case (classDecl: ClassDef) :: Nil =>
val q"$mods class ... | pdalpra/sbt | sbt/src/sbt-test/source-dependencies/macro-annotation/macros/src/main/scala/Macros.scala | Scala | bsd-3-clause | 761 |
/*******************************************************************************
* Copyright (c) 2019. Carl Minden
*
* 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 ... | carlminden/anathema-roguelike | src/com/anathema_roguelike/entities/items/weapons/types/MeleeWeaponType.scala | Scala | gpl-3.0 | 1,947 |
/* *\\
** A Toy Model of Environment **
** https://github.com/cubean/environment-toy-model.git **
\\* */
package Env.Tools
impor... | cubean/environment-toy-model | src/main/scala/Env/Tools/DateTimeCal.scala | Scala | apache-2.0 | 5,070 |
package objsets
import common._
import TweetReader._
/**
* A class to represent tweets.
*/
class Tweet(val user: String, val text: String, val retweets: Int) {
override def toString: String =
"User: " + user + "\\n" +
"Text: " + text + " [" + retweets + "]"
}
/**
* This represents a set of objects of ... | macarran/coursera-progfun | Week 3/objsets/src/main/scala/objsets/TweetSet.scala | Scala | mit | 7,050 |
/*
* Copyright © 2013 by Jörg D. Weisbarth
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License 3 as published by
* the Free Software Foundation;
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRA... | joergdw/antconflictbeh | src/sim/app/antDefenseAIs/model/LN_RPB_WithFetching.scala | Scala | lgpl-3.0 | 4,618 |
package Project
import scalafx.scene.media.AudioClip
/**
* Games Sounds are in this object and it has methods which play specific sound file if sound is on
*/
object Sound {
var isSoundOn: Boolean = true
//Sound Files
val menuSoundFile = new AudioClip("file:audio/menu.wav")
val shootSoundFile = new AudioCli... | TarmoA/ProjectAsteroid | Documents/ohjelmointistuff/ProjectAsteroid/src/Project/Sound.scala | Scala | gpl-3.0 | 688 |
package controllers
import pl.pholda.malpompaaligxilo.ContextJVM
import pl.pholda.malpompaaligxilo.dsl.parser.FormSpecificationParser
import pl.pholda.malpompaaligxilo.form.FormInstanceJVM
import pl.pholda.malpompaaligxilo.i18n.{I18nJVM, Lang}
import play.api.libs.json._
import play.api.mvc._
import views.html
import... | pholda/MalpompaAligxilo | examples/dslPlay/app/controllers/Main.scala | Scala | gpl-3.0 | 1,569 |
package mypipe
import mypipe.api.consumer.{ BinaryLogConsumer, BinaryLogConsumerListener }
import mypipe.api.event.{ Mutation, InsertMutation }
import mypipe.mysql._
import scala.concurrent.{ Future, Await }
import scala.concurrent.duration._
import mypipe.producer.QueueProducer
import java.util.concurrent.{ TimeUnit,... | Asana/mypipe | mypipe-api/src/test/scala/mypipe/LatencySpec.scala | Scala | apache-2.0 | 4,738 |
package nn.conv
import java.io.{File, PrintWriter}
import java.nio.file.Files.{createDirectory, exists}
import java.nio.file.Paths.get
import java.util.Calendar
import com.typesafe.scalalogging.Logger
import nn.conv.versions.{Conv1, Conv3, Conv4}
import nn.{PaddedArray, Shape}
//import nn.mysql.Connector
import openc... | lift-project/lift | src/test/nn/conv/TestConv.scala | Scala | mit | 14,180 |
package com.mesosphere.cosmos
import com.netaporter.uri.dsl._
import com.twitter.conversions.storage._
import com.twitter.finagle.http.RequestBuilder
import com.twitter.finagle.http.Status
import com.twitter.util.Await
import com.twitter.util.Return
import org.scalatest.FreeSpec
final class ServicesIntegrationSpec ex... | takirala/cosmos | cosmos-integration-tests/src/main/scala/com/mesosphere/cosmos/ServicesIntegrationSpec.scala | Scala | apache-2.0 | 738 |
/*
* The MIT License
*
* Copyright (c) 2017 Fulcrum Genomics LLC
*
* 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 us... | fulcrumgenomics/fgbio | src/main/scala/com/fulcrumgenomics/Writer.scala | Scala | mit | 1,419 |
/*
* 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/iht-frontend | test/iht/controllers/registration/RegistrationControllerTest.scala | Scala | apache-2.0 | 3,401 |
package io.transwarp.midas.constant.midas.params
object ProcessParams {
val CronExpr = "cron expression"
val GlobalVars = "global"
val MaxRows = "max data rows"
}
| transwarpio/rapidminer | api-driver/src/main/scala/io/transwarp/midas/constant/midas/params/ProcessParams.scala | Scala | gpl-3.0 | 170 |
/*
* 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 ... | chenc10/Spark-PAF | sql/core/src/test/scala/org/apache/spark/sql/ColumnExpressionSuite.scala | Scala | apache-2.0 | 21,109 |
/*
* 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... | chipsenkbeil/incubator-toree | kernel/src/main/scala/org/apache/toree/boot/KernelBootstrap.scala | Scala | apache-2.0 | 6,060 |
package spark.scheduler.cluster
import spark.{Utils, Logging, SparkContext}
import spark.deploy.client.{Client, ClientListener}
import spark.deploy.{Command, ApplicationDescription}
import scala.collection.mutable.HashMap
private[spark] class SparkDeploySchedulerBackend(
scheduler: ClusterScheduler,
sc: Spark... | prabeesh/Spark-Kestrel | core/src/main/scala/spark/scheduler/cluster/SparkDeploySchedulerBackend.scala | Scala | bsd-3-clause | 2,545 |
package whisk.docker
import org.scalatest.concurrent.ScalaFutures
import org.scalatest.time.{ Second, Seconds, Span }
import org.scalatest.{ BeforeAndAfterAll, FlatSpec, Matchers }
import whisk.docker.test.DockerTestKit
class MongodbServiceSpec extends FlatSpec with Matchers with BeforeAndAfterAll with ScalaFutures
... | kiequoo/docker-it-scala | src/test/scala/whisk/docker/MongodbServiceSpec.scala | Scala | mit | 572 |
/*
* Copyright (c) 2013-2014, ARM Limited
*
* 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, modify, merge, p... | Meinersbur/pencil | src/scala/com/arm/carp/apps/optimizer/passes/GCP.scala | Scala | mit | 3,319 |
package com.datastax.spark.connector
import org.scalatest.{Matchers, WordSpec}
import com.datastax.spark.connector.cql._
import com.datastax.spark.connector.types.{TimestampType, VarCharType, IntType}
class ColumnSelectorSpec extends WordSpec with Matchers {
"A ColumnSelector#selectFrom method" should {
val co... | Stratio/spark-cassandra-connector | spark-cassandra-connector/src/test/scala/com/datastax/spark/connector/ColumnSelectorSpec.scala | Scala | apache-2.0 | 1,541 |
package org.eigengo.sogx.core
import org.springframework.integration.annotation.{Header, Payload}
import java.util.Collections
import org.eigengo.sogx.ContentTypes._
import org.eigengo.sogx._
import java.util
class ChunkDecoder(mjpegDecoder: MJPEGDecoder) {
/**
* Take the chunk arriving on a particular correlat... | eigengo/springone2gx2013 | jvm/src/main/scala/org/eigengo/sogx/core/ChunkDecoder.scala | Scala | apache-2.0 | 1,321 |
package com.generativists.thirdway.core
import org.scalatest.{FunSpec, Matchers}
class EventSpec extends FunSpec with Matchers {
describe("An Event") {
it("should be ordered by time then order") {
val activity = new NoOp[String]
Event(0.0, 0, activity) should be < Event(1.0, 0, activity)
Eve... | generativists/ThirdWay | src/test/scala/com/generativists/thirdway/core/EventSpec.scala | Scala | mit | 455 |
package com.mentatlabs.nsa
package scalac
package options
/* -Xno-forwarders
* ===============
* 2.8.0 - 2.8.2: Do not generate static forwarders in mirror classes
* 2.9.0 - 2.12.0: Do not generate static forwarders in mirror classes.
*/
case object ScalacXNoForwarders
extends ScalacOptionBoolean("-Xno-... | melezov/sbt-nsa | nsa-core/src/main/scala/com/mentatlabs/nsa/scalac/options/advanced/ScalacXNoForwarders.scala | Scala | bsd-3-clause | 357 |
package org.pgscala
package builder
package converters
object PGElemConverterBuilder
extends PGConverterBuilder {
val scalaClazz = "Elem"
override val imports = "import scala.xml.Elem"
val defaultValue = "null // no sane default for XML"
}
| melezov/pgscala | builder/src/main/scala/org/pgscala/builder/converters/scala/PGElemConverterBuilder.scala | Scala | bsd-3-clause | 254 |
import swing._
import swing.event.{KeyReleased, Key, SelectionChanged}
import swing.BorderPanel.Position._
import swing.ListView.IntervalMode
import javax.swing.Icon
import swing.event.WindowOpened
import scala.concurrent._
import ExecutionContext.Implicits.global
import java.util.concurrent.atomic.AtomicReference
i... | goodlyrottenapple/calculus-toolbox | template/gui/Dialogs.scala | Scala | mit | 9,614 |
/*
* 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 ... | zzcclp/carbondata | integration/spark/src/main/scala/org/apache/spark/sql/execution/command/table/CarbonShowTablesCommand.scala | Scala | apache-2.0 | 2,080 |
package dhg.ccg.tag.learn
import dhg.util._
import math.pow
import scalaz.{ \\/ => _, _ }
import scalaz.Scalaz._
import dhg.ccg.cat._
import dhg.ccg.rule._
import dhg.ccg.prob._
import dhg.ccg.tagdict.TagDictionary
/**
* Assign `combinableTransitionMass` proportion of the probability mass of
* the delegate Transiti... | dhgarrette/2015-ccg-parsing | src/main/scala/dhg/ccg/tag/learn/CcgHmmInitialization.scala | Scala | apache-2.0 | 6,601 |
/**
* Licensed to Big Data Genomics (BDG) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The BDG licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use ... | bigdatagenomics/PacMin | pacmin-core/src/test/scala/org/bdgenomics/pacmin/overlapping/OverlapperSuite.scala | Scala | apache-2.0 | 5,156 |
package nodes.learning
import breeze.linalg._
import edu.berkeley.cs.amplab.mlmatrix.{RowPartition, NormalEquations, BlockCoordinateDescent, RowPartitionedMatrix}
import nodes.stats.{StandardScalerModel, StandardScaler}
import org.apache.spark.rdd.RDD
import nodes.util.{VectorSplitter, Identity}
import utils.{MatrixUt... | tomerk/keystone | src/main/scala/nodes/learning/BlockLinearMapper.scala | Scala | apache-2.0 | 9,593 |
package com.github.mdr.mash.ns.collections
import com.github.mdr.mash.completions.CompletionSpec
import com.github.mdr.mash.functions.{ BoundParams, MashFunction, Parameter, ParameterModel }
import com.github.mdr.mash.inference._
import com.github.mdr.mash.ns.core.objectClass.GetMethod
import com.github.mdr.mash.runti... | mdr/mash | src/main/scala/com/github/mdr/mash/ns/collections/DeselectFunction.scala | Scala | mit | 1,941 |
package org.linnando.sunmap
import google.maps
import google.maps.canvaslayer._
import org.scalajs.dom
import scala.scalajs.js
class SunMapOverlay(map: maps.Map) {
val rectLatLng = new maps.LatLng(40, -95)
val rectWidth = 6.5
private val options = CanvasLayerOptions(
map = map,
resizeHandler = resize,
... | linnando/sunmap | sunmap/src/main/scala/org/linnando/sunmap/SunMapOverlay.scala | Scala | apache-2.0 | 1,674 |
package org.littlewings.javaee7.service
import javax.enterprise.context.RequestScoped
@RequestScoped
class CalcService {
def add(left: Int, right: Int): Int =
left + right
def multiply(left: Int, right: Int): Int =
left * right
}
| kazuhira-r/javaee7-scala-examples | bean-manager-lookup/src/main/scala/org/littlewings/javaee7/service/CalcService.scala | Scala | mit | 245 |
package uni.big_data.spark.betweenness_centrality
import org.apache.spark.graphx._
import uni.big_data.spark.sssp.SingleSourceShortestPath
/**
* Implements an solution to calculate betweeness centrality values for a given graph.
* [https://en.wikipedia.org/wiki/Betweenness_centrality]
*
* @example Given a sim... | DarthMax/Graph-Centrality-Measures | spark/betweenness-centrality/src/main/scala/uni/big_data/spark/betweenness_centrality/BetweennessCentrality.scala | Scala | mit | 4,640 |
/*
* ____ ____ _____ ____ ___ ____
* | _ \\ | _ \\ | ____| / ___| / _/ / ___| Precog (R)
* | |_) | | |_) | | _| | | | | /| | | _ Advanced Analytics Engine for NoSQL Data
* | __/ | _ < | |___ | |___ |/ _| | | |_| | Copyright (C) 2010 - 2013 SlamData, In... | precog/platform | mimir/src/test/scala/com/precog/mimir/NormalizationSpecs.scala | Scala | agpl-3.0 | 4,265 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | ebruchez/darius-xml.js | xerces/shared/src/main/scala/org/orbeon/apache/xerces/xni/QName.scala | Scala | apache-2.0 | 4,511 |
package service
import model._
import scala.slick.driver.H2Driver.simple._
import Database.threadLocalSession
trait ActivityService {
def getActivitiesByUser(activityUserName: String, isPublic: Boolean): List[Activity] =
Activities
.innerJoin(Repositories).on((t1, t2) => t1.byRepository(t2.userName, t2.r... | ihad28/gitbucket | src/main/scala/service/ActivityService.scala | Scala | apache-2.0 | 7,734 |
/*
* Copyright (C) 2013-2015 by Michael Hombre Brinkmann
*/
package net.twibs.util
object SortOrder extends Enumeration {
type SortOrder = Value
val NotSortable = Value
val Unsorted = Value
val Ascending = Value
val Descending = Value
}
| hombre/twibs | twibs-util/src/main/scala/net/twibs/util/SortOrder.scala | Scala | apache-2.0 | 251 |
/*
* 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 n... | themarkypantz/kafka | core/src/main/scala/kafka/coordinator/group/GroupMetadata.scala | Scala | apache-2.0 | 19,108 |
/* Title: Pure/term_xml.scala
Author: Makarius
XML data representation of lambda terms.
*/
package isabelle
object Term_XML
{
import Term._
object Encode
{
import XML.Encode._
val sort: T[Sort] = list(string)
def typ: T[Typ] =
variant[Typ](List(
{ case Type(a, b) => ... | MerelyAPseudonym/isabelle | src/Pure/term_xml.scala | Scala | bsd-3-clause | 1,620 |
/**
* Copyright 2015 Thomson Reuters
*
* Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or ag... | hochgi/CM-Well | server/cmwell-ws/app/controllers/Help.scala | Scala | apache-2.0 | 1,618 |
package io.github.datamoth.dm.imp
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.File
import java.io.FileWriter
import java.io.FileReader
import java.nio.file.Files
import java.nio.file.Paths
import java.nio.charset.StandardCharsets
import com.typesafe.config.Config
import com.typesafe.confi... | datamoth/datamoth | datamot/src/main/scala/io/github/datamoth/dm/imp/Renderer.scala | Scala | apache-2.0 | 6,763 |
package de.m7w3.signal
import javafx.stage.Stage
import de.m7w3.signal.account.AccountHelper
import de.m7w3.signal.events.GroupsSyncedEvent
import de.m7w3.signal.store.model.{Group, GroupMember, GroupWithMembers}
import de.m7w3.signal.store.{DBActionRunner, SignalDesktopApplicationStore, SignalDesktopProtocolStore}
i... | ayoub-benali/signal-desktop-client | src/test/scala/de/m7w3/signal/ChatsListTest.scala | Scala | apache-2.0 | 3,089 |
package aecor.example.account
import aecor.MonadActionReject
import aecor.data.Folded.syntax._
import aecor.data._
import aecor.example.account.AccountEvent._
import aecor.example.account.EventsourcedAlgebra.AccountState
import aecor.example.account.Rejection._
import aecor.example.common.Amount
import cats.Monad
impo... | notxcain/aecor | modules/example/src/main/scala/aecor/example/account/EventsourcedAlgebra.scala | Scala | mit | 3,196 |
/*
* This file is part of Zoe Assistant - https://github.com/guluc3m/gul-zoe
*
* Copyright (c) 2013 David Muñoz Díaz <[email protected]>
*
* This file is distributed under the MIT LICENSE
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentat... | voiser/gul-zoe-server | src/main/scala/org/voiser/zoe/Launcher.scala | Scala | mit | 3,392 |
package util
object StringUtil {
implicit class StringExtensions(val s: String) {
import scala.util.control.Exception._
import scala.util.control.Exception.Catch._
def toIntOpt:Option[Int] = catching(classOf[NumberFormatException]) opt s.toInt
def toLongOpt:Option[Long] = catching(classOf[Numbe... | vokhotnikov/sevstone-play | app/util/StringUtil.scala | Scala | mit | 358 |
/*
* Copyright 2013-2015 Websudos, Limited.
*
* 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 of c... | levinson/phantom | phantom-dsl/src/test/scala/com/websudos/phantom/tables/Primitives.scala | Scala | bsd-2-clause | 3,334 |
package unfiltered.netty.request
import unfiltered.netty
import unfiltered.netty.{ Http => NHttp, ExceptionHandler }
import unfiltered.netty.cycle.ThreadPool
import unfiltered.request.{ Path => UFPath, POST, & }
import unfiltered.response.{ Pass, ResponseString }
import unfiltered.specs2.netty.Served
import dispatch.... | peel/unfiltered | netty-uploads/src/test/scala/NoChunkAggregatorSpec.scala | Scala | mit | 5,141 |
package ru.yandex.mysqlDiff
package util
trait StringImplicits {
implicit def stringExtras(string: String) = new StringExtras(string)
}
object StringImplicits extends StringImplicits
class StringExtras(string: String) {
import string._
def % (args: Any*) =
String.format(string, args.toArray.... | hkerem/mysql-diff | src/main/scala/ru/yandex/mysqlDiff/util/string.scala | Scala | bsd-3-clause | 969 |
package org.jetbrains.sbt.project.template.techhub
import javax.swing.Icon
import com.intellij.ide.util.projectWizard.AbstractModuleBuilder
import com.intellij.openapi.ui.ValidationInfo
import com.intellij.platform.ProjectTemplate
import org.jetbrains.plugins.scala.icons.Icons
import org.jetbrains.sbt.SbtBundle
class... | JetBrains/intellij-scala | scala/scala-impl/src/org/jetbrains/sbt/project/template/techhub/TechHubProjectTemplate.scala | Scala | apache-2.0 | 790 |
package com.geishatokyo.sqlgen.external.s3
import com.amazonaws.services.s3.AmazonS3Client
import com.amazonaws.auth.BasicAWSCredentials
import java.io.ByteArrayInputStream
import com.amazonaws.services.s3.model.{ObjectMetadata, CannedAccessControlList, PutObjectRequest}
import com.geishatokyo.sqlgen.external.FileUplo... | geishatokyo/sql-generator | src/main/scala/com/geishatokyo/sqlgen/external/s3/AmazonS3Uploader.scala | Scala | mit | 2,643 |
package ch.epfl.yinyang.api
import reflect.runtime.universe.Symbol
/**
* Marker trait for DSLs in which all holes are used for optimizations and
* therefore lifted. This implies that if a DSL program has at least one hole,
* it won't be compiled at compile time. All variables are treated as
* [[RequiredStaticComp... | vjovanov/scala-yinyang | components/yin-yang/src/api/FullyStaged.scala | Scala | bsd-3-clause | 637 |
package com.seanshubin.todo.sample.server
trait HttpServer {
def start()
def join()
def stop()
}
| SeanShubin/javascript-todo-samples | server/src/main/scala/com/seanshubin/todo/sample/server/HttpServer.scala | Scala | unlicense | 106 |
package com.fortysevendeg.scala.android.ui.textstyles
import android.os.Bundle
import android.support.v7.app.AppCompatActivity
import android.view.MenuItem
import macroid.Contexts
class TextStylesActivity
extends AppCompatActivity
with Contexts[AppCompatActivity]
with Layout {
override def onCreate(savedInst... | wvandrunen/scala-android | src/main/scala/com/fortysevendeg/scala/android/ui/textstyles/TextStylesActivity.scala | Scala | apache-2.0 | 726 |
/**
* 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... | rfranco/play-silhouette | silhouette/app/com/mohiva/play/silhouette/impl/providers/OpenIDProvider.scala | Scala | apache-2.0 | 6,245 |
package molt.tokenize
// We find all of the terminal symbols and make sure we split on
// them, then assume everything in between is contiguous.
// We are restricting atoms from containing any of our terminal
// symbols.
class BasicTokenizer(tokens: Set[String]) extends Tokenizer {
private def getOverlaps(toks: List... | julianmichael/molt | molt/shared/src/main/scala/molt/tokenize/BasicTokenizer.scala | Scala | mit | 2,160 |
package keystoneml.nodes.images
import breeze.linalg._
import keystoneml.workflow.Transformer
import keystoneml.utils.ChannelMajorArrayVectorizedImage
import keystoneml.utils.Image
import keystoneml.utils.ImageUtils
/**
* Computes the local color statistic of (LCS) on a regular spaced grid [1]:
* "...each patch is... | amplab/keystone | src/main/scala/keystoneml/nodes/images/LCSExtractor.scala | Scala | apache-2.0 | 4,379 |
package im.mange.driveby.driver
trait NakedElement {
def attribute(name: String): String
def clear()
def click()
def enter(value: String)
def isDisplayed: Boolean
def isEnabled: Boolean
def hasFocus: Boolean
def childrenCount: Int
//TODO: sort out this shonky mess
def option(value: String): Option[... | alltonp/driveby | src/main/scala/im/mange/driveby/driver/NakedElement.scala | Scala | apache-2.0 | 399 |
package redbot.utils
import java.util.concurrent.Executors
import scala.concurrent.{Future, Promise}
import scala.concurrent.duration._
import scala.concurrent.ExecutionContext.Implicits.global
import scala.util.Try
object TimerUtils {
private val scheduler = Executors.newSingleThreadScheduledExecutor()
private... | JamesGallicchio/RedBot | src/main/scala/redbot/utils/TimerUtils.scala | Scala | mit | 1,284 |
trait A
class B(val x: Int) {
self: A =>
def this() = this()
}
object Test extends B(2) with A {
def main(args: Array[String]) { }
}
| felixmulder/scala | test/pending/run/t4460.scala | Scala | bsd-3-clause | 145 |
/*******************************************************************************
* Copyright 2017 Capital One Services, LLC and Bitwise, Inc.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at... | capitalone/Hydrograph | hydrograph.engine/hydrograph.engine.spark/src/main/scala/hydrograph/engine/spark/flow/HydrographRuntime.scala | Scala | apache-2.0 | 12,595 |
import sbt._
import Keys._
import Tests._
import Defaults._
import java.io.{ CharArrayWriter, PrintWriter }
object Ticket543Test extends Build {
val marker = new File("marker")
val check = TaskKey[Unit]("check", "Check correct error has been returned.")
lazy val root = Project("root", file("."), settings = default... | jaceklaskowski/sbt | sbt/src/sbt-test/tests/t543/project/Ticket543Test.scala | Scala | bsd-3-clause | 1,161 |
/*
* 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 ... | chenc10/Spark-PAF | sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/optimizer/FilterPushdownSuite.scala | Scala | apache-2.0 | 22,404 |
/**
* Copyright (C) 2014 Orbeon, Inc.
*
* This program 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
* 2.1 of the License, or (at your option) any later version.
*
* This program i... | wesley1001/orbeon-forms | src/main/scala/org/orbeon/oxf/xforms/schema/MSVGrammarReaderController.scala | Scala | lgpl-2.1 | 3,672 |
package tastytest
class >>>[A] // some symbolic operator representing a "pull"
| scala/scala | test/tasty/neg-isolated/src-3-B/publicSymbolicClass.scala | Scala | apache-2.0 | 80 |
/*
* Copyright 2014–2018 SlamData Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agr... | jedesah/Quasar | connector/src/main/scala/quasar/qscript/package.scala | Scala | apache-2.0 | 10,121 |
package pureconfig.module.magnolia.auto
import scala.language.experimental.macros
import scala.reflect.ClassTag
import magnolia._
import pureconfig.generic.{CoproductHint, ProductHint}
import pureconfig.module.magnolia.{ExportedMagnolia, MagnoliaConfigWriter}
import pureconfig.{ConfigWriter, Exported}
/** An object... | pureconfig/pureconfig | modules/magnolia/src/main/scala/pureconfig/module/magnolia/auto/writer.scala | Scala | mpl-2.0 | 940 |
/*******************************************************************************
Copyright (c) 2012-2014, KAIST, S-Core.
All rights reserved.
Use is subject to license terms.
This distribution may include materials developed by third parties.
**********************************************************... | darkrsw/safe | src/main/scala/kr/ac/kaist/jsaf/analysis/typing/models/DOMHtml/HTMLDocument.scala | Scala | bsd-3-clause | 11,354 |
/*
* jFin - bond math
*
* Copyright (C) 2005-2008, 2012 Morgan Brown Consultancy Ltd.
*
* 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 y... | mbcltd/jfin | src/test/scala/mbc/jfin/ScheduleSpec.scala | Scala | agpl-3.0 | 6,213 |
package com.criteo.slab.lib
import com.criteo.slab.lib.graphite.{DataPoint, GraphiteMetric}
import com.criteo.slab.utils.Jsonable
import org.json4s.DefaultFormats
import org.scalatest.{FlatSpec, Matchers}
import scala.util.Success
class GraphiteMetricSpec extends FlatSpec with Matchers {
"JSON serializer" should "... | criteo/slab | src/test/scala/com/criteo/slab/lib/GraphiteMetricSpec.scala | Scala | apache-2.0 | 746 |
/*
* 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... | travisbrown/scalatest | src/main/scala/org/scalactic/Requirements.scala | Scala | apache-2.0 | 18,611 |
package mesosphere.marathon
package core.group
import javax.inject.Provider
import akka.Done
import akka.event.EventStream
import mesosphere.AkkaUnitTest
import mesosphere.marathon.core.async.ExecutionContexts
import mesosphere.marathon.core.event.GroupChangeSuccess
import mesosphere.marathon.core.group.impl.GroupMan... | janisz/marathon | src/test/scala/mesosphere/marathon/core/group/GroupManagerTest.scala | Scala | apache-2.0 | 6,217 |
package ddd.support.domain
import ddd.support.domain.IdResolution.EntityIdResolver
import ddd.support.domain.command.Command
class AggregateIdResolution[A] extends EntityIdResolution[A] {
override def entityIdResolver: EntityIdResolver = {
super.entityIdResolver.orElse {
case c: Command => c.aggregateId
... | pawelkaczor/ddd-leaven-akka | src/main/scala/ddd/support/domain/AggregateIdResolution.scala | Scala | mit | 333 |
package spatial.codegen.pirgen
import argon.core._
import argon.nodes._
import spatial.aliases._
import spatial.metadata._
import spatial.nodes._
import spatial.utils._
import virtualized.SourceContext
import scala.collection.mutable
class PIRMemoryAnalyzer(implicit val codegen:PIRCodegen) extends PIRTraversal {
o... | stanford-ppl/spatial-lang | spatial/core/src/spatial/codegen/pirgen/PIRMemoryAnalyzer.scala | Scala | mit | 6,160 |
/**
* Copyright (c) 2007-2011 Eric Torreborre <[email protected]>
*
* 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 ... | yyuu/specs | src/test/scala/org/specs/specification/baseSpecificationSpec.scala | Scala | mit | 3,360 |
/* Copyright 2009-2016 EPFL, Lausanne */
import leon.invariant._
object ConcatVariationsAbs {
def genL(n: BigInt): BigInt = {
require(n >= 0)
if (n == 0)
BigInt(2)
else
4 + genL(n - 1)
} ensuring (res => tmpl((a, b) => res <= a * n + b))
def append(l1: BigInt, l2: BigInt): BigInt = {
... | regb/leon | src/test/resources/regression/orb/numerical/ConcatVariationsAbs.scala | Scala | gpl-3.0 | 1,154 |
// Equites, a Scala chess playground
// Copyright © 2013 Frank S. Thomas <[email protected]>
//
// 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 ... | equites-chess/equites-core | src/main/scala/eu/timepit/equites/util/PieceAbbr.scala | Scala | gpl-3.0 | 3,116 |
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.