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 |
|---|---|---|---|---|---|
/**
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed ... | bluebreezecf/kafka | core/src/test/scala/integration/kafka/api/QuotasTest.scala | Scala | apache-2.0 | 10,078 |
/*
* Copyright 2013 - 2020 Outworkers Ltd.
*
* 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... | outworkers/phantom | phantom-dsl/src/test/scala/com/outworkers/phantom/jdk8/Jdk8TimeUUIDTests.scala | Scala | apache-2.0 | 12,127 |
/**
* Copyright (c) 2014, MoonGene. All rights reserved.
*
* This source code is licensed under the GPL license found in the
* LICENSE_GPL file in the root directory of this source tree. An alternative
* commercial license is also available upon request.
*/
package controllers
import play.api.mvc.{Action, Contr... | MoonGene/Analytics | src/moon/app/controllers/Email.scala | Scala | gpl-3.0 | 1,417 |
package com.intenthq.pucket.writer
import com.intenthq.pucket.Pucket
import scalaz.\\/
import scalaz.syntax.either._
/** Incremental functional writer class for parquet
*
* ==Overview==
* Allows large files to be written to parquet in smaller incements.
* Closes the underlying writer and creates a new file a... | intenthq/pucket | core/src/main/scala/com/intenthq/pucket/writer/IncrementalWriter.scala | Scala | mit | 2,748 |
package org.cddcore.rendering.view
import org.cddcore.enginecomponents.Scenario
import org.cddcore.rendering.{ReferenceMapMakers, RenderContext}
class ScenarioView(linkView: LinkView, exceptionView: ExceptionView) extends View[Scenario[_, _]] with ReferenceMapMakers {
import View._
override def apply... | phil-rice/CddCore2 | module/rendering/src/main/scala/org/cddcore/rendering/view/ScenarioView.scala | Scala | bsd-2-clause | 1,026 |
/*
* This file is part of the diffson project.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed t... | gnieh/diffson | core/src/main/scala/diffson/jsonmergepatch/package.scala | Scala | apache-2.0 | 1,110 |
/*
* 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 ... | daewon/incubator-s2graph | s2core/src/main/scala/org/apache/s2graph/core/storage/hbase/AsynchbasePatcher.scala | Scala | apache-2.0 | 5,659 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | ueshin/apache-spark | sql/core/src/main/scala/org/apache/spark/sql/execution/python/UserDefinedPythonFunction.scala | Scala | apache-2.0 | 1,613 |
/**
* (c) 2012 Mark Lister
*
* This software is licenced under the Apache Licence 2.0
*
* Quick and dirty FreeDns.afraid.org client -- written because inadyn-mt wasted several hours of my life
* This aims to support ip6 / teredo / miredo
*/
package org.catch22.freedns
import java.net.NetworkInterface
import j... | marklister/teredo-ddns-client | src/main/scala/FreeDns.scala | Scala | apache-2.0 | 1,392 |
package filodb.coordinator
import org.velvia.filo.RowReader
import filodb.core._
import filodb.core.metadata.{Dataset, DataColumn, Projection}
// Public, external Actor/Akka API for NodeCoordinatorActor, so every incoming command should be a NodeCommand
sealed trait NodeCommand
sealed trait NodeResponse
object Data... | markhamstra/FiloDB | coordinator/src/main/scala/filodb.coordinator/NodeCommands.scala | Scala | apache-2.0 | 3,849 |
package miniconf.server
import akka.event.LoggingAdapter
import akka.http.scaladsl.model._
import StatusCodes._
import akka.http.scaladsl.server.Route
import akka.http.scaladsl.unmarshalling._
import akka.actor._
import miniconf.server.persistence.MiniConfPersistActor.{DeleteCmd, Cmd}
import miniconf.server.persisten... | netcomm/miniconf | src/main/scala/miniconf/server/MainHttpService.scala | Scala | apache-2.0 | 6,582 |
package com.typeassimilation.scala
import org.eclipse.gef4.zest.fx.ui.parts.ZestFxUiView
import com.google.inject.Guice
import com.google.inject.util.Modules
import org.eclipse.gef4.zest.fx.ZestFxModule
import org.eclipse.gef4.zest.fx.ui.ZestFxUiModule
import com.typeassimilation.model.Model
import scala.collection.mu... | kalgoodman/type-assimilation | com.typeassimilation.zest.examples.graph.ui/src/com/typeassimilation/scala/ScalalalaActualView.scala | Scala | epl-1.0 | 2,391 |
package com.typesafe.sbt
package packager
package debian
import sbt._
import sbt.Keys.{name, packageBin, sourceDirectory, streams, target, version, TaskStreams}
import packager.Keys._
import packager.Hashing
import linux.LinuxPlugin.autoImport.{
daemonShell,
linuxPackageMappings,
linuxPackageSymlinks,
linuxScr... | kodemaniak/sbt-native-packager | src/main/scala/com/typesafe/sbt/packager/debian/DebianPlugin.scala | Scala | bsd-2-clause | 18,116 |
/*
* ImportanceTest.scala
* Importance sampling tests.
*
* Created By: Avi Pfeffer ([email protected])
* Creation Date: Jan 1, 2009
*
* Copyright 2013 Avrom J. Pfeffer and Charles River Analytics, Inc.
* See http://www.cra.com or email [email protected] for information.
*
* See http://www.github.com/p... | scottcb/figaro | Figaro/src/test/scala/com/cra/figaro/test/algorithm/sampling/ImportanceTest.scala | Scala | bsd-3-clause | 27,314 |
package mesosphere.marathon.api.validation
import mesosphere.marathon.MarathonSpec
import mesosphere.marathon.core.plugin.PluginManager
import mesosphere.marathon.core.readiness.ReadinessCheck
import mesosphere.marathon.state._
import org.scalatest.{ GivenWhenThen, Matchers }
import scala.collection.immutable.Seq
cl... | yp-engineering/marathon | src/test/scala/mesosphere/marathon/api/validation/AppDefinitionReadinessCheckValidationTest.scala | Scala | apache-2.0 | 3,026 |
/* - Coeus web framework -------------------------
*
* Licensed under the Apache License, Version 2.0.
*
* Author: Spiros Tzavellas
*/
package com.tzavellas.coeus.spring.config
import org.junit.Test
import org.junit.Assert._
import javax.servlet.ServletContextEvent
import org.springframework.mock.web.{ MockServle... | sptz45/coeus-spring | src/test/scala/com/tzavellas/coeus/spring/config/SpringRegistrarTest.scala | Scala | apache-2.0 | 1,366 |
package com.twitter.finagle.postgres
import org.scalatest.BeforeAndAfter
import org.scalatest.matchers.must.Matchers
import org.scalatest.wordspec.AnyWordSpec
/*
* Base class for finagle postgres tests.
*/
class Spec
extends AnyWordSpec
with Matchers
with BeforeAndAfter {
}
| finagle/finagle-postgres | src/test/scala/com/twitter/finagle/postgres/Spec.scala | Scala | apache-2.0 | 285 |
package com.olvind.crud
package frontend
import japgolly.scalajs.react._
import japgolly.scalajs.react.vdom.prefix_<^._
import scala.scalajs.js
import scalacss.ScalaCssReact._
object EditorLinkedSingleRow
extends EditorBaseSingleRow
with EditorBaseUpdaterLinked {
final case class Props(
base: Editor... | elacin/slick-crud | crud/js/src/main/scala/com/olvind/crud/frontend/EditorLinkedSingleRow.scala | Scala | apache-2.0 | 3,154 |
package brown.tracingplane.bdl.compiler
import scala.collection.JavaConverters._
import scala.collection.mutable.Map
import fastparse.all._
import scala.reflect.runtime.universe._
object Ast {
sealed trait FieldType {
def isValid: Boolean = true
}
sealed abstract class ParameterizedType(parameters: Lis... | tracingplane/tracingplane-java | bdl/compiler/src/main/scala/brown/tracingplane/bdl/compiler/Ast.scala | Scala | bsd-3-clause | 5,795 |
/*
* 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/main/scala/org/apache/flink/table/planner/codegen/agg/batch/HashAggCodeGenerator.scala | Scala | apache-2.0 | 9,046 |
/**
* 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... | eribeiro/kafka | core/src/test/scala/unit/kafka/controller/ControllerFailoverTest.scala | Scala | apache-2.0 | 6,310 |
package chrome.events
import chrome.events.bindings.Event
import scala.scalajs.js
class EventSource0Impl(event: Event[js.Function0[_]]) extends EventSource[Unit] {
class SubscriptionImpl(fn: Unit => Unit) extends Subscription {
val fn2 = js.Any.fromFunction0(() => fn(()))
event.addListener(fn2)
de... | amsayk/scala-js-chrome | bindings/src/main/scala/chrome/events/EventSourceImplicits.scala | Scala | mit | 2,225 |
package test_data.v20
import scala.xml.Elem
case class SectionAboutYourPayDetails(xml: Elem) {
val rootPath = xml \\ "DWPCATransaction" \\ "DWPCAClaim"
val howToGetPaidQuestion = rootPath \\ "Payment" \\ "InitialAccountQuestion" \\ "QuestionLabel"
val howToGetPaidAnswer = rootPath \\ "Payment" \\ "InitialAcc... | Department-for-Work-and-Pensions/RenderingService | test/test_data/v20/SectionAboutYourPayDetails.scala | Scala | mit | 2,300 |
package guige.before
object Client {
def main(args: Array[String]) {
//首先初始化一批用户
val userList = List(
User("苏大", 3), User("牛二", 8), User("张三", 10), User("杨八", 34),
User("李四", 15), User("王五", 18), User("赵六", 23), User("马七", 34)
)
//定义一个用户查询类
val userProvider: TUserProvider = new UserP... | zj-lingxin/DesignPattern | src/main/scala/guige/before/Client.scala | Scala | mit | 587 |
package com.sksamuel.elastic4s.requests.searches.aggs.pipeline
import com.sksamuel.elastic4s.requests.script.Script
import com.sksamuel.elastic4s.requests.searches.aggs.AbstractAggregation
import com.sksamuel.elastic4s.requests.searches.sort.Sort
trait PipelineAggregationApi {
def avgBucketAgg(name: String, bucket... | stringbean/elastic4s | elastic4s-core/src/main/scala/com/sksamuel/elastic4s/requests/searches/aggs/pipeline/PipelineAggDsl.scala | Scala | apache-2.0 | 2,580 |
package ru.wordmetrix.webcrawler
/**
* EvaluatePriorityMatrix is an implementation of strategy that estimates
* possible semantic deposit of future web pages into common asset. It uses two
* abstraction:
*
* - SemanticEstimator estimates web pages (seeds) on the base of their
* content.
*
* - NetworkEstimator ... | electricmind/webcrawler | src/main/scala/ru/wordmetrix/webcrawler/EvaluatePriorityMatrix.scala | Scala | apache-2.0 | 11,702 |
/*
* Copyright (C) 2014 - 2017 Contributors as noted in the AUTHORS.md file
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option)... | Tensei-Data/tensei-agent | src/it/scala/com/wegtam/scalatest/tags/DbTestH2.scala | Scala | agpl-3.0 | 933 |
package scalaSci.CommonMaths
import org.apache.commons.math3.linear._
import scalaSci.RichDouble1DArray
import scalaSci.Vec
// this class performs a higher level interface to the Apache Common Maths,
// Array2DRowRealMatrix class
class Mat(ar: Array2DRowRealMatrix) extends AnyRef with scalaSci.scalaSciMatrix[scala... | scalalab/scalalab | source/src/main/scala/scalaSci/CommonMaths/Mat.scala | Scala | mit | 9,157 |
/*
* 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/main/scala/org/apache/spark/mllib/optimization/tfocs/fs/generic/double/SmoothDual.scala | Scala | apache-2.0 | 2,621 |
/**
* Copyright 2015 Yahoo Inc. Licensed under the Apache License, Version 2.0
* See accompanying LICENSE file.
*/
package kafka.manager.utils
import java.util.Properties
import kafka.manager.ActorModel._
import kafka.manager.{ClusterConfig, Kafka_0_8_2_0}
import kafka.manager.utils.zero81._
import org.apache.zook... | cvcal/kafka-manager | test/kafka/manager/utils/TestReassignPartitions.scala | Scala | apache-2.0 | 4,474 |
package benchmark
/** Builder of a [[KeySeq]]
*
* @tparam K the type of the keys
*/
trait KeySeqBuilder[K] {
/** Return a [[KeySeq]] having at least the given size. */
def build(size: Int): KeySeq[K]
}
object KeySeqBuilder {
/** Builder of a sequence of `Int` keys.
* Simply maps the sequence index to... | felixmulder/scala | test/benchmarks/src/main/scala/benchmark/KeySeqBuilder.scala | Scala | bsd-3-clause | 859 |
object PinCodes {
def toBase( from:BigInt, base:Array[Char]) : String = {
var valor = from;
var converted:String = ""
val baseLen = base.length()
while (valor > 0) {
var resto = valor % baseLen;
valor = valor / baseLen;
converted += base.charAt(resto.toInt);
}
return converted.reverse
}
def ... | thiagooak/gera-pincode | PinCodes.scala | Scala | mit | 2,061 |
package slick.relational
import slick.ast._
import slick.basic.{BasicActionComponent, BasicProfile}
import slick.compiler.{EmulateOuterJoins, Phase, QueryCompiler}
import slick.dbio._
import slick.lifted.FunctionSymbolExtensionMethods._
import slick.lifted._
import scala.language.{higherKinds, implicitConversions}
im... | trevorsibanda/slick | slick/src/main/scala/slick/relational/RelationalProfile.scala | Scala | bsd-2-clause | 12,134 |
/**
* Copyright (c) 2014-2016 Tim Bruijnzeels
* 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... | timbru/rpki-ca | src/main/scala/nl/bruijnzeels/tim/rpki/ca/CertificateAuthorityEvents.scala | Scala | bsd-3-clause | 6,619 |
package com.github.tminglei.slickpg
import org.scalatest.funsuite.AnyFunSuite
import slick.jdbc.GetResult
import scala.concurrent.Await
import scala.concurrent.duration._
class PgHStoreSupportSuite extends AnyFunSuite with PostgresContainer {
import MyPostgresProfile.api._
lazy val db = Database.forURL(url = co... | tminglei/slick-pg | src/test/scala/com/github/tminglei/slickpg/PgHStoreSupportSuite.scala | Scala | bsd-2-clause | 5,359 |
package idv.brianhsu.maidroid.plurk.activity
import idv.brianhsu.maidroid.ui.model._
import idv.brianhsu.maidroid.plurk._
import idv.brianhsu.maidroid.plurk.dialog._
import idv.brianhsu.maidroid.plurk.view._
import idv.brianhsu.maidroid.plurk.util._
import idv.brianhsu.maidroid.plurk.fragment._
import idv.brianhsu.mai... | brianhsu/MaidroidPlurk | src/main/scala/activity/ResponseListActivity.scala | Scala | gpl-3.0 | 14,371 |
package nodes.util
import org.apache.spark.rdd.RDD
import pipelines.{Logging, Transformer}
import scala.reflect.ClassTag
/**
* Caches the intermediate state of a node. Follows Spark's lazy evaluation conventions.
* @param name An optional name to set on the cached output. Useful for debugging.
* @tparam T Type of... | etrain/keystone | src/main/scala/nodes/util/Cacher.scala | Scala | apache-2.0 | 649 |
/**
* © 2019 Refinitiv. All Rights Reserved.
*
* 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... | dudi3001/CM-Well | server/cmwell-grid/src/main/scala/k/grid/registration/LocalRegistrationManager.scala | Scala | apache-2.0 | 2,599 |
/*
* Copyright (c) 2014-2021 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... | monix/monix | monix-reactive/shared/src/test/scala/monix/reactive/consumers/FoldLeftConsumerSuite.scala | Scala | apache-2.0 | 1,987 |
/*
* 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 ... | bharathkk/samza | samza-test/src/test/scala/org/apache/samza/test/integration/StreamTaskTestUtil.scala | Scala | apache-2.0 | 13,656 |
package conf
import org.apache.spark.streaming.{ Seconds, StreamingContext }
import org.apache.spark.{ SparkConf, SparkContext }
object Configuration {
private val ContextMaster = "local"
private val AppName = "My Application"
val sparkConf = new SparkConf().setMaster(ContextMaster).setAppName(AppName)
}
/**
... | deeptibhatia/spark-app | src/main/scala/conf/Configuration.scala | Scala | mit | 504 |
package epic.parser
package models
import scala.collection.mutable.HashMap
import scala.util.Random
import scala.collection.GenTraversable
import breeze.features.FeatureVector
import breeze.linalg._
import breeze.util.Index
import epic.constraints.ChartConstraints
import epic.dense.IdentityTransform
import epic.dense.... | langkilde/epic | src/main/scala/epic/parser/models/PositionalNeuralModel.scala | Scala | apache-2.0 | 23,603 |
/* __ *\\
** ________ ___ / / ___ Scala API **
** / __/ __// _ | / / / _ | (c) 2002-2010, LAMP/EPFL **
** __\\ \\/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\\___/_/... | cran/rkafkajars | java/scala/runtime/AbstractFunction16.scala | Scala | apache-2.0 | 835 |
package com.stefansavev.fuzzysearchtest
import java.io.StringReader
import com.stefansavev.TemporaryFolderFixture
import com.stefansavev.core.serialization.TupleSerializers._
import org.junit.runner.RunWith
import org.scalatest.{FunSuite, Matchers}
import org.scalatest.junit.JUnitRunner
@RunWith(classOf[JUnitRunner]... | stefansavev/random-projections-at-berlinbuzzwords | src/test/scala/com/stefansavev/fuzzysearchtest/GloveUnitTest.scala | Scala | apache-2.0 | 1,789 |
package org.jetbrains.plugins.scala.lang.completion.postfix.templates.selector
import com.intellij.openapi.util.Condition
import com.intellij.psi.search.GlobalSearchScope
import com.intellij.psi.PsiElement
import org.jetbrains.plugins.scala.lang.psi.api.expr.ScExpression
import org.jetbrains.plugins.scala.lang.psi.imp... | JetBrains/intellij-scala-historical | src/org/jetbrains/plugins/scala/lang/completion/postfix/templates/selector/SelectorConditions.scala | Scala | apache-2.0 | 2,401 |
package ca.aretex.labs.data
import java.text.{SimpleDateFormat, DecimalFormatSymbols, DecimalFormat}
import java.time.LocalDateTime
import java.time.format.DateTimeFormatter
import java.time.temporal.{ChronoField, WeekFields}
import java.util.{Calendar, UUID, Locale}
import org.slf4j.{Logger, LoggerFactory}
import or... | nicaiseeric/lazy-json | src/main/scala/ca/aretex/labs/data/TicketDataUtil.scala | Scala | apache-2.0 | 3,264 |
package simutils
import akka.actor._
import dmfmessages.DMFSimMessages._
import scala.collection.mutable.ListBuffer
import scala.collection.JavaConversions._
object RemoteWorkers {
def translateAkkaAddres(akkaAddress: AkkaAddress): Address = Address(akkaAddress.getProtocol, akkaAddress.getSystem, akkaAddress.getHos... | rkewley/devsdmf | src/main/scala/simutils/RemoteWorkers.scala | Scala | apache-2.0 | 1,960 |
//
// Extended.scala -- Scala class and objects for the Orc extended AST
// Project OrcScala
//
// $Id: Extended.scala 3023 2012-04-20 02:55:50Z laurenyew $
//
// Created by dkitchin on May 19, 2010.
//
// Copyright (c) 2011 The University of Texas at Austin. All rights reserved.
//
// Use and redistribution of this fi... | laurenyew/cOrcS | src/orc/ast/ext/Extended.scala | Scala | bsd-3-clause | 7,831 |
package beam.utils.scenario.urbansim
private[urbansim] object DataExchange {
case class UnitInfo(unitId: String, buildingId: String)
case class ParcelAttribute(primaryId: String, x: Double, y: Double)
case class BuildingInfo(buildingId: String, parcelId: String)
case class PersonInfo(
personId: String,
... | colinsheppard/beam | src/main/scala/beam/utils/scenario/urbansim/DataExchange.scala | Scala | gpl-3.0 | 778 |
package com.coiney.akka.mailer.actors
import akka.actor.ActorSystem
import akka.testkit.{ImplicitSender, TestProbe, TestKit}
import org.scalatest.{BeforeAndAfterAll, Matchers, WordSpecLike}
class DispatcherSpec(_actorSystem: ActorSystem) extends TestKit(_actorSystem)
wi... | Coiney/akka-mailer | akka-mailer-core/src/test/scala/com/coiney/akka/mailer/actors/DispatcherSpec.scala | Scala | bsd-3-clause | 1,706 |
package org.jetbrains.plugins.scala
package codeInspection
package collections
import com.intellij.testFramework.EditorTestUtil
/**
* Nikolay.Tropin
* 1/24/14
*/
class SortFilterTest extends OperationsOnCollectionInspectionTest {
override protected val classOfInspection: Class[_ <: OperationOnCollectionInspecti... | JetBrains/intellij-scala | scala/scala-impl/test/org/jetbrains/plugins/scala/codeInspection/collections/SortFilterTest.scala | Scala | apache-2.0 | 2,020 |
package jadecrawler.website
import scala.language.postfixOps
import jadeutils.common.Logging
import org.apache.commons.lang.StringUtils.isNotBlank
import org.json.JSONObject
import org.jsoup.Jsoup
import org.jsoup.nodes.Document
import org.jsoup.nodes.Element
import org.jsoup.select.Elements
import jadecrawler.dto... | Jade-Shan/Jade-crawler | crawler-logic/src/main/scala/website/ElongParser.scala | Scala | gpl-3.0 | 4,291 |
package org.scalaide.core
package quickassist
import org.eclipse.jdt.internal.core.util.SimpleDocument
import org.junit.AfterClass
import org.junit.Assert
import org.junit.BeforeClass
import org.junit.Test
import org.scalaide.core.internal.quickassist.explicit.ExplicitReturnType
object ExplicitTypeAssistTest extends ... | dragos/scala-ide | org.scala-ide.sdt.core.tests/src/org/scalaide/core/quickassist/ExplicitTypeAssistTest.scala | Scala | bsd-3-clause | 5,073 |
// Copyright (C) 2019 MapRoulette contributors (see CONTRIBUTORS.md).
// Licensed under the Apache License, Version 2.0 (see LICENSE).
package org.maproulette.provider.websockets
import akka.actor._
import akka.cluster.pubsub.DistributedPubSub
import akka.cluster.pubsub.DistributedPubSubMediator.{Publish}
/**
* WebS... | mvexel/maproulette2 | app/org/maproulette/provider/websockets/WebSocketPublisher.scala | Scala | apache-2.0 | 1,189 |
/* sbt -- Simple Build Tool
* Copyright 2010 Mark Harrah
*/
package sbt
/** A mutable set interface that uses object identity to test for set membership.*/
trait IDSet[T] {
def apply(t: T): Boolean
def contains(t: T): Boolean
def +=(t: T): Unit
def ++=(t: Iterable[T]): Unit
def -=(t: T): Boolean
def all:... | xeno-by/old-scalameta-sbt | util/collection/src/main/scala/sbt/IDSet.scala | Scala | bsd-3-clause | 1,456 |
package com.avsystem.scex.util
import java.io.ByteArrayOutputStream
object EscapedBytes {
def render(bytes: Array[Byte]): String = {
val sb = new StringBuilder
bytes.foreach {
case '\\' => sb ++= "\\\\"
case b if b > 0x1F && b < 0x7F => sb += b.toChar
case b => sb ++= f"\\x$b%02x"
}
... | AVSystem/scex | scex-util/src/main/scala/com/avsystem/scex/util/EscapedBytes.scala | Scala | mit | 1,560 |
package io.udash.web.guide.markdown
import java.io.{BufferedReader, File, FileReader}
import java.time.Instant
import java.util.concurrent.ConcurrentHashMap
import com.avsystem.commons._
import com.vladsch.flexmark.html.HtmlRenderer
import com.vladsch.flexmark.parser.Parser
import scala.concurrent.{ExecutionContext,... | UdashFramework/udash-guide | backend/src/main/scala/io/udash/web/guide/markdown/MarkdownPagesEndpoint.scala | Scala | gpl-3.0 | 1,325 |
package org.allenai.common
import spray.json.{ deserializationError, JsString, JsValue, RootJsonFormat }
/** Enumeration implementation that supports automatic Spray JSON serialization of a case object as
* a JsString.
*
* Usage:
* (format: OFF)
* {{{
* sealed abstract class MyEnum extends Enum[MyEnum]
... | jkinkead/common | core/src/main/scala/org/allenai/common/Enum.scala | Scala | apache-2.0 | 2,000 |
/**
* Magmanics Licensing. This web application allows for centralized control
* of client application activation, with optional configuration parameters
* to control licensable features, and storage of supplementary information
* about the client machine. Client applications may interface with this
* central serv... | manicmonkey/licensing | Licensing-UI-Vaadin/src/main/scala/com/magmanics/vaadin/component/HtmlLabel.scala | Scala | gpl-3.0 | 1,342 |
package controllers
import global.Globals
import models.Profile
import services.ApiServices
import javax.inject._
import play.api._
import play.api.mvc._
import play.api.libs.json._
import io.swagger.core._
import io.swagger.annotations._
import play.api.libs.concurrent.Execution.Implicits._
@Api(value = "/profile... | gilbertw1/personal-api | app/controllers/ProfileController.scala | Scala | gpl-2.0 | 848 |
package org.openurp.edu.eams.number
import java.util.Arrays
import org.beangle.commons.text.i18n.TextResource
object NumberRangeDigestor {
def digest(numberSequence: Array[Int], textResource: TextResource): String = {
digest(numberSequence, textResource, DefaultNumberRangeFormatter.getInstance)
}
def dige... | openurp/edu-eams-webapp | core/src/main/scala/org/openurp/edu/eams/number/NumberRangeDigestor.scala | Scala | gpl-3.0 | 1,979 |
package com.typesafe.slick.testkit.util
import slick.profile.{SqlProfile, RelationalProfile, BasicProfile}
import slick.driver.JdbcProfile
import java.io.{PrintWriter, OutputStreamWriter, BufferedWriter, FileOutputStream, FileWriter}
/** Build a table of supported capability flags for the user manual. */
object Build... | jkutner/slick | slick-testkit/src/main/scala/com/typesafe/slick/testkit/util/BuildCapabilitiesTable.scala | Scala | bsd-2-clause | 2,018 |
import org.scalatest._
import scala.meta.internal.ast._
import scala.meta.dialects.Scala211
class JoinSuite extends FunSuite {
test("idents") {
val Term.Name("xtemp") = {
import scala.meta._
q"xtemp"
}
val Term.Name("ytemp") = {
import scala.meta._
q"ytemp"
}
}
test("vals... | mdemarne/scalameta | tests/src/test/scala/quasiquotes/JoinSuite.scala | Scala | bsd-3-clause | 1,996 |
/**
* Copyright 2011-2016 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... | GabrielPlassard/gatling | gatling-commons/src/main/scala/io/gatling/commons/stats/assertion/AssertionModel.scala | Scala | apache-2.0 | 3,963 |
package com.mentatlabs.nsa
package scalac
package options
/* -help
* =====
* 2.0.0 - 2.12.0: Print a synopsis of standard options
*/
case object ScalacHelp
extends ScalacOptionBoolean("-help", ScalacVersions.`2.0.0`)
| melezov/sbt-nsa | nsa-core/src/main/scala/com/mentatlabs/nsa/scalac/options/ScalacHelp.scala | Scala | bsd-3-clause | 228 |
package bad.robot.temperature
object AutoClosing {
def closingAfterUse[A <: AutoCloseable, B](resource: A)(f: A => B): B = try {
f(resource)
} finally {
resource.close()
}
}
| tobyweston/temperature-machine | src/main/scala/bad/robot/temperature/AutoClosing.scala | Scala | apache-2.0 | 189 |
package org.jetbrains.plugins.scala
package lang
package psi
package stubs
import com.intellij.psi.stubs.StubElement
import org.jetbrains.plugins.scala.lang.psi.api.base.ScStableCodeReferenceElement
import org.jetbrains.plugins.scala.lang.psi.api.toplevel.imports.ScImportExpr
/**
* User: Alexander Podkhalyuzin
* D... | triggerNZ/intellij-scala | src/org/jetbrains/plugins/scala/lang/psi/stubs/ScImportExprStub.scala | Scala | apache-2.0 | 488 |
/*
* 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/scalatest-test/src/test/scala/org/scalatest/matchers/dsl/ResultOfBeWordForNoExceptionSpec.scala | Scala | apache-2.0 | 1,039 |
package org.nikosoft.oanda.api.`def`
import org.nikosoft.oanda.api.ApiModel.AccountModel.AccountID
import org.nikosoft.oanda.api.ApiModel.PositionModel.Position
import org.nikosoft.oanda.api.ApiModel.PrimitivesModel.InstrumentName
import org.nikosoft.oanda.api.ApiModel.TransactionModel._
import org.nikosoft.oanda.api.... | cnnickolay/forex-trader | oanda-scala-api/src/main/scala/org/nikosoft/oanda/api/def/PositionApi.scala | Scala | mit | 4,901 |
package sbtmarathon
import java.net.{URL, URLEncoder, InetSocketAddress}
import scala.concurrent.{Await, Future, Promise}
import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.duration.Duration
import com.twitter.finagle.{Http, Name, Address}
import com.twitter.finagle.http.{RequestBuilder,... | Tapad/sbt-marathon | marathon/src/main/scala/sbtmarathon/MarathonService.scala | Scala | bsd-3-clause | 4,510 |
package chandu0101.scalajs.react.components.materialui
import chandu0101.macros.tojs.JSMacro
import japgolly.scalajs.react._
import materialui.Mui
import scala.scalajs.js
case class MuiListDivider(key: js.UndefOr[String] = js.undefined,
style: js.UndefOr[js.Any] = js.undefined,
... | mproch/scalajs-react-components | core/src/main/scala/chandu0101/scalajs/react/components/materialui/MuiLists.scala | Scala | apache-2.0 | 2,581 |
// package scala.util.control
object TailCalls {
abstract class TailRec[+A] {
final def flatMap[B](f: A => TailRec[B]): TailRec[B] =
this match {
case Done(a) => Call(() => f(a))
case c@Call(_) => Cont(c, f)
case c: Cont[a1, b1] => Cont(c.a, (x: a1) => c.f(x) flatMap f)
}
... | lampepfl/dotty | tests/pos/gadt-TailCalls.scala | Scala | apache-2.0 | 1,209 |
package bad.robot
import simplehttp.configuration.{Username => SimpleHttpUsername}
import simplehttp.configuration.{Password => SimpleHttpPassword}
import bad.robot.radiate.config.{Password, Username}
package object http {
implicit def toUsername(username: Username): SimpleHttpUsername = {
SimpleHttpUsername.u... | tobyweston/radiate | src/main/scala/bad/robot/package.scala | Scala | apache-2.0 | 473 |
/*
* Copyright 2014 Michael Krolikowski
*
* 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... | mkroli/dns4s | core/src/test/scala/com/github/mkroli/dns4s/section/resource/AResourceSpec.scala | Scala | apache-2.0 | 2,086 |
case class Matrix(in: Seq[Seq[Int]]) {
val minRows: Seq[Int] = in.map(_.max).toArray
val minCols: Seq[Int] = in.transpose.map(_.min).toArray
val len: Int = in.length
// (9, 8, 7)
// (5, 3, 2)
// (6, 6, 7)
// == (1, 0) max in row, min in col
def saddlePoints: Set[(Int, Int)] = {
var ret = for {
... | daewon/til | exercism/scala/saddle-points/src/main/scala/saddlePoint.scala | Scala | mpl-2.0 | 483 |
import sbt.Keys._
import play.sbt.routes.RoutesKeys._
import sbt.Tests.{SubProcess, Group}
import sbt._
import play.routes.compiler.StaticRoutesGenerator
import uk.gov.hmrc.sbtdistributables.SbtDistributablesPlugin._
trait MicroService {
import uk.gov.hmrc._
import DefaultBuildSettings._
import uk.gov.hmrc.{Sb... | VlachJosef/bforms | project/MicroService.scala | Scala | apache-2.0 | 2,665 |
package models
import org.joda.time.DateTime
import play.api.libs.json._
import play.api.libs.functional.syntax._
case class ZWayEvent(
foreignDeviceId:String,
status:Option[String] = None,
eventType: Option[String] = None,
updateTime:Option[DateTime] = None,
value: Option[String] = None,
deviceType: Opti... | LabCo/rpi-zway-play | app/models/ZWayEvent.scala | Scala | mit | 2,519 |
/*
* Copyright (C) 2014 - 2017 Contributors as noted in the AUTHORS.md file
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option)... | Tensei-Data/tensei-agent | src/it/scala/databases/sqlite/ForeignKeysTest.scala | Scala | agpl-3.0 | 22,872 |
/*
* Copyright 2021 HM Revenue & Customs
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or a... | hmrc/ct-calculations | src/main/scala/uk/gov/hmrc/ct/computations/CP113.scala | Scala | apache-2.0 | 829 |
import scala.quoted.*
import scala.quoted.staging.*
object Test {
sealed trait Var {
def get(using Quotes): Expr[String]
def update(x: Expr[String])(using Quotes): Expr[Unit]
}
object Var {
def apply(init: Expr[String])(body: Var => Expr[String])(using Quotes): Expr[String] = '{
var x = $init... | dotty-staging/dotty | tests/run-staging/quote-var.scala | Scala | apache-2.0 | 837 |
package models.upload
import java.sql.Timestamp
import com.overviewdocs.test.DbSpecification
class OverviewUploadedFileSpec extends DbSpecification {
"OverviewUploadedFile" should {
trait UploadedFileContext extends DbScope {
val before = new Timestamp(System.currentTimeMillis)
val overviewUploade... | overview/overview-server | web/test/models/upload/OverviewUploadedFileSpec.scala | Scala | agpl-3.0 | 2,630 |
/**
* 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 us... | mbrukman/kafka | core/src/test/scala/integration/kafka/api/ConsumerBounceTest.scala | Scala | apache-2.0 | 5,724 |
package com.eclipsesource.schema
import com.eclipsesource.schema.drafts.Version4
import com.eclipsesource.schema.test.{Assets, JsonSpec}
import org.specs2.mutable.Specification
import org.specs2.specification.AfterAll
import org.specs2.specification.core.Fragments
import org.specs2.specification.dsl.Online
import play... | edgarmueller/play-json-schema-validator | src/test/scala/com/eclipsesource/schema/RemoteSpecs.scala | Scala | apache-2.0 | 1,746 |
package org.jetbrains.plugins.scala.codeInspection
import com.intellij.codeInspection._
import com.intellij.psi.PsiElement
import org.jetbrains.plugins.scala.extensions.VisitorWrapper
/**
* Pavel Fatin
*/
abstract class AbstractInspection(id: String, name: String) extends LocalInspectionTool {
def this() {
th... | triggerNZ/intellij-scala | src/org/jetbrains/plugins/scala/codeInspection/AbstractInspection.scala | Scala | apache-2.0 | 1,065 |
/*
* 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 ... | ajantis/zipkin | zipkin-common/src/main/scala/com/twitter/zipkin/query/QueryResponse.scala | Scala | apache-2.0 | 763 |
package com.github.probe.backend
package data
import org.scala_tools.time.Imports._
object LogEntry {
object Severity extends Enumeration {
val Assert = Value("Assert")
val Error = Value("Error")
val Warn = Value("Warn")
val Info = Value("Info")
val Debug = Value("Debug")
val Verbose = Value... | khernyo/freezing-ninja | backend/src/main/scala/com/github/probe/backend/data/LogEntry.scala | Scala | apache-2.0 | 774 |
package org.embulk.input.dynamodb.deprecated
import com.fasterxml.jackson.annotation.JsonProperty
import com.google.common.base.Objects
class FilterConfig {
private var _name: String = _
private var _type: String = _
private var _condition: String = _
private var _value: String = _
private var _value2: Stri... | lulichn/embulk-input-dynamodb | src/main/scala/org/embulk/input/dynamodb/deprecated/FilterConfig.scala | Scala | mit | 1,426 |
/*
* (c) Copyright 2016 Hewlett Packard Enterprise Development LP
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required b... | hpe-cct/cct-core | src/main/scala/cogdebugger/ui/fieldvisualizations/vector/VectorComponentsSubpanel.scala | Scala | apache-2.0 | 12,140 |
package io.buoyant.k8s
import com.fasterxml.jackson.annotation.{JsonProperty, JsonSubTypes, JsonTypeInfo}
import com.fasterxml.jackson.core.`type`.TypeReference
import com.twitter.finagle.{http, Service => FService}
import io.buoyant.k8s.{KubeObject => BaseObject}
package object v1beta1 {
type Client = FService[ht... | hhtpcd/linkerd | k8s/src/main/scala/io/buoyant/k8s/v1beta1.scala | Scala | apache-2.0 | 3,446 |
/*
/*
* Copyright © 2015-2019 the contributors (see Contributors.md).
*
* This file is part of Knora.
*
* Knora 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... | musicEnfanthen/Knora | webapi/src/test/scala/org/knora/webapi/update/plugins/UpdatePluginPR1322Spec.scala | Scala | agpl-3.0 | 2,647 |
/*
* Copyright 2021 HM Revenue & Customs
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or a... | hmrc/ct-calculations | src/test/scala/uk/gov/hmrc/ct/computations/calculations/TotalDeductionsCalculatorSpec.scala | Scala | apache-2.0 | 1,279 |
package io.sipstack.transaction
import akka.actor.Actor
import akka.actor.ActorRef
import akka.actor.Props
import io.sipstack.config.TransactionLayerConfiguration
import io.sipstack.transport.FlowActor.IncomingRequest
import io.sipstack.transport.FlowActor.IncomingResponse
import akka.actor.Terminated
final object Tr... | jonbo372/sipstack | sipstack-transaction/src/main/scala/io/sipstack/transaction/TransactionSupervisor.scala | Scala | mit | 1,227 |
/*
* 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-streaming-scala/src/test/scala/org/apache/flink/streaming/api/scala/WindowReduceITCase.scala | Scala | apache-2.0 | 12,866 |
/*
* Copyright (c) 2002-2018 "Neo Technology,"
* Network Engine for Objects in Lund AB [http://neotechnology.com]
*
* This file is part of Neo4j.
*
* Neo4j 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 Foundatio... | HuangLS/neo4j | community/cypher/cypher-compiler-2.3/src/test/scala/org/neo4j/cypher/internal/compiler/v2_3/ast/conditions/AggregationsAreIsolatedTest.scala | Scala | apache-2.0 | 1,948 |
package mesosphere.marathon
package metrics.current
sealed trait UnitOfMeasurement
object UnitOfMeasurement {
case object None extends UnitOfMeasurement
// Memory is measure in bytes. ".bytes" is appended to metric names.
case object Memory extends UnitOfMeasurement
// Time is measured in seconds. ".seconds... | mesosphere/marathon | src/main/scala/mesosphere/marathon/metrics/current/UnitOfMeasurement.scala | Scala | apache-2.0 | 397 |
package colossus.metrics
import colossus.metrics.collectors.{Counter, DefaultCounter}
import scala.concurrent.duration._
class CounterSpec extends MetricIntegrationSpec {
def counter = new DefaultCounter("/foo")
"Counter" must {
"increment" in {
val c = counter
c.get() must equal(0)
c.inc... | tumblr/colossus | colossus-metrics/src/test/scala/colossus/metrics/CounterSpec.scala | Scala | apache-2.0 | 1,238 |
package mist.api.data
import scala.util._
trait Json4sConversion {
/** For running mist jobs directly from spark-submit **/
def parse(s: String): Try[JsData] = {
import org.json4s._
def translateAst(in: JValue): JsData = in match {
case JNothing => JsNull //???
case JNull => JsNull
cas... | Hydrospheredata/mist | mist-lib/src/main/spark-2.4.0/mist/api/data/Json4sConversion.scala | Scala | apache-2.0 | 1,847 |
package chandu0101.scalajs.react.components.listviews
import chandu0101.scalajs.react.components.searchboxes.ReactSearchBox
import japgolly.scalajs.react._
import japgolly.scalajs.react.vdom.prefix_<^._
import scala.scalajs.js
import scalacss.Defaults._
import scalacss.ScalaCssReact._
object ReactListView {
clas... | coreyauger/scalajs-react-components | core/src/main/scala/chandu0101/scalajs/react/components/listviews/ReactListView.scala | Scala | apache-2.0 | 2,372 |
package vaadin.scala
import vaadin.scala.mixins.ScaladinMixin
import vaadin.scala.mixins.ContainerMixin
import vaadin.scala.mixins.ContainerIndexedMixin
import vaadin.scala.mixins.ContainerHierarchicalMixin
import vaadin.scala.mixins.ContainerOrderedMixin
import vaadin.scala.mixins.ContainerViewerMixin
import vaadin.s... | CloudInABox/scalavaadinutils | src/main/scala/vaadin/scala/Container.scala | Scala | mit | 6,020 |
package kidstravel.client.components
import diode.Action
import diode.data.Pot
import diode.react.ModelProxy
import diode.react.ReactPot._
import japgolly.scalajs.react._
import japgolly.scalajs.react.vdom.prefix_<^._
trait SearchBox {
type T
def getAction: String => Action
def updateAction: Seq[T] => Action
... | devkat/kidstravel | client/src/main/scala/kidstravel/client/components/SearchBox.scala | Scala | apache-2.0 | 1,315 |
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.