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 |
|---|---|---|---|---|---|
/**
* (C) Copyright IBM Corp. 2015 - 2017
*
* 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 applicabl... | SparkTC/spark-bench | cli/src/test/scala/com/ibm/sparktc/sparkbench/workload/exercise/PartitionAndSleepWorkloadTest.scala | Scala | apache-2.0 | 1,338 |
package net.sansa_stack.query.spark.gremlinator.sparql2gremlin
import com.datastax.sparql.gremlin.SparqlToGremlinCompiler
import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal
import org.apache.tinkerpop.gremlin.structure.{Graph, Vertex}
object QuaryTranslator {
def apply(sparql: String, g... | SANSA-Stack/SANSA-RDF | sansa-query/sansa-query-spark/src/main/scala/net/sansa_stack/query/spark/gremlinator/sparql2gremlin/QuaryTranslator.scala | Scala | apache-2.0 | 429 |
package controllers
import javax.inject.Inject
import com.mohiva.play.silhouette.api.Silhouette
import com.mohiva.play.silhouette.api.Environment
import com.mohiva.play.silhouette.api.LoginEvent
import com.mohiva.play.silhouette.api.exceptions.{ConfigurationException, ProviderException}
import com.mohiva.play.silhouet... | sne11ius/geotracker-service | app/controllers/CredentialsAuthController.scala | Scala | gpl-3.0 | 2,870 |
package com.twitter.finagle.builder
import com.twitter.util
import com.twitter.concurrent.AsyncSemaphore
import com.twitter.finagle.{Server => FinagleServer, _}
import com.twitter.finagle.filter.{MaskCancelFilter, RequestSemaphoreFilter, ServerAdmissionControl}
import com.twitter.finagle.netty3.Netty3Listener
import c... | spockz/finagle | finagle-core/src/main/scala/com/twitter/finagle/builder/ServerBuilder.scala | Scala | apache-2.0 | 28,139 |
/*
* Copyright 2019 Scanamo
*
* 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 w... | scanamo/scanamo | scanamo/src/main/scala/org/scanamo/ops/package.scala | Scala | apache-2.0 | 7,908 |
/*
* 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/iht-frontend | test/iht/connectors/IhtConnectorTest.scala | Scala | apache-2.0 | 3,598 |
/**
* Copyright 2011-2012 eBusiness Information, Groupe Excilys (www.excilys.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
*
*... | Tjoene/thesis | Case_Programs/gatling-1.4.0/gatling-core/src/main/scala/com/excilys/ebi/gatling/core/structure/package.scala | Scala | gpl-2.0 | 950 |
package nodes.stats
import breeze.linalg.DenseVector
import breeze.numerics.sqrt
import org.apache.spark.mllib.stat.MultivariateOnlineSummarizer
import org.apache.spark.rdd.RDD
import pipelines.{Estimator, Transformer}
import utils.MLlibUtils
/**
* Represents a StandardScaler model that can transform dense vectors.
... | shivaram/keystone | src/main/scala/nodes/stats/StandardScaler.scala | Scala | apache-2.0 | 2,213 |
package controllers
import play.api.mvc.Controller
import play.api.data._
import format.Formatter
import play.api.data.Forms._
import play.api.data.format.Formats._
import validation.Constraint
import model.Location
import play.api.libs.json.Json.toJson
import play.libs.Akka
trait Locations {
this: Controller with... | jeantil/xstaffing-mobile | app/controllers/Locations.scala | Scala | mit | 2,797 |
package suzaku.ui.style
import suzaku.ui.resource.ImageResource
trait StylePropOrClass
trait StyleDef extends StylePropOrClass
trait StyleProperty extends StyleDef
trait StyleBaseProperty extends StyleProperty
// meta styles
case class StyleSeq(styles: List[StyleBaseProperty]) extends StyleDef {
def ++(other: S... | suzaku-io/suzaku | core-shared/shared/src/main/scala/suzaku/ui/style/StyleProperty.scala | Scala | apache-2.0 | 8,519 |
package ee.cone
import scala.annotation.StaticAnnotation
package object c4assemble {
class assemble extends StaticAnnotation
class fieldAccess extends StaticAnnotation
class ignore extends StaticAnnotation
type MakeJoinKey = IndexFactory⇒JoinKey
}
| wregs/c4proto | c4assemble-runtime/src/main/scala/ee/cone/c4assemble/package.scala | Scala | apache-2.0 | 260 |
package com.sksamuel.elastic4s.handlers.searches.queries.term
import com.sksamuel.elastic4s.ElasticDate
import com.sksamuel.elastic4s.json.{XContentBuilder, XContentFactory}
import com.sksamuel.elastic4s.requests.searches.queries.RangeQuery
object RangeQueryBodyFn {
def apply(range: RangeQuery): XContentBuilder = ... | sksamuel/elastic4s | elastic4s-handlers/src/main/scala/com/sksamuel/elastic4s/handlers/searches/queries/term/RangeQueryBodyFn.scala | Scala | apache-2.0 | 1,744 |
/*
* 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")... | ksimar/incubator-carbondata | integration/spark2/src/test/scala/org/apache/carbondata/spark/util/ExternalColumnDictionaryTestCase.scala | Scala | apache-2.0 | 11,961 |
package club.diybio.bank.views
import club.diybio.bank.views.stubs.WithDomain
import org.denigma.binding.extensions._
import org.denigma.binding.views.BindableView
import org.querki.jquery._
import org.scalajs.dom.raw.HTMLElement
import rx._
/**
* View for the sitebar
*/
class SidebarView (val elem:HTMLElement,val p... | denigma/plasmid-bank | frontend/src/main/scala/club/diybio/bank/views/SidebarView.scala | Scala | mpl-2.0 | 750 |
/*
* 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/test/scala/com/intel/analytics/bigdl/dllib/keras/layers/internal/InternalMaxSpec.scala | Scala | apache-2.0 | 1,037 |
/*
* 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/sift/SiftReminderNotice.scala | Scala | apache-2.0 | 1,614 |
/*
* Copyright 2017 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... | VlachJosef/bforms | app/uk/gov/hmrc/bforms/exceptions/UnexpectedState.scala | Scala | apache-2.0 | 1,425 |
package me.laiseca.docfulapi.model
case class Versions(list:List[String]) {
def first = list.head
def last = list.last
} | xabierlaiseca/docful-api | core/src/main/scala/me/laiseca/docfulapi/model/Versions.scala | Scala | apache-2.0 | 125 |
/**
* Licensed to Big Data Genomics (BDG) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The BDG licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use ... | Veryku/gnocchi | gnocchi-core/src/test/scala/net/fnothaft/gnocchi/algorithms/LoadPhenotypesWithCovariatesSuite.scala | Scala | apache-2.0 | 6,623 |
package me.heaton.genericity
class Reference[T] {
// _ is 0 for numeric types, false for the Boolean type,
// () for the Unit type and null for all object types.
private var contents: T = _
def set(value: T) { contents = value }
def get: T = contents
} | heaton/hello-scala | src/main/scala/me/heaton/genericity/Reference.scala | Scala | mit | 266 |
package de.frosner.broccoli.controllers
import de.frosner.broccoli.auth.{Account, Role}
import de.frosner.broccoli.services.SecurityService
import jp.t2v.lab.play2.auth.test.Helpers._
import org.mockito.Mockito._
import org.specs2.matcher.MatchResult
import org.specs2.matcher.MatchersImplicits._
import play.api.cache.... | FRosner/cluster-broccoli | server/src/test/scala/de/frosner/broccoli/controllers/AuthUtils.scala | Scala | apache-2.0 | 2,412 |
package views.json.DocumentSet
import play.api.i18n.Messages
import play.api.libs.json.{Json,JsValue}
import play.api.mvc.RequestHeader
import models.User
import com.overviewdocs.models.{DocumentSet,ImportJob}
object showHtml {
def apply(documentSet: DocumentSet, jobs: Iterable[ImportJob], nViews: Int)(implicit me... | overview/overview-server | web/app/views/DocumentSet/showHtml.json.scala | Scala | agpl-3.0 | 519 |
package controllers
import play.api._
import play.api.mvc._
import play.api.data._
import play.api.data.Forms._
import java.util.{Date}
import models._
import views._
/**
* Manage tasks related operations.
*/
object Tasks extends Controller with Secured {
/**
* Display the tasks panel for this project.
*... | play2-maven-plugin/play2-maven-test-projects | play23/scala/zentasks/app/controllers/Tasks.scala | Scala | apache-2.0 | 2,279 |
/*
* 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 ... | nilsgrabbert/spark | mllib/src/main/scala/org/apache/spark/ml/feature/RFormula.scala | Scala | apache-2.0 | 23,669 |
package blog2
import skinny.orm._, feature._
import scalikejdbc._, SQLInterpolation._
import org.joda.time._
case class Post(
id: Long,
title: String,
body: String,
tags: Seq[Tag] = Nil,
createdAt: DateTime,
updatedAt: Option[DateTime] = None)
object Post extends SkinnyCRUDMapper[Post] with TimestampsFea... | BlackPrincess/skinny-framework | orm/src/test/scala/blog2/Post.scala | Scala | mit | 833 |
package org.jetbrains.plugins.scala.components.libextensions
import java.io.File
import java.util.concurrent.atomic.AtomicBoolean
import com.intellij.ide.plugins.PluginManagerCore
import com.intellij.ide.util.PropertiesComponent
import com.intellij.notification._
import com.intellij.openapi.application.ApplicationMana... | JetBrains/intellij-scala | scala/scala-impl/src/org/jetbrains/plugins/scala/components/libextensions/LibraryExtensionsManager.scala | Scala | apache-2.0 | 11,361 |
import com.excilys.ebi.gatling.core.Predef._
import com.excilys.ebi.gatling.http.Predef._
import akka.util.duration._
import bootstrap._
class CreateRelationship extends Simulation {
val httpConf = httpConfig
.baseURL("http://localhost:9292")
val nbrNodes = 100000
val nodesRange = 1 to nbrNodes
val rnd =... | maxdemarzi/neo_accumulate_writes | neo4j_simulations/CreateRelationship.scala | Scala | mit | 759 |
/*
* Copyright (c) 2017 Mario Pastorelli (pastorelli.mario@gmail.com)
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
package sonic
package object shrink {
... | melrief/sonic | core/src/main/scala/sonic/shrink/package.scala | Scala | mpl-2.0 | 2,313 |
package sprawler.concurrency
import akka.actor.ActorSystem
import scala.concurrent.duration.FiniteDuration
import scala.concurrent.{ ExecutionContext, Future, Promise }
/**
* Extra useful concurrency related stuff to help with common concurrency tasks
*/
object FutureActions {
/**
* A port of play's Promise.... | daniel-trinh/sprawler | src/main/scala/sprawler/concurrency/FutureActions.scala | Scala | mit | 1,200 |
/**
* Copyright (C) 2010 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/xforms/control/ControlEventSupport.scala | Scala | lgpl-2.1 | 5,650 |
package no.netcompany.testdatagen.generators.sample
// Copyright (C) 2014 Lars Reed -- GNU GPL 2.0 -- see LICENSE.txt
import no.netcompany.testdatagen.aggreg.SequenceOf
import no.netcompany.testdatagen.dsl.DslLikeSyntax
import no.netcompany.testdatagen.generators.misc.Names
import no.netcompany.testdatagen.generators... | lre-mesan/testdata | src/test/scala/no/netcompany/testdatagen/generators/sample/LongerSample.scala | Scala | gpl-2.0 | 3,637 |
package almhirt.i18n.text
import org.scalatest._
class WordIteratorTests extends FunSuite with Matchers {
test("""It should deliver [] for """"") {
val iter = WordIterator("", "de")
iter.toList should equal(Nil)
}
test("""It should deliver [a] for "a"""") {
val iter = WordIterator("a", "de")
... | chridou/almhirt | almhirt-i18n/src/test/scala/almhirt/i18n/text/WordIteratorTests.scala | Scala | apache-2.0 | 1,055 |
package wandou.math.indicator
/**
* Define it as a RuntimeException, because this issue should be resolved in developing
*
* @author Caoyuan Deng
*/
final class BaseSerNotSetException(message: String) extends RuntimeException(message)
| wandoulabs/wandou-math | wandou-math/src/main/scala/wandou/math/indicator/BaseSerNotSetException.scala | Scala | apache-2.0 | 240 |
package com.twitter.finagle.netty3
import com.twitter.finagle.client.{LatencyCompensation, Transporter}
import com.twitter.finagle.httpproxy.HttpConnectHandler
import com.twitter.finagle.netty3.channel.{ChannelRequestStatsHandler, ChannelStatsHandler, IdleChannelHandler}
import com.twitter.finagle.netty3.socks.SocksCo... | kingtang/finagle | finagle-core/src/main/scala/com/twitter/finagle/netty3/Netty3Transporter.scala | Scala | apache-2.0 | 15,215 |
package scredis.tags
import org.scalatest.Tag
object V100 extends Tag("V100")
object V101 extends Tag("V101")
object V120 extends Tag("V120")
object V200 extends Tag("V200")
object V220 extends Tag("V220")
object V2212 extends Tag("V2212")
object V223 extends Tag("V223")
object V240 extends Tag("V240")
object V260 ex... | 1and1/scredis | src/test/scala/scredis/tags/Tags.scala | Scala | apache-2.0 | 633 |
package org.geoscript.style
package io
import org.geoscript.io.{ Format, Source, Sink }
object SLD extends Format[Style] {
def read(source: Source): Style =
source { in =>
new org.geotools.styling.SLDParser(factory, in).readXML()(0)
}
def write[T](s: Style, sink: Sink[T]): T = {
sink { out =>
... | dwins/geoscript.scala | geoscript/src/main/scala/style/io/SLD.scala | Scala | mit | 1,174 |
package com.sksamuel.scapegoat.inspections.collections
import com.sksamuel.scapegoat._
/**
* @author Stephen Samuel
*/
class ListSize
extends Inspection(
text = "List.size is O(n)",
defaultLevel = Levels.Info,
description = "Checks for use of List.size.",
explanation =
"List.size... | sksamuel/scalac-scapegoat-plugin | src/main/scala/com/sksamuel/scapegoat/inspections/collections/ListSize.scala | Scala | apache-2.0 | 894 |
/**
* This file is part of the TA Buddy project.
* Copyright (c) 2014 Alexey Aksenov ezh@ezh.msk.ru
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Affero General Global License version 3
* as published by the Free Software Foundation with the addition of t... | digimead/digi-TABuddy-desktop | part-model-editor/src/main/scala/org/digimead/tabuddy/desktop/model/editor/ui/view/editor/bar/element/Edit.scala | Scala | agpl-3.0 | 4,057 |
/*
* The MIT License (MIT)
*
* Copyright (c) 2016 GatlingCql developers
*
* 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 t... | Mishail/GatlingCql | src/main/scala/io/github/gatling/cql/response/CqlResponseHandler.scala | Scala | mit | 3,499 |
package com.example.android_servicetest
import com.example.android_servicetest.CommonUtil._
import android.app.Activity
import android.content.ComponentName
import android.content.Intent
import android.content.ServiceConnection
import android.os.Bundle
import android.os.IBinder
import android.widget.Button
import andr... | firefoxmmx2/Android_ServiceTest | src/com/example/android_servicetest/MainActivity.scala | Scala | apache-2.0 | 1,886 |
package scwebapp
object HttpMethod {
import method.*
val all:Seq[HttpMethod] =
Vector[HttpMethod](
OPTIONS, HEAD, GET, POST, PUT, DELETE, TRACE, CONNECT,
PROPFIND, PROPPATCH, MKCOL, COPY, MOVE, LOCK, UNLOCK
)
def lookup(caseless:String):Option[HttpMethod] =
all find { _.id == caseless }
}
sealed abst... | ritschwumm/scwebapp | modules/core/src/main/scala/scwebapp/HttpMethod.scala | Scala | bsd-2-clause | 1,126 |
package org.jetbrains.plugins.scala
package conversion
package generated
class JavaToScalaConversionStatementsTest extends JavaToScalaConversionTestBase {
//This class was generated by build script, please don't change this
override def folderPath: String = super.folderPath + "statements/"
def testAssert(): Uni... | JetBrains/intellij-scala | scala/conversion/test/org/jetbrains/plugins/scala/conversion/generated/JavaToScalaConversionStatementsTest.scala | Scala | apache-2.0 | 1,088 |
/**
* 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... | joansmith/orbeon-forms | src/main/scala/org/orbeon/oxf/xforms/control/controls/InstanceMirror.scala | Scala | lgpl-2.1 | 17,731 |
/*
* 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/iht-frontend | app/iht/models/des/ihtReturn/Liability.scala | Scala | apache-2.0 | 926 |
/*
* Copyright (c) 2008 Robey Pointer <robeypointer@lag.net>
*
* 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, cop... | al3x/kestrel | src/main/scala/net/lag/kestrel/QueueCollection.scala | Scala | mit | 6,772 |
/*
* 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/main/scala/org/scalatest/words/ResultOfMessageWordApplication.scala | Scala | apache-2.0 | 1,800 |
package org.jetbrains.plugins.scala.codeInsight.intention.controlflow
import com.intellij.codeInsight.intention.PsiElementBaseIntentionAction
import com.intellij.openapi.editor.Editor
import com.intellij.openapi.project.Project
import com.intellij.psi.util.PsiTreeUtil
import com.intellij.psi.{PsiDocumentManager, PsiEl... | loskutov/intellij-scala | src/org/jetbrains/plugins/scala/codeInsight/intention/controlflow/MergeElseIfIntention.scala | Scala | apache-2.0 | 3,325 |
/*
* 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 ... | chenc10/Spark-PAF | core/src/test/scala/org/apache/spark/rdd/PairRDDFunctionsSuite.scala | Scala | apache-2.0 | 27,620 |
package de.zalando.apifirst.generators
import de.zalando.apifirst.Application.{ApiCall, Parameter, StrictModel}
import de.zalando.apifirst.Domain._
import de.zalando.apifirst.ScalaName._
import de.zalando.apifirst.generators.DenotationNames._
import de.zalando.apifirst.naming.Reference
import scala.language.existenti... | zalando/play-swagger | play-scala-generator/src/main/scala/de/zalando/apifirst/generators/AstScalaPlayEnricher.scala | Scala | mit | 6,715 |
package test
import com.memsql.spark.etl.api.UserExtractConfig
import com.memsql.spark.etl.utils.ByteUtils
import com.memsql.streamliner.examples._
import org.apache.spark.streaming.{Time, Duration, StreamingContext}
import java.io._
import spray.json._
import test.util.{UnitSpec, TestLogger, LocalSparkContext}
import... | memsql/streamliner-examples | src/test/scala/test/ExtractorsSpec.scala | Scala | apache-2.0 | 3,024 |
package org.http4s
package server
import java.util.concurrent.TimeUnit
import fs2._
import com.codahale.metrics.MetricRegistry
import com.codahale.metrics.json.MetricsModule
import com.fasterxml.jackson.databind.ObjectMapper
package object metrics {
private val defaultMapper = {
val module = new MetricsModule(... | ZizhengTai/http4s | server-metrics/src/main/scala/org/http4s/server/metrics/package.scala | Scala | apache-2.0 | 1,277 |
package org.jetbrains.plugins.scala
package lang
package psi
package api
package toplevel
package typedef
import com.intellij.navigation.NavigationItem
import com.intellij.openapi.util.Iconable
import com.intellij.psi._
import com.intellij.psi.impl.PsiClassImplUtil
import com.intellij.psi.util.PsiModificationTracker
i... | triggerNZ/intellij-scala | src/org/jetbrains/plugins/scala/lang/psi/api/toplevel/typedef/ScTypeDefinition.scala | Scala | apache-2.0 | 4,984 |
package jp.co.cyberagent.aeromock.template.groovytemplate
import jp.co.cyberagent.aeromock.config.TemplateConfig
/**
* Configuration of class for groovy template.
* @author stormcat24
*/
case class GroovyTemplateConfig(
extension: Option[String],
mode: Option[String]
) extends TemplateConfig
| CyberAgent/aeromock | aeromock-groovy-template/src/main/scala/jp/co/cyberagent/aeromock/template/groovytemplate/GroovyTemplateConfig.scala | Scala | mit | 302 |
/* _____ _
* | ___| __ __ _ _ __ ___ (_) __ _ _ __
* | |_ | '__/ _` | '_ ` _ \\| |/ _` | '_ \\
* | _|| | | (_| | | | | | | | (_| | | | |
* |_| |_| \\__,_|_| |_| |_|_|\\__,_|_| |_|
*
* Copyright 2014 Pellucid Analytics
*
* Licensed under the Apache License, Version 2.0 (the "License");
*... | codeaudit/framian | framian/src/main/scala/framian/reduce/Max.scala | Scala | apache-2.0 | 1,353 |
import org.scalatest._
class HammingSpecs extends FlatSpec with Matchers {
it should "detect no difference between empty strands" in {
Hamming.compute("", "") should be (0)
}
it should "detect no difference between identical strands" in {
Hamming.compute("GGACTGA", "GGACTGA") should be (0)
}
it sh... | daewon/til | exercism/scala/hamming/src/test/scala/hamming_test.scala | Scala | mpl-2.0 | 983 |
package org.scaladebugger.api.lowlevel.events.filters.processors
import com.sun.jdi.event._
import com.sun.jdi._
import org.scaladebugger.api.lowlevel.events.filters.WildcardPatternFilter
import org.scaladebugger.test.helpers.ParallelMockFunSpec
import org.scalamock.scalatest.MockFactory
import org.scalatest.{FunSpec,... | ensime/scala-debugger | scala-debugger-api/src/test/scala/org/scaladebugger/api/lowlevel/events/filters/processors/WildcardPatternFilterProcessorSpec.scala | Scala | apache-2.0 | 8,688 |
package org.crockeo.genericplatformer.geom
// The types of collision
trait CollisionType
case object TopCollision extends CollisionType
case object BottomCollision extends CollisionType
case object LeftCollision extends CollisionType
case object RightCollision extends CollisionType
class CollisionRectangle(var... | crockeo/generic-platformer | src/org/crockeo/genericplatformer/geom/CollisionRectangle.scala | Scala | gpl-3.0 | 3,088 |
package com.twitter.finagle.httpproxy
import org.scalatest.FunSuite
import org.scalatest.junit.JUnitRunner
import org.junit.runner.RunWith
import org.scalatest.mock.MockitoSugar
import org.mockito.Mockito.{times, verify, when, atLeastOnce}
import org.mockito.ArgumentCaptor
import org.mockito.Matchers._
import org.jbos... | travisbrown/finagle | finagle-core/src/test/scala/com/twitter/finagle/httpproxy/HttpConnectHandlerTest.scala | Scala | apache-2.0 | 5,359 |
package mesosphere.util
import org.slf4j.LoggerFactory
trait Logging {
protected[this] val log = LoggerFactory.getLogger(getClass.getName)
}
| Caerostris/marathon | src/main/scala/mesosphere/util/Logging.scala | Scala | apache-2.0 | 145 |
package com.sksamuel.avro4s.schema
import com.sksamuel.avro4s.{AvroSchema, AvroTransient}
import org.scalatest.funsuite.AnyFunSuite
import org.scalatest.matchers.should.Matchers
class TransientSchemaTest extends AnyFunSuite with Matchers {
test("@AvroTransient fields should be ignored") {
case class TransientF... | sksamuel/avro4s | avro4s-core/src/test/scala/com/sksamuel/avro4s/schema/TransientSchemaTest.scala | Scala | apache-2.0 | 587 |
// Copyright (c) 2013-2020 Rob Norris and Contributors
// This software is licensed under the MIT License (MIT).
// For more information see LICENSE or https://opensource.org/licenses/MIT
package doobie.util
import shapeless._
import shapeless.ops.hlist.IsHCons
trait GetPlatform {
import doobie.util.compat.=:=
... | tpolecat/doobie | modules/core/src/main/scala-2/util/GetPlatform.scala | Scala | mit | 673 |
/*
* Copyright 2014 Commonwealth Computer Research, 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 applica... | jwkessi/geomesa | geomesa-core/src/test/scala/org/locationtech/geomesa/core/process/knn/GenerateKNNQueryTest.scala | Scala | apache-2.0 | 4,298 |
package edu.colorado.hopper.jumping
import com.ibm.wala.analysis.pointers.HeapGraph
import com.ibm.wala.ipa.callgraph.propagation.{HeapModel, InstanceKey, PointerKey}
import com.ibm.wala.ipa.callgraph.{CGNode, CallGraph}
import com.ibm.wala.ipa.cha.IClassHierarchy
import com.ibm.wala.ssa.SSAInvokeInstruction
import co... | cuplv/hopper | src/main/scala/edu/colorado/hopper/jumping/JumpingTransferFunctions.scala | Scala | apache-2.0 | 6,319 |
/*******************************************************************************
Copyright (c) 2013-2014, KAIST.
All rights reserved.
Use is subject to license terms.
This distribution may include materials developed by third parties.
******************************************************************... | darkrsw/safe | src/main/scala/kr/ac/kaist/jsaf/widl/WIDLToDB.scala | Scala | bsd-3-clause | 22,252 |
package skinny.controller.feature
/**
* Filtering sensitive parameters.
*
* config.filter_parameters in Rails.
*/
trait SensitiveParametersFeature {
/**
* Returns registered sensitive parameter names.
*/
protected def sensitiveParameterNames: Seq[String] = Seq(
"password",
"password_confir... | seratch/skinny-framework | framework/src/main/scala/skinny/controller/feature/SensitiveParametersFeature.scala | Scala | mit | 416 |
abstract class NeedsXEarly {
val x: Int
}
class Foo extends NeedsXEarly {
// TODO NEEDS MANUAL CHANGE (early initializers)
// BEGIN copied early initializers
val x = 1
// END copied early initializers
}
| yusuke2255/dotty | tests/untried/pos/needstypeearly.scala | Scala | bsd-3-clause | 205 |
package edu.jhu.hlt.probe
import util._
import scala.annotation.unchecked.{uncheckedVariance => uv}
/**
* Represents a group of features (having the same group name)
* that has real-valued weights.
*
* @author Tongfei Chen (ctongfei@gmail.com).
* @since 0.4.0
*/
trait FeatureGroup[+A] { self =>
/** The ... | ctongfei/probe | core/src/main/scala/edu/jhu/hlt/probe/FeatureGroup.scala | Scala | mit | 3,950 |
package is.hail.expr.ir
import is.hail.utils.ArrayBuilder
object LiftRelationalValues {
def apply(ir0: IR): IR = {
def rewrite(ir: BaseIR, ab: ArrayBuilder[(String, IR)]): BaseIR = ir match {
case RelationalLet(name, value, body) =>
val value2 = rewrite(value, ab).asInstanceOf[IR]
val ab... | danking/hail | hail/src/main/scala/is/hail/expr/ir/LiftRelationalValues.scala | Scala | mit | 1,686 |
/***********************************************************************
* Copyright (c) 2013-2016 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 ... | mdzimmerman/geomesa | geomesa-kafka/geomesa-kafka-datastore/src/test/scala/org/locationtech/geomesa/kafka/ReplayKafkaConsumerFeatureSourceTest.scala | Scala | apache-2.0 | 9,993 |
package apexutils
import scala.slick.driver.H2Driver
import scala.slick.driver.PostgresDriver
import scala.slick.driver.MySQLDriver
import play.api.Play
import play.api.Play.current
// Inspired by http://stackoverflow.com/a/19061993
object DynamicDriver {
val simple = profile.simple
lazy val profile = {
val driv... | rpiaggio/apex-utils | src/main/scala/apexutils/DynamicDriver.scala | Scala | mit | 508 |
/**
* Copyright 2013-2015 PayPal
*
* 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 ... | 2rs2ts/cascade | common/src/test/scala/com/paypal/cascade/common/tests/map/RichMapSpecs.scala | Scala | apache-2.0 | 1,746 |
object Program1 {
def main(args: Array[String]) {
println("Hello from Program1")
}
}
| grzegorzbalcerek/scala-book-examples | examples/Program1.scala | Scala | mit | 93 |
package com.github.jeanadrien.evrythng.scala.json
/**
*
*/
case class Location(
latitude : Option[Double],
longitude : Option[Double],
timestamp : Option[Long] = None
) {
}
object Location {
def of(latitude : Double, longitude : Double) : Location = Location(Some(latitude), Some(longitude))
}
| jeanadrien/evrythng-scala-sdk | src/main/scala/com/github/jeanadrien/evrythng/scala/json/Location.scala | Scala | apache-2.0 | 320 |
package codechicken.multipart
/**
* Interface which must be implemented by parts that go in an edge slot.
*/
trait TEdgePart extends TSlottedPart
{
/**
* Return true if this part can conduct redstone signal or let redstone signal pass through it.
*/
def conductsRedstone = false
} | Chicken-Bones/ForgeMultipart | src/codechicken/multipart/TEdgePart.scala | Scala | lgpl-2.1 | 301 |
/*
* Copyright 2014 Treode, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to... | Treode/store | store/src/com/treode/store/paxos/Acceptor.scala | Scala | apache-2.0 | 10,689 |
package org.flowpaint.raster.layer
import _root_.org.flowpaint.util.Rectangle
import org.flowpaint.raster.picture.Picture
import org.flowpaint.model2.Operation
import org.flowpaint.raster.channel.Raster
/**
* A layer with raster data, rendering the data on top of the provided raster data.
*/
class RasterLayer(val p... | zzorn/flowpaint | src/main/scala/org/flowpaint/raster/layer/RasterLayer.scala | Scala | gpl-2.0 | 956 |
/*
* Copyright 2019 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/frontend-bootstrap | src/main/scala/uk/gov/hmrc/play/frontend/filters/DeviceIdCookieFilter.scala | Scala | apache-2.0 | 1,786 |
package de.unifreiburg.cs.proglang.jgs.jimpleutils
import de.unifreiburg.cs.proglang.jgs.constraints.TypeDomain
import de.unifreiburg.cs.proglang.jgs.constraints.TypeDomain._
import de.unifreiburg.cs.proglang.jgs.instrumentation.{ACasts, Var}
import de.unifreiburg.cs.proglang.jgs.instrumentation.ACasts.{CxCast, ValueC... | luminousfennell/jgs | GradualConstraints/src/main/java/de/unifreiburg/cs/proglang/jgs/jimpleutils/CastsFromMapping.scala | Scala | bsd-3-clause | 2,346 |
/*
* Scala (https://www.scala-lang.org)
*
* Copyright EPFL and Lightbend, Inc.
*
* Licensed under Apache License 2.0
* (http://www.apache.org/licenses/LICENSE-2.0).
*
* See the NOTICE file distributed with this work for
* additional information regarding copyright ownership.
*/
package scala.async
package ru... | scala/async | src/test/scala/scala/async/run/anf/AnfTransformSpec.scala | Scala | bsd-3-clause | 9,892 |
/*
* Copyright 2001-2009 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... | svn2github/scalatest | src/main/scala/org/scalatest/fixture/FreeSpecLike.scala | Scala | apache-2.0 | 23,681 |
/*
* Copyright 2014 IBM Corp.
*
* 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... | bpburns/spark-kernel | kernel/src/main/scala/com/ibm/spark/kernel/protocol/v5/handler/CodeCompleteHandler.scala | Scala | apache-2.0 | 2,428 |
/**
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may... | flange/drift-dev | kafka/00-kafka_2.11-0.10.1.0/libs/tmp/kafka/cluster/Replica.scala | Scala | apache-2.0 | 4,719 |
// Generated by <a href="http://scalaxb.org/">scalaxb</a>.
package eveapi.xml.account.char.WalletTransactions
import scala.concurrent.Future
/**
usage:
val obj = scalaxb.fromXML[eveapi.xml.account.char.WalletTransactions.Foo](node)
val document = scalaxb.toXML[eveapi.xml.account.char.WalletTransactions.Foo](obj, "fo... | scala-eveapi/eveapi | xml/src/main/scala/eveapi/xml/char/WalletTransactions/xmlprotocol.scala | Scala | mit | 11,777 |
inline val a = ""
def (x: Int) combine (y: Int) = x + y
def combine(x: Int, y: Int, z: Int) = x + y + z
def combine = 0
def foo = "foo"
| som-snytt/dotty | tests/semanticdb/expect/toplevel.scala | Scala | apache-2.0 | 136 |
package models
import play.api.Play.current
import java.util.Date
import com.novus.salat._
import com.novus.salat.annotations._
import com.novus.salat.dao._
import com.mongodb.casbah.Imports._
import se.radley.plugin.salat._
import mongoContext._
import models.persistance._
import com.mongodb.casbah.Imports.ObjectId
... | TPTeam/mongo_views_example | app/models/Granpa.scala | Scala | gpl-2.0 | 2,390 |
package de.holisticon.showcase.ticketbooking.model
/**
* <p>
* A reusable representation of an address.
* </p>
*
* <p>
* Addresses are used in many places in an application, so to observe the DRY principle, we model Address as an embeddable
* entity. An embeddable entity appears as a child in the object model, ... | holisticon/reactive-ticket-booking | src/main/scala/de/holisticon/showcase/ticketbooking/model/Address.scala | Scala | apache-2.0 | 522 |
/*
* 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... | wangyixiaohuihui/spark2-annotation | sql/catalyst/src/test/scala/org/apache/spark/sql/types/DecimalSuite.scala | Scala | apache-2.0 | 10,596 |
package eu.radusw.services
import akka.actor.ActorSystem
import akka.event.{Logging, LoggingAdapter}
import cats.implicits._
import courier._
import eu.radusw.AppConfig.Config
import eu.radusw.model.{Error, GiftPair, Person}
import eu.radusw.util.MonixExtensions.RichTask
import javax.mail.internet.InternetAddress
impo... | radusw/SantaEMail | src/main/scala/eu/radusw/services/MailService.scala | Scala | apache-2.0 | 2,005 |
package com.socrata.datacoordinator
package service
import com.ibm.icu.util.ULocale
import com.rojoma.json.v3.ast._
import com.rojoma.json.v3.codec.{DecodeError, JsonDecode, JsonEncode}
import com.rojoma.json.v3.io._
import com.rojoma.json.v3.util.{Strategy, JsonKeyStrategy, AutomaticJsonDecodeBuilder}
import com.socr... | socrata-platform/data-coordinator | coordinator/src/main/scala/com/socrata/datacoordinator/service/Mutator.scala | Scala | apache-2.0 | 44,859 |
class A {
def f() : Int = {
while (false)
return 0
}
}
object Main { def main(args: Array[String]) { } }
| tobast/compil-petitscala | tests/typing/bad/testfile-no_return4-1.scala | Scala | gpl-3.0 | 119 |
package de.about.scalatrain
import org.specs2.mutable._
class TrainSpec extends Specification {
"Creating a Train should" in {
"throw an IAE for a null kind" >> {
new Train(null, "number") must throwA[IllegalArgumentException]
}
"throw an IAE for a null number" in {
new Train("kind", null) ... | atamanroman/scalatrain | src/test/scala/de/aboutco/scalatrain/TrainSpec.scala | Scala | unlicense | 370 |
/*
* Copyright (c) 2012 - 2020 Splice Machine, Inc.
*
* This file is part of Splice Machine.
* Splice Machine 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, or (at your option) ... | splicemachine/spliceengine | splice_spark2/src/test/scala/com/splicemachine/spark2/splicemachine/triggers/TestContext.scala | Scala | agpl-3.0 | 3,667 |
/**
* Created by pnagarjuna on 12/11/15.
*/
object Main {
def main(args: Array[String]): Unit = {
println(s"head of the list")
def head[A](xs: List[A]): A = xs(0)
val xs = 1 :: 2 :: 3 :: Nil
println(s"${head(xs)}")
}
}
| pamu/scalaz-demo | src/main/scala/Main.scala | Scala | apache-2.0 | 247 |
package db
import com.bryzek.apidoc.api.v0.models.{Application, Change, ChangeVersion, User, UserSummary, Version}
import com.bryzek.apidoc.api.v0.models.{Diff, DiffBreaking, DiffNonBreaking, DiffUndefinedType}
import com.bryzek.apidoc.common.v0.models.{Reference, ReferenceGuid}
import com.bryzek.apidoc.internal.v0.mo... | Seanstoppable/apidoc | api/app/db/ChangesDao.scala | Scala | mit | 7,832 |
/*
* Copyright (C) 22/11/12 Romain Reuillon
*
* 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.
*
* This pr... | openmole/openmole | openmole/plugins/org.openmole.plugin.method.evolution/src/main/scala/org/openmole/plugin/method/evolution/package.scala | Scala | agpl-3.0 | 2,868 |
package omniauth.lib
import net.liftweb.util.Props
import scala.sys.SystemProperties
import net.liftweb.common.{Full, Box}
/**
* Property access utility which favors SystemProperties over the Lift Props. The rationale is that system
* properties are often set via the command-line or the cloud container, and hence ... | ghostm/lift-omniauth | src/main/scala/omniauth/lib/Properties.scala | Scala | apache-2.0 | 687 |
import akka.http.scaladsl.model.StatusCodes
import akka.http.scaladsl.testkit.ScalatestRouteTest
import org.scalatest.{Matchers, WordSpec}
class TodoRouterCreateSpec extends WordSpec with Matchers with ScalatestRouteTest {
import de.heikoseeberger.akkahttpcirce.FailFastCirceSupport._
import io.circe.generic.auto.... | matija94/show-me-the-code | akka-http-quickstart/src/test/scala/TodoRouterCreateSpec.scala | Scala | mit | 1,593 |
package daos
import java.util.UUID
import com.google.inject.{ImplementedBy, Inject, Singleton}
import models._
import org.bson.{BsonArray, BsonValue}
import org.mongodb.scala._
import org.mongodb.scala.model.Filters._
import org.mongodb.scala.result.UpdateResult
import play.api.libs.concurrent.Execution.Implicits.de... | TVilaboa/Egresados | app/daos/GraduateDao.scala | Scala | gpl-3.0 | 11,579 |
/***********************************************************************
* Copyright (c) 2013-2019 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... | elahrvivaz/geomesa | geomesa-fs/geomesa-fs-storage/geomesa-fs-storage-orc/src/main/scala/org/locationtech/geomesa/fs/storage/orc/OrcFileSystemStorageFactory.scala | Scala | apache-2.0 | 1,091 |
/*
* 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... | yiheng/BigDL | spark/dl/src/main/scala/com/intel/analytics/bigdl/utils/Table.scala | Scala | apache-2.0 | 8,797 |
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.