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 com.dsa.array; import java.util.Arrays; /** * find the next lexicographic permutation of the given list of numbers than the number formed by the given array. * We need to find the first pair of two successive numbers a[i]a[i] and a[i-1]a[i−1], from the right, which satisfy a[i] > a[i-1]. Now, no rearrangeme...
src/com/dsa/array/nextPermutation.java
0.72086
0.804751
nextPermutation.java
starcoder
Therefore, for each pivot index i, its expected index j is given by ptn[pos[ptn[row[i]]]]. As long as i != j, we swap the two elements at index i and j, a nd continue until the placement requirement is satisfied. A minor complication here is that for each swapping operation, we need to swap both the row and pos array...
src/Interview_exp/goog/CouplesHoldignHands.java
0.674479
0.71638
CouplesHoldignHands.java
starcoder
package mho.wheels.ordering.comparators; import org.jetbrains.annotations.NotNull; import java.util.Comparator; import java.util.HashMap; import java.util.Map; /** * Compares two {@code Character}s by an ordering specified by a {@code String}. */ public class StringBasedComparator implements Comparator<Character> ...
src/main/java/mho/wheels/ordering/comparators/StringBasedComparator.java
0.937117
0.583797
StringBasedComparator.java
starcoder
package boofcv.alg.filter.kernel; import boofcv.struct.convolve.*; import boofcv.struct.image.GrayF32; import boofcv.struct.image.GrayI; import boofcv.struct.image.GrayS32; /** * @author <NAME> */ public class KernelMath { public static void scale( Kernel1D_F32 kernel , float value ) { for( int i = 0; i < kern...
main/ip/src/boofcv/alg/filter/kernel/KernelMath.java
0.66236
0.558086
KernelMath.java
starcoder
package org.javarosa.core.util; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.util.ArrayList; import java.util.List; import static java.lang.Math.abs; import static java.lang.Math.acos; import static java.lang.Math.cos; import static java.lang.Math.sin; import static java.lang.Math.toRadians; ...
src/org/javarosa/core/util/GeoUtils.java
0.926166
0.574066
GeoUtils.java
starcoder
package com.github.keven.problem7; /** * In mathematics, the Fibonacci numbers or Fibonacci sequence are the numbers in the following * integer sequence: * * 0,1,1,2,3,5,8,13,21,34. * * The Fibonacci spiral: an approximation of the golden spiral created by drawing circular arcs * connecting the opposite corners...
src/main/java/com/github/keven/problem7/FibonacciNumbers.java
0.911621
0.602149
FibonacciNumbers.java
starcoder
package com.google.template.soy.jssrc.dsl; import static com.google.common.base.Preconditions.checkArgument; import com.google.common.base.Optional; import com.google.common.base.Preconditions; import com.google.common.base.Splitter; import com.google.common.collect.ImmutableList; import com.google.common.collect.Imm...
java/src/com/google/template/soy/jssrc/dsl/Expression.java
0.919534
0.411998
Expression.java
starcoder
package cncleveler; /** * Defines labels for each supported modal G code word. Also defines the modal group * that the G code belongs to. */ public enum Mode { // Motion modes: {G0, G1, G2, G3} RAPID ("G0", Group.MOTION), LINEAR ("G1", Group.MOTION), CIRCULAR_CW ("G2",Group.MOTION), CIRCULAR_CCW ("...
src/cncleveler/Mode.java
0.817101
0.411406
Mode.java
starcoder
package loon.action.map; import loon.action.map.colider.Tile; import loon.action.map.colider.TileGenerator; import loon.action.map.colider.TileImpl; import loon.action.map.colider.TileImplFinder; import loon.utils.MathUtils; import loon.utils.TArray; /** * Tile对象到地图的转化管理用类(Field2D类是处理简单的数组地图用的,这个是处理复杂的Tile对象集合的(主要是T...
Java/Loon-Neo/src/loon/action/map/Grid2D.java
0.55447
0.549701
Grid2D.java
starcoder
package org.jnbt; import java.io.DataInput; import java.io.DataInputStream; import java.io.DataOutput; import java.io.DataOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.ArrayList; import java.util.LinkedHashMap; import java.util.List; import java.uti...
src/main/java/org/jnbt/Nbt.java
0.89229
0.410874
Nbt.java
starcoder
package unis.stores.services.product; import unis.stores.entities.Product; import java.util.List; public interface IProductService { /** * Returns the products of the system * * @return the list of the products from the database. */ List<Product> getProducts(); /** * Returns ...
src/main/java/unis/stores/services/product/IProductService.java
0.772616
0.404096
IProductService.java
starcoder
package com.amazon.aace.core; import com.amazon.aace.core.NativeRef; public class MessageStream extends NativeRef { /// An enumeration representing the stream operation mode. public enum Mode { /** * @hideinitializer */ READ("READ"), /** * @hideinitializer ...
modules/core/android/src/main/java/com/amazon/aace/core/MessageStream.java
0.875282
0.409634
MessageStream.java
starcoder
package me.sizableshrimp.adventofcode2021.helper; import me.sizableshrimp.adventofcode2021.templates.Coordinate; import me.sizableshrimp.adventofcode2021.templates.EnumState; import java.util.ArrayList; import java.util.List; import java.util.function.BiConsumer; import java.util.function.Consumer; import java.util.r...
src/main/java/me/sizableshrimp/adventofcode2021/helper/Parser.java
0.887948
0.470068
Parser.java
starcoder
package org.trypticon.luceneupgrader.lucene7.internal.lucene.document; import java.util.Arrays; import java.util.Collection; import org.trypticon.luceneupgrader.lucene7.internal.lucene.index.PointValues; import org.trypticon.luceneupgrader.lucene7.internal.lucene.search.PointInSetQuery; import org.trypticon.luceneupg...
src/main/java/org/trypticon/luceneupgrader/lucene7/internal/lucene/document/FloatPoint.java
0.905713
0.404566
FloatPoint.java
starcoder
package com.cloudsort.keyboard.keyboard; /** * This class handles key detection. */ public class KeyDetector { private final int mKeyHysteresisDistanceSquared; private final int mKeyHysteresisDistanceForSlidingModifierSquared; private Keyboard mKeyboard; private int mCorrectionX; private int mCo...
app/src/main/java/com/cloudsort/keyboard/keyboard/KeyDetector.java
0.9088
0.419886
KeyDetector.java
starcoder
package org.aion.mcf.db; import java.math.BigInteger; import org.aion.types.AionAddress; import org.aion.util.types.ByteArrayWrapper; /** * Repository interface for individual account additions and updates. * * @implNote Tracking a repository should be done through implementing this interface. */ public interface...
modMcf/src/org/aion/mcf/db/RepositoryCache.java
0.890407
0.461563
RepositoryCache.java
starcoder
package com.android.volley.misc; import java.io.ByteArrayInputStream; import java.io.InputStream; import android.util.Log; public class Exif { private static final String TAG = "CameraExif"; /** * Returns the degrees in clockwise. Values are 0, 90, 180, or 270. * @param inputStream The input strea...
library/src/com/android/volley/misc/Exif.java
0.866881
0.448426
Exif.java
starcoder
package io.cloudneutral.shortestpath.graph.grid; import java.util.Arrays; import java.util.Objects; import io.cloudneutral.shortestpath.graph.HeuristicCost; public class Cell { // Diagonal octile distance (8x) // https://en.wikipedia.org/wiki/Chebyshev_distance public static final HeuristicCost<Cell> oct...
shortestpath-java/src/main/java/io/cloudneutral/shortestpath/graph/grid/Cell.java
0.912736
0.599016
Cell.java
starcoder
package cmap.matrix; import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; import java.util.List; import java.util.Map; /** * * Abstract dataset. * */ public abstract class AbstractDataset implements Dataset { protected List<Matrix> matrices = new ArrayList<Matrix>(); prote...
src/cmap/matrix/AbstractDataset.java
0.914231
0.49884
AbstractDataset.java
starcoder
import java.util.Scanner; public class Program { public static void main(String args[]) { Scanner userInput = new Scanner(System.in); // Initialise Scanner class. double degreesUnit = 0.0; // Initial values of Degrees Unit. double cels2Fahren = degreesUnit * 9/5 + 32; // Degrees Celsi...
PROG-1/src/Program.java
0.561215
0.50708
Program.java
starcoder
package io.druid.segment; import io.druid.data.input.impl.DimensionSchema.MultiValueHandling; import io.druid.segment.column.Column; import io.druid.segment.column.ColumnCapabilities; import io.druid.segment.data.Indexed; import io.druid.segment.writeout.SegmentWriteOutMedium; import java.io.Closeable; import java.io...
processing/src/main/java/io/druid/segment/DimensionHandler.java
0.846451
0.501282
DimensionHandler.java
starcoder
package ai.certifai.solution.classification; import org.deeplearning4j.core.storage.StatsStorage; import org.deeplearning4j.nn.conf.layers.*; import org.deeplearning4j.nn.graph.ComputationGraph; import org.deeplearning4j.nn.transferlearning.FineTuneConfiguration; import org.deeplearning4j.nn.transferlearning.Transfer...
dl4j-cv-labs/src/main/java/ai/certifai/solution/classification/CNN.java
0.732687
0.465023
CNN.java
starcoder
package de.terrestris.shoguncore.importer.communication; /** * A data is the description of the source data of a import (overall) or a * task. In case the import has a global data definition, this normally refers * to an aggregate store such as a directory or a database, and the data * associated to the tasks refe...
src/shogun-core-main/src/main/java/de/terrestris/shoguncore/importer/communication/RESTData.java
0.830388
0.418875
RESTData.java
starcoder
package androidx.biometric; import static com.google.common.truth.Truth.assertThat; import static org.mockito.Mockito.when; import android.content.Context; import android.content.res.Resources; import android.os.Build; import androidx.test.ext.junit.runners.AndroidJUnit4; import androidx.test.filters.MediumTest; i...
biometric/biometric/src/androidTest/java/androidx/biometric/DeviceUtilsTest.java
0.834103
0.455259
DeviceUtilsTest.java
starcoder
package org.glamey.training.codes.binarysearch; import java.util.Arrays; /** * 给定一个按照升序排列的整数数组 nums,和一个目标值 target。找出给定目标值在数组中的开始位置和结束位置。 * 你的算法时间复杂度必须是 O(log n) 级别。 * 如果数组中不存在目标值,返回 [-1, -1]。 * 示例 1: * 输入: nums = [5,7,7,8,8,10], target = 8 * 输出: [3,4] * <p> * 示例 2: * 输入: nums = [5,7,7,8,8,10], target = 6 * ...
codes/src/main/java/org/glamey/training/codes/binarysearch/SearchBoundRange.java
0.710628
0.488893
SearchBoundRange.java
starcoder
package org.apache.geode.distributed; import static org.apache.geode.distributed.AbstractLauncher.Status.NOT_RESPONDING; import static org.apache.geode.distributed.AbstractLauncher.Status.ONLINE; import static org.apache.geode.distributed.AbstractLauncher.Status.STOPPED; import static org.apache.geode.distributed.Conf...
geode-core/src/integrationTest/java/org/apache/geode/distributed/ServerLauncherLocalIntegrationTest.java
0.756268
0.44348
ServerLauncherLocalIntegrationTest.java
starcoder
import java.lang.reflect.Field; import java.util.ArrayList; import java.util.Collections; import java.util.IdentityHashMap; import java.util.List; import java.util.Random; import org.testng.annotations.DataProvider; import org.testng.annotations.Test; import static org.testng.Assert.*; /* * @test * @bug 6904367 *...
testcase/java/util/IdentityHashMap/Capacity.java
0.859413
0.498169
Capacity.java
starcoder
package qub; public interface MutableURLTests { static void test(TestRunner runner) { runner.testGroup(MutableURL.class, () -> { runner.test("create()", (Test test) -> { final MutableURL url = MutableURL.create(); test.assertNull(url.getSc...
tests/qub/MutableURLTests.java
0.775009
0.505005
MutableURLTests.java
starcoder
package cn.weekdragon.utils.bt.tabooed; import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; import java.util.LinkedHashSet; import java.util.List; import java.util.Map; import java.util.Set; /** * 敏感词汇过滤工具类,使用了 <a href="http://zh.wikipedia.org/wiki/确定有限状态自动机">DFA</a> 算法来实现词汇过滤。 * * ...
src/cn/weekdragon/utils/bt/tabooed/TabooedTools.java
0.566498
0.461563
TabooedTools.java
starcoder
package it.unimi.dsi.fastutil.ints; import java.util.Collection; /** A type-specific {@link Collection}; provides some additional methods * that use polymorphism to avoid (un)boxing. * * <p>Additionally, this class defines strengthens (again) {@link #iterator()}. * * @see Collection */ public interface IntCollect...
src/main/java/it/unimi/dsi/fastutil/ints/IntCollection.java
0.891185
0.410106
IntCollection.java
starcoder
package ch3; import ch1.Queue; /** * Implements that Left Leaning Red-Black Binary Search Tree data structure. * * A BST is a binary search tree in symmetric order. * * A binary tree is either: - empty, Or - two disjoint binary trees (left and * right) * * Symmetric Order: Each node has a key and every nod...
src/ch3/LeftLeaningRedBlackBST.java
0.866571
0.524456
LeftLeaningRedBlackBST.java
starcoder
package mho.wheels.structures; import mho.wheels.ordering.Ordering; import org.jetbrains.annotations.NotNull; import java.util.Arrays; import java.util.Comparator; import java.util.List; import java.util.Optional; import java.util.function.Function; import static mho.wheels.iterables.IterableUtils.*; import static m...
src/main/java/mho/wheels/structures/Sextuple.java
0.931158
0.569793
Sextuple.java
starcoder
package sorting; import static org.junit.Assert.*; import java.util.Arrays; import java.util.Collection; import java.util.Comparator; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; import org.junit.runners.Parameterized.Parameters; @RunWith(Pa...
src/sorting/TestSorting.java
0.76145
0.526038
TestSorting.java
starcoder
package com.googlecode.objectify.impl.translate; import java.nio.charset.StandardCharsets; import java.util.Arrays; import com.google.cloud.Timestamp; import com.google.cloud.datastore.Blob; import com.google.cloud.datastore.BlobValue; import com.google.cloud.datastore.TimestampValue; import com.google.cloud.datastor...
src/main/java/com/googlecode/objectify/impl/translate/ValueTranslator.java
0.863492
0.457621
ValueTranslator.java
starcoder
package cn.hutool.core.lang.hash; import java.util.Arrays; /** * Google发布的Hash计算算法:CityHash64 与 CityHash128。<br> * 它们分别根据字串计算 64 和 128 位的散列值。这些算法不适用于加密,但适合用在散列表等处。 * * <p> * 代码来自:https://github.com/rolandhe/string-tools<br> * 原始算法:https://github.com/google/cityhash * * @author hexiufeng * @since 5.2.5 */ pu...
hutool-core/src/main/java/cn/hutool/core/lang/hash/CityHash.java
0.516595
0.479016
CityHash.java
starcoder
package org.recast4j.detour; /** Provides high level information related to a dtMeshTile object. */ public class MeshHeader { /** A magic number used to detect compatibility of navigation tile data. */ public static final int DT_NAVMESH_MAGIC = 'D' << 24 | 'N' << 16 | 'A' << 8 | 'V'; /** A version number u...
detour/src/main/java/org/recast4j/detour/MeshHeader.java
0.862076
0.443902
MeshHeader.java
starcoder
package org.openstack4j.api.workflow; import java.util.List; import org.openstack4j.model.common.ActionResponse; import org.openstack4j.model.workflow.Scope; import org.openstack4j.model.workflow.WorkflowDefinition; import org.testng.annotations.BeforeTest; import org.testng.annotations.Test; import static org.testn...
core-test/src/main/java/org/openstack4j/api/workflow/WorkflowDefinitionTest.java
0.859059
0.630856
WorkflowDefinitionTest.java
starcoder
static void solve() throws IOException { scan = new FastReader(); pw = new PrintWriter(System.out, true); StringBuilder sb = new StringBuilder(); int t = ni(); while (t-- > 0) { int n = ni(), m = ni(), a = ni(), b = ni(); ArrayList<Integer> a_edges = new ArrayList<>(); ArrayL...
raw_dataset/67475983@solve@OK.java
0.617167
0.404449
67475983@solve@OK.java
starcoder
package org.eclipse.jdt.internal.compiler.ast; import org.eclipse.jdt.internal.compiler.ASTVisitor; import org.eclipse.jdt.internal.compiler.codegen.CodeStream; import org.eclipse.jdt.internal.compiler.flow.FlowContext; import org.eclipse.jdt.internal.compiler.flow.FlowInfo; import org.eclipse.jdt.internal.compiler.im...
eclipse/src/main/java/org/eclipse/jdt/internal/compiler/ast/CombinedBinaryExpression.java
0.70912
0.493958
CombinedBinaryExpression.java
starcoder
package com.ansorgit.plugins.bash.lang.psi.impl.word; import com.ansorgit.plugins.bash.LightBashCodeInsightFixtureTestCase; import com.ansorgit.plugins.bash.file.BashFileType; import com.ansorgit.plugins.bash.lang.psi.api.BashString; import com.intellij.openapi.util.TextRange; import com.intellij.psi.PsiFile; import c...
test/com/ansorgit/plugins/bash/lang/psi/impl/word/BashStringImplTest.java
0.800302
0.418756
BashStringImplTest.java
starcoder
package com.mapbox.android.gestures; import android.content.Context; import androidx.annotation.DimenRes; import androidx.annotation.NonNull; import androidx.annotation.UiThread; import java.util.HashSet; import java.util.Set; import static com.mapbox.android.gestures.AndroidGesturesManager.GESTURE_TYPE_SIDEWAYS_SHO...
library/src/main/java/com/mapbox/android/gestures/SidewaysShoveGestureDetector.java
0.953902
0.400105
SidewaysShoveGestureDetector.java
starcoder
package androidx.appsearch.localstorage.stats; import static com.google.common.truth.Truth.assertThat; import androidx.appsearch.app.AppSearchResult; import org.junit.Test; public class AppSearchStatsTest { static final String TEST_PACKAGE_NAME = "com.google.test"; static final String TEST_DATA_BASE = "test...
appsearch/appsearch-local-storage/src/androidTest/java/androidx/appsearch/localstorage/stats/AppSearchStatsTest.java
0.730386
0.482612
AppSearchStatsTest.java
starcoder
package sp.maths; public class Vector2 { public float x, y; public Vector2() { x = 0.0f; y = 0.0f; } public Vector2(float x, float y) { this.x = x; this.y = y; } public Vector2(Vector3 other) { x = other.x; y = other.y; } public Vector2(Vector2 other) { x = other.x; y = other.y; } ...
java/Sparky4j-core-3D/src/sp/maths/Vector2.java
0.775987
0.675996
Vector2.java
starcoder
package cc.mallet.fst; import java.util.ArrayList; import java.util.Collections; import cc.mallet.types.FeatureVectorSequence; import cc.mallet.types.Instance; import cc.mallet.types.InstanceList; import cc.mallet.types.Sequence; import cc.mallet.fst.TransducerTrainer.ByInstanceIncrements; /** * Trains CRF by stoc...
src/cc/mallet/fst/CRFTrainerByStochasticGradient.java
0.69233
0.589244
CRFTrainerByStochasticGradient.java
starcoder
package io.cloudstate.javasupport.crdt; /** * A Last-Write-Wins Register. * <p/> * This uses a clock value to determine which of two concurrent writes should win. When both clock values are the same, * an ordering defined over the node addresses is used to break the tie. * <p/> * By default, the clock used is th...
java-support/src/main/java/io/cloudstate/javasupport/crdt/LWWRegister.java
0.918521
0.613989
LWWRegister.java
starcoder
package seedu.address.model.event; import java.util.Arrays; import java.util.HashSet; import java.util.Objects; import java.util.Set; import java.util.stream.Collectors; //@@author: jieliangang /** * Represents a the attendees with emails in a event. */ public class Attendees { private Set<String> attendeesSet;...
src/main/java/seedu/address/model/event/Attendees.java
0.867499
0.440108
Attendees.java
starcoder
package gov.sandia.cognition.math.matrix.custom; import gov.sandia.cognition.collection.ArrayUtil; import gov.sandia.cognition.math.matrix.Matrix; import gov.sandia.cognition.math.matrix.Vector; import gov.sandia.cognition.math.matrix.VectorEntry; import gov.sandia.cognition.math.matrix.VectorFactory; import java.util...
Components/CommonCore/Source/gov/sandia/cognition/math/matrix/custom/DenseVector.java
0.93133
0.651577
DenseVector.java
starcoder
package org.contentmine.cproject.util; import java.io.File; import java.io.IOException; import java.nio.file.FileSystems; import java.nio.file.FileVisitResult; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.PathMatcher; import java.nio.file.Paths; import java.nio.file.SimpleFileVisitor; im...
src/main/java/org/contentmine/cproject/util/CMineGlobber.java
0.68342
0.417568
CMineGlobber.java
starcoder
package org.opensim.modeling; /** * A class that represents a control in a dynamic simulation.<br> * <br> * This class is intended to be the base class for different types of controls,<br> * so many of its methods are virtual.<br> * <br> * In general, a control consists of a set of parameters. These parameters<...
Gui/opensim/modeling/src/org/opensim/modeling/Control.java
0.961107
0.648981
Control.java
starcoder
package projects.wsn.simulation.network; import lombok.Getter; import lombok.RequiredArgsConstructor; import projects.wsn.nodes.SimulationNode; import projects.wsn.simulation.io.SimulationOutput; import projects.wsn.simulation.network.data.DemandPoints; import projects.wsn.simulation.network.data.Sensor; import java....
src/main/java/projects/wsn/simulation/network/Simulation.java
0.762601
0.483466
Simulation.java
starcoder
package com.galenframework.generator.raycast; import com.galenframework.generator.PageItemNode; import com.galenframework.page.Point; import java.util.LinkedList; import java.util.List; public class EdgesContainer { public EdgesContainer(List<Edge> rightEdges, List<Edge> leftEdges, List<Edge> bottomEdges, List<E...
galen-core/src/main/java/com/galenframework/generator/raycast/EdgesContainer.java
0.81538
0.498535
EdgesContainer.java
starcoder
package de.lmu.ifi.dbs.elki.math.geometry; import de.lmu.ifi.dbs.elki.result.Result; import de.lmu.ifi.dbs.elki.utilities.datastructures.arraylike.DoubleArray; /** * An XYCurve is an ordered collection of 2d points, meant for chart generation. * Of key interest is the method {@link #addAndSimplify} which tries to s...
elki-0.7.5/sources/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/geometry/XYCurve.java
0.938428
0.501709
XYCurve.java
starcoder
package org.streaminer.stream.frequency; import org.streaminer.stream.frequency.util.CountEntry; import java.util.ArrayList; import java.util.List; import java.util.Map; import java.util.Set; import java.util.concurrent.ConcurrentHashMap; /** * <p> * A naive counter implementation. Simply contains a counter * for ...
src/main/java/org/streaminer/stream/frequency/RealCounting.java
0.90764
0.457803
RealCounting.java
starcoder
package org.apache.poi.ss.util; import java.util.Locale; import org.apache.poi.ss.util.ExpandedDouble; import org.apache.poi.ss.util.IEEEDouble; import org.apache.poi.ss.util.NormalisedDecimal; public final class NumberComparer { public static int compare(double a, double b) { long rawBitsA = Double.doubleT...
org/apache/poi/ss/util/NumberComparer.java
0.836454
0.471832
NumberComparer.java
starcoder
package de.tuberlin.mcc.simra.app.entities; public class DataLogEntry { public final Integer rideId; public final Double latitude; public final Double longitude; public final Float accelerometerX; public final Float accelerometerY; public final Float accelerometerZ; public final Long timest...
app/src/main/java/de/tuberlin/mcc/simra/app/entities/DataLogEntry.java
0.864124
0.468912
DataLogEntry.java
starcoder
package analysis; import java.util.Vector; /** * A spot stamp is a collection of pixels relative to a center point of (0, 0) * @author Eric-t61p * */ public class SpotStamp { private Vector<Pixel> stamp; public SpotStamp() { stamp = new Vector<Pixel>(); } /** * Add a pixel to a pixel s...
src/analysis/SpotStamp.java
0.804098
0.464051
SpotStamp.java
starcoder
package com.deleidos.rtws.core.framework.processor; import java.util.Collection; import java.util.Collections; import java.util.HashMap; import java.util.LinkedList; import com.deleidos.rtws.commons.util.DataModelBasedNames; import com.deleidos.rtws.commons.util.JsonPath; import com.deleidos.rtws.core.framework.parse...
ingest/src/main/java/com/deleidos/rtws/core/framework/processor/EnrichmentFieldMappingCache.java
0.837387
0.476092
EnrichmentFieldMappingCache.java
starcoder
package org.opensha2.eq.fault.surface; import java.util.ListIterator; import org.opensha2.util.Named; /** * <b>Title:</b> Container2DAPI<p> * * <b>Description:</b> Main interface that all 2D data containers must * implement. These provide functions for iteration through the elements, * replacing elements, e...
src/org/opensha2/eq/fault/surface/Container2D.java
0.767167
0.630529
Container2D.java
starcoder
package seedu.zookeep.model; import static java.util.Objects.requireNonNull; import java.util.List; import javafx.collections.ObservableList; import seedu.zookeep.model.animal.Animal; import seedu.zookeep.model.animal.AnimalComparator; import seedu.zookeep.model.animal.UniqueAnimalList; /** * Wraps all data at the...
src/main/java/seedu/zookeep/model/ZooKeepBook.java
0.940756
0.409516
ZooKeepBook.java
starcoder
package android.support.transition; import android.view.View; /** * Base class for <code>TransitionPropagation</code>s that care about * View Visibility and the center position of the View. */ public abstract class VisibilityPropagation extends TransitionPropagation { /** * The property key used for {@li...
transition/src/android/support/transition/VisibilityPropagation.java
0.944842
0.40489
VisibilityPropagation.java
starcoder
package sodium; import java.util.ArrayList; import java.util.List; import java.util.Optional; public class Stream<A> { private static final class ListenerImplementation<A> extends Listener { /** * It's essential that we keep the listener alive while the caller holds * the Listener, so that the finalizer does...
java/sodium/src/sodium/Stream.java
0.808181
0.453746
Stream.java
starcoder
package boofcv.alg.geo.robust; import boofcv.abst.geo.TriangulateTwoViewsCalibrated; import boofcv.alg.geo.DistanceModelStereoPixels; import boofcv.alg.geo.NormalizedToPixelError; import boofcv.struct.geo.AssociatedPair; import georegression.struct.point.Point3D_F64; import georegression.struct.se.Se3_F64; import geor...
main/boofcv-geo/src/boofcv/alg/geo/robust/DistanceSe3SymmetricSq.java
0.939948
0.759627
DistanceSe3SymmetricSq.java
starcoder
package java.awt; import java.awt.geom.AffineTransform; import java.awt.geom.Point2D; import java.awt.geom.Rectangle2D; import java.awt.image.ColorModel; import java.beans.ConstructorProperties; /** * The {@code RadialGradientPaint} class provides a way to fill a shape with * a circular radial color gradient patter...
openjdk/jdk/src/share/classes/java/awt/RadialGradientPaint.java
0.988335
0.759983
RadialGradientPaint.java
starcoder
package Extensions; import de.mosim.mmi.math.MVector3; import java.util.ArrayList; import java.util.List; public class MVector3Extensions { /* Class which extends MVector3 */ // Method which converts double values to MVector3 public static MVector3 toMVector3(List<Double> values) { return new MV...
Framework/LanguageSupport/java/MMIJava/src/Extensions/MVector3Extensions.java
0.876687
0.840717
MVector3Extensions.java
starcoder
package Modelo; import org.testng.Assert; import org.testng.annotations.BeforeClass; import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; /** * Created by david on 20/04/2017. */ public class BarcoTest { private Barco p; private Barco s; private Barco d; private Barco f; ...
test/Modelo/BarcoTest.java
0.662687
0.587292
BarcoTest.java
starcoder
package com.intellij.lang.jsgraphql.types.collect; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.intellij.lang.jsgraphql.types.Internal; import java.util.Collection; import java.util.List; import java.util.Map; import java.util.function.Function; import sta...
src/main/com/intellij/lang/jsgraphql/types/collect/ImmutableKit.java
0.935656
0.561155
ImmutableKit.java
starcoder
package com.sleepycat.je.rep; import java.util.concurrent.TimeUnit; import com.sleepycat.je.ReplicaConsistencyPolicy; import com.sleepycat.je.dbi.EnvironmentImpl; import com.sleepycat.je.rep.impl.RepImpl; import com.sleepycat.je.rep.impl.node.Replica; import com.sleepycat.je.utilint.PropUtil; /** * A consistency po...
src/com/sleepycat/je/rep/TimeConsistencyPolicy.java
0.868339
0.400837
TimeConsistencyPolicy.java
starcoder
package com.googlecode.charts4j; import static com.googlecode.charts4j.collect.Preconditions.*; /** * Static factory class for {@link Marker} hierarchy. * * @author <NAME> (<EMAIL>ien.c.chastang at gmail dot com) * */ public final class Markers { /** * Static factory class can never be instantiated. ...
src/main/java/com/googlecode/charts4j/Markers.java
0.956967
0.446012
Markers.java
starcoder
package com.cocorporation.rainbow.utils; import android.graphics.Color; /** * Created by Corentin on 7/9/2016. */ public class Util { public static Point extendSegmentToDistance(float x1, float y1, float x2, float y2, float radius) { Double numerator = (double)(radius * Math.abs(x1 - x2)); Doubl...
Rainbow/src/main/java/com/cocorporation/rainbow/utils/Util.java
0.887711
0.644826
Util.java
starcoder
package boofcv.alg.fiducial.calib.circle; import boofcv.abst.filter.binary.InputToBinary; import boofcv.alg.fiducial.calib.circle.EllipseClustersIntoGrid.Grid; import boofcv.alg.shapes.ellipse.BinaryEllipseDetector; import boofcv.alg.shapes.ellipse.BinaryEllipseDetectorPixel; import boofcv.struct.image.ImageGray; impo...
main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/circle/DetectCircleRegularGrid.java
0.920812
0.623835
DetectCircleRegularGrid.java
starcoder
package org.bc.math.ntru.polynomial; import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.InputStream; import java.security.SecureRandom; import org.bc.util.Arrays; public class ProductFormPolynomial implements Polynomial { private SparseTernaryPolynomial f1; private SparseTernaryPoly...
examples/src/main/java/org/bc/math/ntru/polynomial/ProductFormPolynomial.java
0.799129
0.48621
ProductFormPolynomial.java
starcoder
package net.finmath.montecarlo.assetderivativevaluation; import java.util.Arrays; import java.util.Map; import net.finmath.exception.CalculationException; import net.finmath.functions.LinearAlgebra; import net.finmath.montecarlo.BrownianMotion; import net.finmath.montecarlo.BrownianMotionLazyInit; import net.finmath....
src/main/java/net/finmath/montecarlo/assetderivativevaluation/MonteCarloMultiAssetBlackScholesModel.java
0.927273
0.524273
MonteCarloMultiAssetBlackScholesModel.java
starcoder
package com.revolsys.record.io.format.esri.gdb.xml.type; import java.util.HashMap; import java.util.Map; import org.jeometry.common.data.type.DataType; import org.jeometry.common.data.type.DataTypes; import com.revolsys.geometry.model.GeometryDataTypes; import com.revolsys.record.io.format.esri.gdb.xml.EsriGeodataba...
revolsys-core/src/main/java/com/revolsys/record/io/format/esri/gdb/xml/type/EsriGeodatabaseXmlFieldTypeRegistry.java
0.835819
0.476884
EsriGeodatabaseXmlFieldTypeRegistry.java
starcoder
package com.sap.xsk.parser.xsodata.core; import org.antlr.v4.runtime.tree.AbstractParseTreeVisitor; /** * This class provides an empty implementation of {@link HdbxsodataVisitor}, * which can be extended to create a visitor which only needs to handle a subset * of the available methods. * * @param <T> The return ...
modules/parsers/parser-xsodata/src/main/java/com/sap/xsk/parser/xsodata/core/HdbxsodataBaseVisitor.java
0.895062
0.414662
HdbxsodataBaseVisitor.java
starcoder
package co.edu.uniandes.isis2503.nosqljpa.service; import co.edu.uniandes.isis2503.nosqljpa.auth.AuthorizationFilter.Role; import co.edu.uniandes.isis2503.nosqljpa.auth.Secured; import co.edu.uniandes.isis2503.nosqljpa.interfaces.IMeasurementLogic; import co.edu.uniandes.isis2503.nosqljpa.interfaces.ISensorLogic; impo...
src/main/java/co/edu/uniandes/isis2503/nosqljpa/service/SensorService.java
0.653348
0.574335
SensorService.java
starcoder
package stixar.graph.attr; import java.util.BitSet; /** Attributable objects. <p> Attributable objects subscribe to a contract in which they have <tt>int</tt> identifiers which are unique and either use their attributability in an <em>ad hoc</em> manner, or use it via managed attributes. </p><p>...
src/java/stixar/graph/attr/Attributable.java
0.797911
0.402157
Attributable.java
starcoder
package org.apache.mahout.clustering.evaluation; import java.io.IOException; import java.util.List; import java.util.Map; import com.google.common.collect.Lists; import com.google.common.collect.Maps; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.Path; import org.apache.hadoop.io.IntWritabl...
mahout/integration/src/main/java/org/apache/mahout/clustering/evaluation/RepresentativePointsMapper.java
0.87247
0.451327
RepresentativePointsMapper.java
starcoder
package com.appbestsmile.voicelikeme.audiovisualization; import android.opengl.GLES20; import java.nio.ByteBuffer; import java.nio.ByteOrder; import java.nio.FloatBuffer; import java.nio.ShortBuffer; /** * Rectangle implementation. */ class GLRectangle extends GLShape { private final FloatBuffer vertexBuffer; ...
app/src/main/java/com/appbestsmile/voicelikeme/audiovisualization/GLRectangle.java
0.869174
0.449453
GLRectangle.java
starcoder
package de.micromata.opengis.kml.v_2_2_0; import de.micromata.opengis.kml.v_2_2_0.annotations.Obvious; import de.micromata.opengis.kml.v_2_2_0.atom.Author; import de.micromata.opengis.kml.v_2_2_0.atom.Link; import de.micromata.opengis.kml.v_2_2_0.gx.MultiTrack; import de.micromata.opengis.kml.v_2_2_0.gx.Track; import ...
src/main/java/de/micromata/opengis/kml/v_2_2_0/Placemark.java
0.764892
0.529689
Placemark.java
starcoder
public class Keypad { private int ypos, xpos; public Keypad(int startPos) { intToPos(startPos); } public int getCurrentButton() { return posToInt(ypos, xpos); } public void move(char move) { switch (move) { case 'U': if (ypos > 0) { ...
Day02/Keypad.java
0.563258
0.457318
Keypad.java
starcoder
package com.simonalong.neo.util; import java.sql.Time; import java.sql.Timestamp; import java.text.ParseException; import java.text.SimpleDateFormat; import java.time.*; import java.time.format.DateTimeFormatter; import java.util.Date; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; import java.ut...
src/main/java/com/simonalong/neo/util/TimeUtils.java
0.788746
0.431045
TimeUtils.java
starcoder
package com.colofabrix.java.figlet4s; import com.colofabrix.scala.figlet4s.figfont.FIGfont; import com.colofabrix.scala.figlet4s.figfont.SubColumns; import com.colofabrix.scala.figlet4s.figfont.SubLines; import com.colofabrix.scala.figlet4s.unsafe.FIGureMixin; import java.util.List; import java.util.function.Consumer;...
figlet4s-java/src/main/java/com/colofabrix/java/figlet4s/FIGure.java
0.901673
0.463566
FIGure.java
starcoder
package com.opengg.core.physics.collision; import com.opengg.core.math.FastMath; import com.opengg.core.math.util.Tuple; import com.opengg.core.math.Vector3f; import com.opengg.core.physics.PhysicsEngine; import java.util.ArrayList; import java.util.List; import java.util.stream.Collectors; import java.util.stream.St...
modules/core/classes/com/opengg/core/physics/collision/ContactManifold.java
0.678327
0.427815
ContactManifold.java
starcoder
package javax.config; import java.time.Duration; import java.util.Optional; import javax.config.spi.Converter; /** * Accessor to a configured value. * * It follows a builder-like pattern to define in which ways to access the configured value * of a certain property name. * * Accessing the configured value is...
api/src/main/java/javax/config/ConfigAccessor.java
0.941129
0.423279
ConfigAccessor.java
starcoder
package com.junsung.wpi3; class MapElement { static class Node { double x; double y; Node(double x, double y) { this.x = x; this.y = y; } double getDist(double x, double y) { return Math.sqrt(sqr(this.x-x) + sqr(this.y-y)); } ...
mobile/src/main/java/com/junsung/wpi3/MapElement.java
0.664323
0.570271
MapElement.java
starcoder
package com.google.common.graph; import com.google.common.annotations.Beta; import com.google.errorprone.annotations.CompatibleWith; import java.util.Set; /** * A functional interface for <a * href="https://en.wikipedia.org/wiki/Graph_(discrete_mathematics)">graph</a>-structured data. * * <p>A graph is composed o...
guava/src/com/google/common/graph/SuccessorGraph.java
0.843605
0.565149
SuccessorGraph.java
starcoder
package com.braintreegateway; import com.braintreegateway.util.NodeWrapper; import com.braintreegateway.util.StringUtils; import java.util.*; /** * Represents a collection of (nested) validation errors. Query for validation * errors by object and field. For Example: * * <pre> * TransactionRequest request = new...
src/main/java/com/braintreegateway/ValidationErrors.java
0.941473
0.426202
ValidationErrors.java
starcoder
package org.gradoop.flink.algorithms.gelly.randomjump.functions; import com.google.common.collect.Lists; import org.apache.flink.api.common.aggregators.LongSumAggregator; import org.apache.flink.api.java.tuple.Tuple2; import org.apache.flink.graph.Edge; import org.apache.flink.graph.Vertex; import org.apache.flink.gra...
gradoop-flink/src/main/java/org/gradoop/flink/algorithms/gelly/randomjump/functions/VCIComputeFunction.java
0.94079
0.436322
VCIComputeFunction.java
starcoder
package org.talend.dataprep.date; import static java.time.Instant.ofEpochMilli; import static java.time.Month.*; import static java.time.ZoneId.systemDefault; import static java.time.temporal.IsoFields.QUARTER_OF_YEAR; import java.io.Serializable; import java.time.*; import java.time.temporal.ChronoUnit; import java...
dataprep-backend-common/src/main/java/org/talend/dataprep/date/DateManipulator.java
0.91672
0.52975
DateManipulator.java
starcoder
package tech.pegasys.teku.reference.phase0.rewards; import static java.util.stream.Collectors.toList; import static org.assertj.core.api.Assertions.assertThat; import static tech.pegasys.teku.reference.phase0.TestDataUtils.loadStateFromSsz; import static tech.pegasys.teku.reference.phase0.TestDataUtils.loadYaml; impo...
eth-reference-tests/src/referenceTest/java/tech/pegasys/teku/reference/phase0/rewards/RewardsTestExecutor.java
0.746139
0.450239
RewardsTestExecutor.java
starcoder
package ch.epfl.cs107.play.math; import java.io.Serializable; /** * Represents an immutable 2D floating-point vector. */ public final class Vector implements Serializable { private static final long serialVersionUID = 1; /** Small value for double precision in vector comparison */ public static final doub...
java/ch/epfl/cs107/play/math/Vector.java
0.953351
0.662005
Vector.java
starcoder
package com.google.engedu.touringmusician; import android.graphics.Point; import java.util.Iterator; public class CircularLinkedList implements Iterable<Point> { private class Node { Point point; Node prev, next; Node(Point p){ this.point=p; } } Node head; ...
TouringMusician_starter/app/src/main/java/com/google/engedu/touringmusician/CircularLinkedList.java
0.602529
0.463201
CircularLinkedList.java
starcoder
package de.otto.rx.composer.content; import com.google.common.collect.ImmutableCollection; import com.google.common.collect.ImmutableMap; import de.otto.rx.composer.page.Page; import java.util.Queue; import java.util.concurrent.ConcurrentLinkedQueue; import static com.google.common.collect.ImmutableList.copyOf; impo...
composer-core/src/main/java/de/otto/rx/composer/content/Contents.java
0.926137
0.407805
Contents.java
starcoder
package com.eru.rlbot.bot.optimizer; import com.eru.rlbot.bot.common.Angles; import com.eru.rlbot.bot.common.Angles3; import com.eru.rlbot.bot.common.Constants; import com.eru.rlbot.bot.prediction.CarBallCollision; import com.eru.rlbot.common.Matrix3; import com.eru.rlbot.common.Moment; import com.eru.rlbot.common.inp...
src/main/java/com/eru/rlbot/bot/optimizer/CarBallOptimizer.java
0.799247
0.418578
CarBallOptimizer.java
starcoder
package boofcv.abst.filter.derivative; import boofcv.alg.filter.convolve.GConvolveImageOps; import boofcv.core.image.border.FactoryImageBorder; import boofcv.factory.filter.kernel.FactoryKernelGaussian; import boofcv.struct.border.BorderType; import boofcv.struct.border.ImageBorder; import boofcv.struct.convolve.Kerne...
main/boofcv-ip/src/main/java/boofcv/abst/filter/derivative/ImageGradient_Gaussian.java
0.876595
0.580322
ImageGradient_Gaussian.java
starcoder
package blue.lhf.nxxt.ext; import com.google.inject.internal.Nullable; public class BlueMath { @SuppressWarnings("unused") public static class Random { private final OpenSimplexNoise openSimplex = new OpenSimplexNoise(); private final java.util.Random random = new java.util.Random(); ...
src/main/java/blue/lhf/nxxt/ext/BlueMath.java
0.948478
0.670207
BlueMath.java
starcoder
package com.opengamma.maths.lowlevelapi.linearalgebra.blas.blas2kernelabstractions; import com.opengamma.analytics.math.matrix.Matrix; /** * BLAS2*KernelAbstraction classes are used to kinda emulate function pointer passing. * We want a unified set of BLAS templates with Matrix type, machine and performance specifi...
src/com/opengamma/maths/lowlevelapi/linearalgebra/blas/blas2kernelabstractions/BLAS2DGEMVKernelAbstraction.java
0.765725
0.64072
BLAS2DGEMVKernelAbstraction.java
starcoder
package app.perceptron; import app.util.UtilRand; public class ProcessUnit { private double variationRate; private double learningRate; private double[] weights; private double[] previousVariation; public ProcessUnit(double learningRate, double variationRate) { this.variationRate = learn...
src/main/java/app/perceptron/ProcessUnit.java
0.799325
0.76882
ProcessUnit.java
starcoder
package es.ucm.modelling.fuzzyautomaton.validation.tool; import java.util.ArrayList; import java.util.Collection; import java.util.List; import java.util.Map; import java.util.Set; import java.util.TreeSet; import java.util.concurrent.ConcurrentHashMap; /** * Contains a mapping of names to variables. * <p> * Both ...
FuzzyAutomaton/es.ucm.modelling.fuzzyautomaton.validation.tool/src/es/ucm/modelling/fuzzyautomaton/validation/tool/Scope.java
0.91629
0.511046
Scope.java
starcoder
package io.basestar.schema.validation; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.collect.ImmutableMap; import io.basestar.expression.Context; import io.basestar.expression.Expression; import io.basestar.expression.constant.NameCo...
basestar-schema/src/main/java/io/basestar/schema/validation/AssertValidation.java
0.884077
0.417806
AssertValidation.java
starcoder