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 org.jetbrains.plugins.scala.lang.parser.parsing
import org.jetbrains.plugins.scala.lang.parser.ErrMsg
import org.jetbrains.plugins.scala.lang.parser.parsing.builder.ScalaPsiBuilder
/*
* Program parses all content in scala source file
*/
object Program extends Program {
override protected def compilationUn... | gtache/intellij-lsp | intellij-lsp-dotty/src/org/jetbrains/plugins/scala/lang/parser/parsing/Program.scala | Scala | apache-2.0 | 752 |
// Webside Source Code Zauberstuhl.de
// Copyright (C) 2016-2019 Lukas Matt <[email protected]>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// any late... | Zauberstuhl/zauberstuhl | app/objects/Provider.scala | Scala | gpl-3.0 | 972 |
/*
* Created on 2010/11/07
* Copyright (c) 2010-2011, Wei-ju Wu.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice, ... | logicmoo/zmpp2 | zmpp-tads3/src/test/scala/org/zmpp/tads3/ObjectModelTest.scala | Scala | bsd-3-clause | 4,355 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may n... | TiVo/kafka | streams/streams-scala/src/main/scala/org/apache/kafka/streams/scala/kstream/StreamJoined.scala | Scala | apache-2.0 | 4,112 |
import sbt._
object Dependencies {
// Compile dependencies
// format: OFF
private def scalaReflect(version: String) = "org.scala-lang" % "scala-reflect" % version
private def scalaCompiler(version: String) = ("org.scala-lang" % "scala-compiler" ... | gatling/gatling | project/Dependencies.scala | Scala | apache-2.0 | 12,608 |
/*
* Copyright 2015 the original author or authors.
* @https://github.com/scouter-project/scouter
*
* 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.apa... | yuyupapa/OpenSource | scouter.server/src/scouter/server/tagcnt/next/WorkDB.scala | Scala | apache-2.0 | 1,083 |
/*
* Copyright 2022 Typelevel
*
* 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... | typelevel/sbt-typelevel | kernel/src/main/scala/org/typelevel/sbt/kernel/V.scala | Scala | apache-2.0 | 2,514 |
package com.karasiq.mapdb.index
import com.karasiq.mapdb.MapDbConversions._
import org.mapdb.{Bind, DB}
import scala.collection.JavaConversions._
import scala.collection.immutable.AbstractMap
object MapDbIndex {
type JavaMap[K, V] = java.util.Map[K, V]
object IndexMaps {
def heapHashMap[K, V](): JavaMap[K, ... | Karasiq/mapdbutils | src/main/scala/com/karasiq/mapdb/index/MapDbIndex.scala | Scala | mit | 1,866 |
package colang.ast.parsed
import colang.SourceCode
import colang.ast.raw
import colang.issues.Issue
/**
* Represents a compiler component that performs semantic analysis of the code, establishes symbol references and
* does the last issue check.
*/
trait Analyzer {
/**
* Performs the code analysis.
*... | merkispavel/colang | src/main/scala/colang/ast/parsed/Analyzer.scala | Scala | mit | 2,844 |
import scala.util.matching.Regex
object Problema1 {
def main(args: Array[String]) {
val source = scala.io.Source.fromFile("A-large-practice.in")
val lines = source.getLines.filter(_.length > 0)
val ldn = lines.next.split(" ")
val D = ldn(1).toInt
val N = ldn(2).toInt
... | Nearsoft/google-code-jam | solutions/alien-language/scala/approach4.scala | Scala | mit | 916 |
package com.sksamuel.elastic4s.locks
trait LocksApi {
def acquireGlobalLock() = AcquireGlobalLockDefinition()
def releaseGlobalLock() = ReleaseGlobalLockDefinition()
}
case class AcquireGlobalLockDefinition()
case class ReleaseGlobalLockDefinition()
| FabienPennequin/elastic4s | elastic4s-core/src/main/scala/com/sksamuel/elastic4s/locks/LocksApi.scala | Scala | apache-2.0 | 256 |
/***
* Excerpted from "Seven Concurrency Models in Seven Weeks",
* published by The Pragmatic Bookshelf.
* Copyrights apply to this code. It may not be used to create training material,
* courses, books, articles, and the like. Contact us if you are in doubt.
* We make no guarantees that this code is fit for any ... | XBOOS/concurrency | code/ActorsScala/WordCountFaultTolerant/src/main/scala/com/paulbutcher/Counter.scala | Scala | gpl-2.0 | 991 |
/**
* Copyright (c) 2012-2013, Tomasz Kaczmarzyk.
*
* This file is part of BeanDiff.
*
* BeanDiff 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 of the License, or
* (at your o... | tkaczmarzyk/beandiff | src/main/scala/org/beandiff/core/LcsResultOptimizer.scala | Scala | lgpl-3.0 | 5,579 |
package lib.query
import org.scalatestplus.play.PlaySpec
import org.scalatestplus.play.guice.GuiceOneAppPerSuite
class QuerySpec extends PlaySpec with GuiceOneAppPerSuite {
def validateQuery(q: String, words: Seq[String], orgKeys: Seq[String]): Unit = {
QueryParser(q) match {
case None => fail(s"Query[$q... | mbryzek/apidoc | api/test/lib/query/QuerySpec.scala | Scala | mit | 1,790 |
package io.toolsplus.atlassian.connect.play.ws
import java.net.URI
import io.lemonlabs.uri.Url
import io.toolsplus.atlassian.connect.play.api.models.AtlassianHost
import io.toolsplus.atlassian.connect.play.auth.jwt.symmetric.JwtGenerator
import io.toolsplus.atlassian.connect.play.ws.jwt.JwtSignatureCalculator
import ... | toolsplus/atlassian-connect-play | modules/core/app/io/toolsplus/atlassian/connect/play/ws/AtlassianConnectHttpClient.scala | Scala | apache-2.0 | 1,958 |
package scwebapp.util
import scutil.core.implicits.*
import scwebapp.data.*
object AcceptanceUtil {
@SuppressWarnings(Array("org.wartremover.warts.TraversableOps"))
def acceptance[T](matches:Seq[T])(extract:T=>Option[(Int,QValue)]):Option[QValue] =
matches
.mapFilter(extract)
// get the highest rank
.group... | ritschwumm/scwebapp | modules/core/src/main/scala/scwebapp/util/AcceptanceUtil.scala | Scala | bsd-2-clause | 510 |
/**
* Copyright (c) 2013-2015 Patrick Nicolas - Scala for Machine Learning - All rights reserved
*
* The source code in this file is provided by the author for the sole purpose of illustrating the
* concepts and algorithms presented in "Scala for Machine Learning". It should not be used to
* build commercial ap... | batermj/algorithm-challenger | books/cs/machine-learning/scala-for-machine-learning/1rst-edition/original-src-from-the-book/src/main/scala/org/scalaml/supervised/crf/package.scala | Scala | apache-2.0 | 1,544 |
package com.signalcollect.triplerush
import org.scalatest.FlatSpec
import org.scalatest.prop.Checkers
import org.scalacheck.Arbitrary
import com.signalcollect.util.TestAnnouncements
class IgnoredBindingsSpec extends FlatSpec with Checkers with TestAnnouncements {
val s1 = 1
val s2 = 2
val s3 = 3
val o1 = 101... | hicolour/triplerush | src/test/scala/com/signalcollect/triplerush/IngoredBindingsSpec.scala | Scala | apache-2.0 | 2,678 |
/*
* Copyright (c) 2018 OVO Energy
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish,... | ovotech/comms-kafka-messages | modules/core/src/test/scala/com/ovoenergy/comms/model/ArbitrariesSpec.scala | Scala | mit | 4,170 |
package org.apache.spark.core.utils
import org.apache.hadoop.conf.Configuration
import org.apache.hadoop.fs.{Path, FileSystem}
/**
* Created by raduchilom on 22/03/15.
*/
object HdfsUtils {
def copyJarFromHdfs(hdfsPath: String, outputFolder: String) = {
// if(!config.hasPath("hdfs.namenode")){
// ... | linzhe/matrix | src/main/scala/org/apache/spark/core/utils/HdfsUtils.scala | Scala | apache-2.0 | 771 |
package nibbler
import nibbler.evaluation.NumericalDifferentiator
import org.apache.spark.rdd.RDD
import org.junit.runner.RunWith
import org.scalatest.FunSuite
import org.scalatest.junit.JUnitRunner
import org.scalatest.matchers.ShouldMatchers
import org.scalatest.mock.MockitoSugar
@RunWith(classOf[JUnitRunner])
clas... | pkoperek/nibbler | src/test/scala/nibbler/NumericalDifferentiatorTest.scala | Scala | gpl-3.0 | 2,474 |
package com.phasmid.laScala.values
// We really do need the following: import com.phasmid.laScala.values.Rational.RationalHelper
import com.phasmid.laScala.values.Rational.RationalHelper
import org.scalatest.{FlatSpec, Matchers}
import scala.language.postfixOps
/**
* @author scalaprof
*/
class RationalSpec exten... | rchillyard/LaScala | src/test/scala/com/phasmid/laScala/values/RationalSpec.scala | Scala | lgpl-2.1 | 8,819 |
package org.jetbrains.plugins.scala.macroAnnotations
import scala.annotation.StaticAnnotation
import scala.language.experimental.macros
import scala.reflect.macros.whitebox
/**
* This annotation generates code that caches result of the function. Caches are invalidated on `dependencyItem` change.
*
* Computation... | jastice/intellij-scala | scala/macros/src/org/jetbrains/plugins/scala/macroAnnotations/CachedWithRecursionGuard.scala | Scala | apache-2.0 | 5,749 |
package com.seanshubin.detangler.report
import com.seanshubin.detangler.model.Standalone
trait GraphTemplateRules {
def generate(graphTemplate: HtmlElement, standalone: Standalone, graphRenderResult: GraphRenderResult): HtmlElement
}
| SeanShubin/detangler | report/src/main/scala/com/seanshubin/detangler/report/GraphTemplateRules.scala | Scala | unlicense | 238 |
/*
* 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... | dotty-staging/scalatest | scalatest-test/src/test/scala/org/scalatest/matchers/ShouldAndMustSpec.scala | Scala | apache-2.0 | 742 |
package elea
import java.io.File
import elea.Parser.{DataDef, StatementHandler, TermDef}
import elea.rewrite.Simplifier
import scopt.OptionParser
/**
* Command-line interface main method
*/
object CLI {
case class Config(
recordStats: Boolean = false,
fromFile: Option[File] = None)
v... | wsonnex/elea | src/main/scala/elea/CLI.scala | Scala | mit | 2,281 |
/*
*
* * Copyright 2014 websudos ltd.
* *
* * Licensed under the Apache License, Version 2.0 (the "License");
* * you may not use this file except in compliance with the License.
* * You may obtain a copy of the License at
* *
* * http://www.apache.org/licenses/LICENSE-2.0
* *
* * Unless required... | nosheenzaza/phantom-data-centric | phantom-zookeeper/src/main/scala/com/websudos/phantom/zookeeper/ZookeeperManager.scala | Scala | gpl-2.0 | 4,893 |
/*
* 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 ... | yu-iskw/spark-word2vec-app | src/test/scala/org/apache/spark/example/WikipediaTextSuite.scala | Scala | apache-2.0 | 7,686 |
package io.buoyant.linkerd.protocol.http
import com.twitter.finagle.Path
import com.twitter.finagle.buoyant.Dst
import com.twitter.finagle.http.Request
import com.twitter.finagle.util.LoadService
import io.buoyant.config.Parser
import io.buoyant.linkerd.IdentifierInitializer
import io.buoyant.linkerd.protocol.HttpIden... | denverwilliams/linkerd | linkerd/protocol/http/src/test/scala/io/buoyant/linkerd/protocol/http/HeaderIdentifierConfigTest.scala | Scala | apache-2.0 | 1,948 |
/** ____ __ ____ ____ ____,,___ ____ __ __ ____
* ( _ \\ /__\\ (_ )(_ _)( ___)/ __) ( _ \\( )( )( _ \\ Read
* ) / /(__)\\ / /_ _)(_ )__) \\__ \\ )___/ )(__)( ) _ < README.txt
* (_)\\_)(__)(__)(____)(____)(____)(___/ (__) (______)(____/ LICENSE.txt
**... | razie/diesel-rx | diesel/src/main/scala/razie/tconf/SpecRef.scala | Scala | apache-2.0 | 4,397 |
package views.html
import play.templates._
import play.templates.TemplateMagic._
import play.api.templates._
import play.api.templates.PlayMagic._
import models._
import controllers._
import java.lang._
import java.util._
import scala.collection.JavaConversions._
import scala.collection.JavaConverters._
import play.... | alternativeTime/unicarb_static | target/scala-2.10/src_managed/main/views/html/stref.template.scala | Scala | gpl-3.0 | 1,964 |
/*
* 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/vat-registration-frontend | app/utils/Base64Util.scala | Scala | apache-2.0 | 900 |
package org.flagz
import scala.reflect.ClassTag
/** FlagField that supports Scala {@link Set}. */
class SetFlagField[E](defaultValue: Set[E])(implicit tag: ClassTag[E])
extends ContainerFlagField[Set[E]](defaultValue, () => Set.empty[E]) {
val elementClazz = tag.runtimeClass.asInstanceOf[Class[E]]
override p... | mwitkow/java-flagz | flagz-scala/src/main/scala/org/flagz/ScalaCollectionsFlagField.scala | Scala | mit | 2,018 |
package club.diybio.bank
import club.diybio.bank.views.{MenuView, SidebarView}
import org.denigma.binding.binders.{GeneralBinder, NavigationBinding}
import org.denigma.binding.extensions._
import org.denigma.binding.views.BindableView
import org.denigma.controls.login.{AjaxSession, LoginView}
import org.querki.jquery.... | antonkulaga/plasmid-bank | frontend/src/main/scala/club/diybio/bank/FrontEnd.scala | Scala | mpl-2.0 | 2,090 |
/*
* 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 ... | cattoire/sparksamples | helloSpark/src/main/scala/com/ibm/cds/spark/samples/HelloSpark.scala | Scala | apache-2.0 | 1,744 |
object Return {
def foo(x: Int): Int = return 3
}
| lampepfl/dotty | tests/pos/tailcall/return.scala | Scala | apache-2.0 | 54 |
/*
* 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 | test/controllers/renewal/FXTransactionsInLast12MonthsControllerSpec.scala | Scala | apache-2.0 | 7,289 |
package fi.allacca
import android.app.{Activity, LoaderManager}
import android.database.Cursor
import android.widget._
import scala.Array
import android.os.Bundle
import android.content.{CursorLoader, ContentUris, Loader}
import android.provider.CalendarContract
import android.util.Log
import android.view.ViewGroup.La... | timorantalaiho/allacca | src/main/scala/fi/allacca/AgendaCreator.scala | Scala | gpl-3.0 | 4,020 |
package me.snov.sns.actor
import java.util.UUID
import akka.actor.Status.{Failure, Success}
import akka.actor.{Actor, ActorLogging, ActorRef, Props}
import me.snov.sns.actor.DbActor.CmdGetConfiguration
import me.snov.sns.model._
import akka.actor.PoisonPill
import akka.actor.Status
object SubscribeActor {
def prop... | s12v/sns | src/main/scala/me/snov/sns/actor/SubscribeActor.scala | Scala | apache-2.0 | 6,682 |
/*
* 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
* distribute... | wvlet/airframe | airframe-http/.jvm/src/main/scala/wvlet/airframe/http/client/URLConnectionClientBackend.scala | Scala | apache-2.0 | 1,206 |
/*
* 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/vat-registration-frontend | app/controllers/registration/returns/LastMonthOfAccountingYearController.scala | Scala | apache-2.0 | 2,597 |
/*
* Copyright (c) 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 http://www.apache.org... | nakulgan/snowplow | 3-enrich/scala-common-enrich/src/main/scala/com.snowplowanalytics.snowplow.enrich/common/adapters/registry/MixpanelAdapter.scala | Scala | apache-2.0 | 4,791 |
package com.blinkbox.books.quartermaster.key.public
import akka.actor.ActorRefFactory
import com.blinkbox.books.logging.DiagnosticExecutionContext
import com.blinkbox.books.spray.{Directives => CommonDirectives, _}
import org.slf4j.LoggerFactory
import spray.http.HttpHeaders._
import spray.http.StatusCodes._
import sp... | blinkboxbooks/key-service | public/src/main/scala/com/blinkbox/books/quartermaster/key/public/PublicApi.scala | Scala | mit | 1,028 |
package com.crockeo.clasp
import org.scalatest._
// Testing the built-in functionality of the language.
// * "=" -> builtin_eq,
// * "not" -> builtin_not,
// * "|" -> builtin_or,
// * "&" -> builtin_and,
// * "^" -> builtin_xor,
// * "def" -> builtin_def,
// * "defn" -> builtin_defn,
// * "+" -> bui... | crockeo/clasp | src/test/scala/BuiltinTests.scala | Scala | mit | 5,028 |
package cromwell.webservice.metadata
import cats.{Monoid, Semigroup}
import cats.instances.map._
import cats.instances.list._
import cats.syntax.foldable._
import cromwell.core.{ExecutionStatus, WorkflowMetadataKeys, WorkflowState}
import cromwell.services.metadata._
import spray.json.{JsArray, _}
import scala.collec... | ohsu-comp-bio/cromwell | engine/src/main/scala/cromwell/webservice/metadata/MetadataComponent.scala | Scala | bsd-3-clause | 7,782 |
package com.lvxingpai.model.marketplace.misc
import java.util.Date
import javax.validation.constraints.{ NotNull, Min }
import com.lvxingpai.model.mixin.ObjectIdEnabled
import org.mongodb.morphia.annotations.{ Entity, Indexed }
/**
* Created by zephyre on 2/18/16.
*/
@Entity
class Coupon extends ObjectIdEnabled {
... | Lvxingpai/core-model | src/main/scala/com/lvxingpai/model/marketplace/misc/Coupon.scala | Scala | apache-2.0 | 775 |
/*
* 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 ... | wowmsi/safe | safe-lang/src/main/scala/safe/safesets/client/Worker.scala | Scala | apache-2.0 | 1,725 |
package collins.models
import shared.PageParams
import org.specs2._
import specification._
import play.api.test.WithApplication
class AssetSpec extends mutable.Specification {
"Asset Model Specification".title
args(sequential = true)
"The Asset Model" should {
"Support CRUD Operations" in new WithApplic... | funzoneq/collins | test/collins/models/AssetSpec.scala | Scala | apache-2.0 | 4,449 |
package ca.uwo.eng.sel.cepsim.query
import ca.uwo.eng.sel.cepsim.event.EventSet
import ca.uwo.eng.sel.cepsim.history.{Produced, WindowAccumulated}
import ca.uwo.eng.sel.cepsim.util.SimEventBaseTest
import org.junit.runner.RunWith
import org.mockito.Mockito._
import org.scalatest.junit.JUnitRunner
import org.scalatest.... | virsox/cepsim | cepsim-core/src/test/scala/ca/uwo/eng/sel/cepsim/query/WindowedOperatorTest.scala | Scala | mit | 18,653 |
package ore.db.access
import scala.language.{higherKinds, implicitConversions}
import slick.lifted.{Query, Rep}
trait QueryView[F[_, _]] {
def modifyingView[T, M](fa: F[T, M])(f: Query[T, M, Seq] => Query[T, M, Seq]): F[T, M]
def filterView[T, M](fa: F[T, M])(f: T => Rep[Boolean]): F[T, M] = modifyingView(fa)(... | SpongePowered/Ore | db/src/main/scala/ore/db/access/QueryView.scala | Scala | mit | 1,331 |
package com.eigengo.lift.exercise.classifiers.model
import akka.actor.{ActorLogging, Actor}
import akka.stream.scaladsl._
import com.eigengo.lift.Exercise.Exercise
import com.eigengo.lift.exercise.UserExercises.ModelMetadata
import com.eigengo.lift.exercise.UserExercisesClassifier.{UnclassifiedExercise, FullyClassifie... | teroxik/open-muvr | server/exercise/src/main/scala/com/eigengo/lift/exercise/classifiers/model/RandomExerciseModel.scala | Scala | apache-2.0 | 4,358 |
object Test {
def main(args:Array[String]): Unit = {
val ns = Array(3L, 3L, 3L)
val a1: A = new A(ns(0))
val a2: A = new A(ns(0))
println(a1 + a2)
}
}
class A(val u: Long) extends AnyVal {
def +(other: A) = new A(other.u + u)
}
| yusuke2255/dotty | tests/run/t5608.scala | Scala | bsd-3-clause | 251 |
package com.jackbeasley.wordFind.test
import com.jackbeasley.wordFind.Word
class WordSpec extends UnitSpec{
"A Word" should "print a breakdown of the coordinates of letters" in {
val wrd = new Word("hello", Array((1,1), (2,2), (3,3), (4,4), (5,5)))
wrd.toString should be ("h (1,1)\\ne (2,2)\\nl (3,3)\\nl (4... | jackbeasley/wordFind | src/test/scala/WordSpec.scala | Scala | mit | 1,982 |
package shade
import scala.collection.mutable.ArrayBuffer
package object testModels {
val bigInstance = Impression(
"96298b14-1e13-a162-662b-969bd3b41ca4",
Session(
"c5c94985-1d91-3a8b-b36b-6791efefc38c",
"dummy-user-sa9d08ahusid",
"android.web",
UserInfo(
"71.89.145.102",
... | kazzna/shade | src/test/scala/shade/testModels/package.scala | Scala | mit | 3,400 |
package freecli
package command
package parser
import api.Action
import dsl.CommandDsl
import freecli.parser.CliParser
object ops extends ParserOps
trait ParserOps {
private[freecli] def parseCommandNonStrict[T](
dsl: CommandDsl[T]):
CliParser[Action, CommandParsingError, T] = {
dsl.foldMap(CommandPars... | pavlosgi/freecli | core/src/main/scala/freecli/command/parser/ParserOps.scala | Scala | apache-2.0 | 614 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | dotunolafunmiloye/spark | core/src/main/scala/org/apache/spark/scheduler/DAGScheduler.scala | Scala | apache-2.0 | 44,688 |
package aws.daleks.ai
import rx.lang.scala._
import scala.collection.JavaConverters._
import com.amazonaws.regions.Region
import java.util.List
import java.util.Collections
import aws.daleks.RxDalek
import com.amazonaws.services.machinelearning.model._
import com.amazonaws.services.machinelearning.AmazonMachineLearnin... | jfaerman/aws-daleks | archive/src/main/scala/aws/daleks/ai/MLDatasourcesDalek.scala | Scala | apache-2.0 | 949 |
package com.orendainx.trucking.simulator.simulators
import akka.actor.{ActorSystem, Inbox}
import better.files.File
import com.orendainx.trucking.commons.models.TruckingData
import com.orendainx.trucking.simulator.coordinators.ManualCoordinator
import com.orendainx.trucking.simulator.depots.NoSharingDepot
import com.o... | orendain/trucking-iot | simulator/src/main/scala/com/orendainx/trucking/simulator/simulators/ManualTickAndFetchSimulator.scala | Scala | apache-2.0 | 3,585 |
class C {
val x: ((Int, Int) => Int) = (((a, b)) => a)
val y: ((Int, Int, Int) => Int) = (((a, !!)) => a)
val z: ((Int, Int, Int) => Int) = (((a, NotAPatternVariableName, c)) => a)
}
| folone/dotty | tests/untried/neg/not-a-legal-formal-parameter-tuple.scala | Scala | bsd-3-clause | 189 |
/*
* Copyright 2013 Akiyoshi Sugiki, University of Tsukuba
*
* 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 a... | axi-sugiki/kumoi | src/kumoi/impl/vm/net/LibvirtHotNetwork.scala | Scala | apache-2.0 | 2,312 |
/*
* Copyright 2015 Roberto Tyley
*
* 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... | rtyley/play-git-hub | src/main/scala/com/madgag/scalagithub/commands/CreateLabel.scala | Scala | gpl-3.0 | 854 |
package formacion.example
import formacion.example.Cocodrilo._
class Cocodrilo(name: String, numLegs: Int) extends Animal(name) with AnimalAcuatico
with AnimalTerrestre with Asesino {
def this() {
this(Cocodrilo.defaultName, Cocodrilo.defaultNumLegs)
}
def this(name: String) = this(name, defaultNumLegs... | anavidad3/PoC-spark-scala-maven | src/test/scala/formacion/example/Cocodrilo.scala | Scala | apache-2.0 | 707 |
package dbtarzan.gui.config.connections
import dbtarzan.gui.util.Validation
import dbtarzan.config.connections.ConnectionData
/* verify if a connection data can be saved */
object ConnectionDataValidation
{
private val MAXFIELDSIZE_MIN = 200
def validate(data : ConnectionData) : List[String] =
List(
er... | aferrandi/dbtarzan | src/main/scala/dbtarzan/gui/config/connections/ConnectionDataValidation.scala | Scala | apache-2.0 | 1,498 |
/*
* Forward.scala
* Forward sampling.
*
* Created By: Avi Pfeffer ([email protected])
* Creation Date: Jan 1, 2009
*
* Copyright 2013 Avrom J. Pfeffer and Charles River Analytics, Inc.
* See http://www.cra.com or email [email protected] for information.
*
* See http://www.github.com/p2t2/figaro for a c... | agarbuno/figaro | Figaro/src/main/scala/com/cra/figaro/algorithm/sampling/Forward.scala | Scala | bsd-3-clause | 1,952 |
import play.api.mvc.Results
import play.api.test.Helpers.stubControllerComponents
object ActionMocks {
def getWeather() = stubControllerComponents().actionBuilder {
Results.Ok(Fixtures.weatherResponse)
}
def getWeatherList() = stubControllerComponents().actionBuilder {
Results.Ok(Fixtures.findWeatherRes... | malaman/scala-weather-app | api/test/Fixtures.scala | Scala | mit | 42,362 |
/*
* 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 ... | mzl9039/spark | sql/core/src/main/scala/org/apache/spark/sql/streaming/DataStreamReader.scala | Scala | apache-2.0 | 15,883 |
import scala.quoted.*
object Macro {
inline def mac(): String = ${ macImpl() }
def macImpl()(using Quotes): Expr[String] =
'{(x: String) => "anything"} match
case '{ (in: String) => ($out: tpe2) } => Expr(out.toString)
case _ => ???
}
| dotty-staging/dotty | tests/run-macros/i8746/Macro_1.scala | Scala | apache-2.0 | 257 |
/*
* Copyright (c) 2013 Habla Computing
*
* 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... | hablapps/app-bigbrothapp | src/test/scala/org/hablapps/bigbrothapp/test/Nominating.scala | Scala | apache-2.0 | 6,164 |
package recfun
import common._
object Main {
def main(args: Array[String]) {
println("Pascal's Triangle")
for (row <- 0 to 10) {
for (col <- 0 to row)
print(pascal(col, row) + " ")
println()
}
}
def min(xs: List[Int]): Int = try {
if (xs.head < min(xs.tail)) xs.head else ... | tuohis/functional_programming | recfun/src/main/scala/recfun/Main.scala | Scala | mit | 1,544 |
package com.acme.sausage
import java.time.Instant
case class S3Location(bucket: String, name: String)
sealed trait Event {
val when: Instant = Instant.now()
}
case class Requested() extends Event
case class Fetched(source: S3Location, directory: String) extends Event
case class Ran(command: Seq[String], cwd: Strin... | rizsotto/Sausage | src/main/scala/com/acme/sausage/Event.scala | Scala | bsd-3-clause | 782 |
package tomby.scala.bricks
case class Position(x: Int, y: Int) {
def neighbors: Set[Position] = Set(up, down, right, left)
def up: Position = {
Position(x, y + 1)
}
def down: Position = {
Position(x, y - 1)
}
def right: Position = {
Position(x + 1, y)
}
def left: Position = {
... | tonivade/scala-bricks | src/main/scala/tomby/scala/bricks/Position.scala | Scala | mit | 586 |
/*
* Copyright 2011-2014 Chris de Vreeze
*
* 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... | EBPI/yaidom | src/main/scala/nl/ebpi/yaidom/convert/ScalaXmlConversions.scala | Scala | apache-2.0 | 1,357 |
import sbt._, Keys._
import sbt.internal.SessionSettings
object Common {
lazy val k1 = taskKey[Unit]("")
lazy val k2 = taskKey[Unit]("")
lazy val k3 = taskKey[Unit]("")
lazy val k4 = taskKey[Unit]("")
val UpdateK1 = Command.command("UpdateK1") { st: State =>
val ex = Project extract st
import ex._
... | Duhemm/sbt | sbt/src/sbt-test/project/session-update-from-cmd/project/Common.scala | Scala | bsd-3-clause | 1,309 |
/*
* Longest Collatz Sequence
* ========================
* The following iterative sequence is defined for the set of positive
* integers:
*
* n → n/2 (n is even)
* n → 3n + 1 (n is odd)
*
* Using the rule above and starting with 13, we generate the following
* sequence:
*
* 13 → 40 → 20 → 10 → 5 →... | daithiocrualaoich/euler | scala/014.scala | Scala | apache-2.0 | 2,147 |
package play.boilerplate.generators.security
import io.swagger.models.{Operation => SwaggerOperation}
import play.boilerplate.generators.injection.InjectionProvider.Dependency
import play.boilerplate.parser.model.SecurityRequirement
import treehugger.forest._
import treehuggerDSL._
import scala.collection.JavaConvert... | Romastyi/sbt-play-boilerplate | sbt-plugin/lib/src/main/scala/play/boilerplate/generators/security/SecurityProvider.scala | Scala | apache-2.0 | 3,056 |
package org.jetbrains.plugins.scala.testingSupport.scalatest.scala2_13.scalatest3_0_8
import org.jetbrains.plugins.scala.testingSupport.scalatest.ScalaTestSelectedTests
class Scalatest2_13_3_0_8_SelectedTestsTest extends Scalatest2_13_3_0_8_Base with ScalaTestSelectedTests
| JetBrains/intellij-scala | scala/scala-impl/test/org/jetbrains/plugins/scala/testingSupport/scalatest/scala2_13/scalatest3_0_8/Scalatest2_13_3_0_8_SelectedTestsTest.scala | Scala | apache-2.0 | 276 |
package ru.maizy.ambient7.core.data
/**
* Copyright (c) Nikita Kovaliov, maizy.ru, 2017
* See LICENSE.txt for details.
*/
trait Device {
def deviceType: DeviceType.Type
def id: String
}
| maizy/ambient7 | core/src/main/scala/ru/maizy/ambient7/core/data/Device.scala | Scala | apache-2.0 | 194 |
/*
* 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 ... | andrewor14/iolap | core/src/main/scala/org/apache/spark/storage/BlockObjectWriter.scala | Scala | apache-2.0 | 7,774 |
package uk.co.morleydev.zander.client.validator.exception
class NoLocalArtefactsExistException extends RuntimeException
| MorleyDev/zander.client | src/main/scala/uk/co/morleydev/zander/client/validator/exception/NoLocalArtefactsExistException.scala | Scala | mit | 121 |
// Copyright: 2010 - 2016 https://github.com/ensime/ensime-server/graphs
// Licence: http://www.gnu.org/licenses/gpl-3.0.en.html
package org.ensime.indexer
import org.objectweb.asm.Opcodes._
import scala.collection.immutable.Queue
sealed trait Access
case object Public extends Access
case object Default extends Acce... | j-mckitrick/ensime-sbt | src/sbt-test/ensime-sbt/ensime-server/core/src/main/scala/org/ensime/indexer/domain.scala | Scala | apache-2.0 | 4,435 |
package reswing
import scala.swing.{Component, LayoutContainer}
import scala.swing.event.{ComponentAdded, ComponentRemoved}
trait ReLayoutContainer[Constraints] extends ReUIElement {
protected def peer: LayoutContainer
private val peerLayout = peer.layout.asInstanceOf[
scala.collection.mutable.Map[Component,... | guidosalva/REScala | Code/Extensions/RESwing/src/main/scala/reswing/ReLayoutContainer.scala | Scala | apache-2.0 | 1,011 |
/*
* Copyright (C) 2009-2017 Lightbend Inc. <https://www.lightbend.com>
*/
package play.api.libs.ws.ahc
import java.net.URI
import akka.stream.scaladsl.Source
import akka.util.ByteString
import play.api.libs.ws.{ WSBody, _ }
import play.api.mvc.MultipartFormData
import play.core.formatters.Multipart
import scala.c... | ktoso/playframework | framework/src/play-ahc-ws/src/main/scala/play/api/libs/ws/ahc/AhcWSRequest.scala | Scala | apache-2.0 | 6,454 |
package com.qingstor.sdk.util
import java.time._
import org.scalatest.FunSuite
class TimeUtilTest extends FunSuite{
test("ZonedDateTime to String test") {
val time = ZonedDateTime.of(2017, 2, 17, 10, 0, 0, 0, ZoneId.of("Asia/Shanghai"))
val timeString = "Fri, 17 Feb 2017 02:00:00 GMT"
assert(timeString... | cheerx/qingstor-sdk-scala | src/test/scala/com/qingstor/sdk/util/TimeUtilTest.scala | Scala | apache-2.0 | 765 |
package com.github.lavrov.xml.reader
import cats.{Applicative, Show}
import cats.instances.list._
case class XmlPath(path: List[String]) {
def \\ (child: String) = copy(path :+ child)
def read[A](implicit reader: Reader[A]) = Reader( nodeSeq =>
reader.run(path.foldLeft(nodeSeq)(_ \\ _))
.leftMap(
... | lavrov/xml-reader | src/main/scala/com/github/lavrov/xml/reader/XmlPath.scala | Scala | mit | 1,064 |
package slash_actions
import models._
object Start extends SlashAction {
def execute(
votingSession:Option[VotingSession],
username:String,
data:String):Option[String] = {
val ticketDescription = data
VotingSession.destroyCurrent
startNewSession(ticketDescription)
sendVotingStartedMess... | conor-pappas/chasm_bot | app/value_objects/slash_actions/Start.scala | Scala | mit | 748 |
/**
* Copyright (C) 2014 Kaj Magnus Lindberg (born 1979)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
... | debiki/debiki-server-old | app/debiki/dao/SpecialContentDao.scala | Scala | agpl-3.0 | 2,726 |
/*
* 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... | Myllyenko/incubator-toree | kernel/src/main/scala/org/apache/toree/kernel/api/Kernel.scala | Scala | apache-2.0 | 16,924 |
package com.databricks.spark.sql.perf.mllib.feature
import org.apache.spark.ml
import org.apache.spark.ml.PipelineStage
import org.apache.spark.sql._
import com.databricks.spark.sql.perf.mllib.OptionImplicits._
import com.databricks.spark.sql.perf.mllib.data.DataGenerator
import com.databricks.spark.sql.perf.mllib.{B... | databricks/spark-sql-perf | src/main/scala/com/databricks/spark/sql/perf/mllib/feature/VectorSlicer.scala | Scala | apache-2.0 | 993 |
package akkaviz.frontend.components
import rx.Var
import scalatags.JsDom.all._
class SettingsTab(
monitoringStatus: Var[MonitoringStatus],
showUnconnected: Var[Boolean]
) extends Tab {
val monitoringOnOff = new MonitoringOnOff(monitoringStatus)
val unconnectedOnOff = new UnconnectedOnOff(showUnconnected... | blstream/akka-viz | frontend/src/main/scala/akkaviz/frontend/components/SettingsTab.scala | Scala | mit | 627 |
package utils
import frequencycount.Item
import scala.collection.immutable.IndexedSeq
object Utils {
def create(elements: Int, item: Item.Item): List[String] = {
val seq: IndexedSeq[String] = for (i <- 1 to elements) yield {
item.toString
}
seq.toList
}
}
| mvogiatzis/freq-count | src/main/scala/Utils/Utils.scala | Scala | mit | 283 |
/*
* 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/main/scala/org/apache/spark/sql/catalyst/json/JacksonUtils.scala | Scala | apache-2.0 | 2,276 |
package com.twitter.finagle.mysql
import java.nio.charset.Charset
import java.nio.charset.StandardCharsets.{UTF_8, ISO_8859_1, US_ASCII}
object MysqlCharset {
/**
* Default Java Charset used by this client, UTF-8.
*/
val defaultCharset: Charset = UTF_8
/**
* Converts from mysql charset to java charse... | luciferous/finagle | finagle-mysql/src/main/scala/com/twitter/finagle/mysql/MysqlCharset.scala | Scala | apache-2.0 | 1,667 |
package euler
object euler11 {
var s =
"""08 02 22 97 38 15 00 40 00 75 04 05 07 78 52 12 50 77 91 08
49 49 99 40 17 81 18 57 60 87 17 40 98 43 69 48 04 56 62 00
81 49 31 73 55 79 14 29 93 71 40 67 53 88 30 03 49 13 36 65
52 70 95 23 04 60 11 42 69 24 68 56 01 32 56 71 37 02 36 91
22... | vramana/euler | src/main/scala/problem011.scala | Scala | mit | 2,003 |
/**
* Copyright 2015 ICT.
*
* 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
... | ayscb/netflow | query/src/main/scala/cn/ac/ict/acs/netflow/query/master/ZKRecoveryModeFactory.scala | Scala | apache-2.0 | 1,579 |
package org.twitterReplica.scala
class ScalaHelperHBase {
}
object ScalaHelperHBase {
def getResults() : RDD[(Result)] = {
function body
return [expr]
}
| DaniUPC/near-image-replica-detection | src/main/scala/HBaseScalaHelper.scala | Scala | gpl-2.0 | 169 |
package tests
import cdgp._
import fuel.util.{CollectorStdout, Options, Rng}
import org.junit.Test
import org.junit.Assert._
import swim.tree.Op
object TestCDGPState {
val scriptMax =
"""(set-logic LIA)
(synth-fun max2 ((x Int) (y Int)) Int
((Start Int (x y 0 1
(+ Start Start)
(- Start Start)
(ite StartBool Star... | kkrawiec/CDGP | src/test/scala/TestCDGPState.scala | Scala | mit | 20,137 |
/*
* Copyright (C) 2018 Lightbend Inc. <https://www.lightbend.com>
* Copyright (C) 2017-2018 Alexis Seigneurin.
*
* 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 o... | mihbor/kafka | streams/streams-scala/src/main/scala/org/apache/kafka/streams/scala/ImplicitConversions.scala | Scala | apache-2.0 | 3,533 |
/*
* Copyright 2020 Precog Data
*
* 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 ... | djspiewak/quasar | foundation/src/test/scala/quasar/TestRateLimitUpdater.scala | Scala | apache-2.0 | 1,183 |
package com.negrisoli.algorithms.implementation
object BeautifulTriplets {
def main(args: Array[String]): Unit = {
val sc = new java.util.Scanner(System.in)
val List(n, d) = ((0 to 1) map (i => sc.nextInt)).toList
val a = ((0 to n - 1) map (i => sc.nextInt)).toList
println(resolve(a, d))
}
def... | rbatista/algorithms | challenges/hacker-rank/scala/src/main/scala/com/negrisoli/algorithms/implementation/BeautifulTriplets.scala | Scala | mit | 651 |
package scoder
object DecodeOk {
def apply[T](t: T): DecodeResult[Nothing, T] =
DecodeResult(Right(t))
def unapply[E, T](result: DecodeResult[E, T]): Option[T] = result match {
case DecodeResult(Right(t)) => Some(t)
case _ => None
}
}
| mrvisser/scoder | core/src/main/scala/scoder/DecodeOk.scala | Scala | mit | 256 |
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.