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 |
|---|---|---|---|---|---|
/* sbt -- Simple Build Tool
* Copyright 2010 Mark Harrah
*/
package sbt
import Relation._
object Relation
{
/** Constructs a new immutable, finite relation that is initially empty. */
def empty[A,B]: Relation[A,B] = make(Map.empty, Map.empty)
def make[A,B](forward: Map[A,Set[B]], reverse: Map[B, Set[A]]): Rela... | olove/xsbt | util/relation/src/main/scala/sbt/Relation.scala | Scala | bsd-3-clause | 4,847 |
package nozzle.webresult
import spray.json._
import nozzle.jsend._
import spray.httpx.marshalling._
import spray.httpx.SprayJsonSupport
trait JSendMarshallingSupport extends MarshallingSupport with nozzle.jsend.JSendSupport {
import JSendJsonProtocol._
private implicit def okRootJsonFormat[T](implicit jsendable... | utaal/nozzle | src/main/scala/webresult/JSendMarshallingSupport.scala | Scala | mit | 1,711 |
/*
* Copyright 2016 The BigDL Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agr... | intel-analytics/BigDL | scala/dllib/src/main/scala/com/intel/analytics/bigdl/dllib/optim/parameters/FP16SplitsCompressedTensor.scala | Scala | apache-2.0 | 5,578 |
package monocle.generic
import monocle.law.discipline.IsoTests
import monocle.law.discipline.function.EachTests
import monocle.generic.all._
import org.scalacheck.Arbitrary
import cats.Eq
import munit.DisciplineSuite
import scala.annotation.nowarn
@nowarn
class ProductSpec extends DisciplineSuite {
case class Pers... | julien-truffaut/Monocle | generic/src/test/scala/monocle/generic/ProductSpec.scala | Scala | mit | 1,171 |
package org.allenai.common
import org.allenai.common.testkit.UnitSpec
class MathUtilsSpec extends UnitSpec {
"MathUtils" should "correctly perform math operations" in {
MathUtils.round(3.1415, 2) should be(3.14)
MathUtils.round(3.1415, 3) should be(3.142)
}
it should "correctly incorporate rounding mo... | allenai/common | core/src/test/scala/org/allenai/common/MathUtilsSpec.scala | Scala | apache-2.0 | 499 |
/*
* ____ ____ _____ ____ ___ ____
* | _ \\ | _ \\ | ____| / ___| / _/ / ___| Precog (R)
* | |_) | | |_) | | _| | | | | /| | | _ Advanced Analytics Engine for NoSQL Data
* | __/ | _ < | |___ | |___ |/ _| | | |_| | Copyright (C) 2010 - 2013 SlamData, In... | precog/platform | ragnarok/src/main/scala/com/precog/ragnarok/test/ClicksTestSuite.scala | Scala | agpl-3.0 | 1,351 |
package org.scalatra
import org.scalatest.{Matchers, FunSuite}
import org.scalatest.matchers.MustMatchers
class RailsLikeUrlGeneratorTest extends FunSuite with Matchers {
def url(path: String, params: Tuple2[String, String]*): String =
url(path, params.toMap)
def url(path: String, splat: String, moreSplats:... | etorreborre/scalatra | core/src/test/scala/org/scalatra/RailsLikeUrlGeneratorTest.scala | Scala | bsd-2-clause | 3,207 |
/*
* Copyright 2016 Coral realtime streaming analytics (http://coral-streaming.github.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... | coral-streaming/coral | src/main/scala/io/coral/utils/NameSuggester.scala | Scala | apache-2.0 | 1,939 |
/*
* 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/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkSQLSessionManager.scala | Scala | apache-2.0 | 4,047 |
/**
* Copyright (C) 2016 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... | orbeon/orbeon-forms | form-runner/jvm/src/main/scala/org/orbeon/oxf/fr/persistence/relational/search/part/columnFilterPart.scala | Scala | lgpl-2.1 | 2,924 |
/*
* 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 ... | sgururajshetty/carbondata | integration/spark2/src/main/scala/org/apache/spark/sql/hive/CarbonHiveMetaStore.scala | Scala | apache-2.0 | 9,226 |
package pl.touk.nussknacker.engine.flink.util.transformer
import com.typesafe.config.Config
import com.typesafe.config.ConfigValueFactory.fromAnyRef
import pl.touk.nussknacker.engine.api.component.{ComponentDefinition, ComponentProvider, NussknackerVersion}
import pl.touk.nussknacker.engine.api.process.ProcessObjectDe... | TouK/nussknacker | engine/flink/components/kafka/src/main/scala/pl/touk/nussknacker/engine/flink/util/transformer/FlinkKafkaComponentProvider.scala | Scala | apache-2.0 | 4,937 |
/*
* 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 ... | jianran/spark | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/statsEstimation/ProjectEstimation.scala | Scala | apache-2.0 | 1,921 |
/*
* 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 ... | bOOm-X/spark | external/kafka-0-10/src/main/scala/org/apache/spark/streaming/kafka010/DirectKafkaInputDStream.scala | Scala | apache-2.0 | 12,482 |
/*
* Copyright 2016 Carlo Micieli
*
* 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... | CarloMicieli/hascalator | core/src/test/scala/io/hascalator/dst/SplayTreeSpec.scala | Scala | apache-2.0 | 2,583 |
package text.kanji
/**
* @author K.Sakamoto
* Created on 2016/07/26
*/
object JISLevel2KanjiCharacter extends KanjiCharacter {
override val kanji: Seq[String] = readKanjiCSV("jis_level_2")
}
| ktr-skmt/FelisCatusZero | src/main/scala/text/kanji/JISLevel2KanjiCharacter.scala | Scala | apache-2.0 | 208 |
/*
* 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 ... | yew1eb/flink | flink-streaming-scala/src/main/scala/org/apache/flink/streaming/api/scala/SplitStream.scala | Scala | apache-2.0 | 1,608 |
/*
* 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 ... | spark-test/spark | core/src/test/scala/org/apache/spark/scheduler/WorkerDecommissionSuite.scala | Scala | apache-2.0 | 3,417 |
package org.jetbrains.sbt
import java.io.File
import com.intellij.openapi.module.Module
import com.intellij.openapi.roots.ModuleRootModificationUtil
import com.intellij.openapi.vfs.VfsUtil
import org.jetbrains.plugins.scala.base.libraryLoaders.ScalaLibraryLoader.{ScalaCompilerLoader, ScalaLibraryLoaderAdapter, ScalaR... | triplequote/intellij-scala | scala/scala-impl/test/org/jetbrains/sbt/MockSbt.scala | Scala | apache-2.0 | 4,747 |
/**
* 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 ... | ksmpartners/ernie | ernie-server/src/main/scala/com/ksmpartners/ernie/server/ErnieModel.scala | Scala | apache-2.0 | 12,805 |
import sbt._
import sbt.Keys._
import bintray.Plugin._
import bintray.Keys._
object Build extends Build {
val customBintraySettings = bintrayPublishSettings ++ Seq(
packageLabels in bintray := Seq("json"),
bintrayOrganization in bintray := Some("plasmaconduit"),
repository in bintray := ... | plasmaconduit/json | project/Build.scala | Scala | mit | 1,477 |
/**
* 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... | ryez/gatling | gatling-jms/src/main/scala/io/gatling/jms/client/JmsClient.scala | Scala | apache-2.0 | 2,476 |
package integrationtest
import _root_.controller._
import service._
import skinny.{ Routes, _ }
import skinny.test.SkinnyFlatSpec
class RootControllerSpec extends SkinnyFlatSpec with unit.SkinnyTesting {
class EchoServiceMock extends EchoService {
override def echo(s: String): String = s.toUpperCase
}
add... | skinny-framework/skinny-framework | example/src/test/scala/integrationtest/RootControllerSpec.scala | Scala | mit | 1,990 |
/*
* 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 ... | mrchristine/spark-examples-dbc | src/main/scala/org/apache/spark/examples/mllib/GradientBoostingRegressionExample.scala | Scala | apache-2.0 | 2,926 |
/*
* Copyright (C) 2012 The Regents of The University California.
* 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/LICENS... | vax11780/shark | src/main/scala/shark/execution/SparkTask.scala | Scala | apache-2.0 | 5,370 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | gioenn/xSpark | sql/hive/src/test/scala/org/apache/spark/sql/sources/BucketedReadSuite.scala | Scala | apache-2.0 | 16,035 |
package com.alvin.niagara.util
import java.util.Properties
import com.alvin.niagara.config.Config
import com.alvin.niagara.model.PostTags
import org.apache.kafka.clients.producer._
/**
* Created by JINC4 on 5/26/2016.
*
* Avro message producer connects to kafka cluster
* Then, Sents avro message to kafka
*/
cl... | AlvinCJin/Niagara | src/main/scala/com/alvin/niagara/util/AvroProducer.scala | Scala | apache-2.0 | 1,162 |
/*******************************************************************
* See the NOTICE file distributed with this work for additional *
* information regarding Copyright ownership. The author/authors *
* license this file to you under the terms of the Apache License *
* Version 2.0 (the "License"); you may not... | reactivecodes/scala-time | src/main/scala/scalatime/package.scala | Scala | apache-2.0 | 2,345 |
package demo
import spray.json.DefaultJsonProtocol
case class Stuff(id: Int, data: String)
object Stuff extends DefaultJsonProtocol {
implicit val stuffFormat = jsonFormat2(Stuff.apply)
}
| MonsantoCo/simple-spray-with-routing | src/main/scala/demo/Stuff.scala | Scala | bsd-3-clause | 196 |
package com.pointr.tcp.rpc
abstract class P2pRpc {
import reflect.runtime.universe.TypeTag
def connect(connParam: P2pConnectionParams): Boolean
def isConnected: Boolean
def request[U: TypeTag, V: TypeTag](req: P2pReq[U]): P2pResp[V] // = _
def requestJava[U, V](req: P2pReq[U]): P2pResp[V] // = { null.a... | OpenChaiSpark/OCspark | tcpclient/src/main/scala/com/pointr/tcp/rpc/P2pRpc.scala | Scala | apache-2.0 | 349 |
package com.arcusys.learn.liferay.constants
import com.liferay.portal.kernel.workflow.WorkflowConstants
object WorkflowConstantsHelper {
val STATUS_APPROVED = WorkflowConstants.STATUS_APPROVED
val ACTION_PUBLISH = WorkflowConstants.ACTION_PUBLISH
}
| arcusys/Valamis | learn-liferay700-services/src/main/scala/com/arcusys/learn/liferay/constants/WorkflowConstantsHelper.scala | Scala | gpl-3.0 | 255 |
/*
* Copyright (c) 2014-2016
* nonblocking.at gmbh [http://www.nonblocking.at]
*
* This file is part of Cliwix.
*
* Cliwix 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... | nonblocking/cliwix | cliwix-core/src/main/scala/at/nonblocking/cliwix/core/CliwixLiferayNotReadyException.scala | Scala | agpl-3.0 | 910 |
/* - Coeus web framework -------------------------
*
* Licensed under the Apache License, Version 2.0.
*
* Author: Spiros Tzavellas
*/
package com.tzavellas.coeus.i18n.msg
import java.util.Locale
/**
* A bundle of locale-specific messages.
*
* @see PropertiesMessageBundle
*/
trait MessageBundle {
/**
... | sptz45/coeus | src/main/scala/com/tzavellas/coeus/i18n/msg/MessageBundle.scala | Scala | apache-2.0 | 1,046 |
class Nums {
class Num(x: Double) {
inline def power(inline n: Long) = ${ PowerMacro.powerCode('x, 'n) }
}
}
object Test {
def main(args: Array[String]): Unit = {
val nums = new Nums
val n = new nums.Num(1.5)
println(n.power(0))
println(n.power(1))
println(n.power(2))
println(n.powe... | som-snytt/dotty | tests/run-macros/i4803b/App_2.scala | Scala | apache-2.0 | 332 |
/**
* Copyright (C) 2015 Stratio (http://stratio.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 required by ap... | luismcl/crossdata | core/src/test/scala/com/stratio/crossdata/test/BaseXDTest.scala | Scala | apache-2.0 | 958 |
package scala.meta.quasiquotes
import org.jetbrains.plugins.scala.SlowTests
import org.junit.experimental.categories.Category
/**
* @author mutcianm
* @since 28.10.16.
*/
@Category(Array(classOf[SlowTests]))
class RandomQQTest extends QuasiQuoteTypeInferenceTestBase {
def testPatVarTermApply() = doTest(
... | triplequote/intellij-scala | scala/scala-impl/test/scala/meta/quasiquotes/RandomQQTest.scala | Scala | apache-2.0 | 2,471 |
package breeze.linalg
import java.util._
import breeze.linalg.operators._
import breeze.linalg.support._
import breeze.numerics._
/** This is an auto-generated trait providing operators for CSCMatrix */
trait CSCMatrixOps_Double { this: CSCMatrix.type =>
class canMulM_V_Double private[linalg] () extends BinaryRegis... | tjhunter/scalanlp-core | math/src/main/scala/breeze/linalg/CSCMatrixOps.scala | Scala | apache-2.0 | 11,499 |
package com.goibibo.sqlshift.models
/**
* Project: mysql-redshift-loader
* Author: shivamsharma
* Date: 12/29/16.
*/
case class Status(isSuccessful: Boolean, e: Exception)
| goibibo/SqlShift | src/main/scala/com/goibibo/sqlshift/models/Status.scala | Scala | mit | 181 |
package im.mange.flakeless.innards
import im.mange.flakeless.{Config, Flakeless}
import org.openqa.selenium.{By, WebElement}
//TODO: model Condition
//TODO: work out when description is an Actual and when its something else (like not found)
//... Actual sounds assertion based
//... other sounds like an Action ...
//.... | alltonp/flakeless | src/main/scala/im/mange/flakeless/innards/WaitForElement.scala | Scala | mit | 1,575 |
/**
* The MIT License (MIT) Copyright (c) 2014 University of Applied Sciences, Berlin, Germany
* For more detailed information, please read the licence.txt in the root directory.
**/
package org.onepercent.utils.scoring
import org.apache.spark.SparkContext
import org.apache.spark.SparkContext._
import org.apache.s... | isn0gud/onepercent | src/main/scala/org/onepercent/utils/scoring/TweetScoringLearner.scala | Scala | mit | 3,849 |
package org.openurp.edu.eams.teach.schedule.service
import org.openurp.edu.base.Student
trait StdCourseTablePermissionChecker {
def check(std: Student, kind: String, ids: String): String
}
| openurp/edu-eams-webapp | schedule/src/main/scala/org/openurp/edu/eams/teach/schedule/service/StdCourseTablePermissionChecker.scala | Scala | gpl-3.0 | 196 |
/**
* Copyright (C) 2013 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... | martinluther/orbeon-forms | src/main/scala/org/orbeon/oxf/fr/ResourcesPatcher.scala | Scala | lgpl-2.1 | 4,351 |
/*
* Stratio Meta
*
* Copyright (c) 2014, Stratio, All rights reserved.
*
* This library 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 3.0 of the License, or (at your option) ... | dhiguero/stratio-meta | meta-common/src/main/scala/com/stratio/meta/common/ask/Connect.scala | Scala | gpl-3.0 | 778 |
package hello
import org.springframework.context.annotation.Configuration
import org.springframework.boot.autoconfigure.EnableAutoConfiguration
import org.springframework.context.annotation.ComponentScan
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.Reque... | muffadaldaginawala/hello-world | src/main/scala/hello/HelloConfig.scala | Scala | mit | 745 |
package com.hunorkovacs.koauth.service
import java.security.SecureRandom
import scala.util.Random
trait TokenGenerator {
def generateTokenAndSecret: (String, String)
def generateVerifier: String
def generateNonce: String
}
object DefaultTokenGenerator extends TokenGenerator {
private final val LengthToke... | kovacshuni/koauth | src/main/scala/com/hunorkovacs/koauth/service/DefaultTokenGenerator.scala | Scala | apache-2.0 | 789 |
package co.scriptgeek
import akka.actor.Actor
import spray.routing._
import spray.http._
import spray.http.StatusCodes._
import MediaTypes._
// we don't implement our route structure directly in the service actor because
// we want to be able to test it independently, without having to spin up an actor
class EventSto... | scriptgeeks/eventstore | src/main/scala/co/scriptgeek/EventStoreService.scala | Scala | apache-2.0 | 994 |
import shapes.pimpmylib.{Square, Circle, Shape}
import shapes.untouchable.{Circle => UCircle, Square => USquare}
package object pimpmylib {
implicit def decorateCircle(shape: UCircle): Shape =
Circle(shape.r)
implicit def decorateSquare(shape: USquare): Shape =
Square(shape.a)
}
| tupol/scala-patterns-tc-pml | src/main/scala/shapes/pimpmylib/package.scala | Scala | apache-2.0 | 297 |
/***********************************************************************
* Copyright (c) 2013-2017 Commonwealth Computer Research, Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Apache License, Version 2.0
* which accompanies this distribution and... | ronq/geomesa | geomesa-convert/geomesa-convert-common/src/main/scala/org/locationtech/geomesa/convert/CompositeConverter.scala | Scala | apache-2.0 | 4,231 |
/*
* 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 ... | Mega-DatA-Lab/mxnet | scala-package/examples/src/main/scala/ml/dmlc/mxnetexamples/customop/ExampleCustomOp.scala | Scala | apache-2.0 | 8,095 |
/*
* 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 ... | hhbyyh/spark | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/Statistics.scala | Scala | apache-2.0 | 8,491 |
object Test extends App {
t
def t: Unit = {
val c1 = C1()(1)
println(c1.copy()(2))
{
implicit val i = 2873
println(c1.copy())
}
val c2 = C2()(1)
println(c2.copy()(37))
val c3 = C3(1,2)(3)
println(c3.copy()(27))
println(c3.copy(y = 22)(27))
println(c3.copy(y = ... | lrytz/scala | test/files/run/t5907.scala | Scala | apache-2.0 | 2,714 |
package org.jetbrains.plugins.scala.failed.typeInference
import org.jetbrains.plugins.scala.PerfCycleTests
import org.jetbrains.plugins.scala.lang.typeConformance.TypeConformanceTestBase
import org.junit.experimental.categories.Category
/**
* @author mucianm
* @since 28.03.16.
*/
@Category(Array(classOf[PerfCy... | jeantil/intellij-scala | test/org/jetbrains/plugins/scala/failed/typeInference/HigherKindedTypesConformanceTest.scala | Scala | apache-2.0 | 1,802 |
package com.mesosphere.cosmos.thirdparty.marathon.circe
import com.mesosphere.cosmos.thirdparty.marathon.model._
import io.circe.Decoder
import io.circe.generic.semiauto._
object Decoders {
implicit val decodeAppId: Decoder[AppId] = Decoder.decodeString.map(AppId(_))
implicit val decodeMarathonApp: Decoder[Marath... | takirala/cosmos | cosmos-common/src/main/scala/com/mesosphere/cosmos/thirdparty/marathon/circe/Decoders.scala | Scala | apache-2.0 | 907 |
package models.customer
import models.AssetSupport.IdType
import models._
import models.common._
import org.joda.time.DateTime
import play.api.libs.json.Json
case class TermsOfPayment(
term: Int,
description: String
)
object TermsOfPay... | tsechov/shoehorn | app/models/customer/customer.scala | Scala | apache-2.0 | 4,982 |
/**
* Copyright (c) 2002-2012 "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 Foundati... | dksaputra/community | cypher/src/main/scala/org/neo4j/cypher/internal/pipes/NamedPathPipe.scala | Scala | gpl-3.0 | 1,455 |
/* __ *\\
** ________ ___ / / ___ __ ____ Scala.js tools **
** / __/ __// _ | / / / _ | __ / // __/ (c) 2014, LAMP/EPFL **
** __\\ \\/ /__/ __ |/ /__/ __ |/_// /_\\ \\ http://scala-js.org/ **
** /____/\\___/... | matthughes/scala-js | tools/shared/src/main/scala/org/scalajs/core/tools/javascript/TreeDSL.scala | Scala | bsd-3-clause | 1,824 |
/*
* Copyright 2008-present MongoDB, 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 a... | rozza/mongo-java-driver | driver-scala/src/it/scala/org/mongodb/scala/syncadapter/SyncMongoIterable.scala | Scala | apache-2.0 | 1,743 |
/**
* 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"); yo... | ErikKringen/kafka | core/src/test/scala/unit/kafka/server/DynamicConfigChangeTest.scala | Scala | apache-2.0 | 12,071 |
/*
* 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/jvm/src/test/scala/monix/reactive/compression/DeflateTestUtils.scala | Scala | apache-2.0 | 2,470 |
/**
* © 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-ws/app/BGMonitorActor.scala | Scala | apache-2.0 | 10,098 |
package io.jfc.cursor
import cats.Functor
import io.jfc.{ Context, ContextElement, Cursor, Json }
private[jfc] case class CArray(
focus: Json,
p: Cursor,
u: Boolean,
ls: List[Json],
rs: List[Json]
) extends Cursor {
def context: Context = ContextElement.arrayContext(focus, ls.length) +: p.context
def u... | non/circe | core/src/main/scala/io/jfc/cursor/CArray.scala | Scala | apache-2.0 | 2,698 |
/*
* Copyright (c) 2014 Snowplow Analytics Ltd. All rights reserved.
*
* This program is licensed to you under the Apache License Version 2.0,
* and you may not use this file except in compliance with the Apache License Version 2.0.
* You may obtain a copy of the Apache License Version 2.0 at http://www.apache.org/lice... | krahman/snowplow | 3-enrich/scala-common-enrich/src/main/scala/com.snowplowanalytics.snowplow.enrich/common/utils/JsonUtils.scala | Scala | apache-2.0 | 9,093 |
/*
* RobolabSim
* Copyright (C) 2014 Max Leuthaeuser
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Thi... | max-leuthaeuser/RobolabSim | server/src/main/scala/tud/robolab/testing/package.scala | Scala | gpl-3.0 | 880 |
package lila.learn
import org.joda.time.DateTime
case class LearnProgress(
_id: LearnProgress.Id,
stages: Map[String, StageProgress],
createdAt: DateTime,
updatedAt: DateTime
) {
def id = _id
def withScore(stage: String, level: Int, s: StageProgress.Score) =
copy(
stages = stages + (
... | luanlv/lila | modules/learn/src/main/LearnProgress.scala | Scala | mit | 675 |
/*
* 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 ... | Sephiroth-Lin/incubator-carbondata | integration/spark2/src/test/scala/org/apache/spark/carbondata/restructure/rowreader/DropColumnTestCases.scala | Scala | apache-2.0 | 4,080 |
package com.lucius.kafka.utils
/**
* 该类中定义的是跟项目的业务无关的一些共用方法。这些方法放入到DateUtils和FileUtils中是不合适的。
* 这些方法必须具有通用性。自己能够用到的,并且其他同事也可能用到的方法。且在未来的项目中也能使用。
*/
object Utils {
/**
* Convert Seq to Tuple
* you can use this method to convert List to Tuple,or Array to Tuple, etc.
* It's worth noting that: toTuple(List(... | zj-lingxin/kafka-fw | src/main/scala/com/lucius/kafka/utils/Utils.scala | Scala | mit | 1,267 |
package dotty.tools
package dotc
package typer
import core._
import ast.{Trees, untpd, tpd, TreeInfo}
import util.Positions._
import util.Stats.track
import Trees.Untyped
import Mode.ImplicitsEnabled
import Contexts._
import Flags._
import Denotations._
import NameOps._
import Symbols._
import Types._
import Decorator... | VladimirNik/dotty | src/dotty/tools/dotc/typer/Applications.scala | Scala | bsd-3-clause | 48,811 |
import org.scalatest.{Matchers, FunSuite}
class RobotTest extends FunSuite with Matchers {
test("create") {
val robot = Robot(Bearing.North, (0, 0))
robot.bearing should equal(Bearing.North)
robot.coordinates should equal((0, 0))
}
test("advance - positive") {
Robot(Bearing.North, (0, 0)).advan... | nlochschmidt/xscala | robot-simulator/src/test/scala/RobotTest.scala | Scala | mit | 1,829 |
package chat.tox.antox.callbacks
import android.app.{Notification, PendingIntent}
import android.content.{Context, Intent}
import android.preference.PreferenceManager
import android.support.v4.app.NotificationCompat
import android.util.Log
import chat.tox.antox.R
import chat.tox.antox.activities.MainActivity
import ch... | gale320/Antox | app/src/main/scala/chat/tox/antox/callbacks/AntoxOnFriendRequestCallback.scala | Scala | gpl-3.0 | 2,124 |
package nz.ubermouse.rsbot.tasks
import nz.ubermouse.rsbot.actions.{ActionContainer, Action}
import nz.ubermouse.rsbot._
abstract class Task(val priority: Int) {
def shouldExecute: Boolean
def execute: ActionContainer
}
| UberMouse/RSArchitectureTest | src/nz/ubermouse/rsbot/tasks/Task.scala | Scala | mit | 226 |
package com.twitter.finagle.mux.util
import org.scalacheck.{Arbitrary, Gen}
import org.scalatest.FunSuite
import org.scalatest.prop.GeneratorDrivenPropertyChecks
class TagMapTest extends FunSuite with GeneratorDrivenPropertyChecks {
val min = 8
val max = 10000
implicit val genTagSet: Arbitrary[Range] =
Ar... | mkhq/finagle | finagle-mux/src/test/scala/com/twitter/finagle/mux/util/TagMapTest.scala | Scala | apache-2.0 | 1,386 |
package com.wordnik.client.model
case class Category (
id: Long,
name: String
)
| jfiala/swagger-spring-demo | user-rest-service-1.0.2/generated-code/scalatra/src/main/scala/com/wordnik/client/model/Category.scala | Scala | apache-2.0 | 91 |
/*
* Copyright 2022 HM Revenue & Customs
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or a... | hmrc/fset-faststream | app/services/onlinetesting/phase2/Phase2TestService.scala | Scala | apache-2.0 | 37,687 |
/*
* bytefrog: a tracing framework for the JVM. For more information
* see http://code-pulse.com/bytefrog
*
* Copyright (C) 2014 Applied Visions - http://securedecisions.avi.com
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
... | secdec/bytefrog-clients | file-api/src/main/scala/com/secdec/bytefrog/fileapi/tracefile/entry/EncounteredMethodsEntry.scala | Scala | apache-2.0 | 2,732 |
package io.iohk.ethereum.db.storage
import akka.util.ByteString
import boopickle.Default.{Pickle, Unpickle}
import io.iohk.ethereum.db.dataSource.DataSource
import io.iohk.ethereum.db.storage.ReceiptStorage._
import io.iohk.ethereum.domain.{Address, SuccessOutcome, _}
import io.iohk.ethereum.utils.ByteUtils.{byteSeque... | input-output-hk/etc-client | src/main/scala/io/iohk/ethereum/db/storage/ReceiptStorage.scala | Scala | mit | 3,082 |
package exercises
import scala.util.Random
import scala.collection.mutable.ArrayBuffer
/**
* Created by aguestuser on 12/31/14.
*/
class Ch03_Arrays {
//1//
// imperative
def make_array(n: Int) : Array[Int] = {
for (item <- new Array[Int](n)) yield Random.nextInt(n)
}
// functional
def make_array_... | aguestuser/hackerschool | scala_for_the_impatient/src/main/scala/exercises/Ch03_Arrays.scala | Scala | gpl-3.0 | 2,086 |
package com.portia.downloader
import com.portia.models._
import com.mongodb.WriteConcern
import com.mongodb.casbah.commons.MongoDBObject
import com.novus.salat.dao.SalatMongoCursor
import org.jsoup.Jsoup
import com.github.nscala_time.time.Imports._
/** A dummy downloader which has a simple job of downloading content ... | duytd/blackspider | src/main/scala/com/portia/downloader/Downloader.scala | Scala | gpl-3.0 | 1,720 |
package org.duffqiu.rest.common
import net.liftweb.json.DefaultFormats
import net.liftweb.json.Serialization.write
object RestUtility {
def asJson(body: AnyRef) = {
//Using Lift
implicit val formats = DefaultFormats
val bodyJsonString = write(body)
bodyJsonString
... | duffqiu/rest-test-dsl | src/main/scala/org/duffqiu/rest/common/RestUtility.scala | Scala | apache-2.0 | 331 |
/***********************************************************************
* 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... | jahhulbert-ccri/geomesa | geomesa-utils/src/main/scala/org/locationtech/geomesa/utils/text/KVPairParser.scala | Scala | apache-2.0 | 1,931 |
package com.cds.learn.chapter5
/**
* Created by chendongsheng5 on 2017/5/27.
*/
import Stream._
trait Stream[+A] {
// The natural recursive solution
def toListRecursive: List[A] = this match {
case Cons(h,t) => h() :: t().toListRecursive
case _ => List()
}
/*
The above solution will stack overf... | anancds/scala-project | fpis/src/main/scala/com/cds/learn/chapter5/Stream.scala | Scala | mit | 9,246 |
package models
case class Ladder(id: Int,
name: String,
domain: String,
creator: String,
created: Int,
active: Boolean)
case class LadderInput(name: String)
| yzernik/office-ladder | client/src/main/scala/models/Ladder.scala | Scala | mit | 249 |
package com.sksamuel.elastic4s.searches
import com.sksamuel.elastic4s.get.HitField
import org.elasticsearch.search.SearchHitField
import scala.collection.JavaConverters._
case class RichSearchHitField(java: SearchHitField) extends HitField {
override def name: String = java.name()
override def value: AnyRef = ja... | FabienPennequin/elastic4s | elastic4s-tcp/src/main/scala/com/sksamuel/elastic4s/searches/RichSearchHitField.scala | Scala | apache-2.0 | 697 |
/*
* Copyright 2015 herd contributors
*
* 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 ... | FINRAOS/herd | herd-code/herd-tools/herd-spark-data-source/src/test/scala/org/apache/spark/sql/herd/HerdOptionsSuite.scala | Scala | apache-2.0 | 6,210 |
package org.jetbrains.plugins.scala
package lang
package psi
package impl
package base
package types
import com.intellij.lang.ASTNode
import com.intellij.openapi.progress.ProgressManager
import com.intellij.psi._
import com.intellij.psi.util.PsiTreeUtil.getContextOfType
import org.jetbrains.plugins.scala.extensions._
... | whorbowicz/intellij-scala | src/org/jetbrains/plugins/scala/lang/psi/impl/base/types/ScSimpleTypeElementImpl.scala | Scala | apache-2.0 | 20,747 |
package io.byzantium
/**
* @author Scott Mansfield
*/
package object importers {
}
| ScottMansfield/byzantium | src/main/scala/io/byzantium/importers/package.scala | Scala | apache-2.0 | 89 |
package org.dsa.iot.ignition.spark
import com.ignition.frame.ReduceOp.ReduceOp
import com.ignition.frame.SparkRuntime
import org.dsa.iot.scala.Having
/**
* Performs reduceByKey() function by grouping the rows by the selected key first, and then
* applying a list of reduce functions to the specified data columns.
... | IOT-DSA/dslink-scala-ignition | src/main/scala/org/dsa/iot/ignition/spark/Reduce.scala | Scala | apache-2.0 | 1,287 |
import leon.lang._
object Overflow4 {
def foo4(x: Int): Int = {
x - (-1)
}
}
| epfl-lara/leon | src/test/resources/regression/verification/overflow/invalid/Overflow4.scala | Scala | gpl-3.0 | 88 |
package com.softwaremill.codebrag.rest
import com.softwaremill.codebrag.CodebragServletSpec
import com.softwaremill.codebrag.domain.UserWatchedBranch
import com.softwaremill.codebrag.service.user.RegisterService
import com.softwaremill.codebrag.usecases.branches.WatchedBranchForm
import com.softwaremill.codebrag.useca... | frodejohansen/codebrag | codebrag-rest/src/test/scala/com/softwaremill/codebrag/rest/RegistrationServletSpec.scala | Scala | agpl-3.0 | 4,823 |
/*
* Copyright 2016 The BigDL Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agr... | intel-analytics/BigDL | scala/dllib/src/main/scala/com/intel/analytics/bigdl/dllib/optim/PrecisionRecallAUC.scala | Scala | apache-2.0 | 3,031 |
import akka.actor.{ActorSystem, Props}
import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.Future
import scala.util.{Failure, Success}
/**
* Created by huanwuji on 2017/3/26.
*/
object FutureExample extends App {
val system = ActorSystem()
system.actorOf(Props().withDispatcher("b... | huanwuji/akka-stream-in-action | src/main/scala/FutureExample.scala | Scala | apache-2.0 | 493 |
/*
*
* o o o o o
* | o | |\\ /| | /
* | o-o o--o o-o oo | | O | oo o-o OO o-o o o
* | | | | | | | | | | | | | | | | \\ | | \\ /
* O---oo-o o--O | o-o o-o-o o o o-o-o o o o-o o
* |
... | anskarl/LoMRF | src/main/scala/lomrf/util/ArrayUtils.scala | Scala | apache-2.0 | 3,357 |
package com.thoughtworks.datacommons.prepbuddy.normalizers
import com.thoughtworks.datacommons.prepbuddy.rdds.TransformableRDD
import org.apache.spark.rdd.RDD
/**
* A normalizer strategy which normalizes the data by multiplying it to pow(10,i-1).
* where i is the length of the number.
*/
class DecimalScalingNor... | data-commons/prep-buddy | src/main/scala/com/thoughtworks/datacommons/prepbuddy/normalizers/DecimalScalingNormalizer.scala | Scala | apache-2.0 | 779 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | ahnqirage/spark | mllib/src/main/scala/org/apache/spark/ml/classification/GBTClassifier.scala | Scala | apache-2.0 | 17,176 |
package models.quiz
import com.artclod.slick.NumericBoolean
import models.support.HasOrder
import models.user.User
import models.{QuestionId, QuestionPartId, QuestionSectionId}
import play.twirl.api.Html
import models.quiz.UserConstant.EnhancedHtml
case class QuestionPartChoice(id: QuestionPartId, sectionId: Question... | kristiankime/calc-tutor | app/models/quiz/QuestionPartChoice.scala | Scala | mit | 676 |
package org.scalex
package document
import scala._
object ScaladocUrl {
def apply(doc: Doc): Option[String] = doc match {
case x: Template ⇒ apply(x.member, x.typeParams)
case x: Def ⇒ apply(x.member, x.typeParams)
case x: Val ⇒ apply(x.member, Nil)
}
// http://www.scala-lang.org/api/2.1... | kzys/scalex | src/main/scala/document/ScaladocUrl.scala | Scala | mit | 765 |
package com.github.mehmetakiftutuncu.errors
import com.github.mehmetakiftutuncu.errors.base.ErrorBase
/**
* A simple error implementation for really simple and trivial cases
*
* @param name Name of the error
*
* @author Mehmet Akif Tütüncü
*/
case class SimpleError(name: String) extends ErrorBase {
/**
... | mehmetakiftutuncu/Errors | src/main/scala/com/github/mehmetakiftutuncu/errors/SimpleError.scala | Scala | mit | 1,459 |
/*
* Copyright 2015 Johannes Rudolph
*
* 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 applicab... | jrudolph/sbt-dependency-graph | src/main/scala/net/virtualvoid/sbt/graph/rendering/AsciiTree.scala | Scala | apache-2.0 | 1,357 |
/*
* Copyright (c) 2012-2014 Snowplow Analytics Ltd. All rights reserved.
*
* This program is licensed to you under the Apache License Version 2.0,
* and you may not use this file except in compliance with the Apache License Version 2.0.
* You may obtain a copy of the Apache License Version 2.0 at http://www.apach... | krahman/snowplow | 3-enrich/scala-common-enrich/src/test/scala/com.snowplowanalytics.snowplow.enrich.common/adapters/registry/MailchimpAdapterSpec.scala | Scala | apache-2.0 | 13,129 |
package coltfred.jsongenerator
import scalaz._, Scalaz._
import argonaut.DecodeJson
/**
* A graph is a root variable which is some number of Variables that could be
* chosen as the starting point of traversal. This is separate from adjacencyList
* because the outside caller needs to know the possible starting plac... | coltfred/jsongenerator | src/main/scala/coltfred/jsongenerator/Graph.scala | Scala | apache-2.0 | 2,578 |
import org.scalacheck.Properties
import org.scalacheck.Prop.forAll
import scalautil._
object PredicateTest extends Properties("Predicate"){
property("apply") = forAll{ (p: Int => Boolean, i: Int) =>
Predicate(p)(i) == p(i)
}
property("map") = forAll{ (p: Int => Boolean, f: Boolean => Boolean, i: Int) =>
Predi... | morikuni/scalautil | src/test/scala/PredicateTest.scala | Scala | apache-2.0 | 1,409 |
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.