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 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 ... | dotunolafunmiloye/spark | tools/src/main/scala/org/apache/spark/tools/JavaAPICompletenessChecker.scala | Scala | apache-2.0 | 15,521 |
package com.blackboxsociety.app.services.interfaces
import com.blackboxsociety.http._
trait SessionComponent {
val sessionSecret: SessionSecret
val flashSecret: FlashSecret
}
| blackboxsociety/blackbox-example | src/main/scala/com/blackboxsociety/app/services/interfaces/SessionComponent.scala | Scala | mit | 184 |
/**
* 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... | thomsonreuters/CM-Well | server/cmwell-dc/src/main/scala/cmwell/dc/stream/RatePrinter.scala | Scala | apache-2.0 | 3,364 |
/*
* 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 | app/models/businessmatching/TypeOfBusiness.scala | Scala | apache-2.0 | 1,739 |
package org.openstack.api.restful.elements
import java.net.URL
/**
* @author Antonio Murgia
* @version 10/10/14
*/
case class Link(href : URL, rel : String, contentType : Option[String] = None) {
require(href != null)
require(contentType != null)
} | tmnd1991/ceilometerAPI4s | src/main/scala/org/openstack/api/restful/elements/Link.scala | Scala | apache-2.0 | 257 |
import sbt._
object Dependencies {
object V {
val awsJavaSDK = "1.9.31"
val jodaTime = "2.7"
val jodaConvert = "1.7"
val slf4j = "1.7.12"
val logback = "1.1.3"
}
object Compile {
val awsJavaSDK_cloudwatch = "com.amazonaws" % "aws-java-sdk-cloudwatch" % V.awsJavaSDK
val a... | liruqi/aws-wrap | project/Dependencies.scala | Scala | apache-2.0 | 1,260 |
trait Foo[X]
trait TInt extends Foo[Int]
trait TDouble extends Foo[Double]
trait TLong extends Foo[Long]
val myType = 1 match {
case 1 => null.asInstanceOf[TInt]
case 2 => null.asInstanceOf[TLong]
case 3 => null.asInstanceOf[TDouble]
}
/*start*/myType/*end*/
//Foo[_ >: Int with Long with Double <: AnyVal] | ilinum/intellij-scala | testdata/typeInference/localTypeInference/AnyValUpperLowerBound.scala | Scala | apache-2.0 | 313 |
package org.jetbrains.plugins.scala
package lang.psi.api
import com.intellij.openapi.progress.ProgressManager
import com.intellij.psi._
import com.intellij.psi.impl.migration.PsiMigrationManager
import com.intellij.psi.scope.{NameHint, PsiScopeProcessor}
import com.intellij.psi.search.GlobalSearchScope
import com.inte... | loskutov/intellij-scala | src/org/jetbrains/plugins/scala/lang/psi/api/FileDeclarationsHolder.scala | Scala | apache-2.0 | 10,277 |
package com.twitter.finatra.http.tests.integration.multiserver.add1server
import com.twitter.finatra.http.HttpServer
import com.twitter.finatra.http.routing.HttpRouter
class Add1Server extends HttpServer {
override def configureHttp(router: HttpRouter) {
router
.add[Add1Controller]
}
}
| syamantm/finatra | http/src/test/scala/com/twitter/finatra/http/tests/integration/multiserver/add1server/Add1Server.scala | Scala | apache-2.0 | 303 |
package org.raml.domain
case class DataType(
name: String,
// Multiple types represent Union Types, general case is just one
typ: IndexedSeq[Type],
comment: String = "",
description: String = "",
required: Boolean = false,
// Multiple types represent multiple inheritance
parents: IndexedSeq[DataType] ... | larroy/Scala_raml_parser | src/main/scala/org/raml/domain/DataType.scala | Scala | apache-2.0 | 436 |
package gitbucket.core.controller
import gitbucket.core.issues.priorities.html
import gitbucket.core.service.{
RepositoryService,
AccountService,
IssuesService,
LabelsService,
MilestonesService,
PrioritiesService
}
import gitbucket.core.util.{ReferrerAuthenticator, WritableUsersAuthenticator}
import gitbuc... | McFoggy/gitbucket | src/main/scala/gitbucket/core/controller/PrioritiesController.scala | Scala | apache-2.0 | 5,378 |
package com.sheltonsys
import akka.actor.{Actor, ActorRef}
import akka.actor.Props
import akka.event.Logging
import javax.imageio._
import java.io.File
import java.awt.image.BufferedImage
case class StartProcessFileMsg()
class ImageSeperatorActor(val gifFile: File) extends Actor {
val log = Logging(context.syste... | meshelton/gif-flattener | src/main/scala/ImageSeperatorActor.scala | Scala | gpl-2.0 | 2,672 |
package helper.services
import org.specs2.mutable._
import org.specs2.mock.Mockito
import play.api.libs.json.Json
import esclient.Elasticsearch
import play.api.test.WithApplication
import play.api.test.FakeApplication
import java.io.File
import sys.process._
import play.api.libs.Files.TemporaryFile
class AutoComplet... | MeiSign/Fillable | test/helper/services/AutoCompletionServiceSpec.scala | Scala | apache-2.0 | 5,892 |
object Test {
// crash
def foo(a: Any) = { import a.{toString => toS}; toS }
// okay
def ok1(a: String) = { import a.{isInstanceOf => iio}; iio[String] }
def ok2(a: Int) = { import a.{toInt => ti}; ti }
}
| folone/dotty | tests/untried/pos/t7233b.scala | Scala | bsd-3-clause | 216 |
package nodes.nlp
import org.apache.spark.SparkContext
import org.scalatest.FunSuite
import workflow.PipelineContext
class WordFrequencyEncoderSuite extends FunSuite with PipelineContext {
val text = Seq("Winter coming", "Winter Winter is coming")
test("WordFrequencyEncoder") {
sc = new SparkContext("local... | tomerk/keystone | src/test/scala/nodes/nlp/WordFrequencyEncoderSuite.scala | Scala | apache-2.0 | 820 |
package org.sisioh.aws4s.s3.model
import com.amazonaws.services.s3.model.{ EncryptedInitiateMultipartUploadRequest, ObjectMetadata }
import org.sisioh.aws4s.PimpedType
import scala.collection.JavaConverters._
object RichEncryptedInitiateMultipartUploadRequestFactory {
def create(bucketName: String, key: String): ... | sisioh/aws4s | aws4s-s3/src/main/scala/org/sisioh/aws4s/s3/model/RichEncryptedInitiateMultipartUploadRequest.scala | Scala | mit | 1,620 |
package example.diagnostic
import java.time.Clock
import com.twitter.finagle.Service
import com.twitter.finagle.http.Method.Get
import com.twitter.finagle.http.{Request, Response}
import io.fintrospect.formats.Circe.ResponseBuilder._
import io.fintrospect.{RouteSpec, ServerRoute}
object Uptime {
def route(clock: C... | daviddenton/fintrospect-example-app | src/main/scala/example/diagnostic/Uptime.scala | Scala | apache-2.0 | 596 |
package spire
package random
package rng
package extras
import spire.syntax.cfor._
import java.nio.ByteBuffer
import java.util.Arrays
class XorShift1024Star(private val s: Array[Long], private var p: Int) extends LongBasedGenerator {
import XorShift1024Star.{BYTES, N}
def copyInit: XorShift1024Star = new XorShif... | non/spire | extras/src/main/scala/spire/random/rng/XorShift1024Star.scala | Scala | mit | 1,867 |
package ingress.inventory
import net.minecraft.inventory.{Slot, Container}
import net.minecraft.entity.player.{InventoryPlayer, EntityPlayer}
import ingress.tileentities.TileEntityPortalBlock
/**
* Created by MartijnWoudstra on 18-4-2014.
*/
class ContainerPortalBlock(inventoryPlayer: InventoryPlayer, tileEntity: T... | MartijnWoudstra/Ingress | src/main/scala/ingress/inventory/ContainerPortalBlock.scala | Scala | gpl-3.0 | 977 |
package io.iohk.ethereum.jsonrpc.server.controllers
import java.util.concurrent.TimeUnit
import cats.syntax.all._
import com.typesafe.config.{Config => TypesafeConfig}
import io.iohk.ethereum.jsonrpc.JsonRpcError.{InternalError, MethodNotFound}
import io.iohk.ethereum.jsonrpc.serialization.{JsonEncoder, JsonMethodDec... | input-output-hk/etc-client | src/main/scala/io/iohk/ethereum/jsonrpc/server/controllers/JsonRpcBaseController.scala | Scala | mit | 5,491 |
object Fibonacci {
/* Exercice 2.1 from Functional Programming in Scala */
def fib(n: Int): Int = {
@annotation.tailrec
def loop(max: Int, current: Int, previous: Int, antePrevious: Int, acc: Int): Int = {
if (current == max) acc
else loop(max, current + 1, previous + antePrevious, previous, ac... | TGITS/programming-workouts | scala/basic/fpis_chap2/src/main/scala/Fibonacci.scala | Scala | mit | 894 |
package pl.msitko.xml.printing
// mostly not to make io module depending on cats/scalaz
private [printing] trait InternalMonoid [T] {
def combine(a: T, b: String): T
def combine(a: T, ch: Char): T
def zero: T
}
private [printing] object InternalMonoid {
def apply[T : InternalMonoid]: InternalMonoid[T] = impli... | note/xml-lens | io/shared/src/main/scala/pl/msitko/xml/printing/InternalMonoid.scala | Scala | mit | 1,057 |
package at.logic.gapt.proofs.hoare
import at.logic.gapt.language.fol.FOLSubstitution
import at.logic.gapt.proofs.lk.base.FSequent
import at.logic.gapt.expr._
import at.logic.gapt.language.fol.Utils.numeral
object unrollLoop {
def apply( p: Program, actualN: Int ): Program = p match {
case ForLoop( i, n, b ) => ... | gisellemnr/gapt | src/main/scala/at/logic/gapt/proofs/hoare/unrolling.scala | Scala | gpl-3.0 | 1,958 |
/*
* 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 | app/utils/AckRefGenerator.scala | Scala | apache-2.0 | 845 |
/*
* 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... | asorianostratio/incubator-toree | pyspark-interpreter/src/main/scala/org/apache/toree/kernel/interpreter/pyspark/PySparkBridge.scala | Scala | apache-2.0 | 2,295 |
/*
* 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 ... | kimoonkim/spark | sql/core/src/main/scala/org/apache/spark/sql/UDFRegistration.scala | Scala | apache-2.0 | 47,401 |
/*
* 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... | travisbrown/scalatest | src/test/scala/org/scalatest/ParallelTestExecutionInfoExamples.scala | Scala | apache-2.0 | 24,204 |
package com.typesafe.slick.testkit.tests
import org.junit.Assert._
import com.typesafe.slick.testkit.util.{RelationalTestDB, AsyncTest}
class JoinTest extends AsyncTest[RelationalTestDB] {
import tdb.profile.api._
@deprecated("Using deprecated join operators", "3.0")
def testJoin = {
class Categories(tag: ... | adamkozuch/slick | slick-testkit/src/main/scala/com/typesafe/slick/testkit/tests/JoinTest.scala | Scala | bsd-2-clause | 13,433 |
package comp.bio.aging.crispr.services
/*
import fr.hmil.roshttp.HttpRequest
import fr.hmil.roshttp.body.JSONBody.JSONObject
import io.circe.{Decoder, Encoder, Json, Parser, _}
import io.circe.generic.semiauto.{deriveDecoder, deriveEncoder}
import fr.hmil.roshttp.body.Implicits._
import fr.hmil.roshttp.body.JSONBody._
... | antonkulaga/CRISPR | crispr/shared/src/main/scala/comp/bio/aging/crispr/services/GenomeCRISPR.scala | Scala | mpl-2.0 | 4,705 |
package com.github.j5ik2o.reactive.redis
import java.net.InetSocketAddress
import java.util.UUID
import akka.actor.ActorSystem
import cats.data.NonEmptyList
import com.github.j5ik2o.reactive.redis.command.strings.{ GetRequest, SetRequest }
import monix.eval.Task
import cats.implicits._
abstract class AbstractRedisCo... | j5ik2o/reactive-redis | core/src/test/scala/com/github/j5ik2o/reactive/redis/AbstractRedisConnectionPoolSpec.scala | Scala | mit | 1,511 |
import org.scalatest.{GivenWhenThen, FeatureSpec}
import org.scalatest.matchers.ShouldMatchers
/**
* @author Tomasz Nurkiewicz
* @since 4/7/13, 10:45 PM
*/
class ViewTest extends AbstractBaseTestCase {
feature("Parsing view") {
scenario("Parsing all possible cells") {
Given("")
When("")
val v = build... | nurkiewicz/scalatron-bot | src/test/scala/ViewTest.scala | Scala | apache-2.0 | 2,736 |
/*
* 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 ... | bravo-zhang/spark | sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/aggregate/DeclarativeAggregateEvaluator.scala | Scala | apache-2.0 | 2,298 |
package org.scalatra.test
import javax.servlet.http._
import dispatch._
import org.specs2.mutable._
import org.specs2.specification.{Step, Fragments}
class EmbeddedJettyContainerSpec extends Specification
with EmbeddedJettyContainer
with DispatchClient
{
override def map(fs: =>Fragments) =
Step(start()) ^ s... | louk/scalatra | test/src/test/scala/org/scalatra/test/EmbeddedJettyContainerSpec.scala | Scala | bsd-2-clause | 662 |
package ai.agnos.sparql.mapper
import ai.agnos.sparql.api.QuerySolution
object DefaultSolutionMapper {
def apply() = new DefaultSolutionMapper {}
}
/**
* Default mapper doesn't map query solutions. It returns unmodified solutions.
*/
trait DefaultSolutionMapper
extends SolutionMapper[QuerySolution] {
def ... | modelfabric/reactive-sparql | src/main/scala/ai/agnos/sparql/mapper/DefaultSolutionMapper.scala | Scala | mit | 389 |
/***********************************************************************
* Copyright (c) 2013-2018 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... | ddseapy/geomesa | geomesa-features/geomesa-feature-avro/src/main/scala/org/locationtech/geomesa/features/avro/AvroDataFile.scala | Scala | apache-2.0 | 2,253 |
/*
* Copyright 2011-2021 Asakusa Framework Team.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable ... | asakusafw/asakusafw-spark | runtime/src/main/scala/com/asakusafw/spark/runtime/directio/ObjectFactory.scala | Scala | apache-2.0 | 867 |
package com.joshcough.minecraft
import org.bukkit.GameMode._
import scala.collection.JavaConversions._
/**
* Some common commands that I found myself writing over and over again
* for various plugins. I wanted to put them all into one location,
* so that they could be reused elsewhere.
*/
trait CommonCommands {
... | JunctionAt/JunctionAPI | src/main/scala/com/joshcough/minecraft/CommonCommands.scala | Scala | agpl-3.0 | 1,448 |
package reactivemongo.bson.lowlevel
import reactivemongo.bson.buffer.{ ReadableBuffer, WritableBuffer }
@deprecated("Will be removed", "0.13.0")
sealed trait Field {
def tpe: Byte
def name: String
}
@deprecated("Will be removed", "0.13.0")
trait ValueField[A <: AnyVal] { _: Field =>
def value: A
}
@deprecated... | ornicar/ReactiveMongo | bson/src/main/scala/lowlevel.scala | Scala | apache-2.0 | 8,739 |
package shapes.decorator
import shapes.untouchable.{Circle => UCircle, Shape => UShape, Square => USquare}
/**
*
*/
object Main extends App {
// val shapes = List(Circle(UCircle(2)), Square(USquare(2)))
// val areas = shapes.map(_.area)
//
// println(areas)
}
| tupol/scala-patterns-tc-pml | src/main/scala/shapes/decorator/Main.scala | Scala | apache-2.0 | 269 |
package chrome.webNavigation.bindings
import scala.scalajs.js
import scala.scalajs.js.native
@js.native
trait FrameDetails extends js.Object {
/**
* True if the last navigation in this frame was interrupted by an error, i.e. the onErrorOccurred event fired.
*/
val errorOccurred: Boolean = native
/**
... | lucidd/scala-js-chrome | bindings/src/main/scala/chrome/webNavigation/bindings/FrameDetails.scala | Scala | mit | 733 |
/**
* 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... | MykolaB/gatling | gatling-http/src/main/scala/io/gatling/http/check/body/HttpBodyJsonpJsonPathProvider.scala | Scala | apache-2.0 | 1,858 |
/*
* Copyright (C) 2017 Radicalbit
*
* This file is part of flink-JPMML
*
* flink-JPMML 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) an... | francescofrontera/flink-jpmml | flink-jpmml-scala/src/main/scala/io/radicalbit/flink/pmml/scala/models/prediction/Target.scala | Scala | agpl-3.0 | 2,150 |
/*
* 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 ... | u2009cf/spark-radar | sql/core/src/main/scala/org/apache/spark/sql/execution/joins/HashedRelation.scala | Scala | apache-2.0 | 25,970 |
package com.karasiq.bootstrap.context
import scala.language.postfixOps
import scalatags.text.Builder
import scalatags.text.Builder.GenericAttrValueSource
import com.karasiq.bootstrap.context.ReactiveBinds.FormValue
//noinspection ConvertExpressionToSAM
// Reactive emulation
trait TextReactiveBinds extends ReactiveBi... | Karasiq/scalajs-bootstrap | context/shared/src/main/scala/com/karasiq/bootstrap/context/TextReactiveBinds.scala | Scala | mit | 3,566 |
/*
* 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 ... | yanboliang/spark | sql/core/src/main/scala/org/apache/spark/sql/execution/ui/SparkPlanGraph.scala | Scala | apache-2.0 | 7,403 |
/*
* 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 ... | maropu/spark | sql/core/src/test/scala/org/apache/spark/sql/DatasetPrimitiveSuite.scala | Scala | apache-2.0 | 18,427 |
package geotrellis.op
import geotrellis._
import geotrellis.process._
import geotrellis.raster._
import org.junit.runner.RunWith
import org.scalatest.FunSuite
import org.scalatest.junit.JUnitRunner
import geotrellis.raster.op.local.Add
@RunWith(classOf[JUnitRunner])
class AddTest extends FunSuite {
val e = Extent(0... | Tjoene/thesis | Case_Programs/geotrellis-0.7.0/src/test/scala/geotrellis/op/AddTest.scala | Scala | gpl-2.0 | 667 |
package priv.sp
class SpWorld {
val houses: Houses = HouseSingleton
} | illim/freespectrogdx | core/src/main/scala/priv/sp/SpWorld.scala | Scala | gpl-3.0 | 73 |
package com.github.andr83.parsek.pipe
import com.github.andr83.parsek._
import com.github.andr83.parsek.meta._
import com.github.andr83.parsek.util.RuntimeUtils
import com.typesafe.config.Config
import net.ceedubs.ficus.Ficus._
import scala.util.{Failure, Success, Try}
/**
* Created by bfattahov on 11/07/2017.
*... | andr83/parsek | core/src/main/scala/com/github/andr83/parsek/pipe/MapPipe.scala | Scala | mit | 1,176 |
package net.fehmicansaglam.tepkin.protocol.message
import java.nio.{ByteBuffer, ByteOrder}
import akka.util.ByteString
import net.fehmicansaglam.bson.BsonDocument
import net.fehmicansaglam.bson.reader.BsonDocumentReader
import scala.collection.mutable.ArrayBuffer
/**
* The OP_REPLY message is sent by the database ... | danielwegener/tepkin | tepkin/src/main/scala/net/fehmicansaglam/tepkin/protocol/message/Reply.scala | Scala | apache-2.0 | 2,058 |
package io.github.suitougreentea.VariousMinos.game
import io.github.suitougreentea.VariousMinos.{MinoGeneratorConfigBombInfinite, MinoGeneratorBombInfinite}
class HandlerBombSurvivalInsane extends HandlerBombSurvival {
var handleLevel: List[Int] = List(100, 200, 300, 400, 500, 600, 700, 800, 900, 1000, 1100, 1200, ... | suitougreentea/VariousMinos2 | src/main/scala/io/github/suitougreentea/VariousMinos/game/HandlerBombSurvivalInsane.scala | Scala | mit | 1,985 |
// Copyright 2016 Jim Pivarski
//
// 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... | diana-hep/rootconverter | scaroot-reader/src/main/scala/org/dianahep/scaroot/reader/factory.scala | Scala | apache-2.0 | 26,577 |
/*
* The MIT License (MIT)
*
* Copyright (c) 2015-2019 Helge Holzmann (Internet Archive) <helge@archive.org>
*
* 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, incl... | helgeho/ArchiveSpark | src/main/scala/org/archive/archivespark/dataspecs/access/HttpTextAccessor.scala | Scala | mit | 1,507 |
/*
* 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/catalyst/src/main/scala/org/apache/spark/sql/connector/catalog/Catalogs.scala | Scala | apache-2.0 | 4,000 |
import swing.{Action, Button, Component, Dialog, Swing, MenuItem, Graphics2D, ListView, GridPanel}
import swing.event.{ButtonClicked, MouseClicked}
import org.scilab.forge.jlatexmath.{TeXFormula, TeXConstants}
import javax.swing.KeyStroke.getKeyStroke
import java.awt.event.KeyEvent
import java.awt.Color
import java.a... | goodlyrottenapple/calculus-toolbox | template/gui/SequentViewPanel.scala | Scala | mit | 12,783 |
/*
* #%L
* Active OCR Web Application
* %%
* Copyright (C) 2011 - 2012 Maryland Institute for Technology in the Humanities
* %%
* 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
*
* ... | umd-mith/activeocr | web/src/test/scala/RunWebApp.scala | Scala | apache-2.0 | 1,494 |
package org.embulk.input.dynamodb.item
import java.util.{Optional, List => JList}
import com.amazonaws.services.dynamodbv2.model.AttributeValue
import com.fasterxml.jackson.annotation.{JsonCreator, JsonValue}
import org.embulk.config.{Config, ConfigDefault, Task => EmbulkTask}
import org.embulk.spi.{Column, PageBuild... | lulichn/embulk-input-dynamodb | src/main/scala/org/embulk/input/dynamodb/item/DynamodbItemSchema.scala | Scala | mit | 3,861 |
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you ... | aljoscha/flink | flink-table/flink-table-planner-blink/src/test/scala/org/apache/flink/table/planner/plan/stream/sql/SourceWatermarkTest.scala | Scala | apache-2.0 | 4,227 |
/**
* Copyright 2015 Yahoo Inc. Licensed under the Apache License, Version 2.0
* See accompanying LICENSE file.
*/
package models.navigation
import play.api.mvc.Call
/**
* @author hiral
*/
object BreadCrumbs {
sealed trait BreadCrumb
final case class BCDynamicText(cn: String => String) extends BreadCrumb
... | cvcal/kafka-manager | app/models/navigation/BreadCrumbs.scala | Scala | apache-2.0 | 6,911 |
val vertexArray = Array((0L),(1L),(2L),(3L),(4L),(5L))
val vertices = sc.parallelize(vertexArray)
val idVertices = vertices.map(x => (x,x)).collect
// broadcast idVertices
var bIdVertices = sc.broadcast(idVertices)
val edgeArray = Array((0L,1L),(0L,2L),(1L,2L),(2L,3L),(4L,3L),(4L,5L),(5L,3L))
val edges = sc.paralleli... | wy36101299/DATA-MINING-SOCIAL-NETWORK-ANALYSIS-HW | final-project/LabelPropagation.scala | Scala | mit | 1,142 |
package im.mange.driveby
case class Specification(name: String, id: Long) | alltonp/driveby | src/main/scala/im/mange/driveby/Specification.scala | Scala | apache-2.0 | 74 |
package com.twitter.finagle.mysql
import com.twitter.finagle.mysql.transport.MysqlBuf
import com.twitter.util.TwitterDateFormat
import java.sql.{Date, Timestamp}
import java.text.ParsePosition
import java.util.logging.Logger
import java.util.{Calendar, TimeZone}
/**
* Defines a Value ADT that represents the domain o... | mkhq/finagle | finagle-mysql/src/main/scala/com/twitter/finagle/mysql/Value.scala | Scala | apache-2.0 | 10,134 |
package org.tearne.crosser.output.composition
import org.scalatest.mock.MockitoSugar
import org.mockito.Mockito._
import org.scalatest.junit.AssertionsForJUnit
import org.tearne.crosser.plant.RootPlant
import org.tearne.crosser.plant.Tid
import org.junit.Before
import org.scalatest.FreeSpec
class TidCompositionBuilde... | tearne/Crosser | src/test/scala/org/tearne/crosser/output/composition/TidCompositionBuilderTest.scala | Scala | apache-2.0 | 1,330 |
/*
* Copyright (C) Lightbend Inc. <https://www.lightbend.com>
*/
package com.lightbend.lagom.javadsl.persistence.cassandra.testkit
import com.lightbend.lagom.internal.persistence.testkit.PersistenceTestConfig.cassandraConfig
import com.lightbend.lagom.javadsl.persistence.testkit.AbstractTestUtil
import com.typesafe... | lagom/lagom | persistence-cassandra/javadsl/src/main/scala/com/lightbend/lagom/javadsl/persistence/cassandra/testkit/TestUtil.scala | Scala | apache-2.0 | 563 |
package com.sksamuel.elastic4s
import com.sksamuel.elastic4s.anaylzers.Analyzer
import org.elasticsearch.action.suggest.SuggestResponse
import org.elasticsearch.client.Client
import org.elasticsearch.common.unit.Fuzziness
import org.elasticsearch.search.suggest.Suggest.Suggestion
import org.elasticsearch.search.sugges... | tototoshi/elastic4s | elastic4s-core/src/main/scala/com/sksamuel/elastic4s/suggestions.scala | Scala | apache-2.0 | 9,901 |
/*
* 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-tail/shared/src/main/scala/monix/tail/internal/IterantConcat.scala | Scala | apache-2.0 | 4,898 |
package org.jetbrains.plugins.scala.extensions
import com.intellij.psi.PsiElement
import com.intellij.psi.tree.IElementType
/**
* Pavel Fatin
*/
object ElementType {
def unapply(e: PsiElement): Option[IElementType] = Option(e.getNode.getElementType)
} | ilinum/intellij-scala | src/org/jetbrains/plugins/scala/extensions/ElementType.scala | Scala | apache-2.0 | 258 |
/*
* Copyright (c) 2014-2019 by The Minitest Project Developers.
* Some 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... | alexandru/minitest | shared/src/test/scala/minitest/tests/SourceLocationTest.scala | Scala | apache-2.0 | 1,102 |
/*
* 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 ... | GJL/flink | flink-table/flink-table-planner/src/test/scala/org/apache/flink/table/api/batch/table/validation/SortValidationTest.scala | Scala | apache-2.0 | 2,192 |
package com.eevolution.context.dictionary.domain.model
import ai.x.play.json.Jsonx
import com.eevolution.context.dictionary.api.{ActiveEnabled, DomainModel, Identifiable, Traceable}
import org.joda.time.DateTime
/**
* Copyright (C) 2003-2017, e-Evolution Consultants S.A. , http://www.e-evolution.com
* This progra... | adempiere/ADReactiveSystem | dictionary-api/src/main/scala/com/eevolution/context/dictionary/domain/model/UserDefinedField.scala | Scala | gpl-3.0 | 4,659 |
package com.bazaarvoice.sswf
trait Logger {
def trace(message: => String): Unit
def debug(message: => String): Unit
def info(message: => String): Unit
def warn(message: => String): Unit
def warn(message: => String, throwable: Throwable): Unit
def error(message: => String): Unit
def error(message: => Stri... | bazaarvoice/super-simple-workflow | sswf-core/src/main/scala/com/bazaarvoice/sswf/Logger.scala | Scala | apache-2.0 | 797 |
package ml.sparkling.graph.operators.algorithms.shortestpaths.pathprocessors.fastutils
import ml.sparkling.graph.api.operators.algorithms.shortestpaths.ShortestPathsTypes
import ml.sparkling.graph.api.operators.algorithms.shortestpaths.ShortestPathsTypes.{JDouble, JList, JLong, JMap}
/**
* Created by Roman Bartusiak... | sparkling-graph/sparkling-graph | operators/src/main/scala/ml/sparkling/graph/operators/algorithms/shortestpaths/pathprocessors/fastutils/FastUtilDataTypes.scala | Scala | bsd-2-clause | 522 |
import sbt._
object Version {
val spark = "2.1.0"
val hadoop = "2.7.3"
val slf4j = "1.7.21"
val scalaTest = "3.0.1"
val scalaXml = "1.0.6"
}
object Library {
val sparkCore = "org.apache.spark" %% "spark-core" % Version.spark exclude("org.scala-lang" , "scala-comp... | bbiletskyy/intron-prediction | project/Dependencies.scala | Scala | apache-2.0 | 1,144 |
/*******************************************************************************
* Copyright (c) 2014 Łukasz Szpakowski.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MP... | luckboy/Purfuncor | src/main/scala/pl/luckboy/purfuncor/backend/interp/EnvironmentState.scala | Scala | mpl-2.0 | 740 |
package sorm.mappings
import sorm._
import sorm.driver.DriverConnection
import sorm.jdbc.ResultSetView
import sorm.reflection.Reflection
class SetMapping
( val reflection : Reflection,
val membership : Option[Membership],
val settings : Map[Reflection, EntitySettings] )
extends SlaveTableMapping
{
... | cllu/sorm2 | src/main/scala/sorm/mappings/SetMapping.scala | Scala | mit | 1,472 |
package com.twitter.finagle.exp.mysql
import com.twitter.finagle.exp.mysql.transport.{Buffer, BufferReader, Packet}
import org.junit.runner.RunWith
import org.scalatest.FunSuite
import org.scalatest.junit.JUnitRunner
trait HexDump {
val hex: String
// parse multi-line hex dump where packets are delimited by '|'
... | jamescway/finagle | finagle-mysql/src/test/scala/com/twitter/finagle/mysql/unit/ResultTest.scala | Scala | apache-2.0 | 5,069 |
package spire
package math
import spire.algebra.Sign
import spire.tests.SpireProperties
import org.scalacheck.{ Arbitrary, Gen }
import org.scalacheck.Arbitrary.arbitrary
import java.math.{ MathContext, RoundingMode }
import MathContext.{DECIMAL64, DECIMAL128}
class AlgebraicTest extends SpireProperties {
def ap... | tixxit/spire | tests/src/test/scala/spire/math/AlgebraicTest.scala | Scala | mit | 11,485 |
import uk.gov.hmrc.playcrosscompilation.AbstractPlayCrossCompilation
import uk.gov.hmrc.playcrosscompilation.PlayVersion._
object PlayCrossCompilation extends AbstractPlayCrossCompilation(defaultPlayVersion = Play26)
| hmrc/play-ui | project/PlayCrossCompilation.scala | Scala | apache-2.0 | 218 |
/*
* Copyright © 2015 Lukas Rosenthaler, Benjamin Geer, Ivan Subotic,
* Tobias Schweizer, André Kilchenmann, and Sepideh Alassi.
*
* 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 F... | nie-ine/Knora | webapi/src/main/scala/org/knora/webapi/routing/v1/SearchRouteV1.scala | Scala | agpl-3.0 | 10,404 |
package examples
import shapeless._
import shapeless.ops.hlist.Tupler
import scala.concurrent.{ExecutionContext, Future}
import scala.languageFeature.implicitConversions
package object hzip {
trait IsHListOfFutures[In <: HList, Out <: HList] {
def hsequence(l: In)(implicit ec: ExecutionContext): Future[Out]
... | haghard/shapeless-playbook | src/main/scala/examples/hzip/package.scala | Scala | apache-2.0 | 1,572 |
/*
* ScalaCL - putting Scala on the GPU with JavaCL / OpenCL
* http://scalacl.googlecode.com/
*
* Copyright (c) 2009-2013, Olivier Chafik (http://ochafik.com/)
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following ... | nativelibs4java/ScalaCL | src/main/scala/scalacl/CLArray.scala | Scala | bsd-3-clause | 4,925 |
package com.plista.solrindexer.persistence
import java.nio.charset.Charset
import java.util.UUID
abstract class Persistence {
def generateId(url: String) =
UUID.nameUUIDFromBytes(url.getBytes(Charset.forName("UTF-8"))).toString
def addArticle(urlarg: String, content: String): Unit
def exists(url: String):... | rvegas/solrindexer | src/main/scala/com/plista/solrindexer/persistence/Persistence.scala | Scala | unlicense | 365 |
package net.warpgame.engine.core.context.loader
import org.scalamock.scalatest.MockFactory
import org.scalatest.{Matchers, WordSpecLike}
import net.warpgame.engine.core.context.loader.service._
import ServiceCreatorSpec._
import net.warpgame.engine.core.graph.{DAG, Node}
import scala.reflect.ClassTag
/**
* @author... | WarpOrganization/warp | core/src/test/scala/net/warpgame/engine/core/context/loader/ServiceCreatorSpec.scala | Scala | lgpl-3.0 | 2,194 |
package dotty.tools
package dottydoc
package staticsite
import org.junit.Test
import org.junit.Assert._
class SiteTests extends DottyDocTest with SourceFileOps with CheckFromSource {
@Test def hasCorrectLayoutFiles = {
assert(site.root.exists && site.root.isDirectory,
s"'${site.root.getName}' is not ... | som-snytt/dotty | doc-tool/test/dotty/tools/dottydoc/staticsite/SiteTests.scala | Scala | apache-2.0 | 3,557 |
package se.culvertsoft.mgen.jspack.generator
import java.io.File
import scala.collection.JavaConversions.mapAsScalaMap
object MkFilePath {
def apply(settings: java.util.Map[String, String]): String = {
val path = settings getOrElse ("output_path", "")
val filename = settings getOrElse ("output_filename", "... | culvertsoft/mgen | mgen-javascriptgenerator/src/main/scala/se/culvertsoft/mgen/jspack/generator/MkFilePath.scala | Scala | mit | 372 |
package lila.coach
import org.joda.time.DateTime
import org.joda.time.format.ISODateTimeFormat
import play.api.libs.json._
private[coach] final class JSONWriters(
lightUser: String => Option[lila.common.LightUser]) {
implicit object JodaDateWrites extends Writes[DateTime] {
private val isoFormatter = ISODa... | abougouffa/lila | modules/coach/src/main/JSONWriters.scala | Scala | mit | 2,935 |
/*
* Copyright (C)2014 D. Plaindoux.
*
* 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, or (at your option) any
* later version.
*
* This program is distributed i... | d-plaindoux/rapido | src/test/scala/smallibs/rapido/lang/checker/checkertest.scala | Scala | lgpl-2.1 | 8,916 |
package gitbucket.core.api
import gitbucket.core.model.CommitState
/**
* https://developer.github.com/v3/repos/statuses/#create-a-status
* api form
*/
case class CreateAStatus(
/* state is Required. The state of the status. Can be one of pending, success, error, or failure. */
state: String,
/* context is a ... | intermezzo-fr/gitbucket | src/main/scala/gitbucket/core/api/CreateAStatus.scala | Scala | apache-2.0 | 1,033 |
/**
* Copyright (C) 2009-2011 the original author or authors.
* See the notice.md file distributed with this work for additional
* information regarding copyright ownership.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* Yo... | dnatic09/scalate | scalate-camel/src/test/scala/org/fusesource/scalate/camel/CamelScalateEndpointTest.scala | Scala | apache-2.0 | 3,217 |
package calculator
object Polynomial extends PolynomialInterface {
def computeDelta(a: Signal[Double], b: Signal[Double],
c: Signal[Double]): Signal[Double] = {
Var({
val aVal = a()
val bVal = b()
val cVal = c()
bVal*bVal - 4 * aVal * cVal
})
}
def computeSolutions(a: Signa... | rusucosmin/courses | fp/9-calculator-rusucosmin/src/main/scala/calculator/Polynomial.scala | Scala | mit | 723 |
package au.com.dius.pact.consumer.specs2
import java.util.concurrent.TimeUnit.MILLISECONDS
import au.com.dius.pact.core.model.Consumer
import org.junit.Ignore
import org.junit.runner.RunWith
import org.specs2.mutable.Specification
import org.specs2.runner.JUnitRunner
import scala.concurrent.Await
import scala.concur... | DiUS/pact-jvm | consumer/specs2/src/test/scala/au/com/dius/pact/consumer/specs2/DifferentStatesPactSpec.scala | Scala | apache-2.0 | 1,782 |
/**
* 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... | flange/drift-dev | kafka/00-kafka_2.11-0.10.1.0/libs/tmp/kafka/log/TimeIndex.scala | Scala | apache-2.0 | 9,343 |
package com.sksamuel.elastic4s.requests.searches.aggs.builders
import com.sksamuel.elastic4s.handlers
import com.sksamuel.elastic4s.handlers.script.ScriptBuilderFn
import com.sksamuel.elastic4s.json.{XContentBuilder, XContentFactory}
import com.sksamuel.elastic4s.requests.searches.aggs.{AggMetaDataFn, RangeAggregation... | sksamuel/elastic4s | elastic4s-core/src/main/scala/com/sksamuel/elastic4s/requests/searches/aggs/builders/RangeAggregationBuilder.scala | Scala | apache-2.0 | 1,629 |
package org.codeswarm.aksync
/** When a token is available, the server replies with a `Lease` message to the client
* who requested it.
*/
trait Lease[+Token] {
def token: Token
/** Sends a [[Lease.Acknowledge]] message to the server.
*/
def acknowledge()
/** Sends a [[Lease.Release]] message to the... | chris-martin/aksync | src/main/scala/Lease.scala | Scala | apache-2.0 | 3,525 |
package com.typesafe.sbt
package packager
import sbt._
import com.typesafe.sbt.packager.archetypes.JavaAppPackaging
/** A set of helper methods to simplify the writing of mappings */
object MappingsHelper {
/**
* return a Seq of mappings which effect is to add a whole directory in the generated package
*
... | kodemaniak/sbt-native-packager | src/main/scala/com/typesafe/sbt/packager/MappingsHelper.scala | Scala | bsd-2-clause | 3,577 |
package dotty.tools
import org.junit.Test
import org.junit.Assert.{ assertFalse, assertTrue, fail }
import dotc.ast.Trees._
import dotc.core.Decorators._
class CheckTypeTest extends DottyTest {
@Test
def checkTypesTest: Unit = {
val source = """
|class A
|class B extends A
""".stripMargin
... | som-snytt/dotty | compiler/test/dotty/tools/CheckTypesTests.scala | Scala | apache-2.0 | 1,311 |
import Macros.*
object Test {
def main(args: Array[String]): Unit = {
println(lift[[X] =>> String](new Show)(3))
println(lift[[X] =>> X](new Eval)(3))
println()
println(lift[[X] =>> String](new Show)(if (true) 3 else 4))
println(lift[[X] =>> X](new Eval)(if (true) 3 else 4))
println()
p... | dotty-staging/dotty | tests/run-macros/quote-matcher-symantics-3/quoted_2.scala | Scala | apache-2.0 | 3,467 |
import sbt._
object Builds extends sbt.Build {
import Keys._
import sbtrelease.ReleasePlugin._
import sbtbuildinfo.Plugin._
lazy val buildSettings = Defaults.defaultSettings ++ releaseSettings ++ Seq(
organization := "net.rosien",
scalaVersion := "2.10.2",
scalacOptions ++= Seq("-deprecation", "-u... | arosien/configz | project/Build.scala | Scala | apache-2.0 | 2,411 |
// Equites, a Scala chess playground
// Copyright © 2011, 2013-2014 Frank S. Thomas <frank@timepit.eu>
//
// 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
/... | equites-chess/equites-core | src/main/scala/eu/timepit/equites/Action.scala | Scala | gpl-3.0 | 2,708 |
package org.apache.spot.netflow.model
import org.apache.spark.sql.types.StructType
import org.apache.spark.sql.{Row, SQLContext}
import org.apache.spot.SuspiciousConnectsArgumentParser.SuspiciousConnectsConfig
import org.apache.spot.netflow.FlowSchema._
import org.apache.spot.testutils.TestingSparkContextFlatSpec
impo... | NathanSegerlind/incubator-spot | spot-ml/src/test/scala/org/apache/spot/netflow/model/FlowSuspiciousConnectsModelTest.scala | Scala | apache-2.0 | 4,803 |
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.