code
stringlengths
114
1.05M
path
stringlengths
3
312
quality_prob
float64
0.5
0.99
learning_prob
float64
0.2
1
filename
stringlengths
3
168
kind
stringclasses
1 value
package model; import java.util.ArrayList; import java.util.Objects; public class Graph { private ArrayList<Node> nodes; private ArrayList<Path> paths; public Graph() { this.nodes = new ArrayList<>(); this.paths = new ArrayList<>(); } public ArrayList<Node> getNodes() { ...
SPPV/src/main/java/model/Graph.java
0.8474
0.421492
Graph.java
starcoder
package bio.singa.mathematics.matrices; import bio.singa.core.utility.Pair; import bio.singa.mathematics.vectors.RegularVector; import java.text.DecimalFormat; import java.text.NumberFormat; import java.util.*; import java.util.stream.Collectors; /** * @author cl */ public class LabeledSymmetricMatrix<LabelType> e...
singa-mathematics/src/main/java/bio/singa/mathematics/matrices/LabeledSymmetricMatrix.java
0.950353
0.597608
LabeledSymmetricMatrix.java
starcoder
package org.dyn4j.geometry; import junit.framework.TestCase; import org.dyn4j.geometry.Polygon; import org.dyn4j.geometry.Transform; import org.dyn4j.geometry.Vector2; import org.dyn4j.geometry.hull.DivideAndConquer; import org.dyn4j.geometry.hull.GiftWrap; import org.dyn4j.geometry.hull.GrahamScan; import ...
junit/org/dyn4j/geometry/HullGeneratorTest.java
0.604282
0.426919
HullGeneratorTest.java
starcoder
package uk.gov.dstl.baleen.uima.utils; import java.text.DateFormat; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Properties; import java.util.TimeZone; import uk.gov.dstl.baleen.exceptions.InvalidParameterException; /** Convert a string into an object. Used by LegacyMongoConsu...
baleen-uima/src/main/java/uk/gov/dstl/baleen/uima/utils/StringToObject.java
0.826957
0.417568
StringToObject.java
starcoder
package net.pkhapps.mvvm4vaadin.model; import java.util.Collection; import java.util.function.Predicate; import java.util.stream.Collectors; import java.util.stream.Stream; /** * An extended version of {@link ObservableList} that allows clients to also change the list and not only observe it. * * @param <T> the ty...
mvvm4vaadin/src/main/java/net/pkhapps/mvvm4vaadin/model/WritableObservableList.java
0.935582
0.442034
WritableObservableList.java
starcoder
package com.echo.holographlibrary; import android.content.Context; import android.graphics.Bitmap; import android.graphics.Bitmap.Config; import android.graphics.Canvas; import android.graphics.Color; import android.graphics.Paint; import android.graphics.Path; import android.graphics.Path.Direction; import android.gr...
src/main/java/com/echo/holographlibrary/LineGraph.java
0.865196
0.437103
LineGraph.java
starcoder
package org.parctice.app.hackerrank.java.data_structures; import org.junit.After; import org.junit.Assert; import org.junit.Before; import org.junit.Test; import org.parctice.app.helpers.FileHelper; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.InputStream; import java.io.P...
src/main/java/org/parctice/app/hackerrank/java/data_structures/Java1DArray2Test.java
0.76074
0.57818
Java1DArray2Test.java
starcoder
package com.nextenso.proxylet.diameter.util; import java.math.BigInteger; /** * The Unsigned64 AVP Format. * <p> * See RFC 3588 paragraph 4.2 for information. * <p> * Since no Java primitive can wrap a 64 bit unsigned integer, the methods are * available for 3 types of representation: * <ul> * <li>2 ints : 1...
com.nextenso.proxylet.diameter/src/com/nextenso/proxylet/diameter/util/Unsigned64Format.java
0.944766
0.622918
Unsigned64Format.java
starcoder
package Nonlinear_equations; /** * Created by NarbiD on 14.10.2016. */ public class Method { private static final double eps = 0.0000001; private static double equation(double x) { return x*x*x - 3*x*x - 17*x + 22; } private static double derivative(double x) { return 3*x*x - 6*x -...
Numerical Methods/Nonlinear equations/src/Nonlinear_equations/Method.java
0.775562
0.594434
Method.java
starcoder
package squidpony.squidmath; import squidpony.StringKit; import java.io.Serializable; /** * A well-studied RNG that can be quite fast in some circumstances. This is a port of * <a href="https://romu-random.org/">Romu-Random</a>'s RomuTrio generator to Java. It has * three {@code long} states, which must never all...
squidlib-util/src/main/java/squidpony/squidmath/RomuTrioRNG.java
0.906649
0.54256
RomuTrioRNG.java
starcoder
package raytracer; public class Camera { private Point eye; private Vector vx; private Vector vy; private Vector vz; private double windowDistance; private double windowWidth; private double windowHeight; private double rows, cols; // private double fovy, fovx; public Camera(Point eye, Point center, Vector...
src/main/java/raytracer/Camera.java
0.639511
0.572902
Camera.java
starcoder
package maspack.render; import java.awt.Color; import maspack.matrix.*; /** * A viewer is a component that takes a collection of renderables and * renders them for a given viewpoint and set of lighting conditions. * It also implements the interface {@link Renderable}, which provides * the primary functionality b...
src/maspack/render/Viewer.java
0.930954
0.505127
Viewer.java
starcoder
package bio.singa.simulation.model.simulation.error; import bio.singa.simulation.entities.ChemicalEntity; import bio.singa.simulation.model.simulation.Updatable; /** * The LocalError object stores the error as an result of the currently applied time step. Additionally it stores in * which node and for which chemica...
singa-simulation/src/main/java/bio/singa/simulation/model/simulation/error/NumericalError.java
0.909222
0.467636
NumericalError.java
starcoder
import java.util.ArrayList; import java.util.Arrays; import java.util.HashSet; import java.util.List; import java.util.Random; import java.util.Set; public class NumberOfScoreCombinations { public static int numCombinationsForFinalScore(int finalScore, List<Integer> scores) { int[][] numCombinations = new ...
DP/NumberOfScoreCombinations.java
0.790854
0.422862
NumberOfScoreCombinations.java
starcoder
package org.apache.sysml.runtime.matrix.data; import java.util.ArrayList; import org.apache.sysml.runtime.DMLRuntimeException; import org.apache.sysml.runtime.DMLUnsupportedOperationException; import org.apache.sysml.runtime.functionobjects.Builtin; import org.apache.sysml.lops.PartialAggregate.CorrectionLocationType...
src/main/java/org/apache/sysml/runtime/matrix/data/OperationsOnMatrixValues.java
0.546496
0.413892
OperationsOnMatrixValues.java
starcoder
package uk.ac.uea.cmp.srnaworkbench.utils.degradomestatistics; /** * The ProbabilityDistribution superclass provides an object for * encapsulating probability distributions. * * @version 1.0 * @author <NAME> */ public abstract class ProbabilityDistribution extends Object { /*...
src/main/java/uk/ac/uea/cmp/srnaworkbench/utils/degradomestatistics/ProbabilityDistribution.java
0.871324
0.555496
ProbabilityDistribution.java
starcoder
package org.jitsi.util; /** * RTP-related static utility methods. * @author <NAME> */ public class RTPUtils { /** * Returns the difference between two RTP sequence numbers (modulo 2^16). * @return the difference between two RTP sequence numbers (modulo 2^16). */ public static int sequenceNumb...
src/org/jitsi/util/RTPUtils.java
0.884464
0.507385
RTPUtils.java
starcoder
package org.apache.activemq.util; import java.io.IOException; /** * Used to write and read primitives to and from a ByteSequence. */ public final class ByteSequenceData { private ByteSequenceData() { } public static byte[] toByteArray(ByteSequence packet) { if (packet.offset == 0 && pa...
activemq-client/src/main/java/org/apache/activemq/util/ByteSequenceData.java
0.861771
0.607227
ByteSequenceData.java
starcoder
package com.wantedtech.common.xpresso.sentence.chunker.regexchunker; import com.wantedtech.common.xpresso.x; import com.wantedtech.common.xpresso.regex.Match; import com.wantedtech.common.xpresso.regex.Regex; import com.wantedtech.common.xpresso.types.tuple; /** """ A rule specifying how to modify the chunk...
src/main/java/com/wantedtech/common/xpresso/sentence/chunker/regexchunker/RegexpChunkRule.java
0.88382
0.658157
RegexpChunkRule.java
starcoder
package leetcode._1_100._40_combination_sum_ii; import java.util.ArrayList; import java.util.Arrays; import java.util.List; /** * Given a collection of candidate numbers (candidates) and a target number (target), find all unique combinations in candidates where the candidate numbers sums to target. * <p> * Each nu...
src/main/java/leetcode/_1_100/_40_combination_sum_ii/CombinationSumII.java
0.91436
0.514766
CombinationSumII.java
starcoder
package me.htrewrite.client.util; import static org.lwjgl.opengl.GL11.*; import me.htrewrite.client.Wrapper; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.BufferBuilder; import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.Tessellator; import net.mine...
src/main/java/me/htrewrite/client/util/RenderUtils.java
0.611846
0.469034
RenderUtils.java
starcoder
package org.axiom_tools.codecs; import java.util.*; import javax.xml.bind.annotation.*; /** * Contains mapped name + value pairs. * A convenience for consuming and producing JSON without a predefined schema or class. * Also, compares such structures and reports their differences. */ @XmlRootElement public class ...
axiom-utils/src/main/java/org/axiom_tools/codecs/ValueMap.java
0.913206
0.449332
ValueMap.java
starcoder
package com.xqbase.bn.io; /** * Utilities for binary-encoded data. */ public class BinaryData { private BinaryData() {} /** * Encode a boolean to the byte array at the given position. Will throw * IndexOutOfBounds if the position is not valid. * @return the number of bytes written to the byt...
bn-core/src/main/java/com/xqbase/bn/io/BinaryData.java
0.867738
0.521167
BinaryData.java
starcoder
package water.util.fp; /** * Stores stock pure functions, that is those that don't keep any context. * Pure functions have this feature that their equals() only compares classes. */ public class PureFunctions extends Functions { public static final Function<Double, Double> SQUARE = new Function<Double, Double>() ...
h2o-core/src/main/java/water/util/fp/PureFunctions.java
0.880052
0.729496
PureFunctions.java
starcoder
package com.mazatech.svgt; public class AmanithSVGJNI { // Initialize the library. public final static native int svgtInit(int screenWidth, int screenHeight, float dpi); // Destroy the library, freeing all allocated resources. public final static native void svgtDone(); //Get the maximum d...
libGDX/gameCards/core/src/com/mazatech/svgt/AmanithSVGJNI.java
0.834744
0.485661
AmanithSVGJNI.java
starcoder
package com.smartbear.readyapi4j.extractor; import com.smartbear.readyapi4j.teststeps.propertytransfer.PathLanguage; public class Extractors { /** * Extracts a property from the teststep it was added on with the function "withProperties". The property must exist * on the given teststep. Runs the lambda...
modules/core/src/main/java/com/smartbear/readyapi4j/extractor/Extractors.java
0.85561
0.485539
Extractors.java
starcoder
package com.opengamma.analytics.math.interpolation; import org.apache.commons.lang.Validate; import com.opengamma.analytics.math.interpolation.data.Interpolator1DDataBundle; /** * This left extrapolator is designed for extrapolating a discount factor where the trivial point (0.,1.) is NOT involved in the data. * T...
projects/analytics/src/main/java/com/opengamma/analytics/math/interpolation/QuadraticPolynomialLeftExtrapolator.java
0.950227
0.718385
QuadraticPolynomialLeftExtrapolator.java
starcoder
package algorithms; import grid.GridGraph; import java.util.ArrayList; import java.util.List; import algorithms.priorityqueue.IndirectHeap; public class AcceleratedAStar extends AStar { private List<Integer> closed; private int[][] maxRanges; public AcceleratedAStar(GridGraph graph, int sx, int sy,...
src/algorithms/AcceleratedAStar.java
0.758063
0.434041
AcceleratedAStar.java
starcoder
package jakemarsden.opengl.engine.shader; import static org.fissore.slf4j.FluentLoggerFactory.getLogger; import static org.lwjgl.opengl.GL11.GL_NONE; import static org.lwjgl.opengl.GL20.*; import jakemarsden.opengl.engine.light.Attenuation; import jakemarsden.opengl.engine.math.*; import java.util.HashMap; import jav...
src/main/java/jakemarsden/opengl/engine/shader/ShaderProgram.java
0.864296
0.47025
ShaderProgram.java
starcoder
package rikka.api.util; import com.flowpowered.math.vector.Vector3d; import com.flowpowered.math.vector.Vector3f; import com.flowpowered.math.vector.Vector3i; import org.apache.commons.lang3.Validate; import rikka.api.util.type.DyeColor; import java.util.Objects; import static com.google.common.base.Preconditions.ch...
src/main/java/rikka/api/util/Color.java
0.911055
0.549882
Color.java
starcoder
package lab6.classes; import java.util.StringJoiner; /** * 1. More Exercises on Classes * * <p>1.2 The MyPolynomial Class */ public class MyPolynomial { private double[] coeffs; public MyPolynomial(double[] coeffs) { this.coeffs = coeffs; } public double getCoeff(int i) { return coeffs[i]; } ...
src/lab6/classes/MyPolynomial.java
0.820037
0.404272
MyPolynomial.java
starcoder
package ch.frostnova.force.based.layout.strategy.impl; import ch.frostnova.force.based.layout.geom.Rectangle; import ch.frostnova.force.based.layout.geom.Vector; import ch.frostnova.force.based.layout.geom.domain.ShapeForces; import ch.frostnova.force.based.layout.model.Scene; import ch.frostnova.force.based.layout.mo...
src/main/java/ch/frostnova/force/based/layout/strategy/impl/RepulsionLayoutStrategy.java
0.931111
0.415551
RepulsionLayoutStrategy.java
starcoder
package fr.sii.ogham.sms; public final class SmsConstants { /** * Default constant values for splitting messages. * * * @author <NAME> * */ public static final class SmppSplitConstants { /** * A single SMS GSM message has a maximum size of 140 octets. */ public static final int MAXIMUM_BYTES_...
ogham-core/src/main/java/fr/sii/ogham/sms/SmsConstants.java
0.869327
0.590248
SmsConstants.java
starcoder
package tailspin.samples; import static org.junit.jupiter.api.Assertions.assertEquals; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.nio.charset.StandardCharsets; import java.util.List; import org.junit.jupiter.api.Test; import tailspin.Tailspin; c...
test/tailspin/samples/Numbers.java
0.874332
0.462716
Numbers.java
starcoder
public class QuadraticRoots { private static class Complex { double re, im; public Complex(double re, double im) { this.re = re; this.im = im; } @Override public boolean equals(Object obj) { if (obj == this) {return true;} if ...
lang/Java/roots-of-a-quadratic-function.java
0.902886
0.502625
roots-of-a-quadratic-function.java
starcoder
package gov.sandia.cognition.statistics.method; import gov.sandia.cognition.learning.performance.categorization.DefaultBinaryConfusionMatrix; import gov.sandia.cognition.annotation.PublicationReference; import gov.sandia.cognition.annotation.PublicationType; import gov.sandia.cognition.collection.CollectionUtil; impor...
Components/LearningCore/Source/gov/sandia/cognition/statistics/method/ReceiverOperatingCharacteristic.java
0.923467
0.650134
ReceiverOperatingCharacteristic.java
starcoder
package cetus.analysis; import java.util.*; import cetus.hir.PrintTools; /** * Class DFANode represents a node object to be used as workspace in any * data flow analysis. The "data" map can hold any generic type of contents * by mapping string-type keys to the contents. The "preds" map and the "succs" * map hold ...
src/cetus/analysis/DFANode.java
0.905538
0.432723
DFANode.java
starcoder
package org.jhaws.common.lang; import java.util.Arrays; import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Locale; import java.util.Map; public class DecimalSystem { /** https://en.wikipedia.org/wiki/Unit_prefix */ private static final Map<Locale, List<String>> sho...
jhaws/lang/src/main/java/org/jhaws/common/lang/DecimalSystem.java
0.84916
0.425546
DecimalSystem.java
starcoder
* This is not the original file distributed by the Apache Software Foundation * It has been modified by the Hipparchus project */ package org.hipparchus.linear; import java.io.Serializable; import org.hipparchus.exception.LocalizedCoreFormats; import org.hipparchus.exception.MathIllegalArgumentException; import o...
hipparchus-core/src/main/java/org/hipparchus/linear/Array2DRowRealMatrix.java
0.961461
0.423607
Array2DRowRealMatrix.java
starcoder
* @file ClimateRecord.java */ package wde.emc; /** * Provides a means of copying {@code ClimateRecords}, and accessing * {@code ClimateRecord} attributes. * <p/> * <p> * A {@code ClimateRecord} represents a row from the climate record database. * Records are monthly min, max, and avg values for a particular ty...
WDE/src/wde/emc/ClimateRecord.java
0.925697
0.551513
ClimateRecord.java
starcoder
import java.io.IOException; import java.util.HashMap; import java.util.Map; /** * Program that calculates the correlation between * two documents. * * @author <NAME> * @author <NAME> */ public class Correlator { public static void main(String[] args) { if(args.length != 3) { System.out.pr...
project3/src/Correlator.java
0.903922
0.49292
Correlator.java
starcoder
package com.opengamma.engine; import java.util.Collection; import java.util.Collections; import java.util.HashSet; import java.util.List; import java.util.Set; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.opengamma.OpenGammaRuntimeException; import com.opengamma.core.change.ChangeManager; impo...
projects/engine/src/main/java/com/opengamma/engine/DefaultComputationTargetResolver.java
0.914386
0.508727
DefaultComputationTargetResolver.java
starcoder
import java.util.*; public class nSums { /* 2 Sum Closest Find the pair of elements in a given array that sum to a value that is closest to the given target number. Return the values of the two numbers. Assumptions The given array is not null and has length of at least 2 Examples A = {1...
nSums.java
0.808067
0.737395
nSums.java
starcoder
package edu.uci.ics.jung.graph; import java.util.Collection; import edu.uci.ics.jung.graph.util.EdgeType; /** * A hypergraph, consisting of a set of vertices of type <code>V</code> * and a set of hyperedges of type <code>E</code> which connect the vertices. * This is the base interface for all JUNG graph types....
jung-api/src/main/java/edu/uci/ics/jung/graph/Hypergraph.java
0.91967
0.626524
Hypergraph.java
starcoder
package ru.geekbrains.lesson1; /** * Java Core. Basic level. Lesson 1 * * @author <NAME> * @version dated October 22, 2020 */ public class Main { public static void main(String[] args) { // task №2 createVariable(); // task №3 System.out.println(resultExpression(11, 22, 33, 44...
src/main/java/ru/geekbrains/lesson1/Main.java
0.506836
0.407628
Main.java
starcoder
package com.github.gerdreiss.optics.core; import java.util.Optional; import java.util.function.BiFunction; import java.util.function.Function; /** * "A lens is basically a getter/setter that can be used for deep updates of immutable data." * http://davids-code.blogspot.de/2014/02/immutable-domain-and-lenses-in-java...
core/src/main/java/com/github/gerdreiss/optics/core/OptionalLens.java
0.90882
0.404331
OptionalLens.java
starcoder
package com.netflix.priam.utils; import com.google.common.annotations.VisibleForTesting; import com.google.common.base.CharMatcher; import com.google.common.collect.Ordering; import com.netflix.priam.identity.Location; import org.apache.cassandra.dht.ByteOrderedPartitioner; import org.apache.cassandra.dht.ByteOrderedP...
priam/src/main/java/com/netflix/priam/utils/BOPTokenManager.java
0.934388
0.404096
BOPTokenManager.java
starcoder
package com.oltpbenchmark; import java.util.ArrayList; import java.util.Iterator; import java.util.concurrent.atomic.AtomicInteger; /** Efficiently stores a record of (start time, latency) pairs. */ public class LatencyRecord implements Iterable<LatencyRecord.Sample> { /** Allocate space for 128k samples at a time *...
src/com/oltpbenchmark/LatencyRecord.java
0.846387
0.406361
LatencyRecord.java
starcoder
* To change this template, choose Tools | Templates * and open the template in the editor. */ package org.broad.igv.data; import org.broad.igv.track.WindowFunction; public class DataStatistics { private double mean; private double median; private double min; private double max; private dou...
src/org/broad/igv/data/DataStatistics.java
0.871105
0.45944
DataStatistics.java
starcoder
package org.sosy_lab.cpachecker.cpa.value.symbolic.type; import org.sosy_lab.cpachecker.cfa.types.Type; import org.sosy_lab.cpachecker.cpa.value.type.Value; import org.sosy_lab.cpachecker.util.states.MemoryLocation; import java.util.Objects; /** * {@link SymbolicExpression} that represents a single constant value o...
src/org/sosy_lab/cpachecker/cpa/value/symbolic/type/ConstantSymbolicExpression.java
0.920308
0.415729
ConstantSymbolicExpression.java
starcoder
package com.opencode.app.model; import java.util.ArrayList; import java.util.List; import java.util.Random; /** * Класс реализует логику игры "Быки и коровы". * Здесь генерируется четырёхзначное число, цифры которого не повторяются. Задача игрока - угадать загаданное число * за как можно меньшее количество попыток...
src/main/java/com/opencode/app/model/Game.java
0.504394
0.430207
Game.java
starcoder
package cn.tangyancode.ego.chineseChess.core; import cn.tangyancode.ego.chineseChess.entity.Relation; import cn.tangyancode.ego.chineseChess.entity.Troop; import cn.tangyancode.ego.chineseChess.entity.Unit; import java.util.HashSet; public class ScoreCalculator { public static int getScore(GameMap gameMap, Rela...
src/main/java/cn/tangyancode/ego/chineseChess/core/ScoreCalculator.java
0.726523
0.441252
ScoreCalculator.java
starcoder
package com.streamsets.datacollector.util; import com.google.common.base.Throwables; import java.security.AccessController; import java.security.PrivilegedActionException; import java.security.PrivilegedExceptionAction; public class LambdaUtil { /** * This is custom variant of supplier that adds support for ex...
container/src/main/java/com/streamsets/datacollector/util/LambdaUtil.java
0.834912
0.418162
LambdaUtil.java
starcoder
package io.ogi.boid.corealgorithm; import io.ogi.boid.model.Boid; import io.ogi.boid.model.BoidModel; import java.util.List; import java.util.concurrent.CompletableFuture; import java.util.concurrent.Executor; import java.util.stream.Collectors; import java.util.stream.DoubleStream; import static io.ogi.boid.corealg...
src/main/java/io/ogi/boid/corealgorithm/BoidMoves.java
0.825343
0.626238
BoidMoves.java
starcoder
package org.apache.fop.area; import java.awt.Rectangle; import java.awt.geom.AffineTransform; import java.awt.geom.Rectangle2D; import java.io.Serializable; import org.apache.fop.datatypes.FODimension; public class CTM implements Serializable { private double a; private double b; private double c; private...
org/apache/fop/area/CTM.java
0.796055
0.516656
CTM.java
starcoder
package io.hops.util.featurestore.dtos.stats; import io.hops.util.featurestore.dtos.stats.cluster_analysis.ClusterAnalysisDTO; import io.hops.util.featurestore.dtos.stats.desc_stats.DescriptiveStatsDTO; import io.hops.util.featurestore.dtos.stats.feature_correlation.FeatureCorrelationMatrixDTO; import io.hops.util.fea...
src/main/java/io/hops/util/featurestore/dtos/stats/StatisticsDTO.java
0.757436
0.519034
StatisticsDTO.java
starcoder
package org.jscience.mathematics.internal.vector; import java.io.IOException; import java.util.Comparator; import java.util.List; import javolution.context.StackContext; import javolution.lang.MathLib; import javolution.lang.Realtime; import javolution.lang.ValueType; import javolution.text.Cursor; import ...
mathematics/src/main/java/org/jscience/mathematics/internal/linear/Matrix.java
0.904139
0.433742
Matrix.java
starcoder
package java.sql; import java.math.BigDecimal; import java.io.Reader; import java.io.InputStream; import java.net.URL; /** * The SQLInput interface defines operations which apply to a type of input * stream which carries a series of values which represent an instance of an SQL * structured type or SQL distinct typ...
enhanced/archive/classlib/java6/modules/sql/src/main/java/java/sql/SQLInput.java
0.906914
0.441854
SQLInput.java
starcoder
import java.util.*; /* Construct Binary Tree from Parent Array Given an array of size N that represents a Tree in such a way that array indexes are values in tree nodes and array values give the parent node of that particular index (or node). The value of the root node index would always be -1 as there is no parent fo...
GeeksforGeeks/src/createTree.java
0.719482
0.71418
createTree.java
starcoder
package measure.cluster.agreement.partitioning.classics; import java.util.HashSet; import java.util.Set; import java.util.Vector; import measure.cluster.agreement.partitioning.PartiotioningAgreement; /** * Created on Apr 19, 2012 *<p> This class is an extension of the abstract class <tt>Partitioning Agreement</tt>...
src/measure/cluster/agreement/partitioning/classics/NMI.java
0.519765
0.588712
NMI.java
starcoder
package ch.ethz.systems.netbench.ext.flowlet; import ch.ethz.systems.netbench.core.network.Packet; import ch.ethz.systems.netbench.ext.basic.TcpHeader; /** * The uniform flowlet intermediary simply increases the flowlet identifier * each time a flowlet gap has occurred, changing the sequential hash for each packet ...
aifo_simulation/java-code/src/main/java/ch/ethz/systems/netbench/ext/flowlet/UniformFlowletIntermediary.java
0.84075
0.434881
UniformFlowletIntermediary.java
starcoder
package com.riiablo.io; public class BitConstraints { private BitConstraints() {} private static int _validateSize(int min, int max, int bits) { assert min >= 0 : "min(" + min + ") < " + 0 + "!"; assert max > 0 : "max(" + max + ") <= " + 0; assert min <= max : "min(" + min + ") > max(" + max + ")"; ...
core/src/com/riiablo/io/BitConstraints.java
0.801509
0.489503
BitConstraints.java
starcoder
package de.lmu.ifi.dbs.elki.index.projected; import de.lmu.ifi.dbs.elki.data.NumberVector; import de.lmu.ifi.dbs.elki.data.projection.LatLngToECEFProjection; import de.lmu.ifi.dbs.elki.data.projection.Projection; import de.lmu.ifi.dbs.elki.database.datastore.DataStoreFactory; import de.lmu.ifi.dbs.elki.database.datast...
elki-0.7.5/sources/elki-geo/src/main/java/de/lmu/ifi/dbs/elki/index/projected/LatLngAsECEFIndex.java
0.831074
0.448728
LatLngAsECEFIndex.java
starcoder
package com.opengamma.financial.analytics.curve; import java.util.ArrayList; import java.util.List; import java.util.Map; import java.util.Set; import java.util.TreeSet; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.threeten.bp.Instant; import org.threeten.bp.LocalDate; import com.opengamma.Ope...
projects/financial/src/main/java/com/opengamma/financial/analytics/curve/CurveUtils.java
0.936202
0.478102
CurveUtils.java
starcoder
package com.github.tonivade.purefun.data; import static java.util.Collections.emptyList; import static java.util.Collections.unmodifiableList; import static java.util.stream.Collectors.collectingAndThen; import java.io.Serializable; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; im...
core/src/main/java/com/github/tonivade/purefun/data/ImmutableArray.java
0.898597
0.491273
ImmutableArray.java
starcoder
package cubyz.world; import cubyz.client.ClientSettings; import cubyz.client.GameLauncher; import cubyz.utils.Logger; import cubyz.utils.math.Bits; import cubyz.world.save.ChunkIO; public abstract class Chunk extends ChunkData { public static final int chunkShift = 5; public static final int chunkShift2 = 2*chu...
src/cubyz/world/Chunk.java
0.770119
0.435841
Chunk.java
starcoder
package problem.p1656designanorderedstream; import java.sql.Struct; import java.util.*; /** * 1656. Design an Ordered Stream * * https://leetcode-cn.com/problems/design-an-ordered-stream/ * * There is a stream of n (idKey, value) pairs arriving in an arbitrary order, * where idKey is an integer between 1 and n ...
leetcode-java/src/problem/p1656designanorderedstream/Solution.java
0.904853
0.469095
Solution.java
starcoder
package object_oriented_design; import java.util.Arrays; /** * Design and implement a Minesweeper game for a single-player with a size of NxN grid that has B mines (bombs). * When a player uncover a cell, * - if is a bomb, the player loses, * - if it is a number, the number is exposed. * - if it is a blank cell,...
src/main/java/object_oriented_design/Minesweeper.java
0.557845
0.574634
Minesweeper.java
starcoder
package us.ihmc.jMonkeyEngineToolkit.jme.util; import java.awt.Color; import java.util.List; import javax.vecmath.Color3f; import javax.vecmath.Point3d; import javax.vecmath.Quat4d; import javax.vecmath.Quat4f; import javax.vecmath.TexCoord2f; import javax.vecmath.Tuple3d; import javax.vecmath.Tuple3f; import javax.v...
IHMCJMonkeyEngineToolkit/src/us/ihmc/jMonkeyEngineToolkit/jme/util/JMEDataTypeUtils.java
0.723602
0.582254
JMEDataTypeUtils.java
starcoder
package org.xcsp.common.predicates; import static org.xcsp.common.Types.TypeExpr.LONG; import static org.xcsp.common.Types.TypeExpr.VAR; import java.lang.reflect.Array; import java.util.LinkedHashSet; import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.function.Function; import ...
src/main/java/org/xcsp/common/predicates/XNode.java
0.845113
0.457379
XNode.java
starcoder
public class NBody { public static double readRadius(String file) { In in = new In(file); int planets = in.readInt(); double radius = in.readDouble(); return radius; } public static Body[] readBodies(String file) { In in = new In(file); int n = in.readInt(); double radius = in.readDouble(); Body[]...
proj0/NBody.java
0.517571
0.535341
NBody.java
starcoder
package estructures; import java.util.Objects; public class BinaryTree<T extends Comparable<T>> { private Node<T> root; public BinaryTree() { root = null; } public BinaryTree(T value) { this.root = new Node<>(value); } public Node<T> getRoot() { return root; } ...
src/estructures/BinaryTree.java
0.851737
0.439507
BinaryTree.java
starcoder
package org.assertj.graalvm.api; import java.time.LocalDate; import java.time.LocalTime; import java.util.function.Predicate; import org.assertj.core.api.AbstractAssert; import org.assertj.core.api.AbstractBooleanAssert; import org.assertj.core.api.AbstractByteAssert; import org.assertj.core.api.AbstractDoubleAssert;...
graalvm-test-assertj/src/main/java/org/assertj/graalvm/api/ValueAssert.java
0.895734
0.624093
ValueAssert.java
starcoder
package com.github.jxen.measure.system; import static com.github.jxen.measure.system.MetricUnits.SECOND; import static com.github.jxen.measure.unit.UnitUtil.unit; import com.github.jxen.measure.annotation.AddUnit; import com.github.jxen.measure.unit.AbstractUnit; import java.math.BigDecimal; import javax.measure.quan...
jxen-measure-core/src/main/java/com/github/jxen/measure/system/TimeUnits.java
0.926678
0.44059
TimeUnits.java
starcoder
package toxi.geom; import java.util.ArrayList; import java.util.List; import javax.xml.bind.annotation.XmlElement; import toxi.geom.Line3D.LineIntersection.Type; import toxi.math.MathUtils; public class Line3D { public static class LineIntersection { public static enum Type { NON_INTERSECT...
libraries/toxiclibs/src/toxi/geom/Line3D.java
0.927847
0.530966
Line3D.java
starcoder
package basicGame; import static org.junit.jupiter.api.Assertions.*; import java.io.File; import java.util.Scanner; import org.junit.jupiter.api.Test; class CategoryTest { Scanner input; Category testCategory; @Test void shouldCreateCategoryFromFile() { //Mock category file containing the title "Test" an...
Hangman/src/basicGame/CategoryTest.java
0.641535
0.462048
CategoryTest.java
starcoder
package de.uni_passau.sds.ecmascript2brics; import java.util.Arrays; public class EcmaToBricsTreeConverter { public static ExpressionTree convert(ExpressionTree tree) { ExpressionTree.Node root = tree.getRoot(); ExpressionTree.Node hatRemoved = removeHat(root); ExpressionTree.Node dollarR...
src/main/java/de/uni_passau/sds/ecmascript2brics/EcmaToBricsTreeConverter.java
0.857932
0.660987
EcmaToBricsTreeConverter.java
starcoder
package pt.pcaleia.bks.mitm; import java.math.BigDecimal; import java.util.Collection; import java.util.HashSet; import java.util.Iterator; import java.util.NavigableSet; import java.util.Set; import java.util.TreeSet; import pt.pcaleia.util.asserts.ArgumentAssertions; import pt.pcaleia.util.asserts.NumberArgumentAs...
src/main/java/pt/pcaleia/bks/mitm/MeetInTheMiddleKnapsackSolver.java
0.891946
0.527195
MeetInTheMiddleKnapsackSolver.java
starcoder
package com.jmath.units; import java.util.Objects; public class Angle implements Comparable<Angle> { private final double mValue; private final AngleUnit mUnit; public Angle(double value, AngleUnit unit) { mValue = value; mUnit = Objects.requireNonNull(unit, "unit"); } public st...
src/main/java/com/jmath/units/Angle.java
0.941922
0.545467
Angle.java
starcoder
package leetcode.microsoft.middle; /* Given a binary tree where every node has a unique value, and a target key k, find the value of the nearest leaf node to target k in the tree. Here, nearest to a leaf means the least number of edges travelled on the binary tree to reach any leaf of the tree. Also, a node is call...
leet-codes/src/main/java/leetcode/microsoft/middle/$742_ClosestLeafInBinaryTree.java
0.866754
0.621771
$742_ClosestLeafInBinaryTree.java
starcoder
package net.tangly.gleam.model; import java.math.BigDecimal; import java.time.LocalDate; import java.time.LocalDateTime; import java.util.List; import java.util.Objects; import java.util.function.BiConsumer; import java.util.function.Function; import net.tangly.commons.lang.Strings; import net.tangly.commons.lang.exc...
net.tangly.gleam/src/main/java/net/tangly/gleam/model/TsvProperty.java
0.932714
0.519156
TsvProperty.java
starcoder
package prefuse.data.parser; import java.util.ArrayList; /** * Infers the data types for a table of data by testing each value of the data * against a bank of parsers and eliminating candidate parsers that do not * successfully parse the data. This class leverages the mechanisms of * {@link ParserFactory}...
src/prefuse/data/parser/TypeInferencer.java
0.856077
0.611324
TypeInferencer.java
starcoder
package com.ywh.problem.leetcode.medium; import java.util.ArrayList; import java.util.LinkedList; import java.util.List; import java.util.Queue; /** * 课程表 * [图] [回溯] [拓扑排序] [深度优先搜索] [广度优先搜索] * * 你这个学期必须选修 numCourses 门课程,记为 0 到 numCourses - 1 。 * 在选修某些课程之前需要一些先修课程。 先修课程按数组 prerequisites 给出,其中 prerequisites[i] = ...
java/src/main/java/com/ywh/problem/leetcode/medium/LeetCode207.java
0.514156
0.456652
LeetCode207.java
starcoder
package mikenakis.kit.collections; import mikenakis.kit.Kit; import java.util.Collection; import java.util.List; import java.util.Map; /** * Represents an Enum where each value is associated with a flag bit and all values together fit within an `int`. * * Necessary because Java's {@link java.util.EnumSet} does no...
kit/kit/src/mikenakis/kit/collections/FlagEnum.java
0.918626
0.457864
FlagEnum.java
starcoder
package com.opengamma.strata.product.rate; import java.time.LocalDate; import com.google.common.collect.ImmutableSet; import com.opengamma.strata.basics.ReferenceData; import com.opengamma.strata.basics.date.HolidayCalendar; import com.opengamma.strata.basics.index.Index; import com.opengamma.strata.basics.index.Over...
modules/product/src/main/java/com/opengamma/strata/product/rate/OvernightRateComputation.java
0.924086
0.796372
OvernightRateComputation.java
starcoder
package emit.ipcv.utils; /** * @author rinelfi */ public class IntArrayHelper2D { private int[][] array; public IntArrayHelper2D(int[][] array) { this.array = array; } public int lineLength() { return array.length; } public int columnLength() { return array.length > 0 ? array[0].length : 0; } ...
src/main/java/emit/ipcv/utils/IntArrayHelper2D.java
0.594198
0.50415
IntArrayHelper2D.java
starcoder
package com.github.bishabosha.cuppajoe.examples.sequences; import com.github.bishabosha.cuppajoe.collections.mutable.sequences.NonRecursiveSequence; import com.github.bishabosha.cuppajoe.collections.mutable.sequences.RecursiveSequence; import com.github.bishabosha.cuppajoe.collections.mutable.sequences.Sequence; impo...
cuppajoe-examples/src/main/java/com/github/bishabosha/cuppajoe/examples/sequences/SequenceOf.java
0.894213
0.477128
SequenceOf.java
starcoder
package org.apache.sis.gui.map; import java.util.function.Predicate; import javafx.concurrent.Task; import org.opengis.geometry.Envelope; import org.opengis.referencing.crs.CoordinateReferenceSystem; import org.opengis.referencing.crs.SingleCRS; import org.opengis.referencing.datum.PixelInCell; import org.opengis.refe...
application/sis-javafx/src/main/java/org/apache/sis/gui/map/OperationFinder.java
0.930993
0.492859
OperationFinder.java
starcoder
package com.univocity.shopify.utils; import org.apache.commons.lang3.*; import org.slf4j.*; import java.util.concurrent.*; import java.util.concurrent.atomic.*; /** * A very simple method call rate limiter, based on a time interval. Users can call {@link #waitAndGo()} * or {@link #waitAndGo(long)} to block the cur...
src/main/java/com/univocity/shopify/utils/RateLimiter.java
0.890372
0.473962
RateLimiter.java
starcoder
package be.ugent.zeus.hydra.feed.cards; import androidx.annotation.IntDef; import androidx.annotation.NonNull; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import static be.ugent.zeus.hydra.feed.cards.Card.Type.*; /** * Every subclass should have a {@link Card.Type} associate...
app/src/main/java/be/ugent/zeus/hydra/feed/cards/Card.java
0.913609
0.406509
Card.java
starcoder
package com.netflix.imflibrary.st0377.header; import com.netflix.imflibrary.KLVPacket; import com.netflix.imflibrary.annotations.MXFProperty; import com.netflix.imflibrary.st0377.CompoundDataTypes; /** * Object model corresponding to GenericPictureEssenceDescriptor structural metadata set defined in st377-1:2011 */...
src/main/java/com/netflix/imflibrary/st0377/header/GenericPictureEssenceDescriptor.java
0.624179
0.466603
GenericPictureEssenceDescriptor.java
starcoder
package com.baselogic.tutorials.reference.concurrency; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.time.LocalDateTime; import java.util.LinkedList; import java.util.List; import java.util.concurrent.*; import static java.util.Arrays.asList; /** * CountDownLatch is basically a counter, desi...
src/main/java/com/baselogic/tutorials/reference/concurrency/CountDownLatchExamples.java
0.881857
0.55911
CountDownLatchExamples.java
starcoder
package org.openstreetmap.atlas.tags.annotations.extraction; import java.util.Optional; import org.openstreetmap.atlas.tags.annotations.Tag; import org.openstreetmap.atlas.tags.annotations.validation.LengthValidator; import org.openstreetmap.atlas.utilities.collections.StringList; import org.openstreetmap.atlas.utili...
src/main/java/org/openstreetmap/atlas/tags/annotations/extraction/LengthExtractor.java
0.935957
0.402744
LengthExtractor.java
starcoder
package com.org.thomcz.next.object; import android.os.Parcel; import android.os.Parcelable; /** * Representation of a level. */ public class Level implements Parcelable { /** the id of the level. **/ private int id; /** shows if the level is unlocked by the user. */ private boolean unlocked; p...
app/src/main/java/com/org/thomcz/next/object/Level.java
0.859133
0.480479
Level.java
starcoder
package cc.redberry.rings.poly.multivar; import cc.redberry.rings.IntegersZp64; import cc.redberry.rings.Ring; import cc.redberry.rings.bigint.BigInteger; import java.io.Serializable; /** * Algebraic operations (multiplication, division) and utility methods for monomials. * * @since 2.3 */ public interface IMono...
rings/src/main/java/cc/redberry/rings/poly/multivar/IMonomialAlgebra.java
0.930237
0.521715
IMonomialAlgebra.java
starcoder
package com.torchmind.observable.binding; import com.torchmind.observable.primitive.ReadOnlyByteObservable; import com.torchmind.observable.primitive.ReadOnlyDoubleObservable; import com.torchmind.observable.primitive.ReadOnlyFloatObservable; import com.torchmind.observable.primitive.ReadOnlyIntegerObservable; import ...
src/main/java/com/torchmind/observable/binding/NumberBinding.java
0.940017
0.530054
NumberBinding.java
starcoder
package com.netcracker.oop2; public class Ball { private float x; private float y; private int radius; private float xDelta; private float yDelta; public Ball(float x, float y, int radius, int speed, int direction) { this.x = x; this.y = y; this.radius = radius; ...
src/com/netcracker/oop2/Ball.java
0.917843
0.594963
Ball.java
starcoder
package io.github.vahidshirvani; import java.util.*; import java.util.Map.Entry; import java.util.function.Function; import java.util.stream.Stream; import static java.util.Collections.singletonList; import static java.util.Map.entry; import static java.util.stream.Collectors.*; @SuppressWarnings({"rawtypes", "unche...
src/main/java/io/github/vahidshirvani/Friends.java
0.861392
0.481515
Friends.java
starcoder
package com.convertSortedArraytoBinarySearchTree; import java.util.*; /*Given an array where elements are sorted in ascending order, convert it to a height balanced BST. For this problem, a height-balanced binary tree is defined as a binary tree in which the depth of the two subtrees of every node never differ by mor...
mysol/Category/Tree/E108_Convert_Sorted_Array_to_Binary_Search_Tree/src/com/convertSortedArraytoBinarySearchTree/E108_Convert_Sorted_Array_to_Binary_Search_Tree.java
0.880836
0.5144
E108_Convert_Sorted_Array_to_Binary_Search_Tree.java
starcoder
package q1600; import java.util.Arrays; import java.util.List; import org.junit.runner.RunWith; import q1650.Q1601_MaximumNumberOfAchievableTransferRequests; import util.runner.Answer; import util.runner.LeetCodeRunner; import util.runner.TestData; import util.runner.data.DataExpectation; /** * [Hard] 1595. Minimum ...
src/main/java/q1600/Q1595_MinimumCostToConnectTwoGroupsOfPoints.java
0.890324
0.6306
Q1595_MinimumCostToConnectTwoGroupsOfPoints.java
starcoder