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 |
|---|---|---|---|---|---|
/*
* 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 | manual/cypher/cypher-docs/src/test/scala/org/neo4j/cypher/docgen/cookbook/MultirelationalSocialNetworkTest.scala | Scala | apache-2.0 | 2,527 |
package com.avsystem.scex
package japi
import java.lang.reflect.Type
import java.{lang => jl, util => ju}
import com.avsystem.scex.compiler.JavaTypeParsing._
import com.avsystem.scex.compiler.presentation.ScexPresentationCompiler
import com.avsystem.scex.compiler.presentation.ScexPresentationCompiler.Param
import com... | pnf/scex | scex-core/src/main/scala/com/avsystem/scex/japi/JavaScexCompiler.scala | Scala | apache-2.0 | 6,284 |
package incognito.examples
import org.apache.spark.rdd.RDD
import scala.collection.mutable.ArrayBuffer
import java.util.Arrays
import org.apache.spark.rdd.RDD.numericRDDToDoubleRDDFunctions
import org.apache.spark.rdd.RDD.rddToPairRDDFunctions
import incognito.rdd._
import incognito.anonymization.buckets.IncognitoBuck... | achak1987/SparkAnonymizationToolkit | src/main/scala/incognito/examples/PhaseBasedAnonymization.scala | Scala | apache-2.0 | 6,804 |
/**
* A collection of classes to model forum data.
*
* @author Tao Lee
* @date 12.11.16
*/
// Super class of a line-based data record.
abstract class DataScannedByLine {
protected var numOfFields = 0
}
// Forum-comment subclass of the line-based data family.
class ForumCommentPerStudent (list: Array[Strin... | taolee/XmlDataAnalysisToolsets | DataAnalysis_Preprocessing/xmlgen/src/main/scala/DataScannedByLine.scala | Scala | bsd-3-clause | 772 |
package com.arcusys.valamis.certificate.service
import com.arcusys.valamis.certificate.model.{Certificate, CertificateHistory}
import org.joda.time.DateTime
import scala.concurrent.Future
trait CertificateHistoryService {
def get(companyId: Long, date: DateTime): Future[Seq[CertificateHistory]]
}
| arcusys/Valamis | valamis-certificate/src/main/scala/com/arcusys/valamis/certificate/service/CertificateHistoryService.scala | Scala | gpl-3.0 | 304 |
package com.mesosphere.cosmos.rpc.v1.model
import com.mesosphere.cosmos.thirdparty.marathon.model.AppId
import com.mesosphere.universe.v2.model.PackageDetailsVersion
import io.circe.JsonObject
case class RenderRequest(
packageName: String,
packageVersion: Option[PackageDetailsVersion] = None,
options: Option[Js... | movicha/cosmos | cosmos-model/src/main/scala/com/mesosphere/cosmos/rpc/v1/model/RenderRequest.scala | Scala | apache-2.0 | 370 |
import com.twitter.logging.{ConsoleHandler, Level, LoggerFactory}
import com.twitter.zipkin.anormdb.{DependencyStoreBuilder, SpanStoreBuilder}
import com.twitter.zipkin.builder.{ZipkinServerBuilder, QueryServiceBuilder}
import com.twitter.zipkin.storage.Store
import com.twitter.zipkin.storage.anormdb.{DB, DBConfig, DBP... | gneokleo/zipkin | zipkin-query-service/config/query-mysql.scala | Scala | apache-2.0 | 1,244 |
package mesosphere.marathon
package raml
import mesosphere.UnitTest
import mesosphere.marathon.api.serialization.VolumeSerializer
import mesosphere.marathon.state.{ DiskType, DockerVolume, ExternalVolumeInfo, PersistentVolumeInfo }
import org.apache.mesos.{ Protos => Mesos }
class VolumeConversionTest extends UnitTes... | Caerostris/marathon | src/test/scala/mesosphere/marathon/raml/VolumeConversionTest.scala | Scala | apache-2.0 | 5,352 |
/*
* 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 ... | michalsenkyr/spark | sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetSchemaPruningSuite.scala | Scala | apache-2.0 | 15,859 |
class A2 extends A1 with T1{
def f2 = { def g = 5 ; class A { def a = g }; g ; new A().a }
}
object Test extends A2 {
def main(args: Array[String]): Unit = {
println(Seq(Class.forName(classOf[T1].getName + "$class"), classOf[A1], classOf[A2]).flatMap(_.getDeclaredMethods.map(_.toString).sorted).mkString("\\n"))
... | yusuke2255/dotty | tests/pending/run/t5652/t5652_2.scala | Scala | bsd-3-clause | 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 ... | andrewor14/iolap | external/flume/src/test/scala/org/apache/spark/streaming/flume/FlumeStreamSuite.scala | Scala | apache-2.0 | 5,841 |
package com.wheaties.predicate
import com.wheaties.logical._
trait Predicate9[T1, T2, T3, T4, T5, T6, T7, T8, T9] extends Function9[T1, T2, T3, T4, T5, T6, T7, T8, T9, Boolean]{
self =>
def or[TT1 <: T1, TT2 <: T2, TT3 <: T3, TT4 <: T4, TT5 <: T5, TT6 <: T6, TT7 <: T7, TT8 <: T8, TT9 <: T9](that: Function9[TT1, TT... | wheaties/Predicates | predicates/src/main/scala/com/wheaties/predicate/Predicates9.scala | Scala | apache-2.0 | 4,058 |
package dx.compiler
// Place to put any extra options, equivalent to Cromwell workflowOptions.
// Also, allows dnanexus specific configuration per task.
import dx.api.{DxAccessLevel, DxApi, DxFile}
import spray.json.DefaultJsonProtocol._
import spray.json._
import wdlTools.eval.WdlValues
import wdlTools.types.{TypedA... | dnanexus-rnd/dxWDL | src/main/scala/dx/compiler/Extras.scala | Scala | apache-2.0 | 27,009 |
package uk.ac.ed.inf.mois.examples
import uk.ac.ed.inf.mois.{DeterministicReactionNetwork, Model}
@deprecated("Fix complex formation reactions")
class Replication
extends DeterministicReactionNetwork("Brusselator") {
annotate("uri", "http://www.wholecellkb.org/detail/Mgenitalium/Process_Replication")
val AT... | edinburgh-rbm/karr | src/main/scala/uk/ac/ed/inf/mois/karr/Replication.scala | Scala | gpl-3.0 | 6,928 |
package org.chipmunk.entity.relation
import org.squeryl.Query
import org.chipmunk.entity.Entity
trait Relation[O <: Entity[_]] extends Iterable[O] {
type SRel <: Query[O]
def +=(other: O): this.type
def clear(): Unit
def toSqueryl: SRel
def iterator: Iterator[O] = toSqueryl.iterator
protected def isO... | kpjjpk/chipmunk | src/main/scala/org/chipmunk/entity/relation/Relation.scala | Scala | mit | 341 |
/*
* Copyright (c) 2014 Elmar Athmer
*
* This file is part of SolarSystemGrandTour.
*
* SolarSystemGrandTour 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 yo... | zauberpony/solarsystem-grand-tour | src/main/scala/net/aerospaceresearch/jplparser/CoefficientSet.scala | Scala | gpl-3.0 | 1,680 |
/*
Copyright (c) 2012, The Children's Hospital of Philadelphia All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of cond... | chop-dbhi/dataexpress | src/test/scala/edu/chop/cbmi/dataExpress/test/dataModels/RichOptionSpec.scala | Scala | bsd-2-clause | 2,689 |
package com.kifi.lda
import akka.actor._
import scala.io.Source
import akka.routing.RoundRobinRouter
import scala.collection.mutable
import scala.math._
import scala.util.Random
import org.apache.commons.math3.random.Well19937c
class BetaActor(batchReader: ActorRef, config: LDAConfig) extends Actor with Logging{
v... | kifi/ReactiveLDA | src/main/scala/com/kifi/lda/BetaActor.scala | Scala | mit | 3,864 |
// Copyright (C) 2011-2012 the original author or authors.
// See the LICENCE.txt file distributed with this work for additional
// information regarding copyright ownership.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You ... | scalastyle/scalastyle | src/main/scala/org/scalastyle/scalariform/EqualsHashCodeChecker.scala | Scala | apache-2.0 | 1,245 |
package wallet
import org.springframework.context.annotation.Configuration
import org.springframework.boot.autoconfigure.EnableAutoConfiguration
import org.springframework.context.annotation.ComponentScan
import org.springframework.web.bind.annotation.RequestBody
import org.springframework.web.bind.annotation.RequestM... | meghanagogi/DigitalWalletAssignment2 | src/main/scala/wallet/WalletConfig.scala | Scala | mit | 8,539 |
package fpgatidbits.hlstools
import sys.process._
import java.io.File
// Collection of utilities for Vivado HLS
object TidbitsHLSTools {
// quick-and-dirty single file HLS synthesis
def hlsToVerilog(
inFile: String,
outDir: String,
synDir: String,
projName: String,
topFxnName: String,
incl... | maltanar/fpga-tidbits | src/main/scala/fpgatidbits/hlstools/HLSTools.scala | Scala | bsd-2-clause | 1,119 |
package org.opennetworkinsight.dns
import org.apache.spark.SparkContext
import org.apache.spark.sql.SQLContext
import org.opennetworkinsight.OniLDACWrapper
import org.opennetworkinsight.OniLDACWrapper.OniLDACOutput
import org.opennetworkinsight.SuspiciousConnectsArgumentParser.SuspiciousConnectsConfig
import org.slf4j... | Open-Network-Insight/oni-ml | src/main/scala/org/opennetworkinsight/dns/DNSSuspiciousConnects.scala | Scala | apache-2.0 | 1,281 |
package com.dero.home
import com.dero.home.events.Event
import com.dero.home.items.Rule
import scala.concurrent.Future
import scala.concurrent.ExecutionContext.Implicits.global
/**
* Created by daniel on 9/5/15.
*/
class EventBus {
val _modules = scala.collection.concurrent.TrieMap.empty[AbstractModule, Any]
... | derolf/scala4mqtt | src/main/scala/com/dero/home/EventBus.scala | Scala | mit | 742 |
class Bar[@specialized(Int, AnyRef) A](a: A) {
val memb = a
}
class WithInner[@specialized(Int, AnyRef) A](a: A) {
class Inner {
def meth = a
}
}
class Baz[@specialized(Int, AnyRef) A, @specialized(Int, AnyRef) B] {
def ab(a: A, b: B) = (a, b)
}
trait Base[@specialized(Int, AnyRef) A]
class Concre... | loskutov/intellij-scala | testdata/scalacTests/pos/spec.scala | Scala | apache-2.0 | 1,051 |
package chandu0101.scalajs.react.components.tables
import chandu0101.scalajs.react.components.optionselectors.DefaultSelect
import chandu0101.scalajs.react.components.pagers.Pager
import chandu0101.scalajs.react.components.searchboxes.ReactSearchBox
import japgolly.scalajs.react.vdom.prefix_<^._
import japgolly.scalaj... | coreyauger/scalajs-react-components | core/src/main/scala/chandu0101/scalajs/react/components/tables/ReactTable.scala | Scala | apache-2.0 | 8,426 |
package glaux.persistence.mongodb
import java.time.{Clock, LocalTime, LocalDate, ZonedDateTime}
import glaux.interfaces.api.domain.Action
import glaux.linearalgebra.Dimension._
import glaux.linearalgebra._
import glaux.neuralnetwork.Net.DefaultNet
import glaux.neuralnetwork.trainers.BatchTrainer.{BatchResult, LossInf... | A-Noctua/glaux | persistence-mongodb/src/test/scala/glaux/persistence/mongodb/GlauxHandlersSpec.scala | Scala | mit | 5,628 |
使用Spark MLlib给豆瓣用户推荐电影
推荐算法就是利用用户的一些行为,通过一些数学算法,推测出用户可能喜欢的东西。
随着电子商务规模的不断扩大,商品数量和种类不断增长,用户对于检索和推荐提出了更高的要求。由于不同用户在兴趣爱好、关注领域、个人经历等方面的不同,以满足不同用户的不同推荐需求为目的、不同人可以获得不同推荐为重要特征的个性化推荐系统应运而生。
推荐系统成为一个相对独立的研究方向一般被认为始自1994年明尼苏达大学GroupLens研究组推出的GroupLens系统。该系统有两大重要贡献:一是首次提出了基于协同过滤(Collaborative Filtering)来完成推荐任务的思想,二是为推荐问题建立了一个形式化... | xieguobin/Spark_2.0.0_cn1 | mllib_analysis/recommendation/ALS算法_建模剖析1.scala | Scala | apache-2.0 | 24,554 |
package scorex.crypto.authds.merkle.sparse
import scorex.crypto.authds.LeafData
import scorex.util.encode.Base16
import scorex.crypto.hash._
trait Node[D <: Digest] {
def hash: D
def isNull: Boolean
}
object Node {
type ID = BigInt
}
case class InternalNode[D <: Digest](left: Option[Node[D]],
... | ScorexProject/scrypto | src/main/scala/scorex/crypto/authds/merkle/sparse/Node.scala | Scala | cc0-1.0 | 1,308 |
package controllers.api
import javax.inject.{Inject, Singleton}
import db.AccountDto
import play.api.libs.json._
import play.api.mvc.{Action, Controller}
import services._
@Singleton
class AccountApi @Inject()(val accountDto: AccountDto) extends Controller {
def allRaters = Action { request =>
SessionService.g... | PanzerKunst/redesigned-cruited.com-frontend | rater-ui/app/controllers/api/AccountApi.scala | Scala | gpl-3.0 | 620 |
package org.shlrm.codingDojo.kataPotter
/**
* Just something to contain my discounts
*/
object Discount {
/**
* Convert from a book count to a discount amount
* @param count
* @return
*/
def apply(count: Int): Double = {
count match {
case 1 => one
case 2 => two
case 3 => three... | dkowis/CodingDojo | KataPotter/src/main/scala/org/shlrm/codingDojo/kataPotter/Discount.scala | Scala | mit | 761 |
package net.tixxit.contract
package store
import java.io.File
import com.sleepycat.je.{ Environment, Database, EnvironmentConfig, DatabaseConfig,
DatabaseEntry, LockMode, OperationStatus, Durability }
import scalaz.effect.IO
final class BerkeleyDBStore(env: Environment, db: Database) exten... | tixxit/contract | src/main/scala/net/tixxit/contract/store/BerkeleyDBActor.scala | Scala | mit | 1,909 |
package de.choffmeister.secpwd.security
import de.choffmeister.secpwd.security.RandomGenerator._
import de.choffmeister.securestring.SecureString
case class PasswordCharacters(val alphaLower: Boolean = false, val alphaUpper: Boolean = false, val numbers: Boolean = false, val special: Boolean = false, val other: Boole... | choffmeister/secpwd | src/main/scala/de/choffmeister/secpwd/security/PasswordUtils.scala | Scala | apache-2.0 | 2,592 |
/**
* Copyright (C) 2011 Typesafe Inc. <http://typesafe.com>
*/
package com.typesafe.config.impl
import org.junit.Assert._
import org.junit._
import scala.collection.JavaConverters._
import com.typesafe.config._
import java.util.Collections
import java.util.TreeSet
import java.io.File
import scala.collection.mutab... | fpringvaldsen/config | config/src/test/scala/com/typesafe/config/impl/PublicApiTest.scala | Scala | apache-2.0 | 48,119 |
import com.localytics.sbt.dynamodb.DynamoDBLocalKeys
import com.localytics.sbt.dynamodb.DynamoDBLocalKeys._
import sbt._
object LocalDynamoDBScheduleLambda {
val settings: Seq[Setting[_]] = DynamoDBLocalKeys.baseDynamoDBSettings ++ Seq(
dynamoDBLocalDownloadDir := file("dynamodb-local-schedule-lambda"),
dyn... | guardian/mobile-n10n | project/LocalDynamoDBScheduleLambda.scala | Scala | apache-2.0 | 427 |
package org.jetbrains.plugins.scala.scalai18n.codeInspection.i18n
import java.text.MessageFormat
import com.intellij.codeInsight.AnnotationUtil
import com.intellij.lang.properties.parsing.PropertiesElementTypes
import com.intellij.lang.properties.psi.impl.{PropertyImpl, PropertyStubImpl}
import com.intellij.lang.prop... | triplequote/intellij-scala | scala/scala-impl/src/org/jetbrains/plugins/scala/scalai18n/codeInspection/i18n/ScalaI18nUtil.scala | Scala | apache-2.0 | 13,353 |
package scalarules.test.junit.specs2
import org.specs2.mutable.SpecWithJUnit
import scalarules.test.junit.support.JUnitCompileTimeDep
class JunitSpecs2Test extends SpecWithJUnit {
"specs2 tests" should {
"run smoothly in bazel" in {
println(JUnitCompileTimeDep.hello)
success
}
"not run smo... | smparkes/rules_scala | test_version/version_specific_tests_dir/src/main/scala/scalarules/test/junit/specs2/Specs2Tests.scala | Scala | apache-2.0 | 895 |
package org.positronicnet
/** ==Basic Concepts==
*
* The Positronic Net ORM tries to abstract away a lot of the boilerplate
* involved in dealing with data managed through cursors (or, more
* precisely, any data which can be accessed through a
* [[org.positronicnet.content.ContentRepository]]; that currently... | rst/positronic_net | src/main/scala/orm/package.scala | Scala | bsd-3-clause | 17,663 |
/**
* 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 prog... | orbeon/orbeon-forms | xforms/jvm/src/test/scala/org/orbeon/oxf/xforms/analysis/ComplexContentDependenciesTest.scala | Scala | lgpl-2.1 | 4,129 |
package org.hibernate.cache.rediscala.client
import org.hibernate.cache.rediscala._
import redis.commands.Transactions
import redis.{RedisClient, RedisCommands}
/**
* HibernateRedisCache Companion Object
*/
object RedisCache {
// Cache expiration 기본 값 (0 이면 expire 하지 않는다)
val DEFAULT_EXPIRY_IN_SECONDS = 0
/... | debop/debop4s | hibernate-rediscala/src/main/scala/org/hibernate/cache/rediscala/client/RedisCache.scala | Scala | apache-2.0 | 1,009 |
/*
* 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 ... | akopich/spark | sql/core/src/test/scala/org/apache/spark/sql/execution/WholeStageCodegenSuite.scala | Scala | apache-2.0 | 10,391 |
package codebook.runtime.testkit
import akka.actor.{Actor, ActorRef, ActorSystem, Props}
import akka.io.Tcp.{Close, Write}
import akka.pattern.ask
import akka.util.ByteString
import codebook.runtime.protocol.Decoder
import codebook.runtime.io.TcpClientPort
import codebook.runtime.packet.{DummyPacketCipher, Packet}
imp... | RustyRaven/CodebookRuntime | scala/src/main/scala/codebook/runtime/testkit/TestClient.scala | Scala | mit | 3,505 |
package scala.meta.internal.classpath
import java.io.File
import java.io.FilterInputStream
import java.io.InputStream
import java.nio.file.Files
import java.nio.file.Path
import java.util.zip.ZipEntry
import java.util.zip.ZipFile
import scala.collection.mutable
import scala.meta.io.AbsolutePath
/** Represents a entry... | xeno-by/scalameta | semanticdb/metacp/src/main/scala/scala/meta/internal/classpath/ClasspathElement.scala | Scala | bsd-3-clause | 2,269 |
package com.betfair.domain
import play.api.libs.json.Json
case class KeepAliveResponse(token: String, product: String, status: String, error: String)
object KeepAliveResponse {
implicit val readsKeepAliveResponse = Json.reads[KeepAliveResponse]
}
| city81/betfair-service-ng | src/main/scala/com/betfair/domain/KeepAliveResponse.scala | Scala | bsd-2-clause | 253 |
package com.github.tminglei.slickpg
import java.time._
import java.util.concurrent.Executors
import org.scalatest.FunSuite
import slick.jdbc.{GetResult, PostgresProfile}
import scala.concurrent.{Await, ExecutionContext}
class PgDate2SupportSuite extends FunSuite {
import MyPostgresProfile.api._
val db = Databa... | TimothyKlim/slick-pg | src/test/scala/com/github/tminglei/slickpg/PgDate2SupportSuite.scala | Scala | bsd-2-clause | 16,373 |
/*
* Copyright (C) 2016-2017 Lightbend Inc. <https://www.lightbend.com>
*/
package com.lightbend.lagom.internal.scaladsl.broker.kafka
import org.scalatest.{ FlatSpec, Matchers }
/**
*
*/
class ScaladslKafkaSubscriberSpec extends FlatSpec with Matchers {
behavior of "ScaladslKafkaSubscriber"
it should "creat... | edouardKaiser/lagom | service/scaladsl/kafka/client/src/test/scala/com/lightbend/lagom/internal/scaladsl/broker/kafka/ScaladslKafkaSubscriberSpec.scala | Scala | apache-2.0 | 565 |
import concurrent.ExecutionContext.Implicits.global
class Admin extends javax.swing.JApplet {
val jScrollPane = new javax.swing.JScrollPane (null, 0, 0)
def t2484: Unit = {
scala.concurrent.Future {jScrollPane.synchronized {
def someFunction () = {}
//scala.concurrent.ops.spawn {someFunction ()}
... | loskutov/intellij-scala | testdata/scalacTests/pos/t2484.scala | Scala | apache-2.0 | 645 |
/* sbt -- Simple Build Tool
* Copyright 2009 Mark Harrah
*/
package xsbt.test
final class TestException(statement: Statement, msg: String, exception: Throwable)
extends RuntimeException(statement.linePrefix + " " + msg, exception)
class ScriptRunner {
import scala.collection.mutable.HashMap
def apply(stateme... | mdedetrich/sbt | scripted/base/src/main/scala/xsbt/test/ScriptRunner.scala | Scala | bsd-3-clause | 1,718 |
package pl.combosolutions.backup
object ReportException {
def onIllegalArgumentOf(message: String): Nothing = throw new IllegalArgumentException(message)
def onIllegalStateOf(message: String): Nothing = throw new IllegalStateException(message)
def onIllegalStateOf(message: String, exception: Throwable): Nothin... | MateuszKubuszok/BackupDSL | modules/common/src/main/scala/pl/combosolutions/backup/ReportException.scala | Scala | mit | 585 |
import org.specs2.mutable._
import org.specs2.runner._
import org.junit.runner._
import play.api.test._
import play.api.test.Helpers._
@RunWith(classOf[JUnitRunner])
class ApplicationSpec extends Specification {
import models._
// -- Date helpers
def dateIs(date: java.util.Date, str: String) = new java.t... | codeck/play2sae | samples/computer-database/test/ApplicationSpec.scala | Scala | apache-2.0 | 2,867 |
/*
* 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 ... | jasonpet/openwhisk | core/cosmosdb/cache-invalidator/src/main/scala/org/apache/openwhisk/core/database/cosmosdb/cache/KafkaEventProducer.scala | Scala | apache-2.0 | 3,022 |
package com.sksamuel.scapegoat.inspections.matching
import com.sksamuel.scapegoat.{Inspection, InspectionContext, Inspector, Levels}
/**
* @author Stephen Samuel
*/
class PartialFunctionInsteadOfMatch
extends Inspection(
text = "Match instead of a partial function",
defaultLevel = Levels.Info,
... | sksamuel/scalac-scapegoat-plugin | src/main/scala/com/sksamuel/scapegoat/inspections/matching/PartialFunctionInsteadOfMatch.scala | Scala | apache-2.0 | 2,265 |
/*
* Copyright 2014-2022 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... | Netflix/atlas | atlas-core/src/main/scala/com/netflix/atlas/core/algorithm/RollingBuffer.scala | Scala | apache-2.0 | 3,493 |
package pureconfig.module.yaml
import java.net.URLDecoder
import java.nio.file.{Files, Path, Paths}
import com.typesafe.config.{ConfigValue, ConfigValueType}
import org.scalatest.EitherValues
import pureconfig.BaseSuite
import pureconfig.error._
import pureconfig.generic.auto._
import pureconfig.module.yaml.error.No... | melrief/pureconfig | modules/yaml/src/test/scala/pureconfig/module/yaml/YamlApiSuite.scala | Scala | mpl-2.0 | 9,119 |
package ml.combust.mleap.executor
import java.util.concurrent.{Executors, TimeUnit}
import akka.NotUsed
import akka.actor.{ExtendedActorSystem, Extension, ExtensionId, ExtensionIdProvider}
import akka.stream.scaladsl.Flow
import com.typesafe.config.{Config, ConfigFactory}
import com.typesafe.scalalogging.Logger
impor... | combust/mleap | mleap-executor/src/main/scala/ml/combust/mleap/executor/MleapExecutor.scala | Scala | apache-2.0 | 4,374 |
package is.hail.expr.ir
import is.hail.asm4s.Settable
import is.hail.types.virtual.{Type, TInt32, TInt64, TFloat32, TFloat64}
object NumericPrimitives {
def newLocal(cb: EmitCodeBuilder, name: String, typ: Type): Settable[Any] = {
coerce[Any](typ match {
case TInt32 => cb.newLocal[Int](name)
case T... | hail-is/hail | hail/src/main/scala/is/hail/expr/ir/NumericPrimitives.scala | Scala | mit | 464 |
package spark.scheduler
import java.net.URI
import java.util.concurrent.atomic.AtomicInteger
import java.util.concurrent.Future
import java.util.concurrent.LinkedBlockingQueue
import java.util.concurrent.TimeUnit
import scala.collection.mutable.{ArrayBuffer, HashMap, HashSet, Queue, Map}
import spark._
import spark.... | hobinyoon/spark-0.7.0 | core/src/main/scala/spark/scheduler/DAGScheduler.scala | Scala | bsd-3-clause | 28,031 |
/*
* 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 ... | ConeyLiu/spark | sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/text/TextOutputWriter.scala | Scala | apache-2.0 | 1,617 |
package models.conf
import scala.slick.driver.MySQLDriver.simple._
import play.api.Play.current
/**
* Created by mind on 8/20/14.
*/
case class TemplateAlias(id: Option[Int],templateId: Option[Int], name: String, value: String, description: String, scriptVersion: String = ScriptVersionHelper.Master)
case class Te... | sdgdsffdsfff/bugatti | app/models/conf/TemplateAlias.scala | Scala | bsd-2-clause | 1,759 |
package x7c1.salad.sample.inspector
import x7c1.salad.inspector.reflect.ObjectReflector
object ObjectInspectorByReflection {
def sample = {
ObjectReflector.inspect(SampleObject)
}
}
object SampleObject {
def sampleMethod(sampleArg: SampleType): Seq[SampleType] = ???
private def privateMethod(foo: Int) ... | x7c1/Salad | salad-sample/src/main/scala/x7c1/salad/sample/inspector/ObjectStructureSample.scala | Scala | mit | 328 |
@identity1 class C1
@pkg.identity2 class C2
@pkg.Module3.identity3 class C3
@Module4.identity4 class C4
object Test extends App {
import pkg._
import Module3._
import Module4._
@identity1 class C1
@identity2 class C2
@identity3 class C3
@identity4 class C4
}
package pkg {
// @identity1 class C1
@id... | scala/scala | test/macro-annot/pos/nameresolution/nameresolution_2.scala | Scala | apache-2.0 | 402 |
package laws
/** Sets of integer values used to check individual cases in certain tests.
*
* In general, we expect but do not enforce here that `n` and `m` are positive
* and bounded by the size of collections `x` and `y`, and that `nn` and `mm`
* are both positive. `r` can be anything.
*
* Do _not_ set `... | scala/scala-collections-laws | laws/src/main/scala/Numbers.scala | Scala | bsd-3-clause | 3,011 |
// scalac: -Xasync
import scala.concurrent._
import scala.concurrent.duration._
import ExecutionContext.Implicits.global
import scala.tools.testkit.async.Async.{async, await}
object TestUtil {
import language.implicitConversions
implicit def lift[T](t: T): Future[T] = Future.successful(t)
def block[T](f: Future[... | lrytz/scala | test/async/jvm/stackoverflow.scala | Scala | apache-2.0 | 538 |
package inverse_macros.forkwhile
import org.scalatest.FunSuite
import scala.concurrent.duration.Duration
import scala.concurrent.{Await, Future}
import scala.language.implicitConversions
class ForkJoinTest extends FunSuite {
val sb = new StringBuilder
implicit class Sync(f: Future[Unit]) {
def sync = {
... | hiroshi-cl/InverseMacros | inverse_macros_libraries/src/test/scala/inverse_macros/forkwhile/ForkJoinTest.scala | Scala | bsd-2-clause | 782 |
/*
* 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 ... | tophua/spark1.52 | yarn/src/test/scala/org/apache/spark/deploy/yarn/ContainerPlacementStrategySuite.scala | Scala | apache-2.0 | 5,685 |
package org.tejo.iza.tests
import org.scalatest.WordSpec
import org.tejo.iza.actor.cirkulerilo.redaktilo.html.HtmlRedaktilo
import org.tejo.iza.rules.facts.CardFact
import org.tejo.model.{Cirkulero, Kontribuo, MarkdownValue}
class RedaktiloSuite extends WordSpec with TestData {
"A HTML redaktilo" when {
"Ther... | tomaszym/izabela | actor/src/test/scala/org/tejo/iza/tests/RedaktiloSuite.scala | Scala | gpl-2.0 | 1,769 |
package com.twitter.scalding
import org.scalatest.FunSuite
import cascading.flow.FlowDef
import com.twitter.scalding.source.{NullSink, TypedText}
import com.twitter.scalding.typed.cascading_backend.CascadingBackend
class FlowStateMapTest extends FunSuite {
test("make sure sure sourcemap isn't empty after planning"... | twitter/scalding | scalding-core/src/test/scala/com/twitter/scalding/FlowStateMapTest.scala | Scala | apache-2.0 | 582 |
package org.bone.ircballoon.model
import org.eclipse.swt.widgets._
import org.eclipse.swt.graphics._
import org.bone.ircballoon._
import org.bone.ircballoon.ImageUtil._
import scala.xml.XML
import scala.io.Source
import scala.util.control.Exception._
object TwitchUser
{
case class CustomAvatar(file: String, image... | brianhsu/IRCBalloon | src/main/scala/model/TwitchUser.scala | Scala | gpl-3.0 | 1,913 |
package org.kneelawk.simplecursemodpackdownloader.console
import java.io.Console
import java.io.PrintStream
import java.io.InputStream
import java.io.BufferedReader
import java.io.InputStreamReader
trait ConsoleInterface {
def prompt(fmt: String, args: Object*): String
def promptHiddenInput(fmt: String, args: Ob... | Kneelawk/SimpleCurseModpackDownloader | src/main/scala/org/kneelawk/simplecursemodpackdownloader/console/ConsoleInterface.scala | Scala | mit | 1,322 |
package org.example3.data
class Z
| JetBrains/intellij-scala | scala/scala-impl/testdata/move/moveToSamePackageWithUsage_MoveAll/after/org/example3/data/Z.scala | Scala | apache-2.0 | 35 |
/*
* 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 ... | hengyicai/OnlineAggregationUCAS | sql/core/src/main/scala/org/apache/spark/sql/execution/commands.scala | Scala | apache-2.0 | 8,132 |
package jgo.tools.compiler
package interm
package symbol
import types._
import util._
sealed abstract class Variable extends ValueSymbol
/*case class PackageVar(pkg: Package, name: String, typeOf: Type) extends Variable(typeOf) {
override def toString = "var " + pkg.name + "." + name + ", type = " + typeOf
}*/
c... | thomasmodeneis/jgo | src/src/main/scala/jgo/tools/compiler/interm/symbol/Variable.scala | Scala | gpl-3.0 | 1,690 |
package com.twitter.finagle.http
import com.twitter.finagle.Stack.Params
import com.twitter.finagle.client.Transporter
import com.twitter.finagle.{ServiceFactory, Service, Stack, Stackable, SimpleFilter}
import com.twitter.util.Future
import org.jboss.netty.handler.codec.http.{HttpRequest, HttpResponse, HttpHeaders}
... | yancl/finagle-6.22.0 | finagle-http/src/main/scala/com/twitter/finagle/http/TlsFilter.scala | Scala | apache-2.0 | 1,274 |
/**
* 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... | evlist/orbeon-forms | src/main/scala/org/orbeon/oxf/xforms/processor/XFormsResourceServer.scala | Scala | lgpl-2.1 | 11,370 |
package com.github.wartman4404.gldraw
import _root_.android.app.Activity
import _root_.android.os.Bundle
import android.widget._
import android.view._
import android.graphics.{SurfaceTexture, Bitmap}
import android.content.{Context, Intent}
import android.content.res.Configuration
import android.app.AlertDialog
impor... | wartman4404/everybody-draw | src/main/scala/MainActivity.scala | Scala | apache-2.0 | 32,722 |
/*
* Copyright 2016 Nokia Solutions and Networks Oy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicab... | nokia/akka-typed-persistence | src/main/scala/com/nokia/ntp/ct/persistence/PersistenceSettings.scala | Scala | apache-2.0 | 1,373 |
def duplicate[A](wa: Store[S, A]): Store[S, Store[S, A]] = wa match {
case Store(f, s) => Store(Store(f), s)
} | hmemcpy/milewski-ctfp-pdf | src/content/3.7/code/scala/snippet36.scala | Scala | gpl-3.0 | 112 |
package com.redis
import org.scalatest.FunSpec
import org.scalatest.BeforeAndAfterEach
import org.scalatest.BeforeAndAfterAll
import org.scalatest.matchers.ShouldMatchers
import org.scalatest.junit.JUnitRunner
import org.junit.runner.RunWith
@RunWith(classOf[JUnitRunner])
class SetOperationsSpec extends FunSpec
... | Tjoene/thesis | Case_Programs/scala-redis-2.9-pre-scala-2.10/src/test/scala/com/redis/SetOperationsSpec.scala | Scala | gpl-2.0 | 12,124 |
package actors
import scala.reflect.NameTransformer
import scala.concurrent._
import scala.concurrent.duration.FiniteDuration
import ExecutionContext.Implicits.global
import akka.actor.ActorSystem
import akka.pattern.after
/**
* @author Alefas
* @since 10/12/15
*/
object ActorUtils {
def encodePath(path: Str... | JetChat/JetChat | app/actors/ActorUtils.scala | Scala | apache-2.0 | 640 |
package com.divisiblebyzero.hakea.service.config
import com.divisiblebyzero.hakea.config.SolrConfiguration
import com.fasterxml.jackson.annotation.JsonProperty
import org.hibernate.validator.constraints.NotEmpty
class DropwizardSolrConfiguration extends SolrConfiguration {
@NotEmpty
@JsonProperty
var url: Stri... | eczarny/hakea | hakea-indexing-service/src/main/scala/com/divisiblebyzero/hakea/service/config/DropwizardSolrConfiguration.scala | Scala | mit | 443 |
/*
* 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 | core/src/main/scala/org/apache/spark/resource/ResourceProfile.scala | Scala | apache-2.0 | 15,233 |
package jsky.app.ot.vcs
sealed trait SyncMode
object SyncMode {
case object ClosePrompt extends SyncMode
case object All extends SyncMode
} | arturog8m/ocs | bundle/jsky.app.ot/src/main/scala/jsky/app/ot/vcs/SyncMode.scala | Scala | bsd-3-clause | 145 |
// Copyright (C) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See LICENSE in project root for information.
package com.microsoft.ml.spark
import org.apache.spark.ml.feature.Tokenizer
import com.microsoft.ml.spark.schema.DatasetExtensions._
import org.apache.spark.ml.Transformer
impor... | rastala/mmlspark | src/multi-column-adapter/src/test/scala/MultiColumnAdapterSpec.scala | Scala | mit | 1,631 |
import scala._;
object test {
trait F[If] {}
def f[Jf](h: Jf):F[Jf] = f[Jf](h);
trait G[Ig] {}
def g[Jg](h: Jg):G[Jg] = g[Jg](h);
class M[P]() {
abstract class I[X]() {
// Methods to check the type X and P as seen from instances of I
def chk_ix(x: X): Unit = ();
def chk_ip(p: P): Unit;
... | AlexSikia/dotty | tests/pending/pos/test5.scala | Scala | bsd-3-clause | 1,510 |
trait Module {
sealed abstract class Tree
case class LetL() extends Tree
object O {
case class LetR() extends Tree
}
}
class Patmat(val module: Module) {
def patmat(tree: module.Tree) = tree match {
case module.LetL() =>
case module.O.LetR() =>
}
}
| som-snytt/dotty | tests/pos/i1269.scala | Scala | apache-2.0 | 276 |
/*
* Copyright (C) 2016 Vincibean <Andre Bessi>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This... | Vincibean/ScalaForTheImpatient-Solutions | src/main/scala/org/vincibean/scala/impatient/chapter11/exercise7/BitSequence.scala | Scala | gpl-3.0 | 1,258 |
package kafka.console
import journal.Logger
import scalaz._, syntax.show._
import scalaz.concurrent.Task
package object logging extends LogDescriptors {
def info(message: String)(implicit log: Logger) = Task.delay {
log.info (message)
}
def warn(message: String)(implicit log: Logger) = Task.delay {
l... | shnapz/service | core/src/main/scala/kafka/console/logging/package.scala | Scala | apache-2.0 | 418 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | ueshin/apache-spark | sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/orc/OrcV2SchemaPruningSuite.scala | Scala | apache-2.0 | 2,485 |
package com.sksamuel.avro4s
import java.nio.ByteBuffer
import java.util.UUID
import org.apache.avro.Schema.Field
import org.apache.avro.generic.{GenericData, GenericRecord}
import org.apache.avro.util.Utf8
import shapeless.ops.coproduct.Reify
import shapeless.ops.hlist.ToList
import shapeless.{:+:, CNil, Coproduct, G... | YuvalItzchakov/avro4s | avro4s-macros/src/main/scala/com/sksamuel/avro4s/FromRecord.scala | Scala | mit | 13,814 |
package scala.meta
package internal
package trees
object Fresh {
private val id = new java.util.concurrent.atomic.AtomicInteger()
def nextId() = id.incrementAndGet()
}
| scalameta/scalameta | scalameta/trees/shared/src/main/scala/scala/meta/internal/trees/Fresh.scala | Scala | bsd-3-clause | 173 |
package com.scala.numbers.solutions
object nthPrime {
/* Finding if a number is prime
It is assumed you know not to ask whether 0 or 1 is primed or any negative numbers.
Don't be evil! */
def isPrime(number:Int):Boolean= (2 until number)forall(number % _ != 0)
/* Most efficient Nth prime */
/* S... | DuCalixte/LearningScalaThroughNumbersProject | Numbers/src/com/scala/numbers/solutions/nthPrime.scala | Scala | mit | 1,564 |
package views.json.ApiToken
import org.joda.time.DateTimeZone
import org.joda.time.format.ISODateTimeFormat
import play.api.libs.json.{JsValue, Json}
import com.overviewdocs.models.ApiToken
object show {
private val iso8601Format = ISODateTimeFormat.dateTime().withZone(DateTimeZone.UTC)
private def formatDate(da... | overview/overview-server | web/app/views/ApiToken/show.json.scala | Scala | agpl-3.0 | 607 |
package jp.co.reraku.harmony
trait Inbound[E, R <: Request[R]] {
def apply(externals: E): R
}
class InboundException(message: String) extends Exception(message)
| ReRaKuIMS/harmony | core/src/main/scala/jp/co/reraku/harmony/Inbound.scala | Scala | mit | 165 |
import scala.quoted._
object PowerMacro {
def power2(x: Expr[Double])(using QuoteContext) = '{
inline def power(x: Double, n: Long): Double =
if (n == 0) 1.0
else if (n % 2 == 0) { val y = x * x; power(y, n / 2) }
else x * power(x, n - 1)
power($x, 2)
}
}
| som-snytt/dotty | tests/run-macros/i4803e/Macro_1.scala | Scala | apache-2.0 | 287 |
import leon.lang._
import leon.annotation._
import leon.collection._
import leon._
object Tokens {
abstract class Token
case object TPlus extends Token
case object TTimes extends Token
case object TLT extends Token
case object TIf extends Token
case object TElse extends Token
case object TLAnd extends To... | regb/leon | testcases/verification/case-studies/Compiler.scala | Scala | gpl-3.0 | 5,232 |
package scala.test.junit
import org.junit.Test
import org.junit.runner.RunWith
import org.junit.runners.Suite
import org.junit.runners.Suite.SuiteClasses
@RunWith(classOf[Suite])
@SuiteClasses(Array(classOf[DeclaredInRunWith]))
class RunWithSupportedTest
class DeclaredInRunWith {
@Test
def runWith: Unit =
pri... | sdtwigg/rules_scala | test/src/main/scala/scala/test/junit/JunitIncludesRunWith.scala | Scala | apache-2.0 | 354 |
package org.jetbrains.plugins.scala
package lang.typeInference.generated
import org.jetbrains.plugins.scala.DependencyManagerBase._
import org.jetbrains.plugins.scala.base.libraryLoaders.{IvyManagedLoader, LibraryLoader}
import org.jetbrains.plugins.scala.lang.typeInference.TypeInferenceTestBase
/**
* @author Alefa... | jastice/intellij-scala | scala/scala-impl/test/org/jetbrains/plugins/scala/lang/typeInference/generated/TypeInferenceScalazTest.scala | Scala | apache-2.0 | 1,710 |
package scrabble;
case class Board(
squares: Map[Pos, Square]) {
override def toString = {
List.range(1, 16).map { (x) =>
List.range(1, 16).map {
y =>
val squareStr = this.squares.get(Pos.posAt(x, y).get).get.toString
if (y == 15) squareStr + "\\n " else squareStr
}
... | ornicar/scalascrabble | src/main/scala/Board.scala | Scala | gpl-2.0 | 3,921 |
package com.hamishdickson.helix.genomes
import scala.language.higherKinds
/**
* Common DNA/RNA/mRNA things
*/
trait Genome[F[_]] {
}
| hamishdickson/helix | src/main/scala/com/hamishdickson/helix/genomes/Genome.scala | Scala | mit | 139 |
package polyite.schedule.sampling
import java.math.BigInteger
import scala.collection.mutable.HashMap
import scala.collection.mutable.HashSet
import scala.util.Random
import org.exastencils.schedopt.chernikova.Chernikova
import org.exastencils.schedopt.chernikova.Generators
import isl.Isl
import isl.Isl.TypeAliases... | stganser/polyite | src/polyite/schedule/sampling/ChernikovaSamplingStrategy.scala | Scala | mit | 17,304 |
package com.geishatokyo.diffsql.parser.mysql
import com.geishatokyo.diffsql.Name
import com.geishatokyo.diffsql.ast.ColumnOption._
import com.geishatokyo.diffsql.ast.{Column, DataType, Table, _}
import com.geishatokyo.diffsql.mysql.MySQLParser
import com.geishatokyo.diffsql.parser.{ColumnParsers, DataTypeParsers, SQLP... | geishatokyo/diff-sql-table | parser/src/test/scala/com/geishatokyo/diffsql/parser/mysql/PartitionParsersTest.scala | Scala | mit | 2,735 |
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.