code stringlengths 5 1M | repo_name stringlengths 5 109 | path stringlengths 6 208 | language stringclasses 1
value | license stringclasses 15
values | size int64 5 1M |
|---|---|---|---|---|---|
package com.thoughtworks.deeplearning.plugins
/** A plugin that automatically names [[Layer]]s and [[Weight]]s.
*
* @author 杨博 (Yang Bo)
*/
trait Names {
trait DifferentiableApi {
def fullName: sourcecode.FullName
def name: sourcecode.Name
override def toString: String = {
raw"""Weight[full... | ThoughtWorksInc/DeepLearning.scala | plugins-Names/src/main/scala/com/thoughtworks/deeplearning/plugins/Names.scala | Scala | apache-2.0 | 408 |
package pl.writeonly.son2.vaadin.util
object JavaFunctions {
implicit def scalaFunctionToJavaFunction[From, To](function: (From) => To): java.util.function.Function[From, To] = {
new java.util.function.Function[From, To] {
override def apply(input: From): To = function(input)
}
}
}
| writeonly/scalare | scalare-adin/src/main/scala/pl/writeonly/son2/vaadin/util/JavaFunctions.scala | Scala | artistic-2.0 | 303 |
package com.youdevise.albatross
import org.specs2.Specification
import Bounds._
class BoundSpec extends Specification {
def is =
openUpperBound ^
closedUpperBound ^
openLowerBound ^
closedLowerBound ^
leastUpperBound ^
greatestLowerBound ^
leastLowerBound ^
greatestUpperBound ^ end
def openUpper... | tim-group/albatross | src/test/scala/BoundSpec.scala | Scala | mit | 5,574 |
/*
* Copyright 2017 TWO SIGMA OPEN SOURCE, LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by appl... | jpallas/beakerx | kernel/scala/src/main/scala/com/twosigma/beakerx/scala/chart/xychart/plotitem/Area.scala | Scala | apache-2.0 | 1,126 |
/*
* 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/SuiteExamples.scala | Scala | apache-2.0 | 2,384 |
package services
import securesocial.core.RuntimeEnvironment
import securesocial.core.services.UserService
import securesocial.core.providers._
import scala.collection.immutable.ListMap
/**
* see https://github.com/jaliss/securesocial/blob/master/module-code/app/securesocial/core/RuntimeEnvironment.scala
*/
class... | janih/play-java-securesocial | app/services/MyEnvironment.scala | Scala | apache-2.0 | 778 |
object HelloWorld {
def main(args: Array[String]) =
println("Hello World!")
}
| Artie18/remembering_scala | hello_world/src/main/scala/HelloWorld.scala | Scala | mpl-2.0 | 84 |
/*
* Copyright (C) Lightbend Inc. <https://www.lightbend.com>
*/
package com.lightbend.lagom.internal.cluster
import akka.actor.ActorRef
import akka.actor.Address
import akka.cluster.Cluster
import akka.cluster.MemberStatus
import akka.remote.testconductor.RoleName
import akka.remote.testkit.MultiNodeSpec
import ak... | lagom/lagom | cluster/core/src/multi-jvm/scala/com/lightbend/lagom/internal/cluster/ClusteredMultiNodeUtils.scala | Scala | apache-2.0 | 1,433 |
package com.github.agourlay.cornichon.steps.wrapped
import java.util.concurrent.atomic.AtomicReference
import java.util.function.UnaryOperator
import com.github.agourlay.cornichon.core._
import com.github.agourlay.cornichon.steps.cats.EffectStep
import com.github.agourlay.cornichon.testHelpers.CommonTestSuite
import m... | agourlay/cornichon | cornichon-core/src/test/scala/com/github/agourlay/cornichon/steps/wrapped/ScenarioResourceStepSpec.scala | Scala | apache-2.0 | 5,827 |
/*
* 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 ... | tzulitai/flink | flink-table/flink-table-planner-blink/src/test/scala/org/apache/flink/table/planner/plan/stream/sql/DagOptimizationTest.scala | Scala | apache-2.0 | 27,665 |
/**
* 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... | airbnb/kafka | core/src/test/scala/unit/kafka/log/LogCleanerTest.scala | Scala | apache-2.0 | 53,074 |
/*
* Copyright 2015 - 2016 Red Bull Media House GmbH <http://www.redbullmediahouse.com> - 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... | ianclegg/eventuate | eventuate-crdt/src/it/scala/com/rbmhtechnology/eventuate/crdt/CRDTServiceSpecLeveldb.scala | Scala | apache-2.0 | 5,722 |
package mesosphere.marathon
package stream
import akka.actor.{ ActorRef, Props, Status }
import akka.{ Done, NotUsed }
import akka.stream.{ Graph, SinkShape, UniformFanOutShape }
import akka.stream.scaladsl.{ SinkQueueWithCancel, Sink => AkkaSink }
import org.reactivestreams.{ Publisher, Subscriber }
import scala.col... | natemurthy/marathon | src/main/scala/mesosphere/marathon/stream/Sink.scala | Scala | apache-2.0 | 3,307 |
/***********************************************************************
* 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-index-api/src/main/scala/org/locationtech/geomesa/index/conf/ColumnGroups.scala | Scala | apache-2.0 | 5,122 |
//
// SupportForDOrc.scala -- Scala class SupportForDOrc
// Project OrcScala
//
// Created by jthywiss on Dec 21, 2015.
//
// Copyright (c) 2017 The University of Texas at Austin. All rights reserved.
//
// Use and redistribution of this file is governed by the license terms in
// the LICENSE file found in the project'... | orc-lang/orc | OrcScala/src/orc/run/extensions/SupportForDOrc.scala | Scala | bsd-3-clause | 612 |
package com.ml
abstract class FitnessEval{
//returns scale of output values
val range: Double
//the size of input vectors associated with this function
val inputCount: Int
//the size of expected output vectors
val outputCount: Int
//returns fitness of given function
def apply(func: Seq[... | BrettAM/EvComp | src/main/scala/ml/FitnessEval.scala | Scala | apache-2.0 | 355 |
package com.rackspace.prefs.model
import com.mchange.v2.c3p0.ComboPooledDataSource
import com.rackspace.prefs.model.DBTables._
import scala.slick.driver.JdbcDriver.simple._
import scala.slick.jdbc.JdbcBackend.Database
import org.joda.time.DateTime
import scala.io.Source
trait InitDbTrait {
/**
* When you ru... | fred5156/preferences-service | app/src/test/scala/com/rackspace/prefs/model/InitDbTrait.scala | Scala | apache-2.0 | 2,638 |
package com.shorrockin.narrator
import java.io.Serializable
import collection.mutable.HashMap
import utils.Logging
object ActionStats extends Logging {
}
/**
* holds statistics related to the operation of an action
*
* @author Chris Shorrock
*/
@SerialVersionUID(1L) class ActionStats(val descriptio... | shorrockin/narrator | src/main/scala/ActionStats.scala | Scala | apache-2.0 | 4,678 |
package io.finch
import cats.Eq
import cats.instances.AllInstances
import cats.laws._
import cats.laws.discipline._
import org.scalacheck.{Arbitrary, Prop}
import org.typelevel.discipline.Laws
trait DecodePathLaws[A] extends Laws with MissingInstances with AllInstances {
def capture: DecodePath[A]
def roundTrip... | yanana/finch | core/src/test/scala/io/finch/DecodePathLaws.scala | Scala | apache-2.0 | 712 |
package ozmi.lambda_core
package lib
import org.kiama.rewriting.Rewriter._
object Integer extends TypeInstance {
import Eq._
import Ord._
import Num._
override lazy val evalRules =
rule[Expr] {
// Eq
case Equal (Literal (a : BigInt), Literal (b : BigInt)) if (a co... | ozmi/lambda_core | src/main/scala/ozmi/lambda_core/lib/Integer.scala | Scala | mit | 1,152 |
package dreamer.context
import scala.util.Random
import scala.collection.GenTraversableOnce
import scalaz._, Scalaz._
import util.forked._, ForkedState._
import dreamer.concept._
import util.Util._
import Concept._
import Relation._
case class Context(
val mind: MentalMap,
val r: Random=new Random,
val re... | tcoxon/dreamer | src/dreamer/context.scala | Scala | mit | 9,363 |
package jp.ac.nagoya_u.dsmoq.sdk.request.json
private[request] case class SetGuestAccessLevelJson(accessLevel: Int) extends Jsonable
| nkawa/dsmoq | sdk/src/main/java/jp/ac/nagoya_u/dsmoq/sdk/request/json/SetGuestAccessLevelJson.scala | Scala | apache-2.0 | 134 |
/*
* 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 ... | publicRoman/spark | resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s/submit/submitsteps/BaseDriverConfigurationStep.scala | Scala | apache-2.0 | 6,363 |
package org.jetbrains.plugins.scala.lang.dfa.analysis.tests
import org.jetbrains.plugins.scala.lang.dfa.Messages.{ConditionAlwaysFalse, ConditionAlwaysTrue, InvocationIndexOutOfBounds}
import org.jetbrains.plugins.scala.lang.dfa.analysis.ScalaDfaTestBase
class ReferenceExpressionsDfaTest extends ScalaDfaTestBase {
... | JetBrains/intellij-scala | scala/scala-impl/test/org/jetbrains/plugins/scala/lang/dfa/analysis/tests/ReferenceExpressionsDfaTest.scala | Scala | apache-2.0 | 3,081 |
/*
* 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 ... | sh-cho/cshSpark | deploy/master/MasterArguments.scala | Scala | apache-2.0 | 3,657 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | kevinyu98/spark | sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/orc/OrcScan.scala | Scala | apache-2.0 | 2,986 |
//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
/** @author John Miller
* @builder scalation.linalgebra.mem_mapped.bld.BldMatri
* @version 1.2
* @date Mon Sep 28 11:18:16 EDT 2015
* @see LICENSE (MIT style license file).
*/
package scalation.linalgebra.mem_mapped
imp... | NBKlepp/fda | scalation_1.2/src/main/scala/scalation/linalgebra/mem_mapped/MatriD.scala | Scala | mit | 31,282 |
/*
* 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/model/PassMarkSettingsCreateResponse.scala | Scala | apache-2.0 | 1,157 |
import scala.tools.partest._
// a cold run of partest takes about 15s for this test on my laptop
object Test extends DirectTest {
def s(n: Int) = "\\""+n+"\\""
override def code
= s"""
|class BigEnoughToFail {
| def m(a: String, b: String, c: String, d: String, e: String, f: String) = null
... | lrytz/scala | test/files/run/large_class.scala | Scala | apache-2.0 | 807 |
/*
* 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 ... | shaneknapp/spark | sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/orc/OrcUtils.scala | Scala | apache-2.0 | 23,219 |
package s99.p12
// P12 (**) Decode a run-length encoded list.
// Given a run-length code list generated as specified in problem P10,
// construct its uncompressed version.
//
// Example:
// scala> decode(List((4, 'a), (1, 'b), (2, 'c), (2, 'a), (1, 'd), (4, 'e)))
// res0: List[Symbol] = List('a, 'a... | izmailoff/scala-s-99 | src/main/scala/s99/p12/P12Answer.scala | Scala | apache-2.0 | 534 |
package com.cloudwick.generator.osge
import ch.qos.logback.classic.{Level, Logger}
import com.cloudwick.generator.utils.LazyLogging
import org.slf4j.LoggerFactory
/**
* Log events generator driver
* @author ashrith
*/
object Driver extends App with LazyLogging {
private val root = LoggerFactory.getLogger(org.slf... | Arpit1286/generator | src/main/scala/com/cloudwick/generator/osge/Driver.scala | Scala | apache-2.0 | 3,599 |
package scorex.transaction
import com.google.common.primitives.{Bytes, Ints, Longs}
import play.api.libs.json.{JsObject, Json}
import scorex.account.Account
import scorex.crypto.encode.Base58
import scorex.crypto.hash.FastCryptographicHash._
import scorex.serialization.Deser
import scorex.transaction.LagonakiTransacti... | ScorexProject/Scorex-Lagonaki | scorex-transaction/src/main/scala/scorex/transaction/GenesisTransaction.scala | Scala | cc0-1.0 | 4,551 |
/*
* 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 ... | big-pegasus/spark | core/src/main/scala/org/apache/spark/memory/ExecutionMemoryPool.scala | Scala | apache-2.0 | 8,448 |
/*
* 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 ... | wangmiao1981/spark | resource-managers/yarn/src/main/scala/org/apache/spark/deploy/yarn/Client.scala | Scala | apache-2.0 | 71,946 |
/*
* Accio is a platform to launch computer science experiments.
* Copyright (C) 2016-2018 Vincent Primault <[email protected]>
*
* Accio is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version... | privamov/accio | accio/java/fr/cnrs/liris/locapriv/ops/EnforceSizeOp.scala | Scala | gpl-3.0 | 1,711 |
package models.job
import java.sql.Timestamp
import akka.actor.ActorSystem
import com.scalableminds.util.accesscontext.{DBAccessContext, GlobalAccessContext}
import com.scalableminds.util.geometry.BoundingBox
import com.scalableminds.util.mvc.Formatter
import com.scalableminds.util.tools.{Fox, FoxImplicits}
import com... | scalableminds/webknossos | app/models/job/Job.scala | Scala | agpl-3.0 | 14,998 |
/*
* Copyright 2018 CJWW Development
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agree... | cjww-development/auth-microservice | it/utils/IntegrationStubbing.scala | Scala | apache-2.0 | 1,651 |
package com.equalinformation.poc.akka
import org.junit._
import Assert._
@Test
class AppTest {
@Test
def testOK() = assertTrue(true)
// @Test
// def testKO() = assertTrue(false)
}
| bpupadhyaya/AkkaPOCMaven | src/test/scala/com/equalinformation/poc/akka/AppTest.scala | Scala | mit | 201 |
package scscene
import java.awt.{ Paint, Font, Composite, Shape, Graphics2D }
import scgeom._
case class TextFigure(
clip:Option[Clip],
transform:SgAffineTransform,
composite:Composite,
paint:Paint,
font:Font,
text:String
) extends Figure {
private val layout = ShapeUtil textLayout (text, font)
private ... | ritschwumm/scscene | src/main/scala/scscene/TextFigure.scala | Scala | bsd-2-clause | 1,079 |
/*
* 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 ... | niketanpansare/incubator-systemml | src/main/scala/org/apache/sysml/api/ml/serving/BatchingUtils.scala | Scala | apache-2.0 | 2,355 |
val b = new { val a = Vector(3,6,7) }
val c = b a 2
/*start*/c/*end*/
//Int | LPTK/intellij-scala | testdata/typeInference/bugs5/SCL4482.scala | Scala | apache-2.0 | 75 |
package org.jetbrains.plugins.scala
package codeInspection
package packageNameInspection
import com.intellij.codeInspection._
import com.intellij.openapi.project.Project
import com.intellij.psi.PsiFile
import org.jetbrains.plugins.scala.extensions.ObjectExt
import org.jetbrains.plugins.scala.lang.psi.api.ScalaFile
imp... | whorbowicz/intellij-scala | src/org/jetbrains/plugins/scala/codeInspection/packageNameInspection/ChainedPackageInspection.scala | Scala | apache-2.0 | 1,921 |
// Copyright 2014 Commonwealth Bank of Australia
//
// 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... | toddmowen/maestro | maestro-macros/src/test/scala/au/com/cba/omnia/maestro/macros/TagMacroSpec.scala | Scala | apache-2.0 | 1,895 |
import scalajs.js
import angulate2._
//@Injectable
class FriendsService {
val names = js.Array("Aarav","Martín","Shannon","Ariana","Kai")
}
@Component(
selector = "display",
template = """<p>My name: {{ myName }}</p>
<p>Friends:</p>
<ul>
<li *ngFor="let name of... | jokade/angulate2-examples | archive/02_displayData/src/main/scala/main.scala | Scala | mit | 658 |
package pe.ambivalenta.rsslib
trait iTunes{
val subtitle : String
val summary : String
val author : String
val imageURL : String
val duration : Int
}
case class Pod(title:String, url:String)
| AmbivalentApe/rsslib | src/main/scala/rss/podcast.scala | Scala | mit | 204 |
/*
* 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 ... | techaddict/spark | sql/core/src/main/scala/org/apache/spark/sql/execution/DataSourceScanExec.scala | Scala | apache-2.0 | 19,309 |
package com.roundeights.isred
/**
* Supported bitwise operations
*/
object BitwiseOp extends Enumeration {
type Op = Value
val AND = Value("AND")
val OR = Value("OR")
val XOR = Value("XOR")
val NOT = Value("NOT")
}
/**
* Methods for interacting with Redis Strings
*/
trait Strings extends Ifac... | Nycto/IsRed | src/main/scala/IsRed/iface/Strings.scala | Scala | mit | 4,436 |
/***********************************************************************
* Copyright (c) 2013-2015 Commonwealth Computer Research, Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Apache License, Version 2.0 which
* accompanies this distribution and is ... | mcharles/geomesa | geomesa-tools/src/main/scala/org/locationtech/geomesa/tools/FeatureCreator.scala | Scala | apache-2.0 | 2,753 |
package org.cmt
object Main {
def main(args: Array[String]): Unit = {
println("Hello world!")
val a = 5
val b = 7
println(s"$a + $b = ${Math.add(a, b)}")
}
}
| lightbend-training/course-management-tools | course-templates/scala-cmt-template-no-common/step_000_initial_state/src/main/scala/org/cmt/Main.scala | Scala | apache-2.0 | 182 |
package software.egger.jirapaymosync
import com.atlassian.jira.rest.client.api.domain.Issue
import software.egger.jirapaymosync.paymo.Task
import scala.language.implicitConversions
object TaskIssueImplicits
{
implicit def issuesToTaskListMatcher(jiraIssues: Iterable[Issue]): TaskListMatcher =
new TaskListMatche... | eggeral/jira-paymo-sync | src/main/scala/software/egger/jirapaymosync/TaskIssueImplicits.scala | Scala | apache-2.0 | 436 |
/*
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 use this f... | transcendent-ai-labs/DynaML | dynaml-core/src/main/scala/io/github/mandar2812/dynaml/algebra/PartitionedMatrixOps.scala | Scala | apache-2.0 | 14,577 |
package me.heaton.implicits
object FunctionImp {
sealed trait Countable[T] {
def count(t: T): Int
}
def getLarge[T](a: T, b: T)(implicit countable: Countable[T]) =
if(countable.count(a) > countable.count(b)) a
else b
implicit lazy val stringCounter = new Countable[String] {
def count(t: Stri... | heaton/hello-scala | src/main/scala/me/heaton/implicits/FunctionImp.scala | Scala | mit | 448 |
/*
* 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 ... | ddna1021/spark | sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/WriteToDataSourceV2.scala | Scala | apache-2.0 | 6,760 |
package io.mth.lever
import java.io.InputStream
object LeverPipe {
def pipe(in: InputStream, writable: {def write(b: Array[Byte], offset: Int, length: Int): Int}, buffersize: Int) = {
val buffer = new Array[Byte](buffersize)
Iterator.continually(in.read(buffer, 0, buffer.length)).
takeWhile(... | markhibberd/lever | src/prod/io/mth/lever/LeverPipe.scala | Scala | bsd-3-clause | 390 |
package com.spr.scala.impl
import com.spr.scala.Bag
/**
* Demonstrates using `ArrayOps` implicit conversions with collection functions. Essentially, this shows off how to
* both implement our `Bag` trait using an array as well as how we can automatically convert arrays into a collection
* type that provides a m... | jvz/scala-for-java | src/main/scala/com/spr/scala/impl/ImplicitArrayBag.scala | Scala | apache-2.0 | 1,943 |
package au.com.dius.pact.consumer
import org.specs2.mutable.Specification
import au.com.dius.pact.consumer.Fixtures._
import au.com.dius.pact.model._
import scala.concurrent.duration.FiniteDuration
import org.json4s.JsonAST.{JField, JString, JObject}
import org.json4s.jackson.JsonMethods._
import scala.concurrent.Exec... | caoquendo/pact-jvm | pact-jvm-consumer/src/test/scala/au/com/dius/pact/consumer/MockProviderSpec.scala | Scala | apache-2.0 | 3,271 |
package ucesoft.cbm.cpu
import ucesoft.cbm.ChipID.ID
import ucesoft.cbm.trace.{BreakType, CpuStepInfo, NoBreak, TraceListener}
import ucesoft.cbm.{Chip, ChipID, Log}
import scala.language.implicitConversions
import java.io.PrintWriter
import java.io.ObjectOutputStream
import java.io.ObjectInputStream
import java.util... | abbruzze/kernal64 | Kernal64/src/ucesoft/cbm/cpu/Z80.scala | Scala | mit | 128,691 |
package org.moe.runtime
import scala.collection.mutable.{HashMap,Map}
import org.moe.runtime.nativeobjects.MoePairObject
class MoeSignature(
private val params: List[MoeParameter] = List()
) extends MoeObject {
lazy val arity = params.length
lazy val namedParameterMap: Map[String,MoeParameter] = Map(
... | MoeOrganization/moe | src/main/scala/org/moe/runtime/MoeSignature.scala | Scala | mit | 3,061 |
/**
*
* Copyright (C) 2017 University of Bamberg, Software Technologies Research Group
* <https://www.uni-bamberg.de/>, <http://www.swt-bamberg.de/>
*
* This file is part of the Data Structure Investigator (DSI) project, which received financial support by the
* German Research Foundation (DFG) under grant no. L... | uniba-swt/DSIsrc | src/entrypoint/DsOliEPT.scala | Scala | gpl-3.0 | 3,520 |
object Test:
extension [A](a: A) def render: String = "Hi"
extension [B](b: B) def render(using DummyImplicit): Char = 'x'
val test = {
42.render // error
Test.render(42) // error
}
| lampepfl/dotty | tests/neg/i6183.scala | Scala | apache-2.0 | 199 |
/*
* 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/datasources/v2/DistributionAndOrderingUtils.scala | Scala | apache-2.0 | 3,065 |
/*
* Copyright (C) 2009-2017 Lightbend Inc. <https://www.lightbend.com>
*/
package play.routes.compiler
import java.io.File
import java.nio.charset.Charset
import org.apache.commons.io.FileUtils
import scala.util.parsing.combinator._
import scala.util.parsing.input._
import scala.language.postfixOps
object Routes... | ktoso/playframework | framework/src/routes-compiler/src/main/scala/play/routes/compiler/RoutesFileParser.scala | Scala | apache-2.0 | 12,137 |
/*
* Copyright (C) 2009-2018 Lightbend Inc. <https://www.lightbend.com>
*/
package play.api.inject
import java.util.concurrent.Executor
import javax.inject.{ Inject, Provider, Singleton }
import akka.actor.{ ActorSystem, CoordinatedShutdown }
import akka.stream.Materializer
import com.typesafe.config.Config
import... | Shenker93/playframework | framework/src/play/src/main/scala/play/api/inject/BuiltinModule.scala | Scala | apache-2.0 | 5,511 |
/**
* 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... | darroyocazorla/spark-mongodb | spark-mongodb/src/main/scala/com/stratio/datasource/mongodb/writer/MongodbSimpleWriter.scala | Scala | apache-2.0 | 1,105 |
/*
* Copyright 2016 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... | ahudspith-equalexperts/ct-calculations | src/main/scala/uk/gov/hmrc/ct/ct600a/v2/A8.scala | Scala | apache-2.0 | 1,367 |
package io.iohk.ethereum.consensus.validators.std
import akka.util.ByteString
import io.iohk.ethereum.consensus.ethash.blocks.OmmersSeqEnc
import io.iohk.ethereum.consensus.validators.BlockValidator
import io.iohk.ethereum.crypto._
import io.iohk.ethereum.domain.{Block, BlockBody, BlockHeader, Receipt, SignedTransacti... | input-output-hk/etc-client | src/main/scala/io/iohk/ethereum/consensus/validators/std/StdBlockValidator.scala | Scala | mit | 7,308 |
package org.deepdive.inference
import org.deepdive.settings.FactorFunctionVariable
import org.deepdive.calibration._
import org.deepdive.settings._
import java.io.File
trait InferenceDataStore {
/* Initializes the data store. This method must be called before any other methods in this class. */
def init() :... | gaapt/deepdive | src/main/scala/org/deepdive/inference/datastore/InferenceDataStore.scala | Scala | apache-2.0 | 2,219 |
package com.cloudera.ds.svdbench
import org.apache.mahout.math.VectorWritable
import org.scalatest.ShouldMatchers
class TestGenerateMatrix extends SparkTestUtils with ShouldMatchers {
def countNonZero(vector: VectorWritable) = {
vector.get().getNumNonZeroElements
}
sparkTest("Test Generate Matrix. ") {
... | jhlch/svd-benchmark | src/test/scala/com/cloudera/ds/svdbench/TestGenerateMatrix.scala | Scala | apache-2.0 | 695 |
package kornell.server
import java.io.{File, FileInputStream, InputStream}
import java.util.{HashMap, UUID}
import kornell.server.jdbc.repository.{CourseClassRepo, CourseRepo}
import kornell.server.report.ReportCourseClassGenerator.getClass
import kornell.server.util.Settings
import net.sf.jasperreports.engine._
impo... | Craftware/Kornell | kornell-api/src/main/scala/kornell/server/report/package.scala | Scala | apache-2.0 | 3,130 |
/*
* Copyright 2016-2020 47 Degrees Open Source <https://www.47deg.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 ... | 47deg/github4s | github4s/src/test/scala/github4s/integration/ReposSpec.scala | Scala | apache-2.0 | 15,609 |
package com.weibo.datasys
import akka.actor.{ ActorSystem, Props, _ }
import akka.io.IO
import akka.util.Timeout
import com.weibo.datasys.rest.Configuration
import spray.can.Http
import scala.concurrent.duration._
/**
* Created by tuoyu on 25/01/2017.
*/
object Main
extends Configuration {
def main(args: Arr... | batizty/wolong | src/main/scala/com/weibo/datasys/Main.scala | Scala | apache-2.0 | 1,268 |
/*
* Part of GDL book_api.
* Copyright (C) 2018 Global Digital Library
*
* See LICENSE
*/
package io.digitallibrary.bookapi.repository
import java.sql.PreparedStatement
import io.digitallibrary.language.model.LanguageTag
import io.digitallibrary.bookapi.model.api.OptimisticLockException
import io.digitallibrary... | GlobalDigitalLibraryio/book-api | src/main/scala/io/digitallibrary/bookapi/repository/InTranslationRepository.scala | Scala | apache-2.0 | 4,135 |
/**
* Copyright (C) 2011 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... | ajw625/orbeon-forms | src/main/scala/org/orbeon/oxf/xforms/xbl/XBLBindings.scala | Scala | lgpl-2.1 | 18,606 |
import sbt._
import sbt.Keys._
object PurfuncorBuild extends Build {
lazy val purfuncor = Project(
id = "purfuncor",
base = file("."),
settings = Project.defaultSettings ++ Seq(
name := "Purfuncor",
organization := "pl.luckboy.purfuncor",
version := "0.1.1",
scalaVersion := "2.10... | luckboy/Purfuncor | project/PurfuncorBuild.scala | Scala | mpl-2.0 | 2,755 |
/**
* Copyright (c) 2014-2016 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
... | TimothyKlim/snowplow | 4-storage/kafka-elasticsearch-sink/src/main/scala/com/snowplowanalytics/snowplow/storage/Transformer.scala | Scala | apache-2.0 | 11,902 |
package parsing.ir.normalized
import parsing.ir.homo.Token
/**
* Created by hongdi.ren.
*/
object ExprNodeTest extends App {
val plus = Token(Token.PLUS, "+")
val one = Token(Token.INT, "1")
val two = Token(Token.INT, "2")
val root = AddNode(IntNode(one), plus, IntNode(two))
println(root.treeString())... | Ryan-Git/LangImplPatterns | src/test/scala/parsing/ir/normalized/ExprNodeTest.scala | Scala | apache-2.0 | 323 |
/*
* Artificial Intelligence for Humans
* Volume 2: Nature Inspired Algorithms
* Java Version
* http://www.aifh.org
* http://www.jeffheaton.com
*
* Code repository:
* https://github.com/jeffheaton/aifh
*
* Copyright 2014 by Jeff Heaton
*
* Licensed under the Apache License, Version 2.0 (the "License");
* y... | PeterLauris/aifh | vol2/vol2-scala-examples/src/main/scala/com/heatonresearch/aifh/evolutionary/sort/GenomeComparator.scala | Scala | apache-2.0 | 2,527 |
package models;
import scala.collection.immutable
object PaypalCountry {
val map = immutable.Map[CountryCode, String](
CountryCode.JPN -> "JP"
)
def apply(cc: CountryCode): Option[String] = map.get(cc)
}
| ruimo/store2 | app/models/PaypalCountry.scala | Scala | apache-2.0 | 217 |
package com.github.reikje
import com.github.reikje.specifiers._
import scala.collection.mutable
/**
* [[com.github.reikje.PrintfStringOps]] adds a new method '''formatx''' to the String class via implicit conversions.
*
* @author rschatz
*/
object PrintfStringOps {
private val pattern = "\\\\%[\\\\w]+".r
... | reikje/printf-ext | src/main/scala/com/github/reikje/PrintfStringOps.scala | Scala | apache-2.0 | 1,853 |
package org.ensime.api
import java.io.File
sealed abstract class DeclaredAs(val symbol: scala.Symbol)
object DeclaredAs {
case object Method extends DeclaredAs('method)
case object Trait extends DeclaredAs('trait)
case object Interface extends DeclaredAs('interface)
case object Object extends DeclaredAs('obj... | eddsteel/ensime | api/src/main/scala/org/ensime/api/common.scala | Scala | gpl-3.0 | 2,867 |
package java.lang
import scala.scalanative.native.Ptr
import scala.scalanative.runtime.Type
final class _Class[A](val ty: Ptr[Type]) {
def getName(): String = (!ty).name
override def hashCode: Int = ty.cast[Long].##
override def equals(other: Any): scala.Boolean = other match {
case other: _Class[_] =>
... | phdoerfler/scala-native | nativelib/src/main/scala/java/lang/Class.scala | Scala | bsd-3-clause | 817 |
package com.bostontechnologies.quickfixs.authentication
import quickfix.SessionID
trait FixCredentialsValidator {
def isValid(credentials: Credentials, sessionId: SessionID): Boolean
}
| Forexware/quickfixs | src/main/scala/com/bostontechnologies/quickfixs/authentication/FixCredentialsValidator.scala | Scala | apache-2.0 | 190 |
package dal
import javax.inject.{ Inject, Singleton }
import play.api.db.slick.DatabaseConfigProvider
import slick.driver.JdbcProfile
import java.time.LocalDateTime
import models.Tour
import scala.concurrent.{ Future, ExecutionContext }
import scala.util.{Success, Failure}
/**
* A repository for tours.
*
* @par... | kelleyb/RPI-Tours-Backend | app/dal/TourRepository.scala | Scala | mit | 3,830 |
package com.thangiee.lolhangouts.data.usecases.entities
case class TopChampion
(name: String,
numOfGames: Int,
winsRate: Double,
avgKills: Double,
avgKillsPerformance: Double,
avgDeaths: Double,
avgDeathsPerformance: Double,
avgAssists: Double,
avgAssistsPerformance: Double,
avgCs: Int,
avgCsPerformance: Int... | Thangiee/LoL-Hangouts | src/com/thangiee/lolhangouts/data/usecases/entities/TopChampion.scala | Scala | apache-2.0 | 401 |
package org.clulab.struct
import scala.collection.mutable
import scala.collection.mutable.ListBuffer
import scala.util.matching.Regex
/**
* An inverted index of the DirectedGraph, so we can efficiently implement enhanced dependencies
* User: mihais
* Date: 8/2/17
*/
class DirectedGraphIndex[E](
val size: In... | sistanlp/processors | main/src/main/scala/org/clulab/struct/DirectedGraphIndex.scala | Scala | apache-2.0 | 3,500 |
package yiris.core.removals
import org.scalatest.{FlatSpec, Matchers}
/**
* Created by kasonchan on 12/2/15.
*/
class RemovalsSuite extends FlatSpec with Matchers with Removals {
"Default removals" should "pass" in {
val defaultRemovals = Removals()
defaultRemovals.tss shouldBe None
defaultRemovals.b... | kasonchan/yiris | core/src/test/scala/yiris/core/removals/RemovalsSuite.scala | Scala | apache-2.0 | 515 |
package example
import diode._
import org.scalajs.dom._
// marker trait to identify actions that should be RAF batched
trait RAFAction extends Action
private[example] final case class RAFWrapper(action: Any, dispatch: Dispatcher) extends Action
final case class RAFTimeStamp(time: Double) extends Action
class RAFBa... | ochrons/diode | examples/raf/src/main/scala/example/RAFBatcher.scala | Scala | mit | 2,289 |
package at.forsyte.apalache.tla.bmcmt.config
import at.forsyte.apalache.tla.bmcmt.types.eager.TrivialTypeFinder
import at.forsyte.apalache.tla.lir.storage.ChangeListener
import at.forsyte.apalache.tla.lir.transformations.TransformationTracker
import at.forsyte.apalache.tla.lir.transformations.impl.TrackerWithListeners... | konnov/apalache | tla-bmcmt/src/main/scala/at/forsyte/apalache/tla/bmcmt/config/TransformationTrackerProvider.scala | Scala | apache-2.0 | 1,485 |
package org.jetbrains.plugins.scala
package annotator
import org.intellij.lang.annotations.Language
import org.jetbrains.plugins.scala.base.SimpleTestCase
import org.jetbrains.plugins.scala.extensions._
import org.jetbrains.plugins.scala.lang.psi.api.ScalaFile
import org.jetbrains.plugins.scala.lang.psi.api.base.ScCon... | loskutov/intellij-scala | test/org/jetbrains/plugins/scala/annotator/ConstructorAnnotatorTest.scala | Scala | apache-2.0 | 3,558 |
package com.lyrx.text
import com.lyrx.text.TextTypes.Pars
/**
* Created by alex on 25.04.17.
*/
abstract class DocumentStructure[T]()(implicit val ctx: Context,
val coll: Collector[T],
var generator: ParBasedGenerator[T]) {
def col... | lyrx/lyrxgenerator | src/main/scala/com/lyrx/text/DocumentStructure.scala | Scala | gpl-3.0 | 2,749 |
package org.genivi.sota.messaging
import cats.data.Xor
import com.typesafe.config.{Config, ConfigException}
object ConfigHelpers {
implicit class RichConfig(config: Config) {
def configAt(path: String): ConfigException Xor Config =
Xor.catchOnly[ConfigException](config.getConfig(path))
def readStrin... | PDXostc/rvi_sota_server | common-messaging/src/main/scala/org/genivi/sota/messaging/ConfigHelpers.scala | Scala | mpl-2.0 | 549 |
package io.digitallibrary.bookapi.controller
import io.digitallibrary.bookapi.{BookSwagger, TestData, TestEnvironment, UnitSuite}
import io.digitallibrary.language.model.LanguageTag
import org.scalatra.test.scalatest.ScalatraFunSuite
import org.mockito.Mockito._
import org.mockito.ArgumentMatchers._
class SourceCon... | GlobalDigitalLibraryio/book-api | src/test/scala/io/digitallibrary/bookapi/controller/SourceControllerTest.scala | Scala | apache-2.0 | 2,553 |
package name.abhijitsarkar.scala.scalaimpatient.types
class DocumentProperty
object Title extends DocumentProperty
object Author extends DocumentProperty
object Then
/**
* Q3: Complete the fluent interface in Section 18.1, "Singleton Types", so that one can call
*
* `book set Title to "Scala for the Impatient" se... | abhijitsarkar/scala-impatient | src/main/scala/name/abhijitsarkar/scala/scalaimpatient/types/Document.scala | Scala | gpl-3.0 | 845 |
package com.equalinformation.interview.algo.scala.test.string_and_array
import com.equalinformation.interview.algo.scala.string_and_array.RotateArrayS1IntermediateArray_O_n
import org.scalatest.FlatSpec
/**
* Created by bpupadhyaya on 6/13/16.
*/
class RotateArrayS1IntermediateArraySpec extends FlatSpec {
"Rot... | bpupadhyaya/interview-collections | interview-collections-algo/src/test/scala/com/equalinformation/interview/algo/scala/test/string_and_array/RotateArrayS1IntermediateArraySpec.scala | Scala | mit | 865 |
package org.jetbrains.plugins.hocon.psi
import java.{lang => jl}
import com.intellij.extapi.psi.ASTWrapperPsiElement
import com.intellij.lang.ASTNode
import com.intellij.openapi.roots.ProjectRootManager
import com.intellij.openapi.util.text.StringUtil
import com.intellij.psi._
import com.intellij.psi.impl.source.reso... | ghik/intellij-hocon | src/org/jetbrains/plugins/hocon/psi/HoconPsiElement.scala | Scala | apache-2.0 | 16,042 |
package io.getquill.oracle
import io.getquill.{ Prefix, ZioSpec }
import zio.{ Task, ZIO }
import io.getquill.context.ZioJdbc._
class ZioJdbcContextSpec extends ZioSpec {
def prefix = Prefix("testOracleDB")
val context = testContext
import testContext._
"provides transaction support" - {
"success" in {
... | getquill/quill | quill-jdbc-zio/src/test/scala/io/getquill/oracle/ZioJdbcContextSpec.scala | Scala | apache-2.0 | 2,218 |
package com.avsystem.commons
package macros.rpc
import com.avsystem.commons.macros.meta.MacroMetadatas
import com.avsystem.commons.macros.misc.{FailMsg, Ok, Res}
private[commons] trait RpcMetadatas extends MacroMetadatas { this: RpcMacroCommons with RpcSymbols with RpcMappings =>
import c.universe._
class Metho... | AVSystem/scala-commons | commons-macros/src/main/scala/com/avsystem/commons/macros/rpc/RpcMetadatas.scala | Scala | mit | 15,130 |
/*
* 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 | core/src/main/scala/org/apache/spark/storage/BlockManagerMaster.scala | Scala | apache-2.0 | 11,572 |
/**
* Copyright 2015, deepsense.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 applicable law or agreed ... | deepsense-io/seahorse-workflow-executor | deeplang/src/main/scala/io/deepsense/deeplang/catalogs/doperable/exceptions/DOperableCatalogException.scala | Scala | apache-2.0 | 812 |
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.