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 org.python.antlr.ast; public interface VisitorIF<R> { public boolean enterModule(Module node); public R visitModule(Module node); public void leaveModule(Module node); public boolean enterInteractive(Interactive node); public R visitInteractive(Interactive node); public void leaveIntera...
org.python/src/org/python/antlr/ast/VisitorIF.java
0.724188
0.433322
VisitorIF.java
starcoder
package zana.java.geometry.functions; import zana.java.geometry.Dn; //---------------------------------------------------------------- /** Apply a scalar function to each coordinate. * * @author wahpenayo at <EMAIL> dot <EMAIL> * @version 2018-04-02 */ @SuppressWarnings("unchecked") public final class UniDiagon...
src/main/java/zana/java/geometry/functions/UniDiagonal.java
0.94079
0.417331
UniDiagonal.java
starcoder
package com.github.bartimaeusnek.bartworks.util.log; import org.apache.commons.lang3.reflect.FieldUtils; import org.apache.logging.log4j.Level; import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Marker; import org.apache.logging.log4j.message.Message; import org.apache.logging.log4j.message.Messag...
src/main/java/com/github/bartimaeusnek/bartworks/util/log/STFUGTPPLOG.java
0.771757
0.441733
STFUGTPPLOG.java
starcoder
import java.util.ArrayList; import java.util.Arrays; import java.util.LinkedList; import java.util.List; /** * @author <NAME> * @version Feb 5, 2020 * @challenge https://leetcode.com/problems/3sum/ * @solution Pick the 1st number and run 2 sum on the rest of the unused numbers. */ public class ThreeSum { publ...
src/main/java/ThreeSum.java
0.890598
0.517937
ThreeSum.java
starcoder
package org.apache.beam.sdk.util; import static org.apache.beam.vendor.guava.v26_0_jre.com.google.common.base.Preconditions.checkArgument; import org.apache.beam.vendor.guava.v26_0_jre.com.google.common.base.MoreObjects; import org.joda.time.Duration; /** * A fluent builder for {@link BackOff} objects that allows c...
sdks/java/core/src/main/java/org/apache/beam/sdk/util/FluentBackoff.java
0.947721
0.446857
FluentBackoff.java
starcoder
package de.illonis.eduras.shapecreator; import java.util.ArrayList; import java.util.Collection; import org.newdawn.slick.geom.Shape; import org.newdawn.slick.geom.Vector2f; import de.illonis.eduras.math.Vector2df; import de.illonis.eduras.shapecreator.templates.TemplateManager; import de.illonis.eduras.sh...
Eduras/src/de/illonis/eduras/shapecreator/EditablePolygon.java
0.816113
0.484136
EditablePolygon.java
starcoder
package urender.scenegraph; import java.util.ArrayList; import java.util.List; import org.joml.Matrix4f; import org.joml.Vector3f; import urender.common.math.Matrix4Unit; import urender.engine.shader.UUniform; /** * Scene description and scenegraph root. */ public class UScene extends UGfxScenegraphObject { priva...
LibUberRender/src/urender/scenegraph/UScene.java
0.883889
0.431584
UScene.java
starcoder
package quizzer; /** * <p>Title: QuestionFileReader</p> * <p>Description: Class to read random questions and answer choices from the quiz file * Uses a vector of QustionIndex objects to determine where in the quiz file to read.</p> * @author <NAME>, mods by <NAME> * @version 1.0 */ import java.io.File; import j...
src/quizzer/QuestionFileReader.java
0.669637
0.441011
QuestionFileReader.java
starcoder
package com.JavaPathtracer.geometry; import com.JavaPathtracer.Raytracer; // container class for geometry public class BoundingBox implements FiniteShape { public Vector min; public Vector max; public BoundingBox(Vector min, Vector max) { this.min = min; this.max = max; } public double area() { double w...
src/com/JavaPathtracer/geometry/BoundingBox.java
0.900407
0.466663
BoundingBox.java
starcoder
package jason.algorithm.geometry; import static org.junit.Assert.assertEquals; import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; import java.util.IdentityHashMap; import java.util.List; import java.util.Map; import java.util.TreeSet; import org.junit.Test; public class VerticalH...
src/main/java/jason/algorithm/geometry/VerticalHorizontalLineSegmentIntersection.java
0.62601
0.476762
VerticalHorizontalLineSegmentIntersection.java
starcoder
package net.jini.lookup; import net.jini.core.lookup.ServiceItem; /** * The <code>ServiceItemFilter</code> interface defines the methods used by * an object such as the {@link net.jini.lookup.ServiceDiscoveryManager * ServiceDiscoveryManager} or the {@link net.jini.lookup.LookupCache * LookupCache} to apply ad...
src/net/jini/lookup/ServiceItemFilter.java
0.881481
0.510802
ServiceItemFilter.java
starcoder
package org.vertexium.accumulo.iterator.model.historicalEvents; import org.apache.accumulo.core.data.ByteSequence; import org.apache.accumulo.core.data.Value; import org.vertexium.accumulo.iterator.util.DataInputStreamUtils; import org.vertexium.accumulo.iterator.util.DataOutputStreamUtils; import java.io.DataInputSt...
accumulo/iterators/src/main/java/org/vertexium/accumulo/iterator/model/historicalEvents/IteratorMapMetadata.java
0.898199
0.432423
IteratorMapMetadata.java
starcoder
package uk.co.optimisticpanda.gtest.dto.defaultfill.insgen; import static uk.co.optimisticpanda.gtest.dto.util.FunctionUtils.NOT_COVERED; import java.lang.reflect.Field; import java.util.function.Supplier; import uk.co.optimisticpanda.gtest.dto.TestUtilsContext; import uk.co.optimisticpanda.gtest.dto.defaultfill.Def...
src/main/java/uk/co/optimisticpanda/gtest/dto/defaultfill/insgen/InstanceGenerator.java
0.81637
0.472562
InstanceGenerator.java
starcoder
package com.mpagliaro98.mysubscriptions.model; import java.util.Calendar; import java.util.Date; /** * An object that functions like a specialized Calendar object. When created, this acts like * a Calendar object set to the current date, but with the invariant that all fields related * to time (hour, minute, secon...
app/src/main/java/com/mpagliaro98/mysubscriptions/model/ZeroTimeCalendar.java
0.900283
0.49469
ZeroTimeCalendar.java
starcoder
package dev.anhcraft.jvmkit.utils; import dev.anhcraft.jvmkit.lang.annotation.NotEmpty; import org.jetbrains.annotations.NotNull; import java.lang.reflect.Array; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Objects; /** * This class provides utility methods for array ...
src/main/java/dev/anhcraft/jvmkit/utils/ArrayUtil.java
0.923996
0.555978
ArrayUtil.java
starcoder
package algorithm; /** * Created by xfhy on 2021/4/8 8:59 * Description : 查找相关 */ public class Find { /* //二分查找框架 int binarySearch(int[] nums, int target) { int left = 0, right = ...; while(...) { int mid = left + (right - left) / 2; if (nums[mid] == target) { ...
src/algorithm/Find.java
0.625781
0.415254
Find.java
starcoder
package Algorithms.BackTracking; public class HamiltonianCycle { private final int[][] graph; private final int[] hamiltonianPath; private final int totalVertex; private HamiltonianCycle(int[][] g) { graph = g; hamiltonianPath = new int[g.length]; totalVertex = g.length; } public static void ...
Algorithms/BackTracking/HamiltonianCycle.java
0.863866
0.494446
HamiltonianCycle.java
starcoder
import java.util.ArrayList; import java.util.List; import java.awt.event.KeyEvent; import edu.princeton.cs.introcs.StdDraw; /** * The Defense Game. * * This is the main program. * * In this game, the player controls a grey ball with the mouse, to avoid and * shoot red balls. The grey ball is in the middle of...
java-tower-defense-game/src/Demo.java
0.665411
0.463991
Demo.java
starcoder
package cellsociety.controller; import cellsociety.cells.Cell; import cellsociety.cells.EmptyCell; import cellsociety.cells.Neighbors; import cellsociety.cells.SegregationCell; import cellsociety.grid.Grid; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.HashMap; imp...
src/cellsociety/controller/SegregationController.java
0.879535
0.513912
SegregationController.java
starcoder
package uk.org.webcompere.modelassert.json.condition.tree; import com.fasterxml.jackson.databind.JsonNode; import uk.org.webcompere.modelassert.json.Result; import uk.org.webcompere.modelassert.json.condition.array.ArrayElementCondition; import java.util.LinkedList; import java.util.List; /** * Allow the {@link uk....
src/main/java/uk/org/webcompere/modelassert/json/condition/tree/ArrayComparisonElementCondition.java
0.904036
0.407923
ArrayComparisonElementCondition.java
starcoder
package com.tstar.util; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.*; /** * @author binvi * @version 1.0 * @Description: 日期工具类 * @date 2019/12/12 22:05 */ public class DateUtil { private static final SimpleDateFormat sdfMedium = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");...
java/framework/boss/src/main/java/com/tstar/util/DateUtil.java
0.610802
0.502319
DateUtil.java
starcoder
import java.util.ArrayList; import java.util.List; /** * Hamming Weight * * Calculate Hamming weight of an array of integers. * Hamming weight of an integer is defined as the number of set bits in its * binary representation. Hamming weight of an array is a sum of hamming weights * of all numbers in it. * * Ex...
src/HammingWeight.java
0.845465
0.468122
HammingWeight.java
starcoder
package org.eclipse.sw360.antenna.model.artifact; import org.eclipse.sw360.antenna.api.exceptions.ExecutionException; import org.eclipse.sw360.antenna.model.artifact.facts.ArtifactIdentifier; import org.eclipse.sw360.antenna.model.coordinates.Coordinate; import java.util.*; import java.util.stream.Collectors; import ...
Resources/Code/Eclipse-SW360antenna/antenna/core/model/src/main/java/org/eclipse/sw360/antenna/model/artifact/ArtifactCoordinates.java
0.919665
0.408041
ArtifactCoordinates.java
starcoder
package com.alipay.sofa.common.utils; import java.lang.reflect.Array; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Map.Entry; /** * * @author luoguimu123 * @version $Id: ArrayUtil.java, v 0.1 2017年08月01日 下午12:02 luoguim...
src/main/java/com/alipay/sofa/common/utils/ArrayUtil.java
0.644449
0.515437
ArrayUtil.java
starcoder
package network.ubic.ubic.BitiMRTD.Tools; import android.util.Log; import java.io.ByteArrayOutputStream; import java.io.InputStream; import java.util.Arrays; public class Tools { public byte[] unpadData(byte[] data) { int pos = 1; while(data[data.length - pos] != (byte) 0x80) { i...
app/src/main/java/network/ubic/ubic/BitiMRTD/Tools/Tools.java
0.713931
0.466299
Tools.java
starcoder
package me.cthorne.kioku.statistics; import android.content.Context; import android.util.Log; import com.github.mikephil.charting.charts.Chart; import com.github.mikephil.charting.charts.LineChart; import com.github.mikephil.charting.components.Legend; import com.github.mikephil.charting.components.XAxis; import com....
app/src/main/java/me/cthorne/kioku/statistics/WordCountGraph.java
0.646795
0.418043
WordCountGraph.java
starcoder
package planet.firework; import org.joml.Vector3f; import renderengine.camera.ACamera; import renderengine.engine.Window; import renderengine.entities.Entity; import renderengine.shader.ShaderProgram; import renderengine.utils.Transformation; import java.util.ArrayList; import java.util.List; import java.util.Random;...
src/main/java/planet/firework/FireworkModel.java
0.8468
0.430985
FireworkModel.java
starcoder
package resolver; import resolver.methods.Methods; import structures.*; import java.util.ArrayList; import java.util.List; public class Resolver { private int resolveTime = 0; private final List<Structure> rows, columns, blocks; private int casesFilled = 0, casesFilledBefore = 0; public Resolver(i...
src/resolver/Resolver.java
0.650356
0.402187
Resolver.java
starcoder
package com.github.jeuxjeux20.loupsgarous.game; import com.github.jeuxjeux20.loupsgarous.game.actionbar.LGActionBarManager; import com.github.jeuxjeux20.loupsgarous.game.bossbar.LGBossBarManager; import com.github.jeuxjeux20.loupsgarous.game.cards.composition.Composition; import com.github.jeuxjeux20.loupsgarous.game....
src/main/java/com/github/jeuxjeux20/loupsgarous/game/LGGameOrchestrator.java
0.5564
0.503845
LGGameOrchestrator.java
starcoder
package interactivespaces.util.sampling; import com.google.common.collect.Lists; import java.util.List; /** * A sequence of data sampled from a variety of named sources. * * @author <NAME> */ public class SampledDataSequence { /** * The samples which have been captured indexed by their source. */ priv...
interactivespaces-core/src/main/java/interactivespaces/util/sampling/SampledDataSequence.java
0.946399
0.467089
SampledDataSequence.java
starcoder
package pl.edu.agh.cs.app.ui.elements; import javafx.scene.image.Image; import javafx.scene.image.ImageView; import javafx.scene.layout.StackPane; import pl.edu.agh.cs.app.simulation.Simulation; import pl.edu.agh.cs.app.simulation.cells.JungleMapCell; import pl.edu.agh.cs.app.simulation.entities.mirrormap.junglemap.An...
src/main/java/pl/edu/agh/cs/app/ui/elements/MapCellView.java
0.587115
0.488405
MapCellView.java
starcoder
package breadth_first_search; import java.util.*; /** * Created by gouthamvidyapradhan on 14/03/2019 Given a matrix consists of 0 and 1, find the * distance of the nearest 0 for each cell. * * <p>The distance between two adjacent cells is 1. Example 1: Input: * * <p>0 0 0 0 1 0 0 0 0 Output: 0 0 0 0 1 0 0 0 0 E...
JAVASCRIPT/DS-and-Algorithms-Prac/Resources/leetcode-/problems/src/breadth_first_search/Matrix.java
0.92415
0.644826
Matrix.java
starcoder
package Matlab.Utils; import Matlab.DotNet.*; import java.util.*; public class Sequence<T> implements ISequence<T> { // region FIELDS: private ArrayList<T> innerList; // endregion // region PROPERTIES: private ArrayList<T> GetInnerList() { return this.innerList; } priv...
src/Matlab/Utils/Sequence.java
0.794823
0.437523
Sequence.java
starcoder
* Copyright 2014-2019 Intel Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to i...
lang_interface/java/com/intel/daal/algorithms/neural_networks/layers/locallyconnected2d/LocallyConnected2dParameter.java
0.916456
0.591251
LocallyConnected2dParameter.java
starcoder
package generics.boundedtypes; import java.util.Arrays; import java.util.List; public class BoundedTypes { /* * if we need to bound the type of the * generic type * * the two use cases here are * first -> we are sorting the integer list * second -> we are sorting the string list ...
src/generics/boundedtypes/BoundedTypes.java
0.786295
0.546859
BoundedTypes.java
starcoder
package ex1.src; import java.util.Collection; /** * This interface represents an undirectional weighted graph. * It should support a large number of nodes (over 10^6, with average degree of 10). * The implementation should be based on an efficient compact representation * (should NOT be based on a n*n matrix). * ...
weighted_graph.java
0.879658
0.488161
weighted_graph.java
starcoder
package challenges.assorted.ctci.arrays; /** * Category: Arrays & Strings * <p> * Given an image represented by an NxN matrix, where each pixel in the image is 4 * bytes, write a method to rotate the image by 90 degrees. Can you do this in place? * <p> * The algorithm involves 2 steps * 1. Convert first row to ...
programming-practice/src/main/java/challenges/assorted/ctci/arrays/RotateMatrix.java
0.834744
0.607343
RotateMatrix.java
starcoder
package io.sf.carte.echosvg.parser; /** * The class provides an adapter for PathHandler. * * @author <a href="mailto:<EMAIL>"><NAME></a> * @author For later modifications, see Git history. * @version $Id$ */ public class DefaultPathHandler implements PathHandler { /** * The only instance of this class. */ ...
echosvg-parser/src/main/java/io/sf/carte/echosvg/parser/DefaultPathHandler.java
0.918206
0.416797
DefaultPathHandler.java
starcoder
package com.opengamma.analytics.financial.provider.calculator.blackstirfutures; import com.opengamma.analytics.financial.interestrate.InstrumentDerivativeVisitorAdapter; import com.opengamma.analytics.financial.interestrate.future.derivative.InterestRateFutureOptionMarginSecurity; import com.opengamma.analytics.financ...
projects/OG-Analytics/src/main/java/com/opengamma/analytics/financial/provider/calculator/blackstirfutures/GammaSTIRFutureOptionCalculator.java
0.90313
0.572036
GammaSTIRFutureOptionCalculator.java
starcoder
package problems; /** * Calcula o floor e ceil de um numero em um array usando a estrategia de busca * binaria. * * Restricoes: * - Algoritmo in-place (nao pode usar memoria extra a nao ser variaveis locais) * - O tempo de seu algoritmo deve ser O(log n). * * @author Adalberto * */ public class FloorCei...
R04-01-Rot-SelectionAndBinarySearch-environment/src/main/java/problems/FloorCeilBinarySearch.java
0.623148
0.638131
FloorCeilBinarySearch.java
starcoder
package edu.iu.dsc.tws.examples.ml.svm.util; import java.io.Serializable; import java.util.logging.Logger; import edu.iu.dsc.tws.api.config.Config; import edu.iu.dsc.tws.data.utils.MLDataObjectConstants; import edu.iu.dsc.tws.data.utils.WorkerConstants; import edu.iu.dsc.tws.examples.ml.svm.constant.WindowingConstant...
twister2/examples/src/java/edu/iu/dsc/tws/examples/ml/svm/util/SVMJobParameters.java
0.812904
0.410579
SVMJobParameters.java
starcoder
package ir.soroushtabesh.tetris.controllers; import ir.soroushtabesh.tetris.models.BlockShape; import ir.soroushtabesh.tetris.models.GameState; import ir.soroushtabesh.tetris.models.Vector2D; import java.io.Serializable; public class BlockController implements Serializable { private static final Vector2D[] ROT_C...
src/main/java/ir/soroushtabesh/tetris/controllers/BlockController.java
0.852276
0.581481
BlockController.java
starcoder
package com.suchasplus.nmea; /** * Powered by <EMAIL> on 2016/1/17. */ /** * * * http://www.gpsinformation.org/dale/nmea.htm * * The National Marine Electronics Association (NMEA) has developed a specification that defines the interface between * various pieces of marine electronic equipment. The standard pe...
src/main/java/com/suchasplus/nmea/nmea.java
0.795936
0.566618
nmea.java
starcoder
package datastructures.String; import java.util.Arrays; import java.util.HashMap; public class Problem1 { public static void main(String[] args) { String str1 = "ab"; String str2 = "ba"; System.out.println(approach1(str1, str2)); System.out.println(approach2(str1, str2)); System.out.println(approach3(str1...
coding-problems/src/datastructures/String/Problem1.java
0.770378
0.51623
Problem1.java
starcoder
package io.art.core.extensions; import io.art.core.collection.*; import io.art.core.exception.*; import lombok.experimental.*; import static io.art.core.collector.SetCollector.*; import static io.art.core.factory.ArrayFactory.*; import static io.art.core.factory.MapFactory.*; import static io.art.core.factory.SetFacto...
core/src/main/java/io/art/core/extensions/CollectionExtensions.java
0.629888
0.506042
CollectionExtensions.java
starcoder
package net.ttddyy.dsproxy.asserts.assertj; import net.ttddyy.dsproxy.asserts.CallableExecution; import net.ttddyy.dsproxy.asserts.assertj.data.ExecutionParameter; import net.ttddyy.dsproxy.asserts.assertj.data.ExecutionParameters; import net.ttddyy.dsproxy.asserts.assertj.helper.ExecutionParameterAsserts; import org....
src/main/java/net/ttddyy/dsproxy/asserts/assertj/CallableExecutionAssert.java
0.675658
0.490663
CallableExecutionAssert.java
starcoder
package Funciones; import java.util.Random; /** * Funciones para asignar valor a las variables de cada persona. * * @author <NAME> * @author <NAME> * @version 1.0 */ public class FuncionesPersona { /** * Creamos la función generoAleatorio, que devolverá un género aleatorio * mediante un booleano,...
LaVidaDaMuchasVueltas_Los4Bandoleros/src/main/java/Funciones/FuncionesPersona.java
0.688783
0.446253
FuncionesPersona.java
starcoder
package io.etrace.common.compression; import java.io.IOException; import java.io.OutputStream; import java.io.UnsupportedEncodingException; import java.util.Arrays; public class FixedByteArrayOutputStream extends OutputStream { /** * The maximum size of array to allocate. Some VMs reserve some header words ...
etrace-common/src/main/java/io/etrace/common/compression/FixedByteArrayOutputStream.java
0.964522
0.499146
FixedByteArrayOutputStream.java
starcoder
package co.aa8y.leetcode; import co.aa8y.leetcode.common.TreeNode; import java.util.SortedSet; import java.util.Stack; import java.util.TreeSet; /** * 988. Smallest String Starting From Leaf * * <p>Given the root of a binary tree, each node has a value from 0 to 25 representing the letters i * 'a' to 'z': a value...
java/src/main/java/co/aa8y/leetcode/SmallestStringStartingFromLeaf.java
0.923182
0.455078
SmallestStringStartingFromLeaf.java
starcoder
package stomp.data3d; import java.util.Vector; import java.awt.*; import javax.vecmath.*; import stomp.*; import stomp.FastVector; import stomp.data3d.*; import stomp.view.View; import stomp.transform.Transformation; /** * Polygon3d class. Represents a simple polygon. * Polygons may have any number of vertices. ...
stomp/stomp/data3d/Polygon3d.java
0.905273
0.558267
Polygon3d.java
starcoder
package engine.entities; import engine.Artist; import engine.Window; import engine.core.Coords; import engine.internal.Rendering; public class Rectangle extends Entity { private final Coords.Size size; private final RectangleGLData glData; private final Artist artist; /* changes here! ...
src/main/java/engine/entities/Rectangle.java
0.623377
0.459986
Rectangle.java
starcoder
package com.longluo.leetcode.bitmanipulation; import java.util.Arrays; /** * 1310. 子数组异或查询 * <p> * 有一个正整数数组 arr,现给你一个对应的查询数组 queries,其中 queries[i] = [Li, Ri]。 * 对于每个查询 i,请你计算从 Li 到 Ri 的 XOR 值(即 arr[Li] xor arr[Li+1] xor ... xor arr[Ri])作为本次查询的结果。 * 并返回一个包含给定查询 queries 所有结果的数组。 * <p> * 示例 1: * 输入:arr = [1,3,4,...
Java/src/com/longluo/leetcode/bitmanipulation/Problem1310_xorQueriesOfASubarray.java
0.671686
0.416203
Problem1310_xorQueriesOfASubarray.java
starcoder
package com.jenkov.db.itf; /** * Represents a DAO capable of simplifying the most ordinary JDBC tasks like reading * a long from the database, iterating a ResultSet and executing an update. * * @author <NAME> - Copyright 2005 Jenkov Development */ public interface IJdbcDao { /** * Reads a long from the ...
src/main/java/com/jenkov/db/itf/IJdbcDao.java
0.901823
0.669873
IJdbcDao.java
starcoder
package org.xmlobjects.gml.model.geometry; import org.xmlobjects.gml.model.GMLObject; import org.xmlobjects.gml.model.common.CoordinateListProvider; import org.xmlobjects.model.ChildList; import java.util.Collection; import java.util.Collections; import java.util.List; import java.util.stream.Collectors; public clas...
src/main/java/org/xmlobjects/gml/model/geometry/GeometricPositionList.java
0.838845
0.411288
GeometricPositionList.java
starcoder
package com.barrybecker4.simulation.snake.geometry; import com.barrybecker4.simulation.snake.LocomotionParameters; import javax.vecmath.Vector2d; import static com.barrybecker4.simulation.snake.geometry.Segment.CENTER_INDEX; import static com.barrybecker4.simulation.snake.geometry.Segment.NUM_PARTICLES; /** * Up...
source/com/barrybecker4/simulation/snake/geometry/SegmentUpdater.java
0.908362
0.580768
SegmentUpdater.java
starcoder
package com.google.iot.cbor; import java.io.IOException; import java.io.OutputStream; import java.math.BigInteger; import java.net.URI; import java.nio.ByteBuffer; import java.util.Map; import org.checkerframework.checker.nullness.qual.Nullable; /** * Base class for CBOR data items. * * @see CborArray * @see Cbor...
src/main/java/com/google/iot/cbor/CborObject.java
0.91579
0.453504
CborObject.java
starcoder
package org.onosproject.cluster; import java.util.Arrays; import java.util.Collection; import java.util.Set; import java.util.stream.Collectors; import static com.google.common.base.Preconditions.checkNotNull; import static com.google.common.base.Verify.verifyNotNull; import static com.google.common.base.Verify.verif...
core/api/src/main/java/org/onosproject/cluster/ClusterMetadata.java
0.936489
0.400544
ClusterMetadata.java
starcoder
package com.aliasi.classify; import com.aliasi.util.Math; import com.aliasi.util.Pair; import com.aliasi.util.ScoredObject; import java.util.Arrays; /** * A <code>ConditionalClassification</code> is a scored classification * which estimates conditional probabilities of categories given an * input. By default, th...
aliasi-lingpipe/src/main/java/com/aliasi/classify/ConditionalClassification.java
0.943465
0.716891
ConditionalClassification.java
starcoder
package org.opensha.sha.imr; import java.util.ListIterator; import org.opensha.commons.data.function.DiscretizedFuncAPI; import org.opensha.commons.exceptions.IMRException; import org.opensha.commons.exceptions.ParameterException; import org.opensha.commons.geo.Location; import org.opensha.sha.util.TectonicRegionType...
java/org/opensha/sha/imr/ScalarIntensityMeasureRelationshipAPI.java
0.913404
0.442396
ScalarIntensityMeasureRelationshipAPI.java
starcoder
package net.pocketdreams.sequinland.util.nukkit; import net.pocketdreams.sequinland.util.NukkitMath; public class Vector3f implements Cloneable { public static final int SIDE_DOWN = 0; public static final int SIDE_UP = 1; public static final int SIDE_NORTH = 2; public static final int SIDE_SOUTH = 3; ...
src/main/java/net/pocketdreams/sequinland/util/nukkit/Vector3f.java
0.893158
0.72167
Vector3f.java
starcoder
public class Particle { private static int counter = 1; private Coordinates position; private Double radius; private Double color; private Movement movement; private int ID; public Particle(Coordinates position, double radius,double color, Coordinates velocity) { this.position = p...
TP1/src/Particle.java
0.796965
0.587943
Particle.java
starcoder
package pythagoras.f; import java.nio.FloatBuffer; /** * Provides read-only access to a {@link Vector3}. */ public interface IVector3 { /** Returns the x-component of this vector. */ float x (); /** Returns the y-component of this vector. */ float y (); /** Returns the z-component of this vec...
src/main/java/pythagoras/f/IVector3.java
0.952849
0.749866
IVector3.java
starcoder
package io.functional; import java.util.ArrayList; import java.util.List; import static java.util.Arrays.asList; import static java.util.Arrays.copyOf; import static java.util.Collections.*; public class CollectionUtilities { public static <T> List<T> list() { return emptyList(); } public stati...
src/main/java/io/functional/CollectionUtilities.java
0.82108
0.541773
CollectionUtilities.java
starcoder
package org.mariotaku.gallery3d.common; // Copied from android.util.LongSparseArray for unbundling /** * SparseArray mapping longs to Objects. Unlike a normal array of Objects, there * can be gaps in the indices. It is intended to be more efficient than using a * HashMap to map Longs to Objects. */ public class L...
src/org/mariotaku/gallery3d/common/LongSparseArray.java
0.810479
0.411525
LongSparseArray.java
starcoder
package org.apache.solr.analytics.value; import java.time.Instant; import java.util.Date; import java.util.function.Consumer; import java.util.function.LongConsumer; import org.apache.solr.analytics.facet.compare.ExpressionComparator; import org.apache.solr.analytics.value.constant.ConstantDateValue; /** * A single-...
solr/modules/analytics/src/java/org/apache/solr/analytics/value/DateValue.java
0.922892
0.403156
DateValue.java
starcoder
package binaryTree; import java.util.Stack; public class TransformLeftClonedTree { public static class Node { int data; Node leftChild; Node rightChild; Node(int data, Node left, Node right) { this.data = data; this.leftChild = left; this.right...
binaryTree/TransformLeftClonedTree.java
0.572842
0.41182
TransformLeftClonedTree.java
starcoder
package javapersianutils.core.string; import org.apache.commons.lang3.StringEscapeUtils; import java.io.UnsupportedEncodingException; import java.nio.charset.StandardCharsets; import java.util.regex.Pattern; import static javapersianutils.core.string.StringUtil.isNullOrWhiteSpace; /** * replace all more than one ...
src/main/java/javapersianutils/core/string/AggressiveEditing.java
0.608361
0.4575
AggressiveEditing.java
starcoder
* Contains bindings to the <a target="_blank" href="https://www.opengl.org/">OpenGL</a> cross-platform 2D and 3D rendering API. * * <p>The <a target="_blank" href="https://www.khronos.org/registry/OpenGL/index_gl.php">OpenGL registry</a> is a useful online resource that contains the OpenGL and OpenGL * Shading Lan...
modules/lwjgl/opengl/src/generated/java/org/lwjgl/opengl/package-info.java
0.86813
0.841077
package-info.java
starcoder
package edu.kit.dol.timetabling.model.base; import edu.kit.dol.timetabling.structures.EventType; import org.apache.poi.ss.usermodel.DataFormatter; import org.apache.poi.ss.usermodel.Row; import java.text.SimpleDateFormat; import java.util.*; public class BaseParser { public static final String inputTimeStringPa...
edu/kit/dol/timetabling/model/base/BaseParser.java
0.743354
0.403596
BaseParser.java
starcoder
package net.chrigel.clustercode.util.di; import com.google.inject.AbstractModule; import com.google.inject.name.Names; import net.chrigel.clustercode.util.ConfigurationHelper; import java.io.IOException; import java.util.List; import java.util.Map; import java.util.Optional; import java.util.Properties; import java.u...
src/backend/main/java/net/chrigel/clustercode/util/di/AbstractPropertiesModule.java
0.915687
0.490846
AbstractPropertiesModule.java
starcoder
package org.spongepowered.api.text.selector; import org.spongepowered.api.entity.Entity; import org.spongepowered.api.util.command.CommandSource; import org.spongepowered.api.world.Location; import org.spongepowered.api.world.World; import org.spongepowered.api.world.extent.Extent; import java.util.Collection; import...
src/main/java/org/spongepowered/api/text/selector/Selector.java
0.918503
0.509703
Selector.java
starcoder
package org.apache.commons.rng.examples.sampling; import java.io.PrintWriter; import java.util.EnumSet; import java.util.concurrent.Callable; import java.io.IOException; import org.apache.commons.rng.UniformRandomProvider; import org.apache.commons.rng.simple.RandomSource; import picocli.CommandLine.Command; import p...
subjects/components/code/commons-rng/commons-rng-examples/examples-sampling/src/main/java/org/apache/commons/rng/examples/sampling/ProbabilityDensityApproximationCommand.java
0.78502
0.415729
ProbabilityDensityApproximationCommand.java
starcoder
package io.netty.util; import static io.netty.util.internal.ObjectUtil.checkNotNull; import io.netty.util.internal.PlatformDependent; import io.netty.util.internal.StringUtil; import java.nio.ByteBuffer; import java.nio.CharBuffer; import java.nio.charset.Charset; import java.nio.charset.CharsetEncoder; import java....
common/src/main/java/io/netty/util/ByteString.java
0.917088
0.520923
ByteString.java
starcoder
* The ProductionWorker class stores a shift and an hourly pay rate for employees */ public class ProductionWorker extends Employee { //Create necessary private variables private int shift; private double payRate; public static final int DAY_SHIFT = 1; public static final int NIGHT_SHIFT = 2; ...
Assignments/AS10/ProductionWorker.java
0.790652
0.585723
ProductionWorker.java
starcoder
package backtrack; /** * Eight Queen puzzle (八皇后问题): * The eight queens puzzle is the problem of placing eight chess queens on an 8×8 chessboard so that no two queens * threaten each other; thus, a solution requires that no two queens share the same row, column, or diagonal. * * @see leetcode.NQueens */ publi...
java/src/backtrack/Queen.java
0.569254
0.418637
Queen.java
starcoder
package fr.vergne.filter; import java.util.Collection; import java.util.HashSet; import java.util.Map; import java.util.Objects; import java.util.Set; import java.util.function.Predicate; import java.util.stream.Collectors; import java.util.stream.Stream; /** * A {@link Filter} provides a filtering function (and as ...
src/main/java/fr/vergne/filter/Filter.java
0.92637
0.554712
Filter.java
starcoder
package io.github.amyassist.amy.natlang.nl; import java.util.*; import org.apache.commons.lang3.StringUtils; import io.github.amyassist.amy.natlang.agf.AGFParseException; import io.github.amyassist.amy.natlang.agf.nodes.*; import io.github.amyassist.amy.natlang.languagespecifics.Stemmer; import io.github.amyassist.a...
natlang/src/main/java/io/github/amyassist/amy/natlang/nl/NLParser.java
0.787809
0.458531
NLParser.java
starcoder
package qub; public interface MutableSize2DistanceTests { static void test(TestRunner runner) { runner.testGroup(MutableSize2Distance.class, () -> { MutableSize2Tests.test(runner, MutableSize2Distance::create); runner.testGroup("create(Distance,Distance)", () -> ...
tests/qub/MutableSize2DistanceTests.java
0.85446
0.831006
MutableSize2DistanceTests.java
starcoder
package model; import java.io.File; import java.io.FileNotFoundException; import java.util.Objects; import java.util.Scanner; public class Matrix { private static double precision = Math.pow(10, -5); private int n; private double[][] matrix; public Matrix(int dim) { this.n = dim; this...
tema2/src/main/java/model/Matrix.java
0.775009
0.462898
Matrix.java
starcoder
package com.machinezoo.sourceafis; import static java.util.stream.Collectors.*; import java.util.*; class Skeleton { final SkeletonType type; final IntPoint size; final List<SkeletonMinutia> minutiae = new ArrayList<>(); Skeleton(BooleanMatrix binary, SkeletonType type) { this.type = type; // https://sourceaf...
src/main/java/com/machinezoo/sourceafis/Skeleton.java
0.606265
0.45417
Skeleton.java
starcoder
package com.comandulli.engine.panoramic.playback.engine.render.material; import java.nio.FloatBuffer; import java.util.ArrayList; import java.util.List; import com.comandulli.engine.panoramic.playback.engine.render.camera.Camera; import com.comandulli.engine.panoramic.playback.engine.render.renderer.Renderer; import...
src/com/comandulli/engine/panoramic/playback/engine/render/material/Shader.java
0.859958
0.416441
Shader.java
starcoder
package org.jaudiotagger.audio.generic; import java.io.File; import java.io.UnsupportedEncodingException; import java.nio.ByteBuffer; import java.nio.charset.Charset; /** * Contains various frequently used static functions in the different tag * formats * * @author <NAME> */ public class Utils { /** * ...
src/org/jaudiotagger/audio/generic/Utils.java
0.764716
0.41478
Utils.java
starcoder
package com.leetcode.med; import java.util.Comparator; import java.util.PriorityQueue; /** * Created by Sri on 4/5/2019. * * https://leetcode.com/problems/k-closest-points-to-origin/ * * We have a list of points on the plane. Find the K closest points to the origin (0, 0). (Here, the distance between two poin...
algos/src/com/leetcode/med/KClosesPointsToOrigin.java
0.883293
0.507263
KClosesPointsToOrigin.java
starcoder
package boofcv.factory.filter.kernel; import boofcv.struct.convolve.*; import boofcv.struct.image.ImageFloat32; import boofcv.struct.image.ImageInteger; import boofcv.struct.image.ImageSingleBand; import java.util.Random; /** * <p> * Factory used to create standard convolution kernels for floating point and * int...
main/ip/src/boofcv/factory/filter/kernel/FactoryKernel.java
0.943099
0.563318
FactoryKernel.java
starcoder
__________________________________________________________________________________________________ sample 3 ms submission class Solution { class Pair { public int x; public int y; public Pair(int x, int y) { this.x = x; this.y = y; } ...
solutions/LeetCode/Java/221.java
0.774924
0.470189
221.java
starcoder
package apg; // <code></code> import java.io.*; import java.util.Vector; import java.util.ListIterator; /** * The Utilities class defines several helper classes and static functions. * These are stand-alone classes and functions that have general utility beyond * the needs of any single class. */ public class Uti...
src/apg/Utilities.java
0.886463
0.427935
Utilities.java
starcoder
package de.pxlab.stat; import java.util.Iterator; import de.pxlab.util.ExpansionIterator; /** * Create an iterator which returns all possible index arrays for a given set * array where those index values given in a mask are fixed. A set array is * something like [1, 3, 1, 4]. This set array tells us that...
pxlab/src/main/java/de/pxlab/stat/MaskedExpansionIterator.java
0.738952
0.441793
MaskedExpansionIterator.java
starcoder
package com.gocardless.resources; import java.util.Map; /** * Represents a customer bank account resource returned from the API. * * Customer Bank Accounts hold the bank details of a [customer](#core-endpoints-customers). They * always belong to a [customer](#core-endpoints-customers), and may be linked to severa...
src/main/java/com/gocardless/resources/CustomerBankAccount.java
0.875108
0.41484
CustomerBankAccount.java
starcoder
package com.tramchester.dataimport.rail.records; // 1 Record Identity 2 1-2 With the constant value ‘BS’. // 2 Transaction Type 1 3-3 ‘N’ = New. ‘D’ = Delete. ‘R’ = Revise. // 3 Train UID 6 4-9 Unique train Identifier. // 4 Date Runs From 6 10-15 yymmdd // 5 Date Runs To 6 16-21 yymmdd // 6 Days Run 7 22-28 // 7 Bank ...
main/src/com/tramchester/dataimport/rail/records/BasicSchedule.java
0.802903
0.439326
BasicSchedule.java
starcoder
package phorcys.java; public class Node { String name; String type; private double x; //Because of my terribleness, these have to remain private double y; Vector2 position; long id; /** * Creates a new Node with name at position (x,y) * Automatically determines the type from the name. * @param name Name...
Phorcys/java/phorcys/java/Node.java
0.829008
0.443179
Node.java
starcoder
package mil.nga.geopackage.map.geom; import com.google.android.gms.maps.model.LatLng; import com.google.android.gms.maps.model.Marker; import com.google.android.gms.maps.model.MarkerOptions; import com.google.android.gms.maps.model.Polygon; import com.google.android.gms.maps.model.PolygonOptions; import com.google.and...
geopackage-map/src/main/java/mil/nga/geopackage/map/geom/GoogleMapShape.java
0.817793
0.513303
GoogleMapShape.java
starcoder
package com.google.zxing.pdf417.detector; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; import com.google.zxing.NotFoundException; import com.google.zxing.common.BitMatrix; import com.google.zxing.pdf417.decoder.BitMatrixParser; /** * <p>...
core/src/com/google/zxing/pdf417/detector/LinesSampler.java
0.912372
0.631197
LinesSampler.java
starcoder
* This is an alternative the CompressedByteBuffer. Instead of using an * ArrayList to hold Byte objects, which is insanely wasteful b/c of boxing, we * hold primitive arrays of bytes. * * We assume the buffer will have to work with variable sizes, so we start with * small allocation (2 bytes), and harmonically in...
tupleflow/src/main/java/org/lemurproject/galago/tupleflow/buffer/DiskSpillCompressedByteBuffer.java
0.91346
0.46478
DiskSpillCompressedByteBuffer.java
starcoder
package fr.univ_artois.lgi2a.similar.microkernel; import java.util.LinkedHashSet; import java.util.List; import java.util.Map; import java.util.Set; import fr.univ_artois.lgi2a.similar.microkernel.agents.IAgent4Engine; import fr.univ_artois.lgi2a.similar.microkernel.environment.IEnvironment4Engine; import fr.univ_art...
similar-microKernel/src/main/java/fr/univ_artois/lgi2a/similar/microkernel/ISimulationModel.java
0.805441
0.654819
ISimulationModel.java
starcoder
package de.ma_vin.util.sample.content.mapper; import de.ma_vin.util.layer.generator.annotations.mapper.BaseTransportMapper; import de.ma_vin.util.sample.content.domain.DomainObjectFactory; import de.ma_vin.util.sample.content.domain.IIdentifiable; import de.ma_vin.util.sample.content.domain.multi.indirect.MultiRefIndi...
layer-generator-sample/src/main/java/de/ma_vin/util/sample/content/mapper/MultiIndirectTransportMapper.java
0.880386
0.520679
MultiIndirectTransportMapper.java
starcoder
package com.oasisfeng.java.util; import java.io.Serializable; import java9.util.Objects; import java9.util.function.Function; import java9.util.function.ToDoubleFunction; import java9.util.function.ToIntFunction; import java9.util.function.ToLongFunction; /** * A comparison function, which imposes a <i>total orderi...
library/src/main/java/com/oasisfeng/java/util/Comparator.java
0.929484
0.634996
Comparator.java
starcoder
package io.mercury.common.util; import static java.lang.System.arraycopy; import javax.annotation.Nonnull; public final class ArrayUtil { /** * * @param array * @return */ public static boolean isNullOrEmpty(byte[] array) { return array == null ? true : array.length == 0 ? true : false; } /** * ...
commons-core/src/main/java/io/mercury/common/util/ArrayUtil.java
0.872958
0.431105
ArrayUtil.java
starcoder
package com.github.zafarkhaja.semver.expr; import com.github.zafarkhaja.semver.ParseException; import com.github.zafarkhaja.semver.UnexpectedCharacterException; import com.github.zafarkhaja.semver.Version; import java.util.function.Predicate; /** * This class implements internal DSL for the * SemVer Expressions us...
src/main/java/com/github/zafarkhaja/semver/expr/CompositeExpression.java
0.938646
0.52683
CompositeExpression.java
starcoder
package com.smdev.algorithm.sorting; import java.util.Arrays; public class MergeSort { public static int[] sort(int[] arr) { if (arr == null || arr.length < 2) { return arr; } int mid = arr.length / 2; int[] leftArr = sort(Arrays.copyOfRange(arr, 0, mid)); int[...
src/com/smdev/algorithm/sorting/MergeSort.java
0.522446
0.448064
MergeSort.java
starcoder
package com.blaise.barrenlandanalysis; import java.util.*; public class BarrenLandAnalysis { public static void main(String[] args) { Land myLand = new Land(); try { ReadInput.readInputFromIO(myLand); } catch (Exception ex) { System.out.println(ex.getMessage()); ...
src/main/java/com/blaise/barrenlandanalysis/BarrenLandAnalysis.java
0.72594
0.432902
BarrenLandAnalysis.java
starcoder