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 problem1; import java.util.Objects; /** * Represents a window cleaning. WindowCleaning is the subclass of AbstractNonspecialist. */ public class WindowCleaning extends AbstractNonspecialist { private int numOfFloor; private static final int MAX_FLOOR = 3; private static final double RATE_OF_EXTRA_CHA...
Homework/HW3/src/main/java/problem1/WindowCleaning.java
0.945324
0.479869
WindowCleaning.java
starcoder
package frc.robot.lib.shooter; public class ShooterDataTable{ private ShooterSpec[] dataTable; private static final double MINDIST = 1.0; private static final double MAXDIST = 7.0; private static final double DINCREMENT = 0.2; private static final int K = 5; private static final int LINEAR = 1;...
src/main/java/frc/robot/lib/shooter/ShooterDataTable.java
0.711531
0.500854
ShooterDataTable.java
starcoder
package com.aiyaapp.aiya.GPUImageCustomFilter; import com.aiyaapp.aiya.GPUImage.AYGLProgram; import com.aiyaapp.aiya.GPUImage.AYGPUImageEGLContext; import com.aiyaapp.aiya.GPUImage.AYGPUImageFilter; import com.aiyaapp.aiya.GPUImage.AYGPUImageFramebuffer; import java.nio.Buffer; import static android.opengl.GLES20.GL...
effecthandler/src/main/java/com/aiyaapp/aiya/GPUImageCustomFilter/AYGPUImageBeautyFilter.java
0.615203
0.401394
AYGPUImageBeautyFilter.java
starcoder
package net.minecraft.client.particle; import net.minecraft.world.*; import net.minecraft.client.renderer.*; import net.minecraft.entity.*; import net.minecraft.util.*; public class EntityCrit2FX extends EntityFX { float field_174839_a; protected EntityCrit2FX(final World worldIn, final double xCoordIn, ...
Astomero/net/minecraft/client/particle/EntityCrit2FX.java
0.694406
0.434641
EntityCrit2FX.java
starcoder
package chapter4; import java.nio.BufferUnderflowException; /** * Created by intellij IDEA * Author:Raven * Date:2017/12/13 * Time:21:52 */ public class AvlTree<Anytype extends Comparable<? super Anytype>> { private AvlNode<Anytype> root; private static final int ALLOWED_IMBALANCE = 1; /** * Co...
src/chapter4/AvlTree.java
0.907612
0.424889
AvlTree.java
starcoder
package com.wildbeeslabs.jentle.algorithms.functor; import java.util.LinkedHashMap; import java.util.Map; public class If { private Map<Conditional, Task> conditionalFlow; private final Conditional noneMatch = () -> true; public If(Conditional condit, Task task) { conditionalFlow = new LinkedHashMap<>(); pu...
algorithms/src/main/java/com/wildbeeslabs/jentle/algorithms/functor/If.java
0.779196
0.434821
If.java
starcoder
package com.ebp.owat.lib.datastructure.matrix.linked; import com.ebp.owat.lib.datastructure.matrix.Matrix; import com.ebp.owat.lib.datastructure.matrix.ScrambleMatrix; import com.ebp.owat.lib.datastructure.matrix.iterator.EmptyMatrixIterator; import com.ebp.owat.lib.datastructure.matrix.iterator.MatrixIterator; import...
implementations/java/OWAT-lib/src/main/java/com/ebp/owat/lib/datastructure/matrix/linked/LinkedScramblingMatrix.java
0.706089
0.501343
LinkedScramblingMatrix.java
starcoder
package com.linkedin.dagli.assorted; import com.linkedin.dagli.dag.DAG1x1; import com.linkedin.dagli.evaluation.MultinomialEvaluation; import com.linkedin.dagli.evaluation.MultinomialEvaluationResult; import com.linkedin.dagli.objectio.ObjectReader; import java.util.Collections; import java.util.List; import java.util...
examples/assorted/src/main/java/com/linkedin/dagli/assorted/Experiment.java
0.891522
0.584657
Experiment.java
starcoder
package vogar.target.junit.junit3; import java.lang.annotation.Annotation; import java.lang.reflect.Method; import java.util.ArrayList; import java.util.List; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; import org.junit.runner.Describable; import org.junit.runner.Des...
src/vogar/target/junit/junit3/TestSuiteTransformer.java
0.88157
0.453867
TestSuiteTransformer.java
starcoder
package advent.year2019.day12; import java.util.*; public class PlanetRadar { public List<Planet> planets; public static long getLCM(long [] numbers) { Map<Long, Long> denominators = new HashMap<>(); for (long number : numbers) { long sum = number; for (long i = 2; i <= number; i++) { ...
src/main/java/advent/year2019/day12/PlanetRadar.java
0.796965
0.475971
PlanetRadar.java
starcoder
package cellsociety.grid; import cellsociety.cells.Cell; import cellsociety.cells.Neighbors; import java.util.Map; /** * Class for Grid objects that wrap around at the edges. * * @author <NAME> */ public class ToroidalGrid extends Grid { /** * Constructor for ToroidalGrid objects, creates a new grid based o...
src/cellsociety/grid/ToroidalGrid.java
0.911803
0.536252
ToroidalGrid.java
starcoder
package pl.edu.pg.eti.biocomp.algorithms; import pl.edu.pg.eti.biocomp.models.Node; import pl.edu.pg.eti.biocomp.models.Point; import pl.edu.pg.eti.biocomp.models.Tree; import pl.edu.pg.eti.biocomp.utils.Labels; import pl.edu.pg.eti.biocomp.utils.Log; import pl.edu.pg.eti.biocomp.utils.Matrix; import java.util.Arrays...
src/main/java/pl/edu/pg/eti/biocomp/algorithms/NJ.java
0.75101
0.537648
NJ.java
starcoder
package de.hpi.mpss2015n.approxind.utils; import com.google.common.base.Verify; import com.google.common.primitives.Ints; import java.util.Arrays; import java.util.Comparator; import java.util.Map; import java.util.Objects; public final class SimpleColumnCombination implements Comparable<SimpleColumnCombination> { ...
FAIDA/FAIDAAlgorithm/src/main/java/de/hpi/mpss2015n/approxind/utils/SimpleColumnCombination.java
0.824497
0.414484
SimpleColumnCombination.java
starcoder
package com.mga.game.enemy; import com.badlogic.gdx.graphics.g2d.Sprite; import com.mga.game.projectiles.StraightBullet; import com.mga.logic.Enemy; /** * Versatile enemy, moves toward player but has the capability of not moving perfectly. * Can charge up and attack. * @author Nicky * */ public class Beta extends...
src/com/mga/game/enemy/Beta.java
0.668772
0.417093
Beta.java
starcoder
package uk.ac.ed.inf.tree; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; import org.jmock.Expectations; import org.jmock.Mockery; import org.jmock.integration.junit4.JMock; import org.jmock...
test/uk/ac/ed/inf/tree/GeneralTreeTestNonRootRoot.java
0.565899
0.641226
GeneralTreeTestNonRootRoot.java
starcoder
package Interviews.Intuit; import java.util.*; public class Ab_FindMidCourse { /* 给出一些课程和课程的先修课,每个课程有且只有一门先修课, 并且保证学生只有一条path修完所有课程,求修到一半时的课程名称。 例如,输入{{A, B}, {C, D}, {B, C}, {E, F}, {D, E}, {F, G}}, 输出 D. */ class ListNode { char value; ListNode next; pu...
src/Interviews/Intuit/Ab_FindMidCourse.java
0.681303
0.532486
Ab_FindMidCourse.java
starcoder
package com.cleverchuk.mips.compiler.lexer; import androidx.annotation.Nullable; import com.cleverchuk.mips.simulator.Opcode; import java.util.ArrayList; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; import java.util.regex.Pattern; import javax.i...
mips/src/main/java/com/cleverchuk/mips/compiler/lexer/MipsLexer.java
0.576542
0.411584
MipsLexer.java
starcoder
package core; import org.apache.commons.math3.stat.descriptive.SummaryStatistics; import java.util.ArrayList; import java.util.List; import java.util.stream.Collectors; /** * GroupStatistics computes statistics for multiple sets of data. It keeps track of values for multiple * sets of values. The only thing requir...
src/main/java/core/GroupStatistics.java
0.934887
0.589155
GroupStatistics.java
starcoder
package madgik.exareme.master.engine.intermediateCache; import madgik.exareme.master.queryProcessor.decomposer.query.*; import madgik.exareme.master.queryProcessor.decomposer.util.Pair; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.*; /** * Created by christos on 12/4/2016. *...
exareme-master/src/main/java/madgik/exareme/master/engine/intermediateCache/QueryContainment.java
0.582372
0.471588
QueryContainment.java
starcoder
package com.github.psygate.bitutils.bitvectors; import java.util.Arrays; import static com.github.psygate.bitutils.bitvectors.ArrayUtils.packToLong; /** * Created by psygate on 04.09.2017. * <p> * Implementation of a BitVector. This implementation is modifying in place and will only return a new vector w...
src/main/java/com/github/psygate/bitutils/bitvectors/BitVector.java
0.922892
0.653542
BitVector.java
starcoder
package org.thegalactic.context.constraint.numerical; /* * NumericalStorage.java * * Copyright: 2016 The Galactic Organization, France * * License: http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html CeCILL-B license * * This file is part of java-lattices. * You can redistribute it and/or modify it und...
src/main/java/org/thegalactic/context/constraint/numerical/NumericalStorage.java
0.946708
0.438665
NumericalStorage.java
starcoder
package com.google.j2cl.junit.integration.junit3; import com.google.j2cl.junit.integration.IntegrationTestBase; import com.google.j2cl.junit.integration.TestResult; import java.util.List; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; /** Integration test for j2cl JUni...
junit/generator/javatests/com/google/j2cl/junit/integration/junit3/JUnit3IntegrationTest.java
0.788787
0.481149
JUnit3IntegrationTest.java
starcoder
package com.bulletphysics.dynamics; import com.bulletphysics.BulletGlobals; import com.bulletphysics.MotionState; import com.bulletphysics.Transform; import com.bulletphysics.collision.broadphase.BroadPhaseProxy; import com.bulletphysics.collision.dispatch.CollisionFlags; import com.bulletphysics.collision.dispatch.Co...
src/main/java/com/bulletphysics/dynamics/RigidBody.java
0.82748
0.525612
RigidBody.java
starcoder
package textmatch; import java.util.*; import org.junit.*; import static org.junit.Assert.*; import static textmatch.GCollectionUtils.*; public class GCollectionUtilsTest { @Test public void testSingleElemList() { List<String> expected = new LinkedList<String>(); expected.add("foobar"); assertEquals(exp...
src/textmatch/GCollectionUtilsTest.java
0.842378
0.449151
GCollectionUtilsTest.java
starcoder
package com.verificatum.arithm; import java.util.Arrays; import com.verificatum.eio.ByteTreeBasic; import com.verificatum.eio.ByteTreeContainer; /** * Represents an element associated with a {@link PPGroup}-instance. * * @author <NAME> */ public final class PPGroupElement extends PGroupElement { /** *...
src/java/com/verificatum/arithm/PPGroupElement.java
0.943145
0.451024
PPGroupElement.java
starcoder
package io.spine.server.storage.datastore.tenant; import com.google.cloud.datastore.Datastore; import io.spine.server.tenant.TenantIndex; import static com.google.common.base.Preconditions.checkNotNull; /** * A factory of the Datastore-specific Tenant related objects. */ public final class DatastoreTenants { ...
datastore/src/main/java/io/spine/server/storage/datastore/tenant/DatastoreTenants.java
0.884058
0.47993
DatastoreTenants.java
starcoder
package com.tenio.engine.physic2d.math; import java.util.List; /** * A 3x3 <a href="http://en.wikipedia.org/wiki/Row-major_order">row major</a> * matrix. It's useful for 2D transforms.<br> * More detail in <a href= * "https://medium.com/swlh/understanding-3d-matrix-transforms-with-pixijs-c76da3f8bd8">this * docu...
framework/engine/src/main/java/com/tenio/engine/physic2d/math/Matrix3.java
0.94474
0.626553
Matrix3.java
starcoder
package smile.feature; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import smile.data.Attribute; import smile.math.Math; /** * Normalize samples individually to unit norm. Each sample (i.e. each row of * the data matrix) with at least one non zero component is rescaled * independently of other samples ...
core/src/main/java/smile/feature/Normalizer.java
0.916241
0.528655
Normalizer.java
starcoder
package org.broadinstitute.hellbender.tools.coveragemodel.cachemanager; import org.broadinstitute.hellbender.utils.Utils; import javax.annotation.Nonnull; import javax.annotation.Nullable; import java.util.Arrays; import java.util.HashSet; import java.util.Set; import java.util.stream.Collectors; /** * A utilities ...
src/main/java/org/broadinstitute/hellbender/tools/coveragemodel/cachemanager/ImmutableComputableGraphUtils.java
0.902182
0.419529
ImmutableComputableGraphUtils.java
starcoder
package jet.opengl.demos.nvidia.waves.crest.collision; import org.lwjgl.util.vector.ReadableVector3f; import org.lwjgl.util.vector.Vector3f; import jet.opengl.demos.nvidia.waves.crest.AvailabilityResult; import jet.opengl.demos.nvidia.waves.crest.SamplingData; import jet.opengl.postprocessing.util.Rectf; /** Interfa...
testframewok/src/main/java/jet/opengl/demos/nvidia/waves/crest/collision/ICollProvider.java
0.904304
0.586345
ICollProvider.java
starcoder
package tech.geocodeapp.geocode.collectable.decorator; import tech.geocodeapp.geocode.collectable.model.CollectableSet; import tech.geocodeapp.geocode.collectable.model.Rarity; import tech.geocodeapp.geocode.mission.model.MissionType; import java.util.GregorianCalendar; import java.util.UUID; public abstract class C...
backend/src/main/java/tech/geocodeapp/geocode/collectable/decorator/CollectableTypeDecorator.java
0.850189
0.496582
CollectableTypeDecorator.java
starcoder
package io.github.hakkelt.ndarrays.internal; import io.github.hakkelt.ndarrays.NDArray; import io.github.hakkelt.ndarrays.NDArrayUtils; import java.math.BigDecimal; import java.math.BigInteger; import java.util.List; import java.util.stream.Collector; import org.apache.commons.math3.complex.Complex; abstract class ...
src/main/java/io/github/hakkelt/ndarrays/internal/AbstractNDArrayView.java
0.912981
0.586641
AbstractNDArrayView.java
starcoder
package org.broadinstitute.sting.gatk.walkers.variantrecalibration; import org.broadinstitute.sting.commandline.Argument; import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; /** * Created by IntelliJ IDEA. * User: rpoplin * Date: Mar 4, 2011 */ public class VariantRecalibratorArgumentCollect...
public/java/src/org/broadinstitute/sting/gatk/walkers/variantrecalibration/VariantRecalibratorArgumentCollection.java
0.857947
0.406361
VariantRecalibratorArgumentCollection.java
starcoder
package org.agmip.translators.aquacrop.tools; public class WeatherDataCalculator { /** * Calculate ET reference. * * @param day number (1 = 1 January … 365 = 31 December) * @param latDeg Latitude in decimal degrees (+ for Northern hemisphere, - for Southern hemisphere) * @param altitudeZ meter above sea ...
src/main/java/org/agmip/translators/aquacrop/tools/WeatherDataCalculator.java
0.816443
0.623463
WeatherDataCalculator.java
starcoder
package smile.util; import java.util.Arrays; /** * {@code HashMap<int, double>} for primitive types. * {@code Integer.MIN_VALUE (0x80000000)} is not allowed as key. */ public class IntDoubleHashMap { private static final int FREE_KEY = Integer.MIN_VALUE; private static final double NO_VALUE = Double.NaN; ...
math/src/main/java/smile/util/IntDoubleHashMap.java
0.941574
0.432782
IntDoubleHashMap.java
starcoder
import static org.junit.Assert.*; import org.junit.Test; public class PointTest { @Test public void test_Constructor_Point0_0() { Point p = new Point(0,0); assertEquals("Created Point(0,0) - testing x value", 0, p.getXCoord()); assertEquals("Created Point(0,0) - testing y value", 0, p.getYCoord()); } @Tes...
compsci courses/CPSC233 - CPSC 233 - Intro to CompSci in Java /teamassignments/teamassignment6/PointTest.java
0.866768
0.782663
PointTest.java
starcoder
package java.time; public class TimeConversions { private TimeConversions() {} public static j$.time.ZonedDateTime convert(java.time.ZonedDateTime dateTime) { if (dateTime == null) { return null; } return j$.time.ZonedDateTime.of( dateTime.getYear(), dateTime.getMonthValue(), ...
src/library_desugar/java/java/time/TimeConversions.java
0.886789
0.424293
TimeConversions.java
starcoder
public class Cube2 { private final String[][][][] cube; private int w = 0, g = 0, r = 0, o = 0, b = 0, y = 0; /** * Constructs a {@code Cube2} and stories it in the cube[][][][] array * * @param temp String[] input from user containing the colors on each side * @exception I...
src/Cube2.java
0.793386
0.459379
Cube2.java
starcoder
package io.micronaut.serde.support.util; import io.micronaut.core.annotation.NonNull; import io.micronaut.core.type.Argument; import io.micronaut.json.tree.JsonNode; import io.micronaut.serde.Encoder; import java.math.BigDecimal; import java.math.BigInteger; import java.util.ArrayList; import java.util.LinkedHashMap;...
serde-support/src/main/java/io/micronaut/serde/support/util/JsonNodeEncoder.java
0.931103
0.483344
JsonNodeEncoder.java
starcoder
package us.ihmc.commonWalkingControlModules.visualizer; import java.util.ArrayList; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import us.ihmc.graphicsDescription.appearance.AppearanceDefinition; import us.ihmc.graphicsDescription.appearance.YoAppearance; import us.ihmc.graphicsDescri...
CommonWalkingControlModules/src/us/ihmc/commonWalkingControlModules/visualizer/WrenchVisualizer.java
0.770767
0.526586
WrenchVisualizer.java
starcoder
package pl.dahdev.bloomfilters; import java.io.Serializable; import java.util.Collection; /** * Interface of Bloom Filter. * * A Bloom filter is a space-efficient probabilistic data structure * that is used to test whether an element is a member of a set. * A query returns either "possibly in set" or "definitely...
src/main/java/pl/dahdev/bloomfilters/BloomFilter.java
0.917939
0.438364
BloomFilter.java
starcoder
package br.com.eventhorizon.edx.ucsandiego.algs200x.pa4; import br.com.eventhorizon.common.pa.FastScanner; import br.com.eventhorizon.common.pa.PA; public class NumberOfInversions implements PA { @Override public void naiveSolution() { FastScanner scanner = new FastScanner(System.in); int n = scanner.nex...
EDX/UCSanDiego-AlgorithmsAndDataStructures/ALGS200x-AlgorithmicDesignAndTechniques/src/main/java/br/com/eventhorizon/edx/ucsandiego/algs200x/pa4/NumberOfInversions.java
0.673406
0.407216
NumberOfInversions.java
starcoder
import java.util.ArrayList; public class Shape3D { public ArrayList<Point3D> points; public ArrayList<Vector3D> vectors; String type; int fillHue; Point3D center; public Shape3D(String type, int fillHue) { this.type = type; this.fillHue = fillHue; setType(); } public Shape3D(ArrayList<Point3D> oldpoin...
CG_Challenge_3/src/Shape3D.java
0.658088
0.47591
Shape3D.java
starcoder
package org.spoofax.jsglr.client; import java.util.ArrayList; import org.spoofax.jsglr.client.SGLR; /** * @author maartje * */ public class FineGrainedRecovery { // safety guard: > 1000 recover branches seem to cause performance problems private static final int MAX_NUMBER_OF_RECOVER_BRANCHES = 1000; //mi...
org.spoofax.jsglr/src/org/spoofax/jsglr/client/FineGrainedRecovery.java
0.796372
0.444565
FineGrainedRecovery.java
starcoder
package com.scalyr.api.knobs.util; import java.util.HashSet; import java.util.Set; import com.scalyr.api.json.JSONArray; import com.scalyr.api.json.JSONObject; import com.scalyr.api.knobs.ConfigurationFile; import com.scalyr.api.knobs.Knob; /** A Whitelist provides a quick and efficient way to test whether a given ...
src/main/com/scalyr/api/knobs/util/Whitelist.java
0.5794
0.678632
Whitelist.java
starcoder
package com.google.j2cl.transpiler.regression.mediumbridgesshard12; import junit.framework.TestCase; public class TestShard extends TestCase { public void testShards() { TestCase7983.test(); TestCase10710.test(); TestCase1302.test(); TestCase1970.test(); TestCase4057.test(); TestCase4892.tes...
transpiler/javatests/com/google/j2cl/transpiler/regression/mediumbridgesshard12/TestShard.java
0.53048
0.716268
TestShard.java
starcoder
package de.dimm.vsm.Utilities; public class SizeStr extends Object { public static double SI_TB_SIZE = 1e12; public static double SI_GB_SIZE = 1e9; public static double SI_MB_SIZE = 1e6; public static double SI_KB_SIZE = 1e3; public static double DV_TB_SIZE = 1024*1024*1024*1024l; public ...
src/de/dimm/vsm/Utilities/SizeStr.java
0.518546
0.41739
SizeStr.java
starcoder
package org.ttzero.excel.entity.style; import org.dom4j.Element; import org.ttzero.excel.util.StringUtil; /** * To create a custom number format, you start by selecting one of the built-in number formats as a starting point. * You can then change any one of the code sections of that format to create your own custom...
src/main/java/org/ttzero/excel/entity/style/NumFmt.java
0.80525
0.412057
NumFmt.java
starcoder
package org.jargp; import java.io.PrintStream; import java.lang.reflect.Field; import java.util.List; /** * Command line parameter processing handler. Organizes all the parameter * information, including the data object to which parameter values defined * by the command line are stored. Provides specialized proces...
src/java/org/jargp/ArgumentProcessor.java
0.803714
0.421909
ArgumentProcessor.java
starcoder
package za.co.entelect.challenge.entities; import za.co.entelect.challenge.config.GameConfig; import za.co.entelect.challenge.enums.PlayerType; import za.co.entelect.challenge.game.contracts.game.GamePlayer; public class TowerDefensePlayer implements GamePlayer { private PlayerType playerType; private int en...
game-engine/domain/src/main/java/za/co/entelect/challenge/entities/TowerDefensePlayer.java
0.818011
0.400691
TowerDefensePlayer.java
starcoder
package q350; import org.junit.Assert; import org.junit.Test; /** * https://leetcode.com/problems/range-sum-query-mutable/ * * Given an integer array nums, find the sum of the elements between indices i and j (i ≤ j), inclusive. * * The update(i, val) function modifies nums by updating the element at index i to ...
src/main/java/q350/Q307_RangeSumQueryMutable.java
0.889217
0.466906
Q307_RangeSumQueryMutable.java
starcoder
package de.jtem.mfc.field; import java.io.StreamTokenizer; import java.io.StringReader; import java.util.LinkedList; import java.util.ListIterator; /** This class provides static functions for complex number. * * @author schmies */ public abstract class ComplexValue implements Field.Complex { final static...
libUnzipped/de/jtem/mfc/field/ComplexValue.java
0.831554
0.415936
ComplexValue.java
starcoder
package advent; import java.io.IOException; import java.util.regex.Matcher; import java.util.regex.Pattern; public class Day20 { private static final Pattern vectorPattern = Pattern.compile("<(-?\\d+),(-?\\d+),(-?\\d+)>"); // Note - the solutions here are naive and the time values were determined // by expe...
src/advent/Day20.java
0.594669
0.427158
Day20.java
starcoder
import java.util.Scanner; final class Algo { // some algorithms on int[] private static int findMaxLessOrEqual(final long[] seq, final long key, final int low, final int high) { if (high < low) return high; final int mid = low + (high - low) / ...
hier/project-euler/euler-010-hackerrank/euler010.java
0.772488
0.419053
euler010.java
starcoder
package com.pavelfatin.typometer.metrics; import java.awt.*; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.List; import java.util.stream.Collectors; import static java.lang.Math.abs; import static java.lang.Math.round; class SequenceRecognizer { private S...
src/main/java/com/pavelfatin/typometer/metrics/SequenceRecognizer.java
0.906816
0.583975
SequenceRecognizer.java
starcoder
package io.sphere.sdk.utils; import org.apache.commons.lang3.RandomStringUtils; import java.text.Normalizer; import java.util.*; import java.util.function.Supplier; import java.util.stream.Stream; import static java.lang.String.format; import static java.util.Arrays.asList; import static java.util.stream.Collectors....
commercetools-sdk-base/src/main/java/io/sphere/sdk/utils/SphereInternalUtils.java
0.864711
0.473536
SphereInternalUtils.java
starcoder
package yadf.simulation.job; import yadf.simulation.IPlayer; import yadf.simulation.IRegion; import yadf.simulation.character.IGameCharacter; import yadf.simulation.character.component.ISkillComponent; import yadf.simulation.item.IStockManager; import yadf.simulation.item.Item; import yadf.simulation.item.ItemType; im...
simulation/src/yadf/simulation/job/BuildConstructionJob.java
0.720073
0.457016
BuildConstructionJob.java
starcoder
package seedu.cakecollate.model.orderitem; import static java.util.Objects.requireNonNull; import static seedu.cakecollate.commons.util.AppUtil.checkArgument; /** * Represents the type of cake of an order item. Type refers to the description of the order item. * Guarantees: immutable; is valid as declared in {@link...
src/main/java/seedu/cakecollate/model/orderitem/Type.java
0.900814
0.478894
Type.java
starcoder
import com.microsoft.azure.cognitiveservices.vision.computervision.*; import com.microsoft.azure.cognitiveservices.vision.computervision.models.*; import java.io.File; import java.io.FileInputStream; import java.nio.file.Files; import java.util.ArrayList; import java.util.List; // </snippet_imports> /* This Quickst...
java/ComputerVision/src/main/java/ComputerVisionQuickstart.java
0.857872
0.442155
ComputerVisionQuickstart.java
starcoder
package us.ihmc.commonWalkingControlModules.barrierScheduler.context; import us.ihmc.concurrent.runtime.barrierScheduler.implicitContext.tasks.InPlaceCopyable; import us.ihmc.euclid.tuple3D.Point3D; import us.ihmc.euclid.tuple3D.Vector3D; import us.ihmc.euclid.tuple3D.interfaces.Point3DReadOnly; import us.ihmc.euclid....
ihmc-common-walking-control-modules/src/main/java/us/ihmc/commonWalkingControlModules/barrierScheduler/context/HumanoidRobotContextRootJointData.java
0.929552
0.60935
HumanoidRobotContextRootJointData.java
starcoder
package com.book.chapter8_tic_tac_toe; import androidx.core.util.Pair; import com.book.chapter8_tic_tac_toe.pojo.GameGrid; import com.book.chapter8_tic_tac_toe.pojo.GameState; import com.book.chapter8_tic_tac_toe.pojo.GameStatus; import com.book.chapter8_tic_tac_toe.pojo.GameSymbol; import com.book.chapter8_tic_tac_t...
chapter8_tic_tac_toe/src/main/java/com/book/chapter8_tic_tac_toe/GameViewModel.java
0.827515
0.401981
GameViewModel.java
starcoder
package javax.realtime; import gnu.gcj.RawData; /** * An asynchronous event handler encapsulates code that gets run at * some time after an AsyncEvent occurs. It is essentially a * java.lang.Runnable with a set of parameter objects, making it very * much like a RealtimeThread . The expectation is that there may ...
src/javax/realtime/AsyncEventHandler.java
0.836321
0.405331
AsyncEventHandler.java
starcoder
package com.chiralbehaviors.inviscid; import java.util.Arrays; import java.util.Iterator; import java.util.concurrent.atomic.AtomicInteger; import java.util.function.Consumer; import javax.vecmath.Point3i; /** * @author halhildebrand * */ public class Necronomata implements Iterable<Point3i> { @FunctionalInt...
src/main/java/com/chiralbehaviors/inviscid/Necronomata.java
0.932576
0.539772
Necronomata.java
starcoder
package com.github.ermay12.regex; import java.util.*; import java.util.function.Function; import java.util.regex.Matcher; import java.util.regex.Pattern; import java.util.stream.Stream; /** * This class represents a matchable regular expression. */ public abstract class RegexLiteral { Pattern pattern; String ra...
src/main/java/com/github/ermay12/regex/RegexLiteral.java
0.905822
0.466967
RegexLiteral.java
starcoder
* LongPrefix * Code-Beispiel zum Buch Patterns Kompakt, Verlag Springer Vieweg * Copyright 2014 <NAME> * * 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/lic...
src/main/java/de/calamanari/pk/muhai/LongPrefix.java
0.912426
0.454351
LongPrefix.java
starcoder
package artisynth.core.opensim.components; import java.util.List; import maspack.matrix.MatrixNd; import maspack.matrix.Point2d; import maspack.matrix.QRDecomposition; import maspack.matrix.VectorNd; /** * Simple 2D Natural Cubic Spline for interpolation in OpenSim Models */ public class NaturalCubicSpline extends...
src/artisynth/core/opensim/components/NaturalCubicSpline.java
0.66769
0.531149
NaturalCubicSpline.java
starcoder
package q1600; import java.util.ArrayList; import java.util.List; import org.junit.runner.RunWith; import util.runner.Answer; import util.runner.LeetCodeRunner; import util.runner.TestData; import util.runner.data.DataExpectation; /** * [Medium] 1557. Minimum Number of Vertices to Reach All Nodes * https://leetcode...
src/main/java/q1600/Q1557_MinimumNumberOfVerticesToReachAllNodes.java
0.847306
0.599251
Q1557_MinimumNumberOfVerticesToReachAllNodes.java
starcoder
package org.talend.components.adapter.beam.transform; import java.io.Closeable; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.atomic.AtomicInteger; import org.apache.beam.sdk.transforms.DoFn; import org.apache.beam.sdk.transforms.PTransform; import org.apache.beam.sd...
core/components-adapter-beam/src/main/java/org/talend/components/adapter/beam/transform/DirectConsumerCollector.java
0.917718
0.414129
DirectConsumerCollector.java
starcoder
package com.bluegosling.tuples; import java.io.Serializable; import java.util.Iterator; import java.util.List; import java.util.function.Function; import com.bluegosling.util.ValueType; /** * A tuple that has more than five elements. It is so named since it can have {@code n} number of * elements (where {@code n >...
src/com/bluegosling/tuples/NTuple.java
0.900547
0.501038
NTuple.java
starcoder
public class EvaluateDivision { // 1.0 method, 2ms 50%, graph + queue-based bfs. // time complexity: O(e) + O(m * (n + e)), n是节点数(不是代码中的n),e是边数,m是query数 // bfs和dfs在时间和空间复杂度上一样,但是访问顺序不同; // 如果采用邻接矩阵存储,那么遍历的效率为O(n2),否则遍历效率为O(n + e),n为节点数,e为边数 public double[] calcEquationNaive(String[][] equations, dou...
Java/src/EvaluateDivision.java
0.615203
0.535645
EvaluateDivision.java
starcoder
package cn.xdean.jex.lang.collection; import java.io.Serializable; import java.util.*; import java.util.function.IntConsumer; import java.util.stream.Collectors; import java.util.stream.IntStream; public class IntList implements RandomAccess, Cloneable, Serializable { public static IntList create() { return ne...
src/main/java/cn/xdean/jex/lang/collection/IntList.java
0.823328
0.458531
IntList.java
starcoder
package frc.robot; import edu.wpi.first.math.geometry.Translation2d; import edu.wpi.first.math.kinematics.SwerveDriveKinematics; import edu.wpi.first.math.trajectory.TrapezoidProfile; import edu.wpi.first.wpilibj.I2C; /** * The Constants class provides a convenient place for teams to hold robot-wide * numerical or...
src/main/java/frc/robot/Constants.java
0.694821
0.415254
Constants.java
starcoder
package io.github.elkin.bitty; public final class IntegerUtil { private IntegerUtil() { } private static void checkSliceIndexes(int startIndex, int stopIndex) { if (startIndex < 0 || startIndex >= Integer.SIZE) { throw new IllegalArgumentException( "startIndex parameter must be in the range ...
src/main/java/io/github/elkin/bitty/IntegerUtil.java
0.811974
0.597843
IntegerUtil.java
starcoder
import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; public class MiniMax { SpecialAgent agent; private final int depth; public MiniMax(SpecialAgent a) { agent = a; depth = 5; } public int getDepth() { return depth; } public int getB...
Projects/Connect4/Java/src/MiniMax.java
0.833596
0.431345
MiniMax.java
starcoder
package king.zach.pynny.database.models; import java.io.Serializable; import java.util.Calendar; /** * Created by Zach on 9/30/2017. */ public class Budget implements Serializable { private long id; private double goal; private double balance; private String month; private Category category; ...
app/src/main/java/king/zach/pynny/database/models/Budget.java
0.753285
0.46721
Budget.java
starcoder
package SimulationTest.one.exam6.part1; import java.time.LocalDate; import java.util.ArrayList; import java.util.Arrays; import java.util.List; /* What will be the result of compiling and executing Test class? */ public class Test15 { public static void main(String[] args) { System.out.println("All the be...
ProjectJavaSE11/src/SimulationTest/one/exam6/part1/Test15.java
0.572842
0.462473
Test15.java
starcoder
package com.arapeak.adkya.model.getStatistics; import com.google.gson.annotations.Expose; import com.google.gson.annotations.SerializedName; public class Statistic { public String getGeneralStudentRate() { return generalStudentRate; } public void setGeneralStudentRate(String generalStudentRate) {...
app/src/main/java/com/arapeak/adkya/model/getStatistics/Statistic.java
0.703142
0.487673
Statistic.java
starcoder
package sort; /* Se basa en la técnica divide y vencerás, que consiste en ir subdividiendo el array en arrays más pequeños, y ordenar éstos. Para hacer esta división, se toma un valor del array como pivote, y se mueven todos los elementos menores que este pivote a su izquierda, y los mayores a su derecha. A continuaci...
src/sort/QuickSort.java
0.664431
0.688704
QuickSort.java
starcoder
public class xxx { @Test public void testRematerializedTablesDoNoInheritSpace() throws Exception { TableName tn = helper.createTableWithRegions(1); TableName tn2 = helper.getNextTableName(); LOG.info("Writing data"); // Set a quota on both tables QuotaSettings settings = QuotaSettingsFactory.lim...
LACCPlus/HBase/9490_1.java
0.796015
0.478041
9490_1.java
starcoder
package project.path; import java.awt.*; /** * Represent the points of a Lemniscate of Bernoulli */ public class LemniscateOfBernoulli implements Path { /** * The angle phi used in the formula */ private double phi; /** * Used as an offset and define where the first point will be */...
src/project/path/LemniscateOfBernoulli.java
0.894933
0.48621
LemniscateOfBernoulli.java
starcoder
package array; /** * Given an array of integers which is initially increasing and then decreasing, find the maximum value in the array. Input: arr[] = {8, 10, 20, 80, 100, 200, 400, 500, 3, 2, 1} Output: 500 Input: arr[] = {1, 3, 50, 10, 9, 7, 6} Output: 50 Corner case (No decreasing part) Input: arr[] = {10...
code-practice/array/src/main/java/array/FindMaximumNumberInArrayWhichisIncreasingandDecreasing.java
0.76934
0.648146
FindMaximumNumberInArrayWhichisIncreasingandDecreasing.java
starcoder
package com.microsoft.azure.management.servicefabric.v2018_02_01; import java.util.Map; import com.fasterxml.jackson.annotation.JsonProperty; /** * Defines a health policy used to evaluate the health of the cluster or of a * cluster node. */ public class ClusterHealthPolicy { /** * The maximum allowed per...
sdk/servicefabric/mgmt-v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_01/ClusterHealthPolicy.java
0.931867
0.674197
ClusterHealthPolicy.java
starcoder
package xal.tools.statistics; /** Calculate running statistics using weighted averaging */ public class RunningWeightedStatistics extends UnivariateStatistics { /** weight for new samples */ final protected double ASYMPTOTIC_WEIGHT; /** population beyond which we should use the asymptotic weight */ final prot...
core/src/xal/tools/statistics/RunningWeightedStatistics.java
0.895987
0.508239
RunningWeightedStatistics.java
starcoder
package nl.esi.metis.aisparser; import cern.colt.bitvector.BitVector; /** This interface represents an AIS message of type 5: Ship static and voyage related data. * Such messages are used by Class A shipborne and SAR aircraft AIS stations to report static and voyage-related data. * @author <NAME> * @author <NAME> ...
java/esiaisparser/src/main/java/nl/esi/metis/aisparser/AISMessage05.java
0.893872
0.609321
AISMessage05.java
starcoder
package org.nschmidt.ldparteditor.helpers; import java.nio.FloatBuffer; import org.lwjgl.BufferUtils; import org.lwjgl.opengl.GL11; import org.lwjgl.util.vector.Matrix4f; import org.lwjgl.util.vector.Vector3f; import org.nschmidt.ldparteditor.opengl.GL33Helper; import org.nschmidt.ldparteditor.opengl.GLMatrixStack; ...
src/org/nschmidt/ldparteditor/helpers/Arrow.java
0.776114
0.448004
Arrow.java
starcoder
package com.flowpowered.react.body; import units.qual.Dimensionless; import com.flowpowered.react.collision.shape.CollisionShape; import com.flowpowered.react.constraint.Joint; import com.flowpowered.react.constraint.Joint.JointListElement; import com.flowpowered.react.engine.Material; import com.flowpowered.react.mat...
annotated/com/flowpowered/react/body/RigidBody.java
0.967487
0.557484
RigidBody.java
starcoder
package algorithms; import data.Log; import models.DataSetModel; import models.StepStateModel; import java.util.LinkedList; /** * Base for algorithm implementations. * Contains the logic for executing and pausing algorithms, * while the implementations contain the algorithms themselves. */ public abstract class ...
src/algorithms/Algorithm.java
0.93263
0.480296
Algorithm.java
starcoder
package org.tensorflow.ndarray.impl.sparse.slice; import org.tensorflow.ndarray.NdArray; import org.tensorflow.ndarray.NdArraySequence; import org.tensorflow.ndarray.Shape; import org.tensorflow.ndarray.buffer.DataBuffer; import org.tensorflow.ndarray.impl.dimension.DimensionalSpace; import org.tensorflow.ndarray.impl...
ndarray/src/main/java/org/tensorflow/ndarray/impl/sparse/slice/SparseSlice.java
0.937583
0.531331
SparseSlice.java
starcoder
package github.yuhongye.util; import java.util.Arrays; import java.util.Iterator; /** * 不可扩展的数组 * @param <E> */ public class Array<E> implements Iterable<E> { int size; int capacity; Object[] data; public Array(int capacity) { this.capacity = capacity; data = new Object[capacity]; ...
src/main/java/github/yuhongye/util/Array.java
0.623033
0.467757
Array.java
starcoder
package org.terasology.math.delaunay; import org.joml.Vector2f; import org.joml.Vector2fc; final class Vertex implements ICoord { public static final Vertex VERTEX_AT_INFINITY = new Vertex(Float.NaN, Float.NaN); private final Vector2f coord = new Vector2f(); private Vertex(float x, float y) { c...
src/main/java/org/terasology/math/delaunay/Vertex.java
0.926375
0.557665
Vertex.java
starcoder
package eu.dc4cities.controlsystem.modules.optionconsolidator.opcp2; import eu.dc4cities.controlsystem.model.easc.ForbiddenState; import eu.dc4cities.controlsystem.model.easc.ForbiddenWorkingMode; import eu.dc4cities.controlsystem.model.easc.Relocability; import eu.dc4cities.controlsystem.modules.optionconsolidator.Al...
modules/option-consolidator/src/main/java/eu/dc4cities/controlsystem/modules/optionconsolidator/opcp2/ActivityAutomaton.java
0.714528
0.431405
ActivityAutomaton.java
starcoder
package org.phoenix.leetcode.challenges; /** * Given the head of a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST. * <p> * 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 diff...
may-2021-leetcode-challenge/src/main/java/org/phoenix/leetcode/challenges/Problem06_ConvertSortedListToBinarySearchTree.java
0.881895
0.500854
Problem06_ConvertSortedListToBinarySearchTree.java
starcoder
package LBJ2.learn; import LBJ2.classify.FeatureVector; /** * A simple implementation of a learner that learns from examples with * multiple labels and is capable of predicting multiple labels on new * examples. A separate {@link LinearThresholdUnit} is learned independently * to predict whether each label ...
src/main/java/LBJ2/learn/MultiLabelLearner.java
0.917048
0.785514
MultiLabelLearner.java
starcoder
package com.andreubita.poo.ficha2; import java.util.Arrays; public class Ex06 { public static void main(String[] args) { int[][] matrix = new int[10][10]; } /** * Gets a certain element of a matrix * * @param matrix matrix to get the element from * @param line line number in m...
src/2ano/2sem/poo/prt/Fichas/Ficha02/ex6/src/com/andreubita/poo/ficha2/Ex06.java
0.861451
0.631836
Ex06.java
starcoder
import java.util.HashMap; public class NGramModel { ExponentialNotation MINIMUM_FREQUENCY_MULTIPLIER = new ExponentialNotation(1, -20); private int n; private int modelEntries; private HashMap<VectorN, Double> model = new HashMap<>(); public NGramModel(byte[] data, int startIndex, int length, in...
NGramModel.java
0.836454
0.481088
NGramModel.java
starcoder
package com.calc3d.engine3d; /** *<p> Represents a rectangular <i> view frustum </i>, the volume of space containing everything that is visible in a three-dimensional scene. </p> <p> The view frustum is shaped like a pyramid whose apex lies at the <b> camera </b> position. It is bounded by six ...
Calc3D/src/com/calc3d/engine3d/Frustum.java
0.920723
0.747777
Frustum.java
starcoder
public final class Matrix<E> implements Cloneable { /*---- Fields ----*/ // The values of the matrix stored in row-major order, with each element initially null. private Object[][] values; // The field used to operate on the values in the matrix. private final Field<E> f; /*---- Constructors ----*/ ...
GaussJordan/core_classes/Matrix.java
0.868715
0.719507
Matrix.java
starcoder
package com.github.mikephil.charting.data; import com.github.mikephil.charting.utils.Highlight; import java.util.ArrayList; /** * Class that holds all relevant data that represents the chart. That involves * at least one (or more) DataSets, and an array of x-values. * * @author <NAME> */ public class ChartData...
MPChartLib/src/com/github/mikephil/charting/data/ChartData.java
0.91776
0.694031
ChartData.java
starcoder
package bio.singa.mathematics.intervals; import bio.singa.core.utility.Range; import bio.singa.mathematics.concepts.Ring; /** * The main focus of interval in an arithmetic context is the simplest way to calculate upper and lower endpoints for * the range of values of a function in one or more variables. The given l...
singa-mathematics/src/main/java/bio/singa/mathematics/intervals/DoubleInterval.java
0.93223
0.463201
DoubleInterval.java
starcoder
package com.platypii.baseline.measurements; import com.platypii.baseline.location.Geo; import com.platypii.baseline.location.LocationCheck; import com.platypii.baseline.location.NMEAException; import com.platypii.baseline.util.Exceptions; import com.platypii.baseline.util.Numbers; import android.util.Log; import andr...
common/src/main/java/com/platypii/baseline/measurements/MLocation.java
0.861494
0.402128
MLocation.java
starcoder