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 Interviews; /** * Omitting actual question for confidentiality reasons. This is my proposed solution. * * Proposed Solution: * To find the largest BST in a tree there are different options to traverse the tree: we could take an top-down approach * or a bottom-up. * * The top-down approach requir...
src/Interviews/AmazonInterview.java
0.749729
0.730885
AmazonInterview.java
starcoder
package com.atc.simulator.display.view.vector_text; import com.badlogic.gdx.graphics.g3d.utils.MeshPartBuilder; import com.badlogic.gdx.math.Matrix4; import com.badlogic.gdx.math.Vector2; import com.badlogic.gdx.math.Vector3; import java.nio.charset.StandardCharsets; import java.util.ArrayList; /** * Hershy text f...
core/src/main/com/atc/simulator/display/view/vector_text/HersheyText.java
0.903054
0.418697
HersheyText.java
starcoder
package ch.weylandinator.ui.model; import java.util.ArrayList; import java.util.Arrays; import java.util.List; public class CircuitElementHelper { public static List<CircuitElement> getFlatList(List<CircuitElement> elements) { List<CircuitElement> collected = new ArrayList<>(); collected.addAll(el...
src/main/java/ch/weylandinator/ui/model/CircuitElementHelper.java
0.888994
0.465873
CircuitElementHelper.java
starcoder
package llnl.gnem.core.util.MathFunctions; /** Complex implements a complex number and defines complex arithmetic and mathematical functions Last Updated February 27, 2001 Copyright 1997-2001 @version 1.0 @author <NAME> * User: <NAME> * Date: Feb 23, 2010 */ public class Complex { priva...
src/main/java/llnl/gnem/core/util/MathFunctions/Complex.java
0.960519
0.626681
Complex.java
starcoder
package model.colortransformation; import model.Image; import model.ImageModel; import util.ColorUtil; /** * Dithers the given image by using Floyd–Steinberg_dithering algorithm. */ public class Dither implements ImageModel { /** * Initially, image is converted to greyscale, and then, Floyd–Steinberg_ditheri...
src/model/colortransformation/Dither.java
0.794345
0.414662
Dither.java
starcoder
package dyvil.collection.view; import dyvil.annotation.Immutable; import dyvil.annotation.internal.NonNull; import dyvil.collection.ImmutableList; import dyvil.collection.ImmutableMatrix; import dyvil.collection.Matrix; import dyvil.collection.MutableMatrix; import dyvil.collection.iterator.ImmutableIterator; import d...
library/src/main/java/dyvil/collection/view/MatrixView.java
0.881882
0.407599
MatrixView.java
starcoder
package clientapi.util.math; import clientapi.util.render.gl.GLUtils; import net.minecraft.util.math.MathHelper; /** * A Vec with a X, Y, and Z position * * @author Brady * @since 2/12/2017 */ public final class Vec3 { /** * Coordinates of this Vec3 */ private double x, y, z; public Vec3(...
src/main/java/clientapi/util/math/Vec3.java
0.938174
0.525186
Vec3.java
starcoder
package rocks.inspectit.ocelot.core.opentelemetry; import io.opentelemetry.sdk.common.CompletableResultCode; import io.opentelemetry.sdk.trace.SpanProcessor; import io.opentelemetry.sdk.trace.data.SpanData; import io.opentelemetry.sdk.trace.export.SpanExporter; import lombok.extern.slf4j.Slf4j; import java.util.Array...
inspectit-ocelot-core/src/main/java/rocks/inspectit/ocelot/core/opentelemetry/DynamicMultiSpanExporter.java
0.903859
0.443239
DynamicMultiSpanExporter.java
starcoder
package cz.vabalcar.rcjbotcontroller.visualizer; /** * This class extends Color to provide a way to easily define Color using HSL color model. */ public class HSLColor extends IntColor { /** * Instantiates a new HSL color. * * @param hue the hue of the color */ public HSLColor(float ...
RCJBot/sources/SensorDataVisualizer/src/cz/vabalcar/rcjbotcontroller/visualizer/HSLColor.java
0.943007
0.579252
HSLColor.java
starcoder
package org.ggp.base.player.gamer.statemachine.MCTS.manager.parameterstuning.structure; import java.util.ArrayList; import java.util.Collections; import java.util.List; /** * This class keeps track (in a random order) of all possible combinations of individuals * (i.e. their indices) from a given number of populati...
src/main/java/org/ggp/base/player/gamer/statemachine/MCTS/manager/parameterstuning/structure/AllCombosOfIndividualsIterator.java
0.749637
0.726037
AllCombosOfIndividualsIterator.java
starcoder
package org.tdl.vireo.state.impl; import java.util.List; import java.util.Map; import org.junit.Test; import org.tdl.vireo.state.State; import play.modules.spring.Spring; import play.test.UnitTest; /** * Test the simple state manager implementation. Intrinsically these tests are * tied to the spring configuration...
test/org/tdl/vireo/state/impl/StateManagerImplTests.java
0.738009
0.444987
StateManagerImplTests.java
starcoder
package chapter9; import chapter4.BaseTailCell; import chapter7.Result; import chapter8.AdvancedList; import lombok.extern.slf4j.Slf4j; import util.Tuple; import java.util.Objects; import java.util.function.Function; import java.util.function.Supplier; /** * @author Spencer */ @SuppressWarnings({"AlibabaAbstractCl...
theory/functional/src/main/java/chapter9/AbstractStream.java
0.919782
0.509032
AbstractStream.java
starcoder
package cn.mulanbay.pms.web.bean.response.chart; import cn.mulanbay.pms.persistent.dto.DateStat; import cn.mulanbay.pms.persistent.enums.DateGroupType; import cn.mulanbay.pms.util.ChartUtil; import java.util.ArrayList; import java.util.List; /** * 图表数据 * * @author fenghong * @create 2017-07-10 21:44 */ public c...
mulanbay-pms/src/main/java/cn/mulanbay/pms/web/bean/response/chart/ChartData.java
0.677794
0.405979
ChartData.java
starcoder
package QAP.generateQAPs.Distributions; public class CorrelateDistribution implements DiscreteDistribution{ private static java.util.Random r = new java.util.Random(); private int min = 0; private int max = 100; private double std = 10; private double mean = 10; //private double correlation ...
QAP/generateQAPs/Distributions/CorrelateDistribution.java
0.673084
0.451992
CorrelateDistribution.java
starcoder
package com.oracle.truffle.polyglot; import java.util.ConcurrentModificationException; import java.util.NoSuchElementException; import org.graalvm.polyglot.Context; import com.oracle.truffle.api.TruffleLanguage; import com.oracle.truffle.api.TruffleLanguage.Env; /** * Represents an expected user exception caused b...
src/main/java/com/oracle/truffle/polyglot/PolyglotEngineException.java
0.906362
0.418519
PolyglotEngineException.java
starcoder
import java.util.Arrays; import java.awt.*; public class Checker { private static int changeY, changeX, Turn; private static int[] Start, End; public static boolean isValidMove(int[] start, int[] end, int turn){ Start = start; End = end; Turn = turn; //System.out.println("...
Chess/Checker.java
0.537284
0.432483
Checker.java
starcoder
package uk.ac.sussex.gdsc.smlm.math3.analysis.integration; import org.apache.commons.math3.analysis.integration.SimpsonIntegrator; import org.apache.commons.math3.exception.NotStrictlyPositiveException; import org.apache.commons.math3.exception.NumberIsTooLargeException; import org.apache.commons.math3.exception.Numbe...
src/main/java/uk/ac/sussex/gdsc/smlm/math3/analysis/integration/CustomSimpsonIntegrator.java
0.917485
0.436682
CustomSimpsonIntegrator.java
starcoder
package leetcode.contests; /** * Given an array A of 0s and 1s, divide the array into 3 non-empty parts such that all of these parts represent the same binary value. * <p> * If it is possible, return any [i, j] with i+1 < j, such that: * <p> * A[0], A[1], ..., A[i] is the first part; * A[i+1], A[i+2], ..., A[j-1]...
src/leetcode/contests/ThreeEqualParts_927.java
0.847227
0.568416
ThreeEqualParts_927.java
starcoder
class Solution { public int findCheapestPrice(int n, int[][] flights, int src, int dst, int K) { int[][] dp = new int[K + 1][n]; for (int[] d : dp) { Arrays.fill(d, Integer.MAX_VALUE); } for (int[] f : flights) { if (f[0] == src) { dp[0][f[1]] ...
newEff/787.cheapest-flights-within-k-stops.java
0.813868
0.459682
787.cheapest-flights-within-k-stops.java
starcoder
package document; import org.junit.Test; import static org.junit.Assert.*; public class BasicDocumentTest { private static BasicDocument basicDocument; @Test public void getNumWords() throws Exception { basicDocument = new BasicDocument(""); assertEquals(0, basicDocument.getNumWords());...
src/document/BasicDocumentTest.java
0.85811
0.610308
BasicDocumentTest.java
starcoder
import java.util.ArrayList; import java.util.List; import org.opencv.core.Core; import org.opencv.core.CvType; import org.opencv.core.Mat; import org.opencv.core.MatOfPoint; import org.opencv.core.Point; import org.opencv.core.Scalar; import org.opencv.highgui.HighGui; import org.opencv.imgcodecs.Imgcodecs; import org...
samples/java/tutorial_code/ml/introduction_to_pca/IntroductionToPCADemo.java
0.825238
0.517327
IntroductionToPCADemo.java
starcoder
package org.ejml.alg.dense.linsol.qr; import org.ejml.alg.dense.decomposition.TriangularSolver; import org.ejml.data.DenseMatrix64F; import org.ejml.interfaces.decomposition.QRPDecomposition; import org.ejml.ops.CommonOps; /** * <p> * A pseudo inverse solver for a generic QR column pivot decomposition algorithm. S...
main/dense64/src/org/ejml/alg/dense/linsol/qr/SolvePseudoInverseQrp_D64.java
0.936285
0.52829
SolvePseudoInverseQrp_D64.java
starcoder
package com.github.rjeschke.neetutils.vectors; import java.nio.IntBuffer; import com.github.rjeschke.neetutils.math.NMath; /** * * @author <NAME> (<EMAIL>) * */ public class Vector3i { public int x; public int y; public int z; public Vector3i() { // 0 } public Vector3i(final...
src/main/java/com/github/rjeschke/neetutils/vectors/Vector3i.java
0.859398
0.450057
Vector3i.java
starcoder
package com.leaxxiv.rpgenetik; import static java.lang.Math.abs; import static java.lang.Math.floor; import static java.lang.Math.random; import java.util.function.Function; import java.util.function.Supplier; import com.leaxxiv.genetics.DNA; import com.leaxxiv.genetics.Population; public class Village<T extends En...
src/com/leaxxiv/rpgenetik/Village.java
0.511717
0.453322
Village.java
starcoder
package invar.lib.data; import java.math.BigInteger; import java.nio.charset.Charset; import java.util.ArrayList; import java.util.List; /** * Created by wangkang on 11/12/16 */ public class DataNode<T> { static final public Charset UTF8 = Charset.forName("utf-8"); public enum TypeId { INT64, BIGI...
invar-lib/src/main/java/invar/lib/data/DataNode.java
0.566978
0.449332
DataNode.java
starcoder
package org.apache.openaz.xacml.api; /** * Defines the API for objects that represent XACML 3.0 data types. * * @param <T> the class of the java objects that represent the XACML values */ public interface DataType<T> { /** * Gets the {@link org.apache.openaz.xacml.api.Identifier} representing the XACML da...
openaz-xacml/src/main/java/org/apache/openaz/xacml/api/DataType.java
0.937009
0.542621
DataType.java
starcoder
package org.monarchinitiative.svart; import java.util.Comparator; public interface Region<T> extends CoordinateSystemed<T> { /** * @return start coordinate of the region */ Position startPosition(); /** * @return end coordinate of the region */ Position endPosition(); @Overr...
src/main/java/org/monarchinitiative/svart/Region.java
0.955672
0.646544
Region.java
starcoder
package org.apache.beam.sdk.transforms; import static org.apache.beam.vendor.guava.v26_0_jre.com.google.common.base.Preconditions.checkNotNull; import org.apache.beam.sdk.transforms.Contextful.Fn; import org.apache.beam.sdk.transforms.WithFailures.ExceptionElement; import org.apache.beam.sdk.values.KV; import org.apa...
sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/MapKeys.java
0.90696
0.456591
MapKeys.java
starcoder
package me.droreo002.oreocore.utils.time; import me.droreo002.oreocore.utils.strings.StringUtils; import java.sql.Timestamp; import java.text.DateFormat; import java.text.ParseException; import java.text.SimpleDateFormat; import java.time.LocalDateTime; import java.util.Calendar; import java.util.Date; import java.ut...
src/main/java/me/droreo002/oreocore/utils/time/TimestampUtils.java
0.90494
0.442576
TimestampUtils.java
starcoder
package org.apache.crunch.lib; import com.google.common.collect.Lists; import org.apache.crunch.MapFn; import org.apache.crunch.PCollection; import org.apache.crunch.PTable; import org.apache.crunch.Pair; import org.apache.crunch.types.PTableType; import org.apache.crunch.types.PType; import org.apache.crunch.types.PT...
crunch-core/src/main/java/org/apache/crunch/lib/TopList.java
0.870322
0.438545
TopList.java
starcoder
package draw; import java.awt.Color; import java.util.List; import algorithms.anya.Fraction; import algorithms.datatypes.SnapshotItem; public class GridObjects { private static final Color POINT_COLOR = new Color(0,64,255); private static final Color LINE_COLOR = Color.RED; public final GridLin...
src/draw/GridObjects.java
0.888922
0.54819
GridObjects.java
starcoder
package practices.questions.easy; import javax.inject.Inject; import javax.inject.Singleton; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import practices.datastructure.SinglyLinkedList.ListNode; import practices.questions.Solution; /* * Given a non-empty, singly linked list ...
src/main/java/practices/questions/easy/MiddleOfLinkedList.java
0.83363
0.403391
MiddleOfLinkedList.java
starcoder
package com.jakewharton.rxbinding.widget; import android.content.Context; import android.support.test.InstrumentationRegistry; import android.support.test.annotation.UiThreadTest; import android.support.test.rule.UiThreadTestRule; import android.support.test.runner.AndroidJUnit4; import android.widget.ProgressBar; imp...
rxbinding/src/androidTest/java/com/jakewharton/rxbinding/widget/RxProgressBarTest.java
0.86378
0.48987
RxProgressBarTest.java
starcoder
package hu.fallen.countitbaby.helpers; public class SpiralGrid { public static Dim getGridAdjustment(int n, Dim direction) { Dim result = getGridAdjustmentUpRight(n); int signX = direction.X() >= 0 ? 1 : -1; int signY = direction.Y() < 0 ? 1 : -1; result.setX(signX * result.X()); ...
app/src/main/java/hu/fallen/countitbaby/helpers/SpiralGrid.java
0.739611
0.524334
SpiralGrid.java
starcoder
public abstract class DynamicMem { public final static int M = 1000000; // Total number of Memory addresses public byte Memory[]; //Memory Array, initailized from data segment public Dictionary freeBlk; // Free blocks dictionary public Dictionary allocBlk; // Allocated...
DynamicMem.java
0.632616
0.480662
DynamicMem.java
starcoder
package voicesplitting.generic; import java.util.List; import java.util.TreeSet; import voicesplitting.utils.MidiNote; /** * A <code>MidiModel</code> is an abstract class which defines any model which takes * a series of {@link voicesplitting.utils.MidiNote}s incrementally as input and generates * some sort of hy...
src/voicesplitting/generic/MidiModel.java
0.843283
0.534795
MidiModel.java
starcoder
package cc.mallet.topics; /** This class implements the value and gradient functions for * Dirichlet-multinomial Regression. See Guimaraes and Lindrooth, * for a general introduction to DMR, * and Mimno and McCallum (UAI, 2008) for an application to * multinomial mixture models. */ import cc.mallet.op...
src/cc/mallet/topics/DMROptimizable.java
0.685107
0.4016
DMROptimizable.java
starcoder
package org.apache.spark.mllib.feature; /** * Word2Vec creates vector representation of words in a text corpus. * The algorithm first constructs a vocabulary from the corpus * and then learns vector representation of words in the vocabulary. * The vector representation can be used as features in * natural language...
mllib/target/java/org/apache/spark/mllib/feature/Word2Vec.java
0.910523
0.580055
Word2Vec.java
starcoder
package moa.clusterers.kmeanspm; /** * Provides methods to calculate different distances of points. * */ public class Metric { /** * Calculates the squared Euclidean length of a point. * * @param pointA * point * @return the squared Euclidean length */ public static double distanceSquared(...
moa/moa/src/main/java/moa/clusterers/kmeanspm/Metric.java
0.948274
0.794026
Metric.java
starcoder
package msm.simulator.util; import java.math.BigDecimal; import java.math.MathContext; import java.util.Collection; import java.util.Map; import java.util.Map.Entry; import java.util.NavigableMap; import java.util.NavigableSet; import java.util.Set; import java.util.SortedMap; import java.util.TreeMap; /** * @autho...
src/msm/simulator/util/DataDistribution.java
0.692538
0.462837
DataDistribution.java
starcoder
package org.apache.commons.imaging.color; public final class ColorConversions { private static final double REF_X = 95.047; // Observer= 2°, Illuminant= D65 private static final double REF_Y = 100.000; private static final double REF_Z = 108.883; private ColorConversions() { } public static...
src/main/java/org/apache/commons/imaging/color/ColorConversions.java
0.804214
0.518485
ColorConversions.java
starcoder
package io.sphere.sdk.search.model; import io.sphere.sdk.search.FilterExpression; import java.util.List; import java.util.function.Function; import java.util.stream.StreamSupport; import static java.util.Collections.singletonList; import static java.util.stream.Collectors.toList; /** * Model to build range and ter...
commercetools-sdk-base/src/main/java/io/sphere/sdk/search/model/RangeTermFilterBaseSearchModel.java
0.937139
0.625738
RangeTermFilterBaseSearchModel.java
starcoder
package org.graalvm.word; /** * Represents an unsigned word-sized value. * * @since 19.0 */ public interface UnsignedWord extends ComparableWord { /** * Returns a Unsigned whose value is {@code (this + val)}. * * @param val value to be added to this Unsigned. * @return {@code this + val} ...
src/main/java/org/graalvm/word/UnsignedWord.java
0.962205
0.471345
UnsignedWord.java
starcoder
package li.cil.oc.api.machine; import li.cil.oc.api.network.Node; /** * This is used to provide some context to {@link li.cil.oc.api.machine.Callback}s, i.e. the * computer from which the callback was called. */ public interface Context { /** * The node through which the computer is attached to the compon...
src/api/java/li/cil/oc/api/machine/Context.java
0.80112
0.406273
Context.java
starcoder
package org.ojalgo.matrix.geometry; import org.ojalgo.structure.Access2D; public class Primitive32Matrix2 implements GeometryMatrix<Primitive32Matrix2> { /** * The matrix elements */ public float m00, m10, m01, m11; public Primitive32Matrix2() { super(); } public Primitive32Ma...
src/org/ojalgo/matrix/geometry/Primitive32Matrix2.java
0.924811
0.569972
Primitive32Matrix2.java
starcoder
package bio.singa.simulation.model.modules.displacement.implementations; import bio.singa.features.quantities.PixelDiffusivity; import bio.singa.features.units.UnitRegistry; import bio.singa.mathematics.vectors.Vector2D; import bio.singa.mathematics.vectors.Vectors2D; import bio.singa.simulation.features.AppliedVesicl...
singa-simulation/src/main/java/bio/singa/simulation/model/modules/displacement/implementations/VesicleConfinedDiffusion.java
0.808029
0.416619
VesicleConfinedDiffusion.java
starcoder
package geometry; import static java.lang.StrictMath.pow; import static java.lang.StrictMath.sqrt; public class Vec3 { public double[] e = new double[3]; public Vec3() { } public Vec3(double e0, double e1, double e2) { e[0] = e0; e[1] = e1; e[2] = e2; } public doubl...
src/main/java/geometry/Vec3.java
0.877451
0.729339
Vec3.java
starcoder
package lz77grammar; import static org.junit.jupiter.api.Assertions.*; import org.junit.jupiter.api.Test; /** * Tests for all grammar related operations. * @author <NAME> * */ class grammarTests { /** * Parses the file "grammarTest.txt". */ @Test void parseGrammarTest() { GrammarParser cfg = new Gramm...
src/lz77grammar/grammarTests.java
0.675765
0.495667
grammarTests.java
starcoder
package com.novacloud.data.commons.suffixtree; import java.util.Arrays; import java.util.Collection; import java.util.HashSet; import java.util.Set; /** * Represents a node of the generalized suffix tree. * * <p> * <b>Note:</b> This class is used only internally by * {@link GeneralizedSuffixTree}. * </p> * ...
src/main/java/com/novacloud/data/commons/suffixtree/Node.java
0.890939
0.464841
Node.java
starcoder
package com.willlee.leetcode.problems801_900; import java.awt.Point; import java.util.ArrayList; import java.util.HashSet; import java.util.List; import java.util.Set; public class Leetcode835 { /* * 解题思路: 本题核心的思路是如何正确的遍历出两个二维数组的所有重叠情况。 * * 我们可以假设两个二维数组为 A,B。我们让A静止,B可以随意的移动 * * 假设数组的长度为2...
Advance/src/main/java/com/willlee/leetcode/problems801_900/Leetcode835.java
0.504883
0.424472
Leetcode835.java
starcoder
package io.github.elkin.bitty; public final class BitUtil { private BitUtil() { } public static int getBitsSlice(int value, int startIndex, int stopIndex) { return IntegerUtil.getBitsSlice(value, startIndex, stopIndex); } public static int getBitsSliceSafe(int value, int startIndex, int stopIndex) { ...
src/main/java/io/github/elkin/bitty/BitUtil.java
0.881436
0.64065
BitUtil.java
starcoder
package de.metanome.algorithms.dvhyperloglog; /** Implementation of HyperLogLog ** Reference: * <NAME>., <NAME>., <NAME>., & <NAME>. (2008). Hyperloglog: the analysis of a near-optimal cardinality estimation algorithm. DMTCS Proceedings, (1). * * @author Hazar.Harmouch * * source with modification: htt...
DVHyperLogLog/src/main/java/de/metanome/algorithms/dvhyperloglog/HyperLogLog.java
0.819749
0.408631
HyperLogLog.java
starcoder
package seedu.schedar.logic.parser; import static java.util.Objects.requireNonNull; import java.util.Collection; import java.util.HashSet; import java.util.Set; import java.util.stream.Stream; import seedu.schedar.commons.core.index.Index; import seedu.schedar.commons.util.StringUtil; import seedu.schedar.logic.pars...
src/main/java/seedu/schedar/logic/parser/ParserUtil.java
0.901415
0.406509
ParserUtil.java
starcoder
package de.mklinger.micro.maps; import java.util.Collections; import java.util.HashMap; import java.util.LinkedHashMap; import java.util.Map; import java.util.Map.Entry; import java.util.Objects; import java.util.TreeMap; /** * Utility class for Maps. * * @author <NAME> - mklinger[at]mklinger[dot]de */ public cla...
src/main/java/de/mklinger/micro/maps/Maps.java
0.818011
0.478163
Maps.java
starcoder
package main.java.edu.stonybrook.cs.frame; import java.util.ArrayList; import java.util.Arrays; /** * This is a loader to generate structured template frames. */ public class FrameOntLoader { public static Frame getFrameOnt(String frameName) { return createFrame(frameName); } /** * @param f1 * @param f2 * ...
kalmfl/disambiguation/main/java/edu/stonybrook/cs/frame/FrameOntLoader.java
0.762336
0.446133
FrameOntLoader.java
starcoder
package com.machinezoo.noexception.optional; import java.util.*; import java.util.function.*; import com.machinezoo.noexception.*; /** * Variation of {@link LongBinaryOperator} that returns {@link OptionalLong} instead of the raw value. * {@code OptionalLongBinaryOperator} is typically obtained from {@link Exceptio...
src/main/java/com/machinezoo/noexception/optional/OptionalLongBinaryOperator.java
0.937747
0.606732
OptionalLongBinaryOperator.java
starcoder
import org.junit.After; import org.junit.Before; import org.junit.Test; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; /** * The test class Segment1Test. * * @author <NAME> * @version 1.0 */ public class Segment1Test { /** * Default constructor for test class S...
Mamans/Maman12/Segment1Test.java
0.892495
0.568416
Segment1Test.java
starcoder
package com.google.javascript.jscomp.serialization; import static com.google.common.base.Preconditions.checkNotNull; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableSet; import com.google.javascript.jscomp.colors.Color; import com.google.javascript.jscomp.colors.ColorId; impo...
src/com/google/javascript/jscomp/serialization/ColorSerializer.java
0.952871
0.406332
ColorSerializer.java
starcoder
package com.wildbeeslabs.sensiblemetrics.diffy.matcher.utils; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; import java.util.Objects; import static org.apache.commons.lang.StringUtils.EMPTY; import static org.apache.commons.lang3.StringUtils.join; /** * String extractor implementatio...
matcher/src/main/java/com/wildbeeslabs/sensiblemetrics/diffy/matcher/utils/StringExtractor.java
0.912002
0.461381
StringExtractor.java
starcoder
package org.robotframework.ide.eclipse.main.plugin.tableeditor.code; import static org.assertj.core.api.Assertions.assertThat; import org.junit.jupiter.api.Test; import org.rf.ide.core.testdata.model.ModelType; import org.robotframework.ide.eclipse.main.plugin.mockmodel.RobotSuiteFileCreator; import org.robotframew...
src/Eclipse-IDE/org.robotframework.ide.eclipse.main.plugin.tests/src/org/robotframework/ide/eclipse/main/plugin/tableeditor/code/CodeElementsColumnsPropertyAccessorTest.java
0.675551
0.508056
CodeElementsColumnsPropertyAccessorTest.java
starcoder
package us.ihmc.exampleSimulations.beetle.planning; import java.awt.Color; import javax.vecmath.Point2d; import javax.vecmath.Vector3d; import us.ihmc.exampleSimulations.beetle.referenceFrames.HexapodReferenceFrames; import us.ihmc.graphicsDescription.plotting.artifact.CircleArtifact; import us.ihmc.graphicsDescript...
ExampleSimulations/src/us/ihmc/exampleSimulations/beetle/planning/FootStepPlanner.java
0.697094
0.582818
FootStepPlanner.java
starcoder
package com.opengamma.analytics.math.statistics.leastsquare; import org.apache.commons.lang.Validate; import com.opengamma.analytics.math.matrix.DoubleMatrix1D; import com.opengamma.analytics.math.matrix.DoubleMatrix2D; import com.opengamma.analytics.math.matrix.MatrixAlgebra; import com.opengamma.analytics.math.matr...
projects/analytics/src/main/java/com/opengamma/analytics/math/statistics/leastsquare/LeastSquareResultsWithTransform.java
0.947527
0.729207
LeastSquareResultsWithTransform.java
starcoder
package noppes.npcs.scripted; import net.minecraft.util.EnumFacing; import net.minecraft.util.math.BlockPos; import noppes.npcs.scripted.interfaces.IPos; public class ScriptBlockPos implements IPos { private BlockPos blockPos; public ScriptBlockPos(BlockPos pos) { this.blockPos = pos; } pub...
src/main/java/noppes/npcs/scripted/ScriptBlockPos.java
0.780244
0.593167
ScriptBlockPos.java
starcoder
package br.usp.each.saeg.opal; import java.util.HashMap; import java.util.Iterator; import java.util.LinkedHashMap; import java.util.LinkedHashSet; import java.util.Map; import java.util.Set; public class Graph<K extends Identifiable> implements IGraph<K> { private final Map<Integer, K> nodes = new HashMap<Integ...
src/main/java/br/usp/each/saeg/opal/Graph.java
0.908029
0.409988
Graph.java
starcoder
package org.jsimpledb.core; import java.util.NavigableSet; /** * Listener interface for notifications of a change in value of a {@link SetField}. * * @see Transaction#addSetFieldChangeListener Transaction.addSetFieldChangeListener() */ public interface SetFieldChangeListener { /** * Receive notification...
src/java/org/jsimpledb/core/SetFieldChangeListener.java
0.892287
0.481088
SetFieldChangeListener.java
starcoder
package com.scottlogic.deg.generator.restrictions.linear; import com.scottlogic.deg.common.profile.constraintdetail.Granularity; import com.scottlogic.deg.generator.restrictions.RestrictionsMerger; import com.scottlogic.deg.generator.restrictions.TypedRestrictions; import java.util.Optional; public class LinearRestr...
generator/src/main/java/com/scottlogic/deg/generator/restrictions/linear/LinearRestrictionsMerger.java
0.891345
0.542136
LinearRestrictionsMerger.java
starcoder
package org.apache.hudi.table.format.cow.vector.reader; import org.apache.flink.table.data.vector.writable.WritableColumnVector; import org.apache.flink.table.data.vector.writable.WritableIntVector; import org.apache.parquet.Preconditions; import org.apache.parquet.bytes.ByteBufferInputStream; import org.apache.parque...
hudi-flink/src/main/java/org/apache/hudi/table/format/cow/vector/reader/RunLengthDecoder.java
0.90551
0.475301
RunLengthDecoder.java
starcoder
package assignmentone_magazine; import java.text.SimpleDateFormat; import java.time.format.DateTimeFormatter; import java.time.temporal.TemporalAccessor; import java.util.Date; /** * <p>Student Record System * DOB.java * This class is the object class that contains the date of birth * object. Contains all the ass...
src/assignmentone_magazine/Datum.java
0.762159
0.468122
Datum.java
starcoder
package com.example.prefix; import java.util.concurrent.ForkJoinPool; import java.util.concurrent.RecursiveTask; import java.util.logging.Logger; // Implements the first pass of the parallel Prefix/Suffix Sum algorithm. class UpPass { private static final Logger log = Logger.getLogger(UpPass.class.getName()); ...
lecture-3/prefix-sum/src/main/java/com/example/prefix/UpPass.java
0.908742
0.454472
UpPass.java
starcoder
package org.archive.crawler.util; import java.io.Serializable; import java.util.logging.Logger; import org.archive.crawler.datamodel.CandidateURI; import org.archive.util.BloomFilter; import org.archive.util.BloomFilter32bitSplit; /** * A MG4J BloomFilter-based implementation of an AlreadySeen list. * * This imp...
code/crawler/src/org/archive/crawler/util/BloomUriUniqFilter.java
0.84781
0.429788
BloomUriUniqFilter.java
starcoder
package Model.Statement.Switch; import Model.Lexeme; import Model.LexemeTypes; import Model.Statement.BlockStatement; import Model.Statement.Expression.ExpressionStatement; import Model.Statement.Others.ReturnStatement; import Model.Statement.Structure.Statement; import Model.Statement.Structure.SyntacticTypes; import...
src/main/java/Model/Statement/Switch/CaseStatement.java
0.739611
0.420778
CaseStatement.java
starcoder
package com.catalinjurjiu.animcubeandroid; import android.graphics.Color; import androidx.annotation.ColorInt; /** * Various utils used primarily when rendering the cube (with few exceptions). * Created by catalin on 05.06.2017. */ class CubeUtils { private CubeUtils() { //private c-tor to prevent in...
animcubeandroid/src/main/java/com/catalinjurjiu/animcubeandroid/CubeUtils.java
0.843219
0.603465
CubeUtils.java
starcoder
import java.io.*; import java.util.*; /* * The class definition of a binary tree node */ class treenode { int data; treenode left; treenode right; public treenode(int val) { data = val; left = null; right = null; } } public class binary_tree_check_if_perfect_tree { ...
binary_tree_check_if_perfect_tree/binary_tree_check_if_perfect_tree.java
0.833494
0.547887
binary_tree_check_if_perfect_tree.java
starcoder
package xyz.mlserver.util; import org.jetbrains.annotations.Contract; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import java.util.Collections; import java.util.HashMap; import java.util.Map; import java.util.function.BiConsumer; import java.util.function.BiFunction; import ja...
src/main/java/xyz/mlserver/util/ICollection.java
0.908532
0.435902
ICollection.java
starcoder
package org.hawkore.ignite.lucene.column; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Optional; import java.util.function.Consumer; /** * * An immutable sorted list of Columns to be indexed * */ public class Columns { private List<Column> columns; /** ...
modules/hk-lucene-builder/src/main/java/org/hawkore/ignite/lucene/column/Columns.java
0.93299
0.40342
Columns.java
starcoder
package com.icm.sphynx.mystyles.ui.metro.tools; import java.awt.BasicStroke; import java.awt.Color; import java.awt.Graphics2D; import java.awt.Image; import java.awt.RenderingHints; import java.awt.image.BufferedImage; import javax.swing.ImageIcon; /** * @author israel-icm */ public class MetroUIIcons { public...
src/main/java/com/icm/sphynx/mystyles/ui/metro/tools/MetroUIIcons.java
0.698124
0.439146
MetroUIIcons.java
starcoder
package algo.tzashinorpu.DpPlan.GSSY.Package; import java.util.Arrays; public class canPartition_416 { // dp[i][j] i个数和<=j的最大值 public boolean canPartition1(int[] nums) { int sum = Arrays.stream(nums).sum(); if (sum % 2 == 1) return false; int target = sum / 2; int len = nums.le...
JavaAlgorithm/src/main/java/algo/tzashinorpu/DpPlan/GSSY/Package/canPartition_416.java
0.630116
0.42483
canPartition_416.java
starcoder
package exercises.calculator; import org.apache.commons.lang3.tuple.ImmutablePair; import org.apache.commons.lang3.tuple.Pair; import java.util.regex.Matcher; /** * */ public class CalculatorImpl implements Calculator { private final OperandConverter operandConverter; public CalculatorImpl(OperandConvert...
src/main/java/exercises/calculator/CalculatorImpl.java
0.917474
0.460228
CalculatorImpl.java
starcoder
import Node.BinaryTreeNode; import java.util.LinkedList; import java.util.Queue; import java.util.TreeMap; /** * Print the top view of a binary tree * * Given binary tree, print the top view of it. * * Top view means when you look the tree from the top, the nodes you will see will be called * top view of tree. ...
src/PrintTopViewOfBinaryTree.java
0.895882
0.461563
PrintTopViewOfBinaryTree.java
starcoder
package org.tensa.facecheck.activation.utils; import java.util.Map; import java.util.function.BinaryOperator; import java.util.function.Function; import java.util.function.Supplier; import java.util.stream.Collector; import java.util.stream.Collectors; import org.tensa.tensada.matrix.NumericMatriz; import org.tensa.te...
src/main/java/org/tensa/facecheck/activation/utils/ActivationUtils.java
0.780537
0.66264
ActivationUtils.java
starcoder
package cn.com.lemon.base; import static cn.com.lemon.base.Preasserts.checkNotNull; import static cn.com.lemon.base.Preasserts.checkArgument; import static cn.com.lemon.util.RegularUtil.matchNumeric; /** * Static utility methods pertaining to {@code int} primitives, that are not * already found in either {@link Int...
src/main/java/cn/com/lemon/base/Ints.java
0.981194
0.758779
Ints.java
starcoder
package com.aranaira.enderio.core.common.vecmath; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Vec3d; import javax.annotation.Nonnull; public class Vector3d { public double x; public double y; public double z; public Vector3d () { x = 0; y = 0; z = 0; } public Vector3d (doub...
src/main/java/com/aranaira/enderio/core/common/vecmath/Vector3d.java
0.848188
0.597608
Vector3d.java
starcoder
package com.facebook.buck.event.listener.stats.parse; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; import com.facebook.buck.core.model.BuildId; import com.facebook.buck.core.model.BuildTargetFactory; import com.facebook.buck.event....
test/com/facebook/buck/event/listener/stats/parse/ParseStatsTrackerTest.java
0.858289
0.406509
ParseStatsTrackerTest.java
starcoder
package cgeo.geocaching.brouter.util; public class ByteDataWriter extends ByteDataReader { public ByteDataWriter(final byte[] byteArray) { super(byteArray); } public final void writeInt(final int v) { ab[aboffset++] = (byte) ((v >> 24) & 0xff); ab[aboffset++] = (byte) ((v >> 16) &...
main/src/cgeo/geocaching/brouter/util/ByteDataWriter.java
0.669205
0.432123
ByteDataWriter.java
starcoder
package graph; import java.util.*; public class Graph { private final Map<Vertex, List<Vertex>> adjVertices; public Graph() { adjVertices = new HashMap<>(); } public Vertex addVertex(String label) { Vertex vertex = new Vertex(label); adjVertices.putIfAbsent(vertex, new Array...
challenges/graph/app/src/main/java/graph/Graph.java
0.916955
0.641675
Graph.java
starcoder
package com.ilives.template.common.util; import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; import java.util.TimeZone; /** * Copyright © 2016 Neo-Lab Co.,Ltd. * Created by VuLT on 24/10/2016. */ public class DateFormatUtil { /** * Given a format string and a time in mill...
app/src/main/java/com/ilives/template/common/util/DateFormatUtil.java
0.926537
0.5769
DateFormatUtil.java
starcoder
package us.ihmc.manipulation.planning.rrt.configurationAndTimeSpace; import java.util.Random; import us.ihmc.robotics.robotSide.RobotSide; public class CTTreeTools { /* * 50 okay . why 1 has problem? angular velocity problem on chest. */ static Random randomManager = new Random(3); static double tim...
ihmc-manipulation-planning/src/main/java/us/ihmc/manipulation/planning/rrt/configurationAndTimeSpace/CTTreeTools.java
0.627609
0.427397
CTTreeTools.java
starcoder
package org.netbeans.modules.cnd.utils.cache; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.NoSuchElementException; import java.util.Set; /** * */ class TinyArr...
cnd/cnd.utils/src/org/netbeans/modules/cnd/utils/cache/TinyArrayMap.java
0.823612
0.461199
TinyArrayMap.java
starcoder
package me.kenzierocks.autoergel.osadata.data.value.immutable; import java.util.List; import me.kenzierocks.autoergel.osadata.data.value.mutable.ListValue; /** * A type of {@link ImmutableCollectionValue} that is backed by a {@link List}. * All "with" and "Without" methods are returning new instances as every * i...
src/main/java/me/kenzierocks/autoergel/osadata/data/value/immutable/ImmutableListValue.java
0.916355
0.516839
ImmutableListValue.java
starcoder
package com.kleematik.foobarqix; public class FooBarQix { private static final String FOO = "Foo"; private static final String BAR = "Bar"; private static final String QIX = "Qix"; private static final String FOO_BAR = "FooBar"; public static String convert(int number) { final String valu...
src/main/java/com/kleematik/foobarqix/FooBarQix.java
0.871434
0.402392
FooBarQix.java
starcoder
package org.jesterj.ingest.trie.analyzer; import org.jesterj.ingest.trie.KeyAnalyzer; import java.nio.CharBuffer; public class CharSequenceAnalyzer extends KeyAnalyzer<CharSequence> { /** * The number of bits per {@link Character}. */ public static final int LENGTH = Character.SIZE; /** * A bit mask ...
code/ingest/src/main/java/org/jesterj/ingest/trie/analyzer/CharSequenceAnalyzer.java
0.854733
0.432603
CharSequenceAnalyzer.java
starcoder
package com.tencentcloudapi.vod.v20180717.models; import com.tencentcloudapi.common.AbstractModel; import com.google.gson.annotations.SerializedName; import com.google.gson.annotations.Expose; import java.util.HashMap; public class AiSampleFaceOperation extends AbstractModel{ /** * Operation type. Valid valu...
src/main/java/com/tencentcloudapi/vod/v20180717/models/AiSampleFaceOperation.java
0.911093
0.490602
AiSampleFaceOperation.java
starcoder
package model; import java.awt.*; /** * A wheeled motor-driven vehicle */ public abstract class Car extends Vehicle { private int nrDoors; // Number of doors on the car private double enginePower; // Engine power of the car private boolean engineOn = false; // Whether the engine is on or not //TODO...
src/model/Car.java
0.688678
0.432003
Car.java
starcoder
package org.datasand.microservice; import org.datasand.codec.BytesArray; import org.datasand.codec.Encoder; import org.datasand.codec.serialize.ISerializer; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; /** * @author - <NAME> (<EMAIL>) * <p> * Message is the vessel which is ...
micro-service/src/main/java/org/datasand/microservice/Message.java
0.812533
0.402979
Message.java
starcoder
package geneticalgorithm; import java.util.ArrayList; import java.util.Arrays; /** * * @author c2-newcombe */ public class GeneticAlgorithm { //Selection Type public final static int SELECTION_TOURNEMENT = 1, SELECTION_ROULETTE = 2, SELECTION_TRUNCATION = 3; //Hyperparameters ...
src/geneticalgorithm/GeneticAlgorithm.java
0.728072
0.442757
GeneticAlgorithm.java
starcoder
package au.edu.rmit.agtgrp.apparate.jpathplan.entites; import java.util.ArrayList; import au.edu.rmit.agtgrp.apparate.jpathplan.interfaces.NodeIterator; /** * A SearchDomain interface represents the search space graph as an abstract view * of the environment/domain. This interface defines the basic requirements fo...
src/main/java/au/edu/rmit/agtgrp/apparate/jpathplan/entites/SearchDomain.java
0.827445
0.45944
SearchDomain.java
starcoder
package com.normalpainter.component.size; import com.badlogic.gdx.math.Vector2; import com.normalpainter.util.math.MathUtil; import com.normalpainter.component.location.Localizable; import static com.normalpainter.util.math.MathUtil.inBox; /** * Represents a WorldObject that has a size and an origin to locate its s...
painter/src/main/java/com/normalpainter/component/size/Sized.java
0.899042
0.461866
Sized.java
starcoder
package us.ihmc.euclid.referenceFrame.interfaces; import us.ihmc.euclid.referenceFrame.ReferenceFrame; import us.ihmc.euclid.referenceFrame.exceptions.ReferenceFrameMismatchException; import us.ihmc.euclid.shape.primitives.interfaces.Sphere3DBasics; import us.ihmc.euclid.shape.primitives.interfaces.Sphere3DReadOnly; i...
src/frame-shape/java/us/ihmc/euclid/referenceFrame/interfaces/FixedFrameSphere3DBasics.java
0.96438
0.596874
FixedFrameSphere3DBasics.java
starcoder
package org.openstreetmap.atlas.checks.validation.linear.edges; import java.util.ArrayList; import java.util.Arrays; import java.util.HashSet; import java.util.LinkedList; import java.util.List; import java.util.Optional; import java.util.Queue; import java.util.Set; import org.openstreetmap.atlas.checks.base.BaseChe...
src/main/java/org/openstreetmap/atlas/checks/validation/linear/edges/MalformedRoundaboutCheck.java
0.877975
0.428473
MalformedRoundaboutCheck.java
starcoder
package com.example.fourthworksheet.dto; import java.math.BigDecimal; import java.util.Date; public class UserDebitDto { private Date maturityDate; private boolean isCollected; private String userName; private String lastName; private Long contractNumber; private BigDecimal totalDebitAmo...
fourthWorksheet/src/main/java/com/example/fourthworksheet/dto/UserDebitDto.java
0.746601
0.410697
UserDebitDto.java
starcoder