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.dataloader;
import org.dataloader.annotations.PublicSpi;
import org.dataloader.impl.CompletableFutureKit;
import org.dataloader.impl.NoOpValueCache;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.CompletableFuture;
/**
* The {@link ValueCache} is used by data loaders that... | src/main/java/org/dataloader/ValueCache.java | 0.844473 | 0.446917 | ValueCache.java | starcoder |
package uk.gov.dstl.baleen.annotators.regex;
import java.text.DecimalFormat;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.apache.uima.UimaContext;
import org.apac... | baleen-annotators/src/main/java/uk/gov/dstl/baleen/annotators/regex/LatLon.java | 0.73077 | 0.411584 | LatLon.java | starcoder |
* Modified by the Sable Research Group and others 1997-1999.
* See the 'credits' file distributed with Soot for the complete list of
* contributors. (Soot is distributed at http://www.sable.mcgill.ca/soot)
*/
package soot.jimple;
import soot.*;
import soot.util.*;
public class LongConstant extends Arithme... | Core/soot/src/main/java/soot/jimple/LongConstant.java | 0.837819 | 0.54583 | LongConstant.java | starcoder |
package org.diirt.datasource.timecache.util;
import java.util.ArrayList;
import java.util.List;
import java.util.Iterator;
import org.diirt.util.time.TimeDuration;
import org.diirt.util.time.TimeInterval;
import org.diirt.util.time.Timestamp;
/**
* This class represents an intervals list. <p> An interval list repre... | pvmanager/pvmanager-timecache/src/main/java/org/diirt/datasource/timecache/util/IntervalsList.java | 0.891188 | 0.403391 | IntervalsList.java | starcoder |
package org.nd4j.linalg.lossfunctions.impl;
import lombok.EqualsAndHashCode;
import org.nd4j.base.Preconditions;
import org.nd4j.linalg.activations.IActivation;
import org.nd4j.linalg.api.ndarray.INDArray;
import org.nd4j.linalg.factory.Nd4j;
import org.nd4j.linalg.lossfunctions.ILossFunction;
import org.nd4j.linalg.l... | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/lossfunctions/impl/LossWasserstein.java | 0.934612 | 0.427098 | LossWasserstein.java | starcoder |
package org.jruby.util;
import org.jruby.runtime.builtin.IRubyObject;
/**
* Support methods for (native) arrays.
*
* These utility methods are intended as `System.arraycopy` replacements esp. for common cases
* such as (method) argument processing, where the arrays are usually small. These are fairly
* common an... | core/src/main/java/org/jruby/util/ArraySupport.java | 0.873458 | 0.524395 | ArraySupport.java | starcoder |
public class Washmap {
private Bucket[] buckets;
private static class Bucket<Type> {
Type value;
int key;
Bucket(int key, Type value) {
this.value = value;
this.key = key;
}
Type getValue() {
return value;
}
int getKe... | src/Washmap.java | 0.848031 | 0.408277 | Washmap.java | starcoder |
package org.apache.cassandra.config;
import org.junit.Test;
import org.apache.cassandra.exceptions.ConfigurationException;
import org.assertj.core.api.Assertions;
public class CassandraRelevantPropertiesTest
{
private static final CassandraRelevantProperties TEST_PROP = CassandraRelevantProperties.ORG_APACHE_CAS... | test/unit/org/apache/cassandra/config/CassandraRelevantPropertiesTest.java | 0.841533 | 0.515742 | CassandraRelevantPropertiesTest.java | starcoder |
package com.solr.ltr.action;
import com.solr.ltr.LtrTestUtils;
import com.solr.ltr.feature.store.StoredFeature;
import com.solr.ltr.feature.store.StoredFeatureSet;
import com.solr.ltr.feature.store.StoredLtrModel;
import com.solr.ltr.feature.store.index.IndexFeatureStore;
import com.solr.ltr.stats.StatName;
import com... | src/javaRestTest/java/com/solr/ltr/action/LTRStatsActionIT.java | 0.767516 | 0.428114 | LTRStatsActionIT.java | starcoder |
package fr.bretzel.wedit.selection;
import net.minecraft.util.math.BlockPos;
import java.util.HashMap;
import java.util.UUID;
public class Selection
{
private static HashMap<UUID, Selection> selections = new HashMap<>();
private BlockPos locationOne;
private BlockPos locationTwo;
private Selection()... | src/main/java/fr/bretzel/wedit/selection/Selection.java | 0.867598 | 0.432063 | Selection.java | starcoder |
package com.increff.commons.lang;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Properties;
import java.util.Set;
import java.util.TreeSet;
import java.util.function.Function;
/**
* Utility... | src/main/java/com/increff/commons/lang/CollectionUtil.java | 0.892293 | 0.527195 | CollectionUtil.java | starcoder |
package jetbrains.exodus;
import jetbrains.exodus.util.LightOutputStream;
import org.jetbrains.annotations.NotNull;
/**
* An adapter of byte array to {@link ByteIterable}.
*/
public class ArrayByteIterable extends ByteIterableBase {
public static final EmptyIterable EMPTY = new EmptyIterable();
private st... | openAPI/src/main/java/jetbrains/exodus/ArrayByteIterable.java | 0.915566 | 0.404684 | ArrayByteIterable.java | starcoder |
package org.apache.lucene.analysis.hunspell;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Locale;
import java.util.stream.Collectors;
/** A class that modifies the given misspelled word in various ways to get correct suggestions */
class ... | lucene/analysis/common/src/java/org/apache/lucene/analysis/hunspell/ModifyingSuggester.java | 0.815122 | 0.407569 | ModifyingSuggester.java | starcoder |
package net.todo.apps.workflows;
import net.fishtron.apps.gpml.MyList;
import net.fishtron.types.Type;
import net.fishtron.types.TypeTerm;
import net.fishtron.types.Types;
import net.fishtron.trees.AppTree;
import net.fishtron.trees.Gamma;
import net.fishtron.gen.Gen;
import net.fishtron.trees.params.Params;
import ne... | src/main/java/net/todo/apps/workflows/Workflows.java | 0.586168 | 0.429669 | Workflows.java | starcoder |
package br.com.eventhorizon.edx.ucsandiego.algs206x.pa1;
import br.com.eventhorizon.common.pa.FastScanner;
import br.com.eventhorizon.common.pa.PA;
import java.util.*;
import java.util.stream.Collectors;
public class MaximalNonBranchingPathsInGraph implements PA {
private static Map<String, List<String>> adjacenc... | EDX/UCSanDiego-AlgorithmsAndDataStructures/ALGS206x-GraphAlgorithmsInGenomeSequencing/src/main/java/br/com/eventhorizon/edx/ucsandiego/algs206x/pa1/MaximalNonBranchingPathsInGraph.java | 0.875534 | 0.453201 | MaximalNonBranchingPathsInGraph.java | starcoder |
package io.nosqlbench.engine.api.activityapi.ratelimits;
import io.nosqlbench.engine.api.activityimpl.ParameterMap;
import io.nosqlbench.engine.api.util.Unit;
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.LogManager;
/**
* <H2>Rate Limiter Specifications</H2>
*
* <P>A rate spec represent ... | engine-api/src/main/java/io/nosqlbench/engine/api/activityapi/ratelimits/RateSpec.java | 0.796174 | 0.498108 | RateSpec.java | starcoder |
package com.acuity.visualisations.rawdatamodel.statistics.filters;
import com.acuity.visualisations.rawdatamodel.filters.ExacerbationFilters;
import com.acuity.visualisations.rawdatamodel.filters.Filters;
import com.acuity.visualisations.rawdatamodel.vo.wrappers.Exacerbation;
public class ExacerbationFiltersSummarySt... | vahub-model/src/main/java/com/acuity/visualisations/rawdatamodel/statistics/filters/ExacerbationFiltersSummaryStatistics.java | 0.820397 | 0.537406 | ExacerbationFiltersSummaryStatistics.java | starcoder |
package com.cosium.vet.thirdparty.apache_commons_lang3.concurrent;
/**
* An interface describing a <a href="http://martinfowler.com/bliki/CircuitBreaker.html">Circuit
* Breaker</a> component.
*
* <p>A <em>circuit breaker</em> can be used to protect an application against unreliable services
* or unexpected load. ... | src/main/java/com/cosium/vet/thirdparty/apache_commons_lang3/concurrent/CircuitBreaker.java | 0.931587 | 0.465327 | CircuitBreaker.java | starcoder |
package org.lwjgl.opengl;
import java.nio.*;
import org.lwjgl.system.*;
import static org.lwjgl.system.Checks.*;
import static org.lwjgl.system.JNI.*;
import static org.lwjgl.system.MemoryUtil.*;
/**
* Native bindings to the <a target="_blank" href="https://www.khronos.org/registry/OpenGL/extensions/NV/NV_explicit... | modules/lwjgl/opengl/src/generated/java/org/lwjgl/opengl/NVExplicitMultisample.java | 0.795579 | 0.486758 | NVExplicitMultisample.java | starcoder |
package com.opengamma.financial.analytics;
import java.util.Set;
import org.apache.commons.lang.Validate;
import com.google.common.collect.Sets;
import com.opengamma.core.position.Position;
import com.opengamma.engine.ComputationTarget;
import com.opengamma.engine.ComputationTargetType;
import com.opengamma.engine.f... | projects/OG-Financial/src/main/java/com/opengamma/financial/analytics/PositionWeightFromNAVFunction.java | 0.872483 | 0.426979 | PositionWeightFromNAVFunction.java | starcoder |
package com.opengamma.analytics.financial.forex.method;
import org.apache.commons.lang.ObjectUtils;
import com.opengamma.analytics.util.amount.SurfaceValue;
import com.opengamma.util.ArgumentChecker;
import com.opengamma.util.money.Currency;
import com.opengamma.util.money.CurrencyAmount;
import com.opengamma.util.tu... | projects/OG-Analytics/src/main/java/com/opengamma/analytics/financial/forex/method/PresentValueForexBlackVolatilitySensitivity.java | 0.955734 | 0.598987 | PresentValueForexBlackVolatilitySensitivity.java | starcoder |
package net.minecraft.server;
import java.util.List;
import java.util.Random;
public class WorldGenVillageHouse extends WorldGenVillagePiece {
private boolean a;
public WorldGenVillageHouse() {}
public WorldGenVillageHouse(WorldGenVillageStartPiece worldgenvillagestartpiece, int i, Random random, Struc... | libs/craftbukkit/src/main/java/net/minecraft/server/WorldGenVillageHouse.java | 0.588298 | 0.437283 | WorldGenVillageHouse.java | starcoder |
package Tree;
import java.util.ArrayList;
import java.util.List;
import java.util.Stack;
/**
* Given a binary search tree and a target node K. The task is to find the node with
* minimum absolute difference with given target value K.
*/
public class FindClosestElementBST {
static class Node {
int key;
... | src/main/java/Tree/FindClosestElementBST.java | 0.867485 | 0.514278 | FindClosestElementBST.java | starcoder |
package com.ddf.fakeplayer.item;
import com.ddf.fakeplayer.item.items.TridentItem;
import com.ddf.fakeplayer.util.NotImplemented;
public class VanillaItems {
public static Item mShovel_iron;
public static Item mPickAxe_iron;
public static Item mHatchet_iron;
public static Item mFlintAndSteel;
publ... | src/main/java/com/ddf/fakeplayer/item/VanillaItems.java | 0.549157 | 0.472683 | VanillaItems.java | starcoder |
package net.tascalate.javaflow.function;
import java.util.Comparator;
import java.util.Objects;
/**
* Represents an continuable operation upon two operands of the same type, producing a result
* of the same type as the operands. This is a specialization of
* {@link SuspendableBiFunction} for the case where the o... | src/main/java/net/tascalate/javaflow/function/SuspendableBinaryOperator.java | 0.935546 | 0.58596 | SuspendableBinaryOperator.java | starcoder |
package org.strongback.command;
import java.util.Collection;
import java.util.Set;
import java.util.concurrent.TimeUnit;
import java.util.function.BooleanSupplier;
import java.util.function.Supplier;
import org.strongback.Strongback;
import org.strongback.control.Controller;
import org.strongback.util.Collections;
... | src/main/java/org/strongback/command/Command.java | 0.897673 | 0.504028 | Command.java | starcoder |
package shape2D;
import java.awt.Color;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.GradientPaint;
import java.awt.BasicStroke;
/*
* Author: <NAME>
* Date: July 9, 2018
* Desc: Create a class containing properties of a visual 2-D line.This class inherits from the Shape class
... | src/shape2D/Line.java | 0.810704 | 0.409634 | Line.java | starcoder |
package us.ihmc.avatar.stepAdjustment;
import us.ihmc.commonWalkingControlModules.configurations.SteppingParameters;
import us.ihmc.euclid.referenceFrame.FrameConvexPolygon2D;
import us.ihmc.euclid.referenceFrame.ReferenceFrame;
import us.ihmc.euclid.referenceFrame.interfaces.FrameConvexPolygon2DBasics;
import us.ihmc... | ihmc-avatar-interfaces/src/main/java/us/ihmc/avatar/stepAdjustment/ReachabilityConstraintCalculator.java | 0.874279 | 0.429908 | ReachabilityConstraintCalculator.java | starcoder |
package com.aliasi.spell;
import com.aliasi.util.Distance;
import com.aliasi.util.Proximity;
/**
* The <code>WeightedEditDistance</code> class implements both the
* proximity and distance interfaces based on the negative proximity
* weights assigned to independent atomic edit operations.
*
* <h4>Weights Scaled a... | aliasi-lingpipe/src/main/java/com/aliasi/spell/WeightedEditDistance.java | 0.941708 | 0.625038 | WeightedEditDistance.java | starcoder |
package com.rayferric.comet.core.scenegraph.node.physics;
import com.rayferric.comet.core.math.Vector3f;
import com.rayferric.comet.core.scenegraph.resource.physics.PhysicsBodyResource;
import com.rayferric.comet.core.util.AtomicFloat;
import java.util.Queue;
import java.util.concurrent.ConcurrentLinkedQueue;
import ... | comet-core/src/main/java/com/rayferric/comet/core/scenegraph/node/physics/PhysicsBody.java | 0.92253 | 0.522872 | PhysicsBody.java | starcoder |
package com.github.nilscoding.seqdatastore;
import java.io.InputStream;
import java.util.Date;
/**
* Binary input, reading data from a stream<br>
* When using the marker mask, data might be empty and the stream must support skip(n)
* @author NilsCoding
*/
public class BinaryInput {
protected final InputS... | src/main/java/com/github/nilscoding/seqdatastore/BinaryInput.java | 0.835785 | 0.46217 | BinaryInput.java | starcoder |
package stl.threebodysimulation;
import java.util.ArrayList;
/**
* A class that packages simulation settings
*/
class SimulationSettings {
/**
* Particle array to be simulated.
*/
private final Particle[] particles;
/**
* Whether the simulation runs continuously.
*/
private fin... | src/main/java/stl/threebodysimulation/SimulationSettings.java | 0.918841 | 0.632602 | SimulationSettings.java | starcoder |
package ar.edu.itba.ss.models;
import ar.edu.itba.ss.io.Input;
import java.awt.geom.Point2D;
import java.util.Optional;
import java.util.concurrent.ThreadLocalRandom;
public class Particle {
private static Long serial_id = Long.valueOf(0);
private final Long id;
private final double radius;
private ... | src/main/java/ar/edu/itba/ss/models/Particle.java | 0.854217 | 0.602968 | Particle.java | starcoder |
package edu.itu.the_d.map.dataprocessing;
import edu.itu.the_d.map.datastructures.Pair;
import java.util.*;
/**
* Class used to store data from the osm file.
* <p>
* Copyright 2016 The-D
*/
public class OSMObject {
public Map<String, String> tagsMap;
public Set<Pair<Long, String>> memberSet;
private ... | src/edu/itu/the_d/map/dataprocessing/OSMObject.java | 0.913404 | 0.44342 | OSMObject.java | starcoder |
package hmi.math;
import static org.junit.Assert.*;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
public class SpatialVecTest
{
@Before
public void setUp() throws Exception
{
}
@After
public void tearDown() throws Exception
{
}
@Te... | test/hmi/math/SpatialVecTest.java | 0.515132 | 0.404713 | SpatialVecTest.java | starcoder |
package com.opengamma.financial.security.lookup;
import com.opengamma.financial.currency.CurrencyPair;
import com.opengamma.financial.currency.CurrencyPairs;
import com.opengamma.financial.currency.CurrencyUtils;
import com.opengamma.util.ArgumentChecker;
import com.opengamma.util.money.Currency;
/**
* The two curre... | projects/financial/src/main/java/com/opengamma/financial/security/lookup/FXAmounts.java | 0.93161 | 0.556761 | FXAmounts.java | starcoder |
package com.opengamma.analytics.financial.equity.variance;
import org.apache.commons.lang.Validate;
import com.opengamma.analytics.financial.equity.AbstractDerivativeVisitor;
import com.opengamma.analytics.financial.equity.Derivative;
import com.opengamma.analytics.financial.equity.StaticReplicationDataBundle;
import... | src/com/opengamma/analytics/financial/equity/variance/VarianceSwapPresentValueCalculator.java | 0.914358 | 0.596874 | VarianceSwapPresentValueCalculator.java | starcoder |
package cgeo.geocaching.utils;
import android.util.Pair;
import androidx.core.util.Predicate;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Set;
/**
* Simple Parser, able to perform common parsing operations on a string
*/
public final class TextParser {
pu... | main/src/cgeo/geocaching/utils/TextParser.java | 0.923165 | 0.437643 | TextParser.java | starcoder |
package com.android.server.utils;
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.util.SparseIntArray;
/**
* A watched variant of SparseIntArray. Changes to the array are notified to
* registered {@link Watcher}s.
*/
public class WatchedSparseIntArray extends WatchableImpl
... | android-31/src/com/android/server/utils/WatchedSparseIntArray.java | 0.941607 | 0.413418 | WatchedSparseIntArray.java | starcoder |
package org.elixir_lang.parser_definition;
import static org.elixir_lang.Level.V_1_4;
import static org.elixir_lang.Level.V_1_5;
import static org.elixir_lang.test.ElixirVersion.elixirSdkLevel;
/**
* Created by luke.imhoff on 9/17/14.
*/
public class BracketOperationParsingTestCase extends ParsingTestCase {
/*... | tests/org/elixir_lang/parser_definition/BracketOperationParsingTestCase.java | 0.732018 | 0.654149 | BracketOperationParsingTestCase.java | starcoder |
package com.xy1m.cci.chapter04_tree_graph;
import com.xy1m.cci.lib.TreeNode;
/**
* Check Subtree: Tl and T2 are two very large binary trees, with Tl much bigger than T2. Create an algorithm to
* determine if T2 is a subtree of Tl.
* A tree T2 is a subtree of Tl if there exists a node n in Tl such that the subtree ... | src/main/java/com/xy1m/cci/chapter04_tree_graph/Q4_10_CheckSubtree.java | 0.878047 | 0.44746 | Q4_10_CheckSubtree.java | starcoder |
public class PercolationStats {
private double[] xs;
private int T;
/**
* perform T independent experiments on an N-by-N grid
*
* @param N
* @param T
*/
public PercolationStats(int N, int T) {
if (N <= 0 || T <= 0)
throw new IllegalArgumentException();
... | Programming Assignment 1: Percolation/src/main/java/PercolationStats.java | 0.892498 | 0.434581 | PercolationStats.java | starcoder |
package org.dockbox.hartshorn.util;
import org.checkerframework.checker.nullness.qual.Nullable;
import java.time.Duration;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public final class StringUtilities {
private static final Pattern minorTimeString = Pattern.compile("^\\d+$");
private st... | hartshorn-core/src/main/java/org/dockbox/hartshorn/util/StringUtilities.java | 0.858081 | 0.534612 | StringUtilities.java | starcoder |
package com.epi;
public class PopulatingNextRightPointers {
public static class BinaryTreeNode<T> {
public T data;
public BinaryTreeNode<T> left, right;
public BinaryTreeNode<T> next; // Populates this field.
public BinaryTreeNode(T data) { this.data = data; }
}
// @include
public static void... | java/src/main/java/com/epi/PopulatingNextRightPointers.java | 0.867766 | 0.598752 | PopulatingNextRightPointers.java | starcoder |
package com.alibaba.nacos.istio.model.mcp;
public interface MetadataOrBuilder extends
// @@protoc_insertion_point(interface_extends:istio.mcp.v1alpha1.Metadata)
com.google.protobuf.MessageOrBuilder {
/**
* <pre>
* Fully qualified name of the resource. Unique in context of a collection.
* The fully... | istio/src/main/java/com/alibaba/nacos/istio/model/mcp/MetadataOrBuilder.java | 0.813905 | 0.537041 | MetadataOrBuilder.java | starcoder |
package com.apple.foundationdb.record.query.plan.temp;
import com.apple.foundationdb.record.query.plan.temp.matchers.ExpressionMatcher;
import com.apple.foundationdb.record.query.plan.temp.matchers.PlannerBindings;
import com.google.common.base.Suppliers;
import com.google.common.collect.ImmutableList;
import javax.a... | fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/temp/PartialMatch.java | 0.839438 | 0.507263 | PartialMatch.java | starcoder |
package javax.persistence.criteria;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.Collection;
import java.util.Map;
import java.util.Set;
import javax.persistence.Tuple;
public interface CriteriaBuilder {
CriteriaQuery<Object> createQuery();
<T> CriteriaQuery<T> createQuery(Cla... | geronimo-jpa_2.0_spec/src/main/java/javax/persistence/criteria/CriteriaBuilder.java | 0.745584 | 0.489198 | CriteriaBuilder.java | starcoder |
package com.fenbi.ytklearn.loss;
/**
* @author xialong
*/
public class MulticlassSmoothHingeFunction implements ILossFunction {
private int target(double []label) {
int target = -1;
for (int i = 0; i < label.length; i++) {
if (label[i] == 1.0) {
target = i;
... | src/main/java/com/fenbi/ytklearn/loss/MulticlassSmoothHingeFunction.java | 0.915844 | 0.438424 | MulticlassSmoothHingeFunction.java | starcoder |
package org.tensorflow.op.tpu;
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
import org.tensorflow.Operand;
import org.tensorflow.Operation;
import org.tensorflow.OperationBuilder;
import org.tensorflow.Output;
import org.tensorflow.op.RawOp;
import org.tensorflow.op.Scope;
import org.ten... | tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/PartitionedOutput.java | 0.938815 | 0.475605 | PartitionedOutput.java | starcoder |
package org.engineFRP.maths;
/**
* Based on BennyBox's GameEngine https://github.com/BennyQBD/3DGameEngine.
* Created by TekMaTek on 05/08/2014.
*/
public class Matrix4f {
private float[][] m;
public Matrix4f( ) {
m = new float[ 4 ][ 4 ];
}
public Matrix4f initCamera( Vector3f forward, Vector3f up ) {
Ve... | src/org/engineFRP/maths/Matrix4f.java | 0.799481 | 0.566019 | Matrix4f.java | starcoder |
package pers.tavish.leetcode.hard;
/*
We can scramble a string s to get a string t using the following algorithm:
If the length of the string is 1, stop.
If the length of the string is > 1, do the following:
Split the string into two non-empty substrings at a random index, i.e., if the string is s, divide it to x an... | src/main/java/pers/tavish/leetcode/hard/ScrambleString.java | 0.741487 | 0.482063 | ScrambleString.java | starcoder |
package me.wobblyyyy.pathfinder.tracking;
import me.wobblyyyy.pathfinder.geometry.HeadingPoint;
import me.wobblyyyy.pathfinder.geometry.Point;
import me.wobblyyyy.pathfinder.robot.Encoder;
import me.wobblyyyy.pathfinder.util.Distance;
/**
* Track a single point in a two-dimensional environment.
*
* <p>
* All of t... | src/main/java/me/wobblyyyy/pathfinder/tracking/PointTracker.java | 0.829492 | 0.428413 | PointTracker.java | starcoder |
package com.google.common.graph;
import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.base.Preconditions.checkNotNull;
import static com.google.common.base.Preconditions.checkState;
import static com.google.common.graph.GraphConstants.PARALLEL_EDGES_NOT_ALLOWED;
import stat... | guava/src/com/google/common/graph/ConfigurableMutableNetwork.java | 0.931033 | 0.471832 | ConfigurableMutableNetwork.java | starcoder |
package lineage;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
public class LineageTree implements Comparable<LineageTree> {
protected HashMap<Integer, TreeNode> nodes;
protected HashMap<Integer, ArrayList<Integer>> edges;
//protected HashMap<Integer, >
protected int num... | src/lineage/LineageTree.java | 0.66061 | 0.512998 | LineageTree.java | starcoder |
package org.hisp.dhis.android.core.event;
import static junit.framework.Assert.assertTrue;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.core.Is.is;
import com.google.common.truth.Truth;
import org.hisp.dhis.android.core.D2;
import org.hisp.dhis.android.core.common.D2Factory;
impor... | core/src/androidTest/java/org/hisp/dhis/android/core/event/EventEndPointCallRealIntegrationShould.java | 0.529993 | 0.402921 | EventEndPointCallRealIntegrationShould.java | starcoder |
package org.apache.hadoop.hive.common.type;
import java.math.BigDecimal;
import java.util.concurrent.TimeUnit;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.apache.commons.lang3.builder.HashCodeBuilder;
import org.apache.hive.common.util.IntervalDayTimeUtils;
/**
* Day-time interval ty... | storage-api/src/java/org/apache/hadoop/hive/common/type/HiveIntervalDayTime.java | 0.908922 | 0.444083 | HiveIntervalDayTime.java | starcoder |
package org.openstreetmap.atlas.geography.atlas.lightweight;
import java.util.Arrays;
import java.util.Collections;
import java.util.Set;
import java.util.stream.Collectors;
import java.util.stream.LongStream;
import org.openstreetmap.atlas.geography.Location;
import org.openstreetmap.atlas.geography.atlas.complete.E... | src/main/java/org/openstreetmap/atlas/geography/atlas/lightweight/LightPoint.java | 0.923368 | 0.411347 | LightPoint.java | starcoder |
package de.gsi.dataset.serializer;
import java.util.concurrent.locks.ReadWriteLock;
/**
* Interface definition in line with the jdk Buffer abstract class. This definition is needed to allow to redirect and
* allow for different buffer implementations.
* <p>
* A buffer is a linear, finite sequence of elements of a... | chartfx-dataset/src/main/java/de/gsi/dataset/serializer/IoBufferHeader.java | 0.938899 | 0.446072 | IoBufferHeader.java | starcoder |
package zhaoyu.DataStructures.Trees.AVL;
import zhaoyu.DataStructures.Trees.BST.BinarySearchTree;
import zhaoyu.DataStructures.Trees.BST.BinaryTree;
/**
* @Description: AVL是一种平衡二叉搜索树。旋转(rotate)不会破会二叉搜索树的特性,AVL就是通过旋转保证AVL的平衡。
* AVL需要判断节点告诉是否平衡,所以需要记录节点的高度。
* @Author: zhaoyu
* @Date: 2021/1/26
*/
public class... | zhaoyu/DataStructures/Trees/AVL/AVLTree.java | 0.592667 | 0.419826 | AVLTree.java | starcoder |
package org.yu55.pwjpa21.inheritance1;
import javax.persistence.*;
/*
@Inheritance strategy by default is SINGLE_TABLE. All attributes from entities hierarchy are mapped to ONE table in
database. This table also has a discriminator column (DTYPE) for persistence provider to know how to map each row into
which entity.... | src/main/java/org/yu55/pwjpa21/inheritance1/Vehicle.java | 0.805403 | 0.416263 | Vehicle.java | starcoder |
package gheat.graphics;
import java.awt.*;
import java.awt.image.ColorModel;
import java.awt.image.DataBuffer;
import java.awt.image.DirectColorModel;
import java.awt.image.RasterFormatException;
/**
* <p>A blend composite defines the rule according to which a drawing primitive
* (known as the source) is mixed with... | JavaHeatMaps/gheat/src/main/java/gheat/graphics/BlendComposite.java | 0.910998 | 0.461441 | BlendComposite.java | starcoder |
package cz.cvut.fel.ida.utils.math.collections;
import cz.cvut.fel.ida.utils.math.VectorUtils;
import java.util.*;
/**
* Created by ondrejkuzelka on 13/10/16.
*/
public class LongSet {
private int hashCode = -1;
private long[] values;
/**
* The unique empty set
*/
public final static E... | Utilities/src/main/java/cz/cvut/fel/ida/utils/math/collections/LongSet.java | 0.780537 | 0.546799 | LongSet.java | starcoder |
package io.deephaven.db.v2.utils;
import org.junit.Test;
import static org.junit.Assert.*;
public class ComplementRangeIteratorTest {
@Test
public void testSimpleComplement() {
final Index ix = Index.FACTORY.getEmptyIndex();
ix.insertRange(10, 20);
ix.insertRange(22, 40);
ix.i... | DB/benchmark/io/deephaven/db/v2/utils/ComplementRangeIteratorTest.java | 0.781247 | 0.671918 | ComplementRangeIteratorTest.java | starcoder |
package com.yahoo.collections;
/**
* Lightweight hash map from key to value with limited
* functionality. This class lets you build a map from key to
* value. The value for a key may be overwritten and the put and get
* methods have the same semantics as for normal Java Maps, but there
* is no remove operation. ... | vespajlib/src/main/java/com/yahoo/collections/Hashlet.java | 0.937769 | 0.570212 | Hashlet.java | starcoder |
package com.jme.intersection;
import java.nio.IntBuffer;
import com.jme.math.FastMath;
import com.jme.math.TransformMatrix;
import com.jme.math.Vector2f;
import com.jme.math.Vector3f;
import com.jme.scene.TriMesh;
import com.jme.util.geom.BufferUtils;
/**
* <code>Intersection</code> provides functional methods for ... | lib/jME2_0_1-Stable/src/com/jme/intersection/Intersection.java | 0.883626 | 0.565719 | Intersection.java | starcoder |
package gov.va.med.imaging;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
* @author VHAISWBECKEC
*
*/
public enum BinaryOrdersOfMagnitude
{
B("Byte", BigInteger.valueOf(1L)),
KB("Kilobyte", BigInteger.valueOf(1024L) ),
MB("Megabyte"... | Source/Java/ImagingCommon/main/src/java/gov/va/med/imaging/BinaryOrdersOfMagnitude.java | 0.878503 | 0.408513 | BinaryOrdersOfMagnitude.java | starcoder |
package ru.otus.l021.supply;
import java.util.Collection;
import java.util.concurrent.ThreadLocalRandom;
import java.util.function.IntFunction;
import java.util.function.Supplier;
import java.util.stream.Stream;
public interface ObjectsSupplier<T> {
Stream<MeasurableObject<? extends T>> objects();
static Obj... | L02.1-memory/src/main/java/ru/otus/l021/supply/ObjectsSupplier.java | 0.758421 | 0.422981 | ObjectsSupplier.java | starcoder |
package de.ruhrunibochum.lecture;
import de.ruhrunibochum.recording.record.LectureRecord;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
/**
* LectureSeries class with basic attributes
*/
public class LectureSeries {
private final Map<Integer, Lecture> lecturesList;
private int lect... | src/main/java/de/ruhrunibochum/lecture/LectureSeries.java | 0.900362 | 0.606149 | LectureSeries.java | starcoder |
package no.ion.jake.graph;
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;
public class Graph<T> {
private final HashSet<Vertex<T>> vertices;
public static <ID extends NodeId, U> Graph<U> fromAda... | src/no/ion/jake/graph/Graph.java | 0.922696 | 0.457379 | Graph.java | starcoder |
package io.gmas.fuze.commons.utils;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
public class ListUtils {
private ListUtils() {
throw new AssertionError();
}
/**
* Retu... | app/src/main/java/io/gmas/fuze/commons/utils/ListUtils.java | 0.882889 | 0.542682 | ListUtils.java | starcoder |
import org.testng.Assert;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;
import java.io.ObjectInputFilter;
import java.io.ObjectInputFilter.FilterInfo;
import java.util.function.Predicate;
import static java.io.ObjectInputFilter.Status;
import static java.io.ObjectInputFilter.Status.A... | test/jdk/java/io/Serializable/serialFilter/SerialFilterFunctionTest.java | 0.803521 | 0.420778 | SerialFilterFunctionTest.java | starcoder |
package venda.negocio;
import venda.dominio.Produto;
import venda.dao.ProdutoDao;
import venda.dao.impl_BD.ProdutoDaoBd;
import java.util.List;
/**
*
* @author 691001155
*/
public class ProdutoNegocio {
private ProdutoDao produtoDao;
public ProdutoNegocio() {
produtoDao = new ProdutoDaoBd();
... | TrabalhoFinal/src/venda/negocio/ProdutoNegocio.java | 0.607314 | 0.462291 | ProdutoNegocio.java | starcoder |
begin_unit|revision:0.9.5;language:Java;cregit-version:0.0.1
begin_comment
comment|/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses... | ql/src/java/org/apache/hadoop/hive/ql/exec/vector/keyseries/VectorKeySeriesSingleImpl.java | 0.677261 | 0.413359 | VectorKeySeriesSingleImpl.java | starcoder |
package org.redquark.leetcoding.challenge;
import java.util.LinkedList;
import java.util.Queue;
/**
* @author <NAME>
* <p>
* Given the root of a binary tree with unique values and the values of two different nodes of the tree x and y,
* return true if the nodes corresponding to the values x and y in the tree are ... | october-2021-leetcoding-challenge/src/main/java/org/redquark/leetcoding/challenge/Problem18_CousinsInBinaryTree.java | 0.896178 | 0.656906 | Problem18_CousinsInBinaryTree.java | starcoder |
package org.lwjgl.opengl;
import javax.annotation.*;
import java.nio.*;
import org.lwjgl.*;
import org.lwjgl.system.*;
import static org.lwjgl.system.APIUtil.*;
import static org.lwjgl.system.Checks.*;
import static org.lwjgl.system.JNI.*;
import static org.lwjgl.system.MemoryStack.*;
import static org.lwjgl.syste... | modules/lwjgl/opengl/src/generated/java/org/lwjgl/opengl/EXTDirectStateAccess.java | 0.780913 | 0.60364 | EXTDirectStateAccess.java | starcoder |
package org.web3j.crypto;
import java.math.BigInteger;
import org.web3j.utils.Bech32;
import org.web3j.utils.Numeric;
/**
* Transaction class used for signing transactions locally.<br>
* For the specification, refer to p4 of the <a href="http://gavwood.com/paper.pdf">yellow
* paper</a>.
*/
public class RawTransa... | crypto/src/main/java/org/web3j/crypto/RawTransaction.java | 0.858659 | 0.471771 | RawTransaction.java | starcoder |
package oolala.model.parsers;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Set;
import oolala.model.exceptions.IncorrectCommand;
import oolala.model.turtle.TurtleMethod;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static org.junit.ju... | test/oolala/model/parsers/LSystemParserTest.java | 0.752831 | 0.407363 | LSystemParserTest.java | starcoder |
package fr.isae.mae.ss;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Locale;
import org.hipparchus.geometry.euclidean.threed.Vector3D;
import org.hipparchus.util.FastMath;
import org.orekit.bodies.G... | src/main/java/fr/isae/mae/ss/OrbitGenerator.java | 0.656768 | 0.40392 | OrbitGenerator.java | starcoder |
package chapter12.BST_Successor;
import java.util.ArrayList;
import java.util.List;
public class InOrderSuccessor {
public class TreeNode {
int val;
TreeNode left;
TreeNode right;
TreeNode(int n) {
this.val = n;
}
}
// 40
// / \
// 20 60
//... | src/main/java/chapter12/BST_Successor/InOrderSuccessor.java | 0.805976 | 0.479565 | InOrderSuccessor.java | starcoder |
package com.opengamma.financial.interestrate.future.method;
import org.apache.commons.lang.Validate;
import com.opengamma.financial.interestrate.InterestRateDerivative;
import com.opengamma.financial.interestrate.PresentValueSABRSensitivityDataBundle;
import com.opengamma.financial.interestrate.InterestRateCurveSensi... | projects/OG-Analytics/src/com/opengamma/financial/interestrate/future/method/InterestRateFutureOptionMarginTransactionSABRMethod.java | 0.948131 | 0.603523 | InterestRateFutureOptionMarginTransactionSABRMethod.java | starcoder |
package org.kie.internal.query;
/**
* This is the base interface for all {@link ParametrizedQueryBuilder} implementations.
* </p>
* It includes the basic query functions.
*
* @param <T> The type of {@link ParametrizedQueryBuilder} instance being implemented. This type
* is here to facilitate the building of a ... | kie-internal/src/main/java/org/kie/internal/query/ParametrizedQueryBuilder.java | 0.945814 | 0.482429 | ParametrizedQueryBuilder.java | starcoder |
package org.bklab.util;
import java.time.Instant;
import java.time.LocalDate;
import java.time.ZoneId;
import java.time.format.DateTimeFormatter;
import java.util.*;
import java.util.stream.Collectors;
import java.util.stream.LongStream;
@SuppressWarnings({"WeakerAccess", "FieldCanBeLocal"})
public class LocalDateRa... | src/main/java/org/bklab/util/LocalDateRange.java | 0.840423 | 0.503357 | LocalDateRange.java | starcoder |
package hypervolume;
import static org.junit.Assert.*;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import java.util.Random;
/**
* The test class EstimatorsTest.
*
* Class provides tests comparing the different estimators
*
* @author <NAME>
* @version 07/05/2019
*/
public class Esti... | hypervolume/EstimatorsTest.java | 0.829803 | 0.433262 | EstimatorsTest.java | starcoder |
import java.io.IOException;
import java.util.ArrayList;
/**
* Calculates the average ASCII value each character in a sting and then reports
* other String objects with the same average
*
* @author <NAME>
* @version 2.21
*/
public class LetterAvg {
/**
* Storage of constructor parameter
*/
private char let... | Java/Java 2/Code Examples/11 - Abstraction Project/src/LetterAvg.java | 0.813535 | 0.417568 | LetterAvg.java | starcoder |
package java.util;
import java.util.concurrent.CountedCompleter;
import java.util.concurrent.RecursiveTask;
/**
* This class implements powerful and fully optimized versions, both
* sequential and parallel, of the Dual-Pivot Quicksort algorithm by
* <NAME>, <NAME> and <NAME>. This algorithm
* offers O(n log(n)) p... | classlib/java.base/src/main/resources/META-INF/modules/java.base/classes/java/util/DualPivotQuicksort.java | 0.923459 | 0.442396 | DualPivotQuicksort.java | starcoder |
package org.seedstack.samples.ddd.domain.model.voyage;
import java.util.Date;
import org.apache.commons.lang.Validate;
import org.mongodb.morphia.annotations.Embedded;
import org.seedstack.business.domain.BaseValueObject;
import org.seedstack.samples.ddd.domain.model.location.Location;
import org.seedstack.samples.ddd... | src/main/java/org/seedstack/samples/ddd/domain/model/voyage/CarrierMovement.java | 0.791781 | 0.404125 | CarrierMovement.java | starcoder |
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Correctness Tests for Sorting Algorithms.
*
* @author <NAME>, <NAME>
*/
public class MySortingAlgorithmsTest {
private SortingAlgorithm[] algorithms = {
new MySortingAlgorithms.InsertionSort(),
new MySortingAlgorithms.Sel... | hw7/MySortingAlgorithmsTest.java | 0.740737 | 0.51623 | MySortingAlgorithmsTest.java | starcoder |
package chapter3_2_BST;
import chapter3_1_SymbolTable.ST;
import java.util.List;
public class BST implements ST {
private Node root;
@Override
public Integer get(int key) {
return get(root, key);
}
private Integer get(Node node, int key) {
if (node == null) {
return ... | algorithms-princeton/src/main/java/chapter3_2_BST/BST.java | 0.84124 | 0.415314 | BST.java | starcoder |
package fem;
import java.util.ArrayList;
import inf.jlinalg.Vector3D;
import inf.v3d.obj.Arrow;
import inf.v3d.obj.Cone;
import inf.v3d.obj.Cylinder;
import inf.v3d.obj.PolygonSet;
import inf.v3d.view.Viewer;
public class Visualizer {
// attributes
private double displacementScale = 1;
private double constraintSc... | src/fem/Visualizer.java | 0.550849 | 0.463444 | Visualizer.java | starcoder |
package com.xinonix.hl7.fhir.stu3;
import java.util.ArrayList;
import com.google.gson.annotations.Expose;
/**
* Significant health events and conditions for a person related to the patient relevant in the context of care for the patient.
*/
public class FamilyMemberHistoryCondition extends BackboneElement {
@Exp... | src/main/java/com/xinonix/hl7/fhir/stu3/FamilyMemberHistoryCondition.java | 0.742422 | 0.526525 | FamilyMemberHistoryCondition.java | starcoder |
package org.enricogiurin.codingchallenges.leetcode.y2022.easy;
import java.util.LinkedList;
import java.util.List;
/*
ou are given a phone number as a string number. number consists of digits, spaces ' ', and/or dashes '-'.
You would like to reformat the phone number in a certain manner. Firstly, remove all spaces a... | src/main/java/org/enricogiurin/codingchallenges/leetcode/y2022/easy/ReformatPhoneNumber.java | 0.617743 | 0.689743 | ReformatPhoneNumber.java | starcoder |
package image;
import engine.math.Matrix4f;
import engine.math.Vector2f;
import engine.math.Vector3f;
import engine.model.RawModel;
import engine.renderEngine.DisplayManager;
import engine.renderEngine.Loader;
import engine.toolbox.Maths;
import org.lwjgl.BufferUtils;
import java.nio.FloatBuffer;
import java.util.con... | src/image/ParticleRenderer.java | 0.673084 | 0.503235 | ParticleRenderer.java | starcoder |
package com.github.drapostolos.typeparser;
import static com.github.drapostolos.typeparser.Util.makeNullArgumentErrorMsg;
import java.lang.reflect.Type;
import java.util.Collections;
import java.util.List;
/**
* Helper class providing helper methods to implementations of {@link Parser} when parsing a
* string to a... | src/main/java/com/github/drapostolos/typeparser/ParserHelper.java | 0.95562 | 0.489564 | ParserHelper.java | starcoder |
* Tracks asynchronous executions and allows retries to be scheduled according to a {@link RetryPolicy}.
*
* @author <NAME>
*/
package org.eclipse.microprofile.faulttolerance;
public interface AsyncExecution extends Execution {
/**
* Completes the execution and the associated {@code Future}.
*
* @throws... | src/main/java/org/eclipse/microprofile/faulttolerance/AsyncExecution.java | 0.905826 | 0.476032 | AsyncExecution.java | starcoder |
package com.opengamma.strata.math.impl.function;
import java.util.Arrays;
import com.google.common.math.DoubleMath;
import com.opengamma.strata.collect.ArgChecker;
/**
* Class representing a polynomial that has real coefficients and takes a real
* argument. The function is defined as:
* $$
* \begin{align*}
* p(... | modules/math/src/main/java/com/opengamma/strata/math/impl/function/RealPolynomialFunction1D.java | 0.96569 | 0.85984 | RealPolynomialFunction1D.java | starcoder |
package us.ihmc.scs2.definition.geometry;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;
import java.util.stream.Collectors;
import javax.xml.bind.annotation.XmlElement;
import us.ihmc.euclid.tools.EuclidCoreIOTools;
import us.ihmc.euclid.tools.EuclidHashCode... | scs2-definition/src/main/java/us/ihmc/scs2/definition/geometry/Polygon2DDefinition.java | 0.945513 | 0.526891 | Polygon2DDefinition.java | starcoder |
package pedsimcity.graph;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import com.vividsolutions.jts.geom.Coordinate;
import com.vividsol... | graph/Graph.java | 0.924283 | 0.52074 | Graph.java | starcoder |
package org.ejml.interfaces.decomposition;
import org.ejml.data.Matrix;
/**
* <p>
* QR decompositions decompose a rectangular matrix 'A' such that 'A=QR'. Where
* A ∈ ℜ <sup>n × m</sup> , n ≥ m, Q ∈ ℜ <sup>n × n</sup> is an orthogonal matrix,
* and R ∈ ℜ <sup>n &time... | main/ejml-core/src/org/ejml/interfaces/decomposition/QRDecomposition.java | 0.946855 | 0.542621 | QRDecomposition.java | starcoder |
package game;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Point;
import java.awt.geom.AffineTransform;
import java.awt.geom.NoninvertibleTransformException;
import java.awt.geom.Point2D;
import java.util.Vector;
//documented
/**
* Renderables is a simple 2D rendering tree structured class.... | src/game/Renderable.java | 0.739422 | 0.478102 | Renderable.java | starcoder |
package com.opengamma.strata.basics.index;
import static com.opengamma.strata.collect.Guavate.toImmutableSet;
import java.io.Serializable;
import java.util.Map;
import java.util.NoSuchElementException;
import java.util.Set;
import org.joda.beans.Bean;
import org.joda.beans.BeanBuilder;
import org.joda.beans.BeanDefi... | modules/basics/src/main/java/com/opengamma/strata/basics/index/ImmutableFloatingRateName.java | 0.892977 | 0.499634 | ImmutableFloatingRateName.java | starcoder |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.