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 alu
import Chisel._
import MicroCodes.MicroCodes._
class ALU extends Module {
var io = new Bundle{
var wire_op= Bits(INPUT, width = 5)
var wire_data_reg_a= SInt(INPUT ,width = 32)
var wire_data_reg_b= SInt(INPUT ,width = 32)
var wire_data_output = SInt(OUTPUT, width = 32)
}
val alu_shamt... | Coxious/MixCPU | project/alu.scala | Scala | gpl-2.0 | 2,105 |
package config
import org.apache.commons.lang3.StringUtils
import org.pac4j.core.authorization.authorizer.ProfileAuthorizer
import org.pac4j.core.context.WebContext
import org.pac4j.core.profile.CommonProfile
class CustomAuthorizer extends ProfileAuthorizer[CommonProfile] {
def isAuthorized(context: WebContext, pr... | ygpark2/play-ain-board | app/config/CustomAuthorizer.scala | Scala | bsd-3-clause | 628 |
/*
Copyright 2012 Twitter, 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 in writing, software
distr... | tdyas/scalding | scalding-json/src/main/scala/com/twitter/scalding/JsonLine.scala | Scala | apache-2.0 | 3,800 |
/*
* Copyright (C) 2014 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 app... | adelapena/cassandra-lucene-index | plugin/src/test/scala/com/stratio/cassandra/lucene/BaseScalaTest.scala | Scala | apache-2.0 | 2,276 |
/**
* 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-http/src/main/scala/com/excilys/ebi/gatling/http/check/bodypart/ChecksumCheck.scala | Scala | gpl-2.0 | 1,202 |
package ch.wsl.rest.service
import spray.http.StatusCodes
import akka.actor.Actor
import spray.routing.{HttpService, RejectionHandler}
// we don't implement our route structure directly in the service actor because
// we want to be able to test it independently, without having to spin up an actor
class MainServic... | minettiandrea/postgres-restify | server/src/main/scala/ch/wsl/rest/service/MainService.scala | Scala | apache-2.0 | 1,036 |
package im.actor.server.enrich
import akka.actor.ActorSystem
import akka.stream.ActorMaterializer
import im.actor.server
import org.scalatest.concurrent.ScalaFutures
import org.scalatest.{ FlatSpecLike, Matchers }
import im.actor.server.{ ActorSpecification, SqlSpecHelpers }
abstract class BaseRichMessageSpec(_syste... | boneyao/actor-platform | actor-server/actor-tests/src/test/scala/im/actor/server/enrich/BaseRichMessageSpec.scala | Scala | mit | 539 |
/*
* This file is part of the Linux Variability Modeling Tools (LVAT).
*
* Copyright (C) 2010 Steven She <[email protected]>
*
* LVAT 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 v... | scas-mdd/linux-variability-analysis-tools.fm-translation | src/main/scala/gsd/linux/Tseitin.scala | Scala | gpl-3.0 | 2,848 |
package coursier.cli.install
import java.nio.file.{Path, Paths}
import caseapp.Tag
import cats.data.{Validated, ValidatedNel}
final case class UninstallParams(
dir: Path,
all: Boolean,
verbosity: Int
)
object UninstallParams {
def apply(options: UninstallOptions): ValidatedNel[String, UninstallParams] = {
... | alexarchambault/coursier | modules/cli/src/main/scala/coursier/cli/install/UninstallParams.scala | Scala | apache-2.0 | 890 |
package gv
package isi
package std.conversions
object ImplicitResolutionOrder {
trait P0 extends AnyRef
// with convertible.ImplicitResolutionOrder.Conversions
trait P50 extends AnyRef with P0
with ByteConversions
trait P60 extends AnyRef with P50
with JavaIoConversions
trait P70 extends AnyRef w... | mouchtaris/jleon | src/main/scala-2.12/gv/isi/std/conversions/ImplicitResolutionOrder.scala | Scala | mit | 626 |
/*
* 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/test/scala/org/apache/spark/sql/execution/datasources/FileMetadataStructSuite.scala | Scala | apache-2.0 | 18,362 |
package java.util
trait ListIterator[E] extends Iterator[E] {
def add(e: E): Unit
def hasPrevious(): Boolean
def previous(): E
def previousIndex(): Int
def nextIndex(): Int
def set(e: E): Unit
}
| doron123/scala-js | javalib/src/main/scala/java/util/ListIterator.scala | Scala | bsd-3-clause | 208 |
package com.sfxcode.sapphire.core.demo.login.controller
import com.sfxcode.sapphire.core.controller.ViewController
import com.sfxcode.sapphire.core.demo.login.LoginApplicationController
import com.sfxcode.sapphire.core.demo.login.model.User
import com.sfxcode.sapphire.core.value._
import javafx.event.ActionEvent
impor... | sfxcode/sapphire-core | demos/login/src/main/scala/com/sfxcode/sapphire/core/demo/login/controller/ProfileController.scala | Scala | apache-2.0 | 1,470 |
object DepMethTypes {
trait Foo {
type Bar
def bar: Bar
}
object AFoo extends Foo {
type Bar = String
def bar = ""
}
val x: Foo = null
def bar(foo: Foo): foo.Bar = foo.bar /* Expression of type DepMethTypes.Foo#Bar doesn't conform to expected type foo.type#Bar */
val s: String = /*star... | ilinum/intellij-scala | testdata/typeInference/bugs5/SCL5048.scala | Scala | apache-2.0 | 443 |
/*
* Copyright 2017 Georgi Krastev
*
* 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 ... | joroKr21/flink-shapeless | src/main/scala/org/apache/flink/api/scala/derived/typeinfo/MkTypeInfo4_Traversable.scala | Scala | apache-2.0 | 4,259 |
package io.github.tailhq.dynaml.models.gp
import io.github.tailhq.dynaml.kernels.LocalScalarKernel
import org.apache.log4j.Logger
/**
* @author tailhq date: 11/8/16.
*
* Abstract implementation of multi-task gaussian process
* as outlined in Lawrence et. al 2012 on arxiv
* @tparam I The index set of the GP.... | mandar2812/DynaML | dynaml-core/src/main/scala/io/github/tailhq/dynaml/models/gp/MTGPRegressionModel.scala | Scala | apache-2.0 | 1,232 |
/*
* 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 ... | dbtsai/spark | resource-managers/kubernetes/integration-tests/src/test/scala/org/apache/spark/deploy/k8s/integrationtest/Utils.scala | Scala | apache-2.0 | 4,377 |
package spire
package macros
import org.scalatest.FunSuite
import org.scalatest.Matchers
import org.scalatest.prop.GeneratorDrivenPropertyChecks
import org.scalacheck.{Arbitrary, Gen}
class CheckedTest extends FunSuite with GeneratorDrivenPropertyChecks with Matchers {
import Checked.checked
import Arbitrary.arb... | rklaehn/spire | macros/src/test/scala/spire/macros/CheckedTest.scala | Scala | mit | 4,723 |
package net.vanfleteren.objectvalidation
import org.scalactic.{Bad, Every, Fail, Good, One, Or, Pass}
/**
* Methods returning T Or Every[Error] should be used first on the actual value being validated.
* The methods returning ValidationError can be chained on them later using when.
*
* For example:
*
* val x =... | cvanfleteren/objectvalidation | src/main/scala/net/vanfleteren/objectvalidation/DefaultValidations.scala | Scala | apache-2.0 | 3,073 |
// Copyright 2011-2012 James Michael Callahan
// See LICENSE-2.0 file for licensing information.
package org.scalagfx.math
//--------------------------------------------------------------------------------------------------
// P O S 2 D
... | JimCallahan/Graphics | src/org/scalagfx/math/Pos2d.scala | Scala | apache-2.0 | 9,662 |
/*
* Copyright (c) 2002-2018 "Neo Technology,"
* Network Engine for Objects in Lund AB [http://neotechnology.com]
*
* This file is part of Neo4j.
*
* Neo4j is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundatio... | HuangLS/neo4j | community/cypher/acceptance/src/test/scala/org/neo4j/internal/cypher/acceptance/SkipLimitAcceptanceTest.scala | Scala | apache-2.0 | 1,775 |
import sbt._
import de.wayofquality.sbt.testlogconfig.TestLogConfig.autoImport._
import blended.sbt.Dependencies
object BlendedAkka extends ProjectFactory {
private[this] val helper = new ProjectSettings(
projectName = "blended.akka",
description = "Provide OSGi services and API to use Actors in OSGi bundle... | lefou/blended | project/BlendedAkka.scala | Scala | apache-2.0 | 1,224 |
package org.reactivecouchbase.rs.scaladsl
/**
* Handles the retries on error. Similar to `RetryBuilder` of java client of couchbase.
*/
object Retries {
import scala.concurrent._
import scala.concurrent.duration._
import akka.pattern.after
import akka.actor.Scheduler
/**
* Tries to invoke a future blo... | ReactiveCouchbase/reactivecouchbase-rs-core | src/main/scala/org/reactivecouchbase/rs/scaladsl/Retries.scala | Scala | apache-2.0 | 1,859 |
package core.clustering.model
import core.DataSet
import core.plotting.Plotting
import core.util.Distances.DistanceFunc
import org.jfree.chart.{ChartFactory, ChartFrame}
import org.jfree.data.xy.{XYSeries, XYSeriesCollection}
/**
* This class represents
*/
class CentroidModel(clusters: List[CentroidCluster],
... | fernandoj92/ScalaML | src/main/scala/core/clustering/model/CentroidModel.scala | Scala | gpl-3.0 | 2,370 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | PredictionIO/PredictionIO | storage/s3/src/main/scala/org/apache/predictionio/data/storage/s3/S3Models.scala | Scala | apache-2.0 | 3,477 |
/*
* 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
package tools.ns... | scala/scala | src/compiler/scala/tools/nsc/Driver.scala | Scala | apache-2.0 | 2,483 |
package nlpdata.util
import cats.Show
import cats.Order
import cats.Monoid
import scala.language.implicitConversions
/* Welcome to the new world.
* The world of ad-hoc refinement types requiring nothing more from the user than a single method call.
* NO MORE WILL YOU BE UNCERTAIN, ON THE FIRST LINE OF YOUR METHOD,... | julianmichael/nlpdata | nlpdata/src/nlpdata/util/LowerCaseString.scala | Scala | mit | 5,631 |
/* Copyright 2009-2021 EPFL, Lausanne */
import stainless.lang._
object ArrayNested1 {
def test(): Int = {
var a = Array(1, 2, 0)
def nested(): Unit = {
require(a.length == 3)
a = a.updated(1, 5)
}
nested()
a(1)
} ensuring(_ == 5)
}
| epfl-lara/stainless | frontends/benchmarks/imperative/valid/ArrayNested1.scala | Scala | apache-2.0 | 277 |
package com.databricks.spark.sql.perf.mllib.feature
import org.apache.spark.ml
import org.apache.spark.ml.linalg.{Vector, Vectors}
import org.apache.spark.ml.PipelineStage
import org.apache.spark.sql._
import org.apache.spark.sql.functions._
import com.databricks.spark.sql.perf.mllib.OptionImplicits._
import com.data... | databricks/spark-sql-perf | src/main/scala/com/databricks/spark/sql/perf/mllib/feature/VectorAssembler.scala | Scala | apache-2.0 | 1,854 |
package xfp.simulation
import xfp.fixedpoint.{FixedPointFormat => FPFormat, Interval}
object TestExamples extends App with Simulation {
//val err = findMaxError(bspline1_1D, bspline1_1I, FPFormat(16, 14), Interval(0.0, 1.0), 15, 0.1)
var err = findLowerBound(bspline1_1D, bspline1_1I, FPFormat(16, 14), Interval(0... | malyzajko/xfp | analysis_tool/src/xfp/simulation/TestExamples.scala | Scala | bsd-3-clause | 34,262 |
package arrxml.arrow
import annotation.implicitNotFound
@implicitNotFound(msg = "No instance in scope for ArrowIf[${=>>}].")
trait ArrowIf[=>>[-_, +_]] extends ArrowList[=>>] {
/**
* if lifted to arrows
*/
def ifA[A, B, C](predicate : A =>> B)(a1 : A =>> C)(a2 : A =>> C) : A =>> C
/**
* shortcu... | ChrisNeveu/ArrXml | src/main/scala/arrxml/arrow/ArrowIf.scala | Scala | bsd-3-clause | 5,514 |
/*
* 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 ... | apache/flink | flink-table/flink-table-planner/src/test/scala/org/apache/flink/table/planner/runtime/stream/table/GroupWindowTableAggregateITCase.scala | Scala | apache-2.0 | 14,170 |
/*
* Copyright 2013 Twitter 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... | twitter/storehaus | storehaus-algebra/src/test/scala/com/twitter/storehaus/algebra/reporting/ReportingReadableStoreProperties.scala | Scala | apache-2.0 | 4,888 |
package im.actor.server.persist.auth
import java.time.{ ZoneOffset, LocalDateTime }
import scala.concurrent.ExecutionContext
import im.actor.server.db.ActorPostgresDriver.api._
import im.actor.server.model.{ AuthTransaction, AuthTransactionBase }
private[auth] abstract class AuthTransactionRepoBase[T](tag: Tag, tna... | EaglesoftZJ/actor-platform | actor-server/actor-persist/src/main/scala/im/actor/server/persist/auth/AuthTransactionRepo.scala | Scala | agpl-3.0 | 2,277 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | ueshin/apache-spark | sql/catalyst/src/main/scala/org/apache/spark/sql/types/DecimalType.scala | Scala | apache-2.0 | 9,328 |
/*
* This file is part of EasyForger which is released under GPLv3 License.
* See file LICENSE.txt or go to http://www.gnu.org/licenses/gpl-3.0.en.html for full license details.
*/
package com.easyforger.recipes
import net.minecraft.block.Block
import net.minecraft.enchantment.Enchantment
import net.minecraft.init.... | easyforger/easyforger | src/main/scala/com/easyforger/recipes/RecipeOps.scala | Scala | gpl-3.0 | 2,632 |
package jp.opap.material.facade
import jp.opap.material.facade.RepositoryDataEventEmitter.{Progress, ProgressListener}
import scala.beans.BeanProperty
import scala.collection.mutable
class RepositoryDataEventEmitter() {
var _isRunning: Boolean = false
def setRunning(value: Boolean): Unit = synchronized {
_is... | opap-jp/material-explorer | rest/src/main/scala/jp/opap/material/facade/RepositoryDataEventEmitter.scala | Scala | mit | 1,248 |
package me.reminisce.gameboard.questions
import akka.actor.Props
import me.reminisce.database.MongoCollections
import me.reminisce.database.MongoDBEntities.FBPage
import me.reminisce.database.MongoDBFormats._
import me.reminisce.gameboard.board.GameboardEntities._
import me.reminisce.gameboard.questions.QuestionGenera... | reminisceme/game-creator | src/main/scala/me/reminisce/gameboard/questions/WhichPageDidYouLike.scala | Scala | apache-2.0 | 4,289 |
package org.jetbrains.plugins.scala
package codeInsight
package template
package macros
import com.intellij.codeInsight.CodeInsightBundle
import com.intellij.codeInsight.lookup.{LookupElement, LookupElementBuilder}
import com.intellij.codeInsight.template._
import com.intellij.openapi.project.Project
import com.intell... | ilinum/intellij-scala | src/org/jetbrains/plugins/scala/codeInsight/template/macros/ScalaVariableOfTypeMacro.scala | Scala | apache-2.0 | 7,126 |
/*
* Copyright 2014–2018 SlamData 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 agr... | slamdata/matryoshka | core/shared/src/main/scala/matryoshka/EqualT.scala | Scala | apache-2.0 | 1,287 |
package com.github.al.roulette.player.impl
import java.util.UUID
import akka.NotUsed
import akka.actor.Scheduler
import com.github.al.logging.EventStreamLogging
import com.github.al.logging.LoggedServerServiceCall.logged
import com.github.al.persistence.{PersistentEntityRegistrySugar, Retrying}
import com.github.al.r... | andrei-l/reactive-roulette | player-impl/src/main/scala/com/github/al/roulette/player/impl/PlayerServiceImpl.scala | Scala | mit | 2,679 |
package magento
import io.gatling.core.Predef._
import io.gatling.http.Predef._
import io.gatling.jdbc.Predef._
import io.gatling.http.Headers.Names._
import scala.concurrent.duration._
import bootstrap._
import assertions._
import Headers._
object AnonymousBrowserScenario {
var feedCategoriesURL = csv("magento_... | candes/magento-gatling2 | user-files/simulations/magento/AnonymousBrowserScenario.scala | Scala | apache-2.0 | 1,153 |
/*
* Copyright 2014-2021 Netflix, 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 agr... | copperlight/atlas | atlas-core/src/test/scala/com/netflix/atlas/core/model/ClampSuite.scala | Scala | apache-2.0 | 2,213 |
package feature
/** Exceptions for invalid [[Feature]]s */
object Exceptions {
/** Exception indicating invalid CDS size */
class CDSSizeException(message: String) extends IllegalArgumentException(message)
}
| pamelarussell/sgxlib | src/main/scala/feature/Exceptions.scala | Scala | mit | 216 |
/*
* Copyright (c) 2014-2021 by The Monix Project Developers.
* See the project homepage at: https://monix.io
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache... | monifu/monix | monix-reactive/shared/src/test/scala/monix/reactive/internal/operators/FilterSuite.scala | Scala | apache-2.0 | 3,924 |
package com.github.aselab.activerecord.io
import com.github.aselab.activerecord._
import inner._
import validations._
import reflections._
object FormSerializer {
import ReflectionUtil._
def assignFunc(value: Any, fieldInfo: FieldInfo): Any =
formAssignFunc(value, fieldInfo)((v: Any, k: FieldInfo) => v)
d... | xdougx/scala-activerecord | activerecord/src/main/scala/io/FormSupport.scala | Scala | mit | 7,176 |
package org.jetbrains.sbt.project.data.service
import java.io.File
import java.util
import com.intellij.facet.ModifiableFacetModel
import com.intellij.openapi.externalSystem.model.project.{ModuleData, ProjectData}
import com.intellij.openapi.externalSystem.model.{DataNode, Key, ProjectKeys}
import com.intellij.openap... | triplequote/intellij-scala | scala/scala-impl/src/org/jetbrains/sbt/project/data/service/AbstractDataService.scala | Scala | apache-2.0 | 5,245 |
package recsys
import java.io.File
import java.util.{Map => JMap}
import com.datastax.driver.core.Cluster
import org.constretto.Constretto
import org.constretto.Constretto._
import org.constretto.Converter._
object Config {
implicit val cassandraConfConverter = fromObject { obj =>
val servers = obj[List[Strin... | przemek1990/spark-cassandra | src/main/scala/recsys/Config.scala | Scala | apache-2.0 | 1,630 |
package be.wegenenverkeer.atomium.client
import be.wegenenverkeer.atomium.japi
import com.github.tomakehurst.wiremock.WireMockServer
import com.github.tomakehurst.wiremock.client.WireMock
import com.github.tomakehurst.wiremock.client.WireMock._
import com.github.tomakehurst.wiremock.common.SingleRootFileSource
import ... | joachimvda/atomium | modules/client-scala/src/test/scala/be/wegenenverkeer/atomium/client/WithWireMock.scala | Scala | mit | 1,513 |
import _root_.io.gatling.core.scenario.Simulation
import ch.qos.logback.classic.{Level, LoggerContext}
import io.gatling.core.Predef._
import io.gatling.http.Predef._
import org.slf4j.LoggerFactory
import scala.concurrent.duration._
/**
* Performance test for the TeamProject entity.
*/
class TeamProjectGatlingTest ... | iMartinezMateu/gamecraft | gamecraft-team/src/test/gatling/user-files/simulations/TeamProjectGatlingTest.scala | Scala | mit | 3,458 |
/*
* Copyright (C) 2012 The Regents of The University California.
* All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENS... | vax11780/shark | src/test/scala/shark/memstore2/TablePartitionSuite.scala | Scala | apache-2.0 | 4,098 |
/*
* 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 ... | jackylk/incubator-carbondata | integration/spark/src/test/scala/org/apache/carbondata/spark/testsuite/datamap/FGDataMapTestCase.scala | Scala | apache-2.0 | 21,538 |
/* Copyright (C) 2008-2016 University of Massachusetts Amherst.
This file is part of "FACTORIE" (Factor graphs, Imperative, Extensible)
http://factorie.cs.umass.edu, http://github.com/factorie
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with... | strubell/factorie | src/main/scala/cc/factorie/util/Attr.scala | Scala | apache-2.0 | 8,121 |
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2015-2021 Andre White.
*
* 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
*
* https://www.apache.org/licenses/LICENSE... | adarro/ddo-calc | subprojects/common/ddo-core/src/main/scala/io/truthencode/ddo/model/feats/AbundantStep.scala | Scala | apache-2.0 | 1,677 |
package net.cucumbersome
import org.scalatest.{MustMatchers, WordSpec}
import scala.concurrent.duration._
import scala.concurrent.{Await, Future}
class UnitSpec extends WordSpec with MustMatchers{
def futureValue[A](f: Future[A]): A = Await.result(f, 5 seconds)
}
| CucumisSativus/rpgRollerBackend | src/test/scala/net/cucumbersome/UnitSpec.scala | Scala | mit | 268 |
package com.twitter.finagle.http
import com.twitter.finagle.{Filter, Service}
import com.twitter.finagle.util.LoadService
import com.twitter.util.Future
import java.net.URI
import org.jboss.netty.handler.codec.http.{DefaultHttpResponse, HttpHeaders,
HttpRequest, HttpResponse, HttpResponseStatus, HttpVersion}
import ... | stevegury/finagle | finagle-http/src/main/scala/com/twitter/finagle/http/HttpMuxer.scala | Scala | apache-2.0 | 4,534 |
package org.jetbrains.plugins.scala
package lang
package psi
import com.intellij.lang.ASTNode
import com.intellij.openapi.editor.Document
import com.intellij.openapi.progress.ProgressManager
import com.intellij.openapi.util.TextRange
import com.intellij.psi._
import com.intellij.psi.impl.source.codeStyle.CodeEditUtil
... | igrocki/intellij-scala | src/org/jetbrains/plugins/scala/lang/psi/ScImportsHolder.scala | Scala | apache-2.0 | 11,958 |
/**
* Created by android on 22/2/15.
*/
import java.sql.Timestamp
import Models._
import scala.slick.driver.DerbyDriver.simple._
object Tables {
class Positions(tag: Tag) extends Table[Position](tag, "Positions") {
def name = column[String]("positionName", O.NotNull)
def description = column[String]("des... | pamu/Slick-Demos | src/main/scala/Tables.scala | Scala | apache-2.0 | 2,055 |
package com.sksamuel.elastic4s.jackson
import com.fasterxml.jackson.core.JsonParser
import com.fasterxml.jackson.databind.module.SimpleModule
import com.fasterxml.jackson.databind.{DeserializationContext, JsonDeserializer, JsonMappingException, ObjectMapper}
import com.fasterxml.jackson.module.scala.experimental.Scala... | sksamuel/elastic4s | elastic4s-tests/src/test/scala/com/sksamuel/elastic4s/jackson/ElasticJacksonIndexableTest.scala | Scala | apache-2.0 | 2,638 |
package org.reactress
import collection._
trait ReactMutable {
def bindSubscription(s: Reactive.Subscription): Reactive.Subscription = s
def onMutated(): Unit = {}
}
object ReactMutable {
trait SubscriptionSet extends ReactMutable {
val subscriptions = mutable.Set[Reactive.Subscription]()
def... | axel22/reactive-collections | src/main/scala/org/reactress/ReactMutable.scala | Scala | bsd-3-clause | 648 |
package com.cloudray.scalapress.plugin.listings.controller.renderer
import com.cloudray.scalapress.item.Item
import com.cloudray.scalapress.util.{Scalate, UrlGenerator}
import com.cloudray.scalapress.framework.ScalapressContext
/** @author Stephen Samuel */
object ListingCompleteRenderer {
def render(context: Scal... | vidyacraghav/scalapress | src/main/scala/com/cloudray/scalapress/plugin/listings/controller/renderer/ListingCompleteRenderer.scala | Scala | apache-2.0 | 551 |
package hevs.especial.generator
import java.io.File
import java.util.Date
import hevs.especial.dsl.components.{Component, ComponentManager, HwImplemented}
import hevs.especial.simulation.QemuLogger
import hevs.especial.utils._
/**
* Output C/C++ code generator corresponding to the DSL program.
*
* To generate the... | hevs-isi/especial-frontend | src/main/scala/hevs/especial/generator/CodeGenerator.scala | Scala | mit | 8,817 |
import org.scalatest.FunSuite
import org.tribbloid.ispark.display.dsl.Display
import Display.Markdown
import org.tribbloid.ispark.display.{MIME, Data}
/**
* Created by peng on 1/6/15.
*/
class TestData extends FunSuite {
test("plain string") {
val text = "I'm a string"
val data = Data.parse(text)
pri... | tribbloid/ISpark | display/src/test/scala/TestData.scala | Scala | apache-2.0 | 1,277 |
package intellij.haskell.editor
import com.intellij.lang.ASTNode
import com.intellij.lang.folding.{FoldingBuilderEx, FoldingDescriptor}
import com.intellij.openapi.editor.Document
import com.intellij.openapi.project.DumbAware
import com.intellij.openapi.util.TextRange
import com.intellij.psi.PsiElement
import com.inte... | rikvdkleij/intellij-haskell | src/main/scala/intellij/haskell/editor/HaskellFoldingBuilder.scala | Scala | apache-2.0 | 2,328 |
/*
* Copyright 2010 Gregor N. Purdy, Sr.
*
* 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 o... | gnp/GraphScala | src/main/scala/org/exoprax/graph/Graph2.scala | Scala | apache-2.0 | 2,614 |
package redis
import scala.concurrent._
import scala.concurrent.stm._
import redis.api.connection.Select
import scala.concurrent.duration._
class RedisPoolSpec extends RedisStandaloneServer {
sequential
"basic pool test" should {
"ok" in {
val redisPool = RedisClientPool(Seq(RedisServer( port = port,d... | npeters/rediscala | src/test/scala/redis/RedisPoolSpec.scala | Scala | apache-2.0 | 1,931 |
import sbt.Keys._
import sbt._
object CompileSettings extends AutoPlugin {
override def trigger = allRequirements
override def projectSettings = Seq(
scalacOptions ++= Seq(
"-optimise",
"-deprecation", // Emit warning and location for usages of deprecated APIs.
"-feature", // Emit warning an... | yuikns/psjrs-ra | project/CompileSettings.scala | Scala | apache-2.0 | 1,773 |
package db
import java.util.UUID
import anorm._
import io.apibuilder.api.v0.models.User
import io.apibuilder.internal.v0.models.{Task, TaskDataDiffVersion}
import org.joda.time.DateTime
import org.postgresql.util.PSQLException
import org.scalatestplus.play.PlaySpec
import org.scalatestplus.play.guice.GuiceOneAppPerSu... | gheine/apidoc | api/test/db/TasksDaoSpec.scala | Scala | mit | 6,316 |
/*
* 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/catalyst/src/main/scala/org/apache/spark/sql/catalyst/json/JacksonParser.scala | Scala | apache-2.0 | 13,520 |
package edu.cmu.lti.nlp.amr
import scala.collection.mutable.Map
import scala.collection.mutable.Set
import scala.collection.mutable.ArrayBuffer
/****************************** Align Spans *****************************/
object AlignSpans {
def logUnalignedConcepts(node: Node) {
if (node.spans.si... | hopshackle/wordAlignment | src/edu/cmu/lti/nlp/amr/AlignSpans.scala | Scala | bsd-2-clause | 5,747 |
/*
* 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 ... | wgpshashank/spark | core/src/test/scala/spark/FileSuite.scala | Scala | apache-2.0 | 9,254 |
/*
* Copyright (c) 2017 Magomed Abdurakhmanov, Hypertino
* 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 com.hypertino.facade.modules
import com.hyp... | hypertino/hyperfacade | src/main/scala/com/hypertino/facade/modules/RamlConfigModule.scala | Scala | mpl-2.0 | 588 |
/*
Copyright 2013, 2014 NICTA
This file is part of t3as (Text Analysis As A Service).
t3as is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your... | NICTA/t3as-pat-clas | pat-clas-parse/src/main/scala/org/t3as/patClas/parse/IPCParser.scala | Scala | gpl-3.0 | 2,152 |
package org.precompiler.scala101.ch03
/**
*
* @author Richard Li
*/
object AccessModifier {
def main(args: Array[String]): Unit = {
val microwave = new Microwave
//Compile error
//microwave.turnTable;
}
}
class Microwave {
def start(): Unit = println("started")
def stop(): Unit = println("s... | precompiler/scala-101 | learning-scala/src/main/scala/org/precompiler/scala101/ch03/AccessModifier.scala | Scala | apache-2.0 | 940 |
package models
import anorm._
import anorm.SqlParser._
import play.api.db._
import play.api.Play.current
case class Task(id: Long, label: String)
object Task {
val task = {
get[Long]("id") ~
get[String]("label") map {
case id~label => Task(id, label)
}
}
def all(): List[Task] = DB.withConne... | ericmoritz/play-example | todolist/app/models/Task.scala | Scala | mit | 730 |
/*
* Copyright (c) 2015 Andreas Wolf
*
* See te LICENSE file in the project root for further copyright information.
*/
package info.andreaswolf.roadhopper.simulation
import org.slf4j.LoggerFactory
import scala.collection.mutable
class SimulationRepository {
type T = Simulation
val log = LoggerFactory.getLo... | andreaswolf/roadhopper | src/main/scala/info/andreaswolf/roadhopper/simulation/SimulationRepository.scala | Scala | mit | 640 |
package builder.api_json
import core.{Importer, ServiceFetcher, TypesProvider, TypesProviderEnum, TypesProviderModel, TypesProviderUnion, VersionMigration}
import lib.{Methods, Primitives, ServiceConfiguration, Text, UrlKey}
import io.apibuilder.spec.v0.models._
import lib.Methods.{MethodsNotAcceptingBodies, supportsB... | apicollective/apibuilder | core/src/main/scala/core/builder/api_json/ServiceBuilder.scala | Scala | mit | 19,208 |
package articles.controllers
import articles.models.Article
import articles.services.ArticleService
import commons.repositories.ActionRunner
import play.api.libs.json.{Format, JsArray, Json}
import play.api.mvc.{AbstractController, Action, AnyContent, ControllerComponents}
import scala.concurrent.ExecutionContext
imp... | Dasiu/play-framework-test-project | app/articles/controllers/ArticleController.scala | Scala | mit | 1,354 |
package com.wuyuntao.aeneas.migration.example.migrations
import com.wuyuntao.aeneas.migration.Migration
import com.wuyuntao.aeneas.migration.dsl.DbModifier
class CreateEventTable extends Migration {
def version = 20151030182648236L
def up(db: DbModifier) = {
db.executeSql("""CREATE TABLE events (
... | wuyuntao/Aeneas | aeneas-migration-example/src/main/scala/com/wuyuntao/aeneas/migration/example/migrations/V20151030182648236_CreateEventTable.scala | Scala | apache-2.0 | 713 |
// Copyright © 2012 Esko Luontola <www.orfjackal.net>
// This software is released under the Apache License 2.0.
// The license text is at http://www.apache.org/licenses/LICENSE-2.0
package net.orfjackal.svngitsaclue
import org.eclipse.jgit.awtui.CommitGraphPane
import java.awt.BorderLayout
import org.eclipse.jgit.st... | orfjackal/svn-gits-a-clue | src/test/scala/net/orfjackal/svngitsaclue/GitCommitGraphSpike.scala | Scala | apache-2.0 | 1,246 |
/*
* 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/serializer/converters/DataConverter.scala | Scala | apache-2.0 | 26,607 |
/*
* 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 ... | DieBauer/flink | flink-libraries/flink-table/src/main/scala/org/apache/flink/table/plan/rules/dataSet/DataSetUnionRule.scala | Scala | apache-2.0 | 2,270 |
package com.overviewdocs.util
import java.util.Locale
object SupportedLanguages {
// Supported languages, in ISO639-2 format
val languageCodes = Set(
"ar",
"ca",
"cs",
"de",
"en",
"es",
"fr",
"sv",
"nl",
"no",
"it",
"pt",
"ro",
"ru"
)
val languages : ... | overview/overview-server | common/src/main/scala/com/overviewdocs/util/SupportedLanguages.scala | Scala | agpl-3.0 | 701 |
package unfiltered.oauth2
import unfiltered.request._
import unfiltered.response._
import unfiltered.filter.Plan
/**
* After your application has obtained an access token, your app can use it to access APIs by
* including it in either an access_token query parameter or an Authorization: Beader header.
*
* To call... | jarin/unfiltered | oauth2/src/main/scala/protections.scala | Scala | mit | 8,402 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | gioenn/xSpark | mllib/src/main/scala/org/apache/spark/ml/recommendation/ALS.scala | Scala | apache-2.0 | 50,863 |
package org.scurator
import org.apache.curator.framework.CuratorFrameworkFactory
import org.apache.curator.retry.RetryOneTime
import org.junit.runner.RunWith
import org.scalatest.junit.JUnitRunner
/**
*
*/
@RunWith(classOf[JUnitRunner])
class TestImplicitConversion extends BaseSCuratorTest {
"A SCuratorClient" s... | granthenke/scurator | src/test/scala/org/scurator/TestImplicitConversion.scala | Scala | apache-2.0 | 1,061 |
package io.taig.gandalf.syntax
import io.taig.gandalf.{ Validation, ops }
import shapeless._
import scala.language.implicitConversions
trait dsl {
implicit def dslRuleSyntax[I, O, V <: HList, E](
validation: Validation.Aux[I, O, V, E]
): ops.dsl.logic[I, O, V, E] = new ops.dsl.logic( validation )
... | Taig/Gandalf | core/src/main/scala/io/taig/gandalf/syntax/dsl.scala | Scala | mit | 538 |
package se.lu.nateko.cp.meta.persistence.postgres
import java.sql.ResultSet
import se.lu.nateko.cp.meta.api.CloseableIterator
import java.sql.Connection
class ResultSetIterator[T](connectionFactory: () => Connection, resultFactory: ResultSet => T, selectQuery: String) extends CloseableIterator[T]{
private[this] val ... | ICOS-Carbon-Portal/meta | src/main/scala/se/lu/nateko/cp/meta/persistence/postgres/ResultSetIterator.scala | Scala | gpl-3.0 | 1,074 |
/*
*************************************************************************************
* Copyright 2013 Normation SAS
*************************************************************************************
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero Ge... | Kegeruneku/rudder | rudder-core/src/main/scala/com/normation/rudder/services/policies/ParameterService.scala | Scala | agpl-3.0 | 8,757 |
/* ___ _ ___ _ _ *\\
** / __| |/ (_) | | The SKilL Generator **
** \\__ \\ ' <| | | |__ (c) 2013 University of Stuttgart **
** |___/_|\\_\\_|_|____| see LICENSE ... | XyzNobody/skill | src/main/scala/de/ust/skill/generator/scala/internal/InternalInstancePorpertiesMaker.scala | Scala | bsd-3-clause | 1,381 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | hhbyyh/spark | resource-managers/mesos/src/main/scala/org/apache/spark/scheduler/cluster/mesos/MesosFineGrainedSchedulerBackend.scala | Scala | apache-2.0 | 17,837 |
/*
* Copyright 2016 Coursera 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 t... | vkuo-coursera/naptime | naptime/src/main/scala/org/coursera/naptime/router2/NestingCollectionResourceRouter.scala | Scala | apache-2.0 | 11,525 |
/*
* 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 ... | rezasafi/spark | core/src/main/scala/org/apache/spark/util/SizeEstimator.scala | Scala | apache-2.0 | 15,825 |
/*
* Copyright 2015, by Vladimir Kostyukov and Contributors.
*
* This file is a part of a Finch library that may be found at
*
* https://github.com/finagle/finch
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
* You may... | penland365/finch | demo/src/main/scala/io/finch/demo/package.scala | Scala | apache-2.0 | 2,397 |
import _root_.io.gatling.core.scenario.Simulation
import ch.qos.logback.classic.{Level, LoggerContext}
import io.gatling.core.Predef._
import io.gatling.http.Predef._
import org.slf4j.LoggerFactory
import scala.concurrent.duration._
/**
* Performance test for the Country entity.
*/
class CountryGatlingTest extends ... | sandor-balazs/nosql-java | oracle/src/test/gatling/simulations/CountryGatlingTest.scala | Scala | bsd-2-clause | 3,308 |
package com.twitter.rowz
import com.twitter.util.Time
object RowState extends Enumeration {
val Normal, Destroyed = Value
}
case class Row(id: Long, name: String, createdAt: Time, updatedAt: Time, state: RowState.Value)
| twitter/Rowz | src/main/scala/com/twitter/rowz/Row.scala | Scala | apache-2.0 | 225 |
package com.jejking.rprng.api
import akka.http.scaladsl.marshallers.sprayjson.SprayJsonSupport
import akka.http.scaladsl.model.HttpEntity.{Chunk, Chunked}
import akka.http.scaladsl.model.{ContentTypes, HttpResponse, StatusCodes}
import akka.http.scaladsl.server.ValidationRejection
import akka.http.scaladsl.testkit.Sca... | jejking/rprng | src/test/scala/com/jejking/rprng/api/RoutesSpec.scala | Scala | apache-2.0 | 10,673 |
package io.dylemma.spac
package impl
import scala.util.control.NonFatal
class TopLevelTransformerHandler[In, Out](inner: Transformer.Handler[In, Out], caller: SpacTraceElement) extends Transformer.Handler[In, Out] {
def push(in: In, out: Transformer.HandlerWrite[Out]) = {
try inner.push(in, out)
catch {
case ... | dylemma/xml-spac | core/src/main/scala/io/dylemma/spac/impl/TopLevelTransformerHandler.scala | Scala | mit | 652 |
import io.prediction.controller.LServing
class Serving
extends LServing[Query, PredictedResult] {
override
def serve(query: Query,
predictedResults: Seq[PredictedResult]): PredictedResult = {
predictedResults.maxBy(e => e.confidence)
}
}
| gongsy945/pio-engine-text-classification-heroku | src/main/scala/Serving.scala | Scala | apache-2.0 | 260 |
/*
* 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 u... | printedheart/sparkling-water | core/src/main/scala/water/app/SparkContextSupport.scala | Scala | apache-2.0 | 1,357 |
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.