Datasets:
Dataset Viewer
title
stringclasses 1
value | text
stringlengths 49
954k
| id
stringlengths 27
30
|
---|---|---|
presto-main/src/main/java/io/prestosql/server/ui/FormWebUiAuthenticationManager.java/FormWebUiAuthenticationManager/getRedirectLocation
class FormWebUiAuthenticationManager: static String getRedirectLocation(HttpServletRequest request, String path, String queryParameter)
{
HttpUriBuilder builder;
if (isNullOrEmpty(request.getHeader(X_FORWARDED_HOST))) {
// not forwarded
builder = uriBuilder()
.scheme(request.getScheme())
.host(request.getServerName())
.port(request.getServerPort());
}
else {
// forwarded
builder = uriBuilder()
.scheme(firstNonNull(emptyToNull(request.getHeader(X_FORWARDED_PROTO)), request.getScheme()))
.host(request.getHeader(X_FORWARDED_HOST));
getForwarderPort(request).ifPresent(builder::port);
}
builder.replacePath(path);
if (queryParameter != null) {
builder.addParameter(queryParameter);
}
return builder.toString();
}
|
apositive_train_query0_00000
|
|
presto-main/src/main/java/io/prestosql/server/ui/FormWebUiAuthenticationManager.java/FormWebUiAuthenticationManager/getForwarderPort
class FormWebUiAuthenticationManager: private static Optional<Integer> getForwarderPort(HttpServletRequest request)
{
if (!isNullOrEmpty(request.getHeader(X_FORWARDED_PORT))) {
try {
return Optional.of(parseInt(request.getHeader(X_FORWARDED_PORT)));
}
catch (ArithmeticException ignore) {
}
}
return Optional.empty();
}
|
apositive_train_query0_00001
|
|
presto-geospatial-toolkit/src/main/java/io/prestosql/geospatial/Rectangle.java/Rectangle/getXMin
class Rectangle: @JsonProperty
public double getXMin()
{
return xMin;
}
|
negative_train_query0_00000
|
|
presto-geospatial-toolkit/src/main/java/io/prestosql/geospatial/Rectangle.java/Rectangle/getXMax
class Rectangle: @JsonProperty
public double getXMax()
{
return xMax;
}
|
negative_train_query0_00001
|
|
presto-geospatial-toolkit/src/main/java/io/prestosql/geospatial/Rectangle.java/Rectangle/getWidth
class Rectangle: public double getWidth()
{
return xMax - xMin;
}
|
negative_train_query0_00002
|
|
presto-geospatial-toolkit/src/main/java/io/prestosql/geospatial/Rectangle.java/Rectangle/intersects
class Rectangle: public boolean intersects(Rectangle other)
{
requireNonNull(other, "other is null");
return this.xMin <= other.xMax && this.xMax >= other.xMin && this.yMin <= other.yMax && this.yMax >= other.yMin;
}
|
negative_train_query0_00003
|
|
presto-geospatial-toolkit/src/main/java/io/prestosql/geospatial/Rectangle.java/Rectangle/merge
class Rectangle: public Rectangle merge(Rectangle other)
{
return new Rectangle(min(this.xMin, other.xMin), min(this.yMin, other.yMin), max(this.xMax, other.xMax), max(this.yMax, other.yMax));
}
|
negative_train_query0_00004
|
|
presto-geospatial-toolkit/src/main/java/io/prestosql/geospatial/Rectangle.java/Rectangle/equals
class Rectangle: @Override
public boolean equals(Object obj)
{
if (obj == null) {
return false;
}
if (!(obj instanceof Rectangle)) {
return false;
}
Rectangle other = (Rectangle) obj;
return other.xMin == this.xMin && other.yMin == this.yMin && other.xMax == this.xMax && other.yMax == this.yMax;
}
|
negative_train_query0_00005
|
|
presto-geospatial-toolkit/src/main/java/io/prestosql/geospatial/Rectangle.java/Rectangle/Rectangle
class Rectangle: @JsonCreator
public Rectangle(
@JsonProperty("xmin") double xMin,
@JsonProperty("ymin") double yMin,
@JsonProperty("xmax") double xMax,
@JsonProperty("ymax") double yMax)
{
checkArgument(xMin <= xMax, "xMin is greater than xMax");
checkArgument(yMin <= yMax, "yMin is greater than yMax");
this.xMin = xMin;
this.yMin = yMin;
this.xMax = xMax;
this.yMax = yMax;
}
|
negative_train_query0_00006
|
|
presto-geospatial-toolkit/src/main/java/io/prestosql/geospatial/Rectangle.java/Rectangle/getYMax
class Rectangle: @JsonProperty
public double getYMax()
{
return yMax;
}
|
negative_train_query0_00007
|
|
presto-geospatial-toolkit/src/main/java/io/prestosql/geospatial/Rectangle.java/Rectangle/getYMin
class Rectangle: @JsonProperty
public double getYMin()
{
return yMin;
}
|
negative_train_query0_00008
|
|
presto-geospatial-toolkit/src/main/java/io/prestosql/geospatial/Rectangle.java/Rectangle/getHeight
class Rectangle: public double getHeight()
{
return yMax - yMin;
}
|
negative_train_query0_00009
|
|
presto-geospatial-toolkit/src/main/java/io/prestosql/geospatial/Rectangle.java/Rectangle/intersection
class Rectangle: public Rectangle intersection(Rectangle other)
{
requireNonNull(other, "other is null");
if (!intersects(other)) {
return null;
}
return new Rectangle(max(this.xMin, other.xMin), max(this.yMin, other.yMin), min(this.xMax, other.xMax), min(this.yMax, other.yMax));
}
|
negative_train_query0_00010
|
|
presto-geospatial-toolkit/src/main/java/io/prestosql/geospatial/Rectangle.java/Rectangle/estimateMemorySize
class Rectangle: public int estimateMemorySize()
{
return INSTANCE_SIZE;
}
|
negative_train_query0_00011
|
|
presto-geospatial-toolkit/src/main/java/io/prestosql/geospatial/Rectangle.java/Rectangle/hashCode
class Rectangle: @Override
public int hashCode()
{
return Objects.hash(xMin, yMin, xMax, yMax);
}
|
negative_train_query0_00012
|
|
presto-geospatial-toolkit/src/main/java/io/prestosql/geospatial/Rectangle.java/Rectangle/toString
class Rectangle: @Override
public String toString()
{
return toStringHelper(this)
.add("xMin", xMin)
.add("yMin", yMin)
.add("xMax", xMax)
.add("yMax", yMax)
.toString();
}
|
negative_train_query0_00013
|
|
presto-geospatial-toolkit/src/main/java/io/prestosql/geospatial/KdbTreeUtils.java/KdbTreeUtils/KdbTreeUtils
class KdbTreeUtils: private KdbTreeUtils() {}
|
negative_train_query0_00014
|
|
presto-geospatial-toolkit/src/main/java/io/prestosql/geospatial/KdbTreeUtils.java/KdbTreeUtils/toJson
class KdbTreeUtils: public static String toJson(KdbTree kdbTree)
{
requireNonNull(kdbTree, "kdbTree is null");
return KDB_TREE_CODEC.toJson(kdbTree);
}
|
negative_train_query0_00015
|
|
presto-geospatial-toolkit/src/main/java/io/prestosql/geospatial/KdbTreeUtils.java/KdbTreeUtils/fromJson
class KdbTreeUtils: public static KdbTree fromJson(String json)
{
requireNonNull(json, "json is null");
return KDB_TREE_CODEC.fromJson(json);
}
|
negative_train_query0_00016
|
|
presto-geospatial-toolkit/src/main/java/io/prestosql/geospatial/GeometryType.java/GeometryType/isMultitype
class GeometryType: public boolean isMultitype()
{
return multitype;
}
|
negative_train_query0_00017
|
|
presto-geospatial-toolkit/src/main/java/io/prestosql/geospatial/GeometryType.java/GeometryType/getForEsriGeometryType
class GeometryType: public static GeometryType getForEsriGeometryType(String type)
{
return getForInternalLibraryName(type);
}
|
negative_train_query0_00018
|
|
presto-geospatial-toolkit/src/main/java/io/prestosql/geospatial/GeometryType.java/GeometryType/GeometryType
class GeometryType: GeometryType(boolean multitype, Slice standardName)
{
this.multitype = multitype;
this.standardName = standardName;
}
|
negative_train_query0_00019
|
|
presto-geospatial-toolkit/src/main/java/io/prestosql/geospatial/GeometryType.java/GeometryType/getForJtsGeometryType
class GeometryType: public static GeometryType getForJtsGeometryType(String type)
{
return getForInternalLibraryName(type);
}
|
negative_train_query0_00020
|
|
presto-geospatial-toolkit/src/main/java/io/prestosql/geospatial/GeometryType.java/GeometryType/standardName
class GeometryType: public Slice standardName()
{
return standardName;
}
|
negative_train_query0_00021
|
|
presto-geospatial-toolkit/src/main/java/io/prestosql/geospatial/GeometryType.java/GeometryType/getForInternalLibraryName
class GeometryType: private static GeometryType getForInternalLibraryName(String type)
{
requireNonNull(type, "type is null");
switch (type) {
case "Point":
return POINT;
case "MultiPoint":
return MULTI_POINT;
case "LineString":
return LINE_STRING;
case "MultiLineString":
return MULTI_LINE_STRING;
case "Polygon":
return POLYGON;
case "MultiPolygon":
return MULTI_POLYGON;
case "GeometryCollection":
return GEOMETRY_COLLECTION;
default:
throw new IllegalArgumentException("Invalid Geometry Type: " + type);
}
}
|
negative_train_query0_00022
|
|
presto-geospatial-toolkit/src/main/java/io/prestosql/geospatial/GeometryUtils.java/GeometryUtils/translateFromAVNaN
class GeometryUtils: private static double translateFromAVNaN(double n)
{
return n < -1.0E38D ? (0.0D / 0.0) : n;
}
|
negative_train_query0_00023
|
|
presto-geospatial-toolkit/src/main/java/io/prestosql/geospatial/GeometryUtils.java/GeometryUtils/translateToAVNaN
class GeometryUtils: public static double translateToAVNaN(double n)
{
return (Double.isNaN(n)) ? -Double.MAX_VALUE : n;
}
|
negative_train_query0_00024
|
|
presto-geospatial-toolkit/src/main/java/io/prestosql/geospatial/GeometryUtils.java/GeometryUtils/getPointCount
class GeometryUtils: public static int getPointCount(OGCGeometry ogcGeometry)
{
GeometryCursor cursor = ogcGeometry.getEsriGeometryCursor();
int points = 0;
while (true) {
com.esri.core.geometry.Geometry geometry = cursor.next();
if (geometry == null) {
return points;
}
if (geometry.isEmpty()) {
continue;
}
if (geometry instanceof Point) {
points++;
}
else {
points += ((MultiVertexGeometry) geometry).getPointCount();
}
}
}
|
negative_train_query0_00025
|
|
presto-geospatial-toolkit/src/main/java/io/prestosql/geospatial/GeometryUtils.java/GeometryUtils/disjoint
class GeometryUtils: public static boolean disjoint(Envelope envelope, OGCGeometry ogcGeometry)
{
GeometryCursor cursor = ogcGeometry.getEsriGeometryCursor();
while (true) {
Geometry geometry = cursor.next();
if (geometry == null) {
return true;
}
if (!GeometryEngine.disjoint(geometry, envelope, null)) {
return false;
}
}
}
|
negative_train_query0_00026
|
|
presto-geospatial-toolkit/src/main/java/io/prestosql/geospatial/GeometryUtils.java/GeometryUtils/isEsriNaN
class GeometryUtils: public static boolean isEsriNaN(double d)
{
return Double.isNaN(d) || Double.isNaN(translateFromAVNaN(d));
}
|
negative_train_query0_00027
|
|
presto-geospatial-toolkit/src/main/java/io/prestosql/geospatial/GeometryUtils.java/GeometryUtils/getEnvelope
class GeometryUtils: public static Envelope getEnvelope(OGCGeometry ogcGeometry)
{
GeometryCursor cursor = ogcGeometry.getEsriGeometryCursor();
Envelope overallEnvelope = new Envelope();
while (true) {
Geometry geometry = cursor.next();
if (geometry == null) {
return overallEnvelope;
}
Envelope envelope = new Envelope();
geometry.queryEnvelope(envelope);
overallEnvelope.merge(envelope);
}
}
|
negative_train_query0_00028
|
|
presto-geospatial-toolkit/src/main/java/io/prestosql/geospatial/GeometryUtils.java/GeometryUtils/contains
class GeometryUtils: public static boolean contains(OGCGeometry ogcGeometry, Envelope envelope)
{
GeometryCursor cursor = ogcGeometry.getEsriGeometryCursor();
while (true) {
Geometry geometry = cursor.next();
if (geometry == null) {
return false;
}
if (GeometryEngine.contains(geometry, envelope, null)) {
return true;
}
}
}
|
negative_train_query0_00029
|
|
presto-geospatial-toolkit/src/main/java/io/prestosql/geospatial/GeometryUtils.java/GeometryUtils/isPointOrRectangle
class GeometryUtils: public static boolean isPointOrRectangle(OGCGeometry ogcGeometry, Envelope envelope)
{
if (ogcGeometry instanceof OGCPoint) {
return true;
}
if (!(ogcGeometry instanceof OGCPolygon)) {
return false;
}
Polygon polygon = (Polygon) ogcGeometry.getEsriGeometry();
if (polygon.getPathCount() > 1) {
return false;
}
if (polygon.getPointCount() != 4) {
return false;
}
Set<Point> corners = new HashSet<>();
corners.add(new Point(envelope.getXMin(), envelope.getYMin()));
corners.add(new Point(envelope.getXMin(), envelope.getYMax()));
corners.add(new Point(envelope.getXMax(), envelope.getYMin()));
corners.add(new Point(envelope.getXMax(), envelope.getYMax()));
for (int i = 0; i < 4; i++) {
Point point = polygon.getPoint(i);
if (!corners.contains(point)) {
return false;
}
}
return true;
}
|
negative_train_query0_00030
|
|
presto-geospatial-toolkit/src/main/java/io/prestosql/geospatial/GeometryUtils.java/GeometryUtils/GeometryUtils
class GeometryUtils: private GeometryUtils() {}
|
negative_train_query0_00031
|
|
presto-geospatial-toolkit/src/main/java/io/prestosql/geospatial/KdbTree.java/KdbTree/equals
class KdbTree: @Override
public boolean equals(Object obj)
{
if (obj == null) {
return false;
}
if (!(obj instanceof Node)) {
return false;
}
Node other = (Node) obj;
return this.extent.equals(other.extent)
&& Objects.equals(this.leafId, other.leafId)
&& Objects.equals(this.left, other.left)
&& Objects.equals(this.right, other.right);
}
|
negative_train_query0_00032
|
|
presto-geospatial-toolkit/src/main/java/io/prestosql/geospatial/KdbTree.java/KdbTree/getLeaves
class KdbTree: public Map<Integer, Rectangle> getLeaves()
{
ImmutableMap.Builder<Integer, Rectangle> leaves = ImmutableMap.builder();
addLeaves(root, leaves, node -> true);
return leaves.build();
}
|
negative_train_query0_00033
|
|
presto-geospatial-toolkit/src/main/java/io/prestosql/geospatial/KdbTree.java/KdbTree/SplitResult
class KdbTree: private SplitResult(T left, T right)
{
this.left = requireNonNull(left, "left is null");
this.right = requireNonNull(right, "right is null");
}
|
negative_train_query0_00034
|
|
presto-geospatial-toolkit/src/main/java/io/prestosql/geospatial/KdbTree.java/KdbTree/hashCode
class KdbTree: @Override
public int hashCode()
{
return Objects.hash(extent, leafId, left, right);
}
|
negative_train_query0_00035
|
|
presto-geospatial-toolkit/src/main/java/io/prestosql/geospatial/KdbTree.java/KdbTree/findIntersectingLeaves
class KdbTree: public Map<Integer, Rectangle> findIntersectingLeaves(Rectangle envelope)
{
ImmutableMap.Builder<Integer, Rectangle> leaves = ImmutableMap.builder();
addLeaves(root, leaves, node -> node.extent.intersects(envelope));
return leaves.build();
}
|
negative_train_query0_00036
|
|
presto-geospatial-toolkit/src/main/java/io/prestosql/geospatial/KdbTree.java/KdbTree/getValue
class KdbTree: double getValue(Rectangle rectangle);
|
negative_train_query0_00037
|
|
presto-geospatial-toolkit/src/main/java/io/prestosql/geospatial/KdbTree.java/KdbTree/buildKdbTree
class KdbTree: public static KdbTree buildKdbTree(int maxItemsPerNode, Rectangle extent, List<Rectangle> items)
{
checkArgument(maxItemsPerNode > 0, "maxItemsPerNode must be > 0");
requireNonNull(extent, "extent is null");
requireNonNull(items, "items is null");
return new KdbTree(buildKdbTreeNode(maxItemsPerNode, 0, extent, items, new LeafIdAllocator()));
}
|
negative_train_query0_00038
|
|
presto-geospatial-toolkit/src/main/java/io/prestosql/geospatial/KdbTree.java/KdbTree/getLeft
class KdbTree: @JsonProperty
public Optional<Node> getLeft()
{
return left;
}
|
negative_train_query0_00039
|
|
presto-geospatial-toolkit/src/main/java/io/prestosql/geospatial/KdbTree.java/KdbTree/newLeaf
class KdbTree: public static Node newLeaf(Rectangle extent, int leafId)
{
return new Node(extent, OptionalInt.of(leafId), Optional.empty(), Optional.empty());
}
|
negative_train_query0_00040
|
|
presto-geospatial-toolkit/src/main/java/io/prestosql/geospatial/KdbTree.java/KdbTree/Node
class KdbTree: @JsonCreator
public Node(
@JsonProperty("extent") Rectangle extent,
@JsonProperty("leafId") OptionalInt leafId,
@JsonProperty("left") Optional<Node> left,
@JsonProperty("right") Optional<Node> right)
{
this.extent = requireNonNull(extent, "extent is null");
this.leafId = requireNonNull(leafId, "leafId is null");
this.left = requireNonNull(left, "left is null");
this.right = requireNonNull(right, "right is null");
if (leafId.isPresent()) {
checkArgument(leafId.getAsInt() >= 0, "leafId must be >= 0");
checkArgument(!left.isPresent(), "Leaf node cannot have left child");
checkArgument(!right.isPresent(), "Leaf node cannot have right child");
}
else {
checkArgument(left.isPresent(), "Intermediate node must have left child");
checkArgument(right.isPresent(), "Intermediate node must have right child");
}
}
|
negative_train_query0_00041
|
|
presto-geospatial-toolkit/src/main/java/io/prestosql/geospatial/KdbTree.java/KdbTree/getRight
class KdbTree: public T getRight()
{
return right;
}
|
negative_train_query0_00042
|
|
presto-geospatial-toolkit/src/main/java/io/prestosql/geospatial/KdbTree.java/KdbTree/KdbTree
class KdbTree: @JsonCreator
public KdbTree(@JsonProperty("root") Node root)
{
this.root = requireNonNull(root, "root is null");
}
|
negative_train_query0_00043
|
|
presto-geospatial-toolkit/src/main/java/io/prestosql/geospatial/KdbTree.java/KdbTree/addLeaves
class KdbTree: private static void addLeaves(Node node, ImmutableMap.Builder<Integer, Rectangle> leaves, Predicate<Node> predicate)
{
if (!predicate.apply(node)) {
return;
}
if (node.leafId.isPresent()) {
leaves.put(node.leafId.getAsInt(), node.extent);
}
else {
addLeaves(node.left.get(), leaves, predicate);
addLeaves(node.right.get(), leaves, predicate);
}
}
|
negative_train_query0_00044
|
|
presto-geospatial-toolkit/src/main/java/io/prestosql/geospatial/KdbTree.java/KdbTree/newInternal
class KdbTree: public static Node newInternal(Rectangle extent, Node left, Node right)
{
return new Node(extent, OptionalInt.empty(), Optional.of(left), Optional.of(right));
}
|
negative_train_query0_00045
|
|
presto-geospatial-toolkit/src/main/java/io/prestosql/geospatial/KdbTree.java/KdbTree/getExtent
class KdbTree: @JsonProperty
public Rectangle getExtent()
{
return extent;
}
|
negative_train_query0_00046
|
|
presto-geospatial-toolkit/src/main/java/io/prestosql/geospatial/KdbTree.java/KdbTree/getRoot
class KdbTree: @JsonProperty
public Node getRoot()
{
return root;
}
|
negative_train_query0_00047
|
|
presto-geospatial-toolkit/src/main/java/io/prestosql/geospatial/KdbTree.java/KdbTree/getComparator
class KdbTree: @Override
public Comparator<Rectangle> getComparator()
{
return comparator;
}
|
negative_train_query0_00048
|
|
presto-geospatial-toolkit/src/main/java/io/prestosql/geospatial/KdbTree.java/KdbTree/split
class KdbTree: @Override
public SplitResult<Rectangle> split(Rectangle rectangle, double x)
{
checkArgument(rectangle.getXMin() < x && x < rectangle.getXMax());
return new SplitResult<>(
new Rectangle(rectangle.getXMin(), rectangle.getYMin(), x, rectangle.getYMax()),
new Rectangle(x, rectangle.getYMin(), rectangle.getXMax(), rectangle.getYMax()));
}
|
negative_train_query0_00049
|
|
presto-geospatial-toolkit/src/main/java/io/prestosql/geospatial/KdbTree.java/KdbTree/getLeafId
class KdbTree: @JsonProperty
public OptionalInt getLeafId()
{
return leafId;
}
|
negative_train_query0_00050
|
|
presto-geospatial-toolkit/src/main/java/io/prestosql/geospatial/KdbTree.java/KdbTree/buildKdbTreeNode
class KdbTree: private static Node buildKdbTreeNode(int maxItemsPerNode, int level, Rectangle extent, List<Rectangle> items, LeafIdAllocator leafIdAllocator)
{
checkArgument(maxItemsPerNode > 0, "maxItemsPerNode must be > 0");
checkArgument(level >= 0, "level must be >= 0");
checkArgument(level <= MAX_LEVELS, "level must be <= 10,000");
requireNonNull(extent, "extent is null");
requireNonNull(items, "items is null");
if (items.size() <= maxItemsPerNode || level == MAX_LEVELS) {
return newLeaf(extent, leafIdAllocator.next());
}
// Split over longer side
boolean splitVertically = extent.getWidth() >= extent.getHeight();
Optional<SplitResult<Node>> splitResult = trySplit(splitVertically ? BY_X : BY_Y, maxItemsPerNode, level, extent, items, leafIdAllocator);
if (!splitResult.isPresent()) {
// Try spitting by the other side
splitResult = trySplit(splitVertically ? BY_Y : BY_X, maxItemsPerNode, level, extent, items, leafIdAllocator);
}
if (!splitResult.isPresent()) {
return newLeaf(extent, leafIdAllocator.next());
}
return newInternal(extent, splitResult.get().getLeft(), splitResult.get().getRight());
}
|
negative_train_query0_00051
|
|
presto-geospatial-toolkit/src/main/java/io/prestosql/geospatial/KdbTree.java/KdbTree/trySplit
class KdbTree: private static Optional<SplitResult<Node>> trySplit(SplitDimension splitDimension, int maxItemsPerNode, int level, Rectangle extent, List<Rectangle> items, LeafIdAllocator leafIdAllocator)
{
checkArgument(items.size() > 1, "Number of items to split must be > 1");
// Sort envelopes by xMin or yMin
List<Rectangle> sortedItems = ImmutableList.sortedCopyOf(splitDimension.getComparator(), items);
// Find a mid-point
int middleIndex = (sortedItems.size() - 1) / 2;
Rectangle middleEnvelope = sortedItems.get(middleIndex);
double splitValue = splitDimension.getValue(middleEnvelope);
int splitIndex = middleIndex;
// skip over duplicate values
while (splitIndex < sortedItems.size() && splitDimension.getValue(sortedItems.get(splitIndex)) == splitValue) {
splitIndex++;
}
// all values between left-of-middle and the end are the same, so can't split
if (splitIndex == sortedItems.size()) {
return Optional.empty();
}
// about half of the objects are <= splitValue, the rest are >= next value
// assuming the input set of objects is a sample from a much larger set,
// let's split in the middle; this way objects from the larger set with values
// between splitValue and next value will get split somewhat evenly into left
// and right partitions
splitValue = (splitValue + splitDimension.getValue(sortedItems.get(splitIndex))) / 2;
SplitResult<Rectangle> childExtents = splitDimension.split(extent, splitValue);
return Optional.of(new SplitResult<>(
buildKdbTreeNode(maxItemsPerNode, level + 1, childExtents.getLeft(), sortedItems.subList(0, splitIndex), leafIdAllocator),
buildKdbTreeNode(maxItemsPerNode, level + 1, childExtents.getRight(), sortedItems.subList(splitIndex, sortedItems.size()), leafIdAllocator)));
}
|
negative_train_query0_00052
|
|
presto-geospatial-toolkit/src/main/java/io/prestosql/geospatial/KdbTree.java/KdbTree/next
class KdbTree: public int next()
{
return nextId++;
}
|
negative_train_query0_00053
|
|
presto-geospatial-toolkit/src/main/java/io/prestosql/geospatial/KdbTree.java/LeafIdAllocator/next
class LeafIdAllocator: public int next()
{
return nextId++;
}
|
negative_train_query0_00054
|
|
presto-geospatial-toolkit/src/main/java/io/prestosql/geospatial/KdbTree.java/SplitDimension/getComparator
class SplitDimension: Comparator<Rectangle> getComparator();
|
negative_train_query0_00055
|
|
presto-geospatial-toolkit/src/main/java/io/prestosql/geospatial/KdbTree.java/SplitDimension/getValue
class SplitDimension: double getValue(Rectangle rectangle);
|
negative_train_query0_00056
|
|
presto-geospatial-toolkit/src/main/java/io/prestosql/geospatial/KdbTree.java/SplitDimension/split
class SplitDimension: SplitResult<Rectangle> split(Rectangle rectangle, double value);
|
negative_train_query0_00057
|
|
presto-geospatial-toolkit/src/main/java/io/prestosql/geospatial/KdbTree.java/Node/newLeaf
class Node: public static Node newLeaf(Rectangle extent, int leafId)
{
return new Node(extent, OptionalInt.of(leafId), Optional.empty(), Optional.empty());
}
|
negative_train_query0_00058
|
|
presto-geospatial-toolkit/src/main/java/io/prestosql/geospatial/KdbTree.java/Node/getLeafId
class Node: @JsonProperty
public OptionalInt getLeafId()
{
return leafId;
}
|
negative_train_query0_00059
|
|
presto-geospatial-toolkit/src/main/java/io/prestosql/geospatial/KdbTree.java/Node/Node
class Node: @JsonCreator
public Node(
@JsonProperty("extent") Rectangle extent,
@JsonProperty("leafId") OptionalInt leafId,
@JsonProperty("left") Optional<Node> left,
@JsonProperty("right") Optional<Node> right)
{
this.extent = requireNonNull(extent, "extent is null");
this.leafId = requireNonNull(leafId, "leafId is null");
this.left = requireNonNull(left, "left is null");
this.right = requireNonNull(right, "right is null");
if (leafId.isPresent()) {
checkArgument(leafId.getAsInt() >= 0, "leafId must be >= 0");
checkArgument(!left.isPresent(), "Leaf node cannot have left child");
checkArgument(!right.isPresent(), "Leaf node cannot have right child");
}
else {
checkArgument(left.isPresent(), "Intermediate node must have left child");
checkArgument(right.isPresent(), "Intermediate node must have right child");
}
}
|
negative_train_query0_00060
|
|
presto-geospatial-toolkit/src/main/java/io/prestosql/geospatial/KdbTree.java/Node/getRight
class Node: @JsonProperty
public Optional<Node> getRight()
{
return right;
}
|
negative_train_query0_00061
|
|
presto-geospatial-toolkit/src/main/java/io/prestosql/geospatial/KdbTree.java/Node/newInternal
class Node: public static Node newInternal(Rectangle extent, Node left, Node right)
{
return new Node(extent, OptionalInt.empty(), Optional.of(left), Optional.of(right));
}
|
negative_train_query0_00062
|
|
presto-geospatial-toolkit/src/main/java/io/prestosql/geospatial/KdbTree.java/Node/getExtent
class Node: @JsonProperty
public Rectangle getExtent()
{
return extent;
}
|
negative_train_query0_00063
|
|
presto-geospatial-toolkit/src/main/java/io/prestosql/geospatial/KdbTree.java/Node/getLeft
class Node: @JsonProperty
public Optional<Node> getLeft()
{
return left;
}
|
negative_train_query0_00064
|
|
presto-geospatial-toolkit/src/main/java/io/prestosql/geospatial/KdbTree.java/Node/equals
class Node: @Override
public boolean equals(Object obj)
{
if (obj == null) {
return false;
}
if (!(obj instanceof Node)) {
return false;
}
Node other = (Node) obj;
return this.extent.equals(other.extent)
&& Objects.equals(this.leafId, other.leafId)
&& Objects.equals(this.left, other.left)
&& Objects.equals(this.right, other.right);
}
|
negative_train_query0_00065
|
|
presto-geospatial-toolkit/src/main/java/io/prestosql/geospatial/KdbTree.java/Node/hashCode
class Node: @Override
public int hashCode()
{
return Objects.hash(extent, leafId, left, right);
}
|
negative_train_query0_00066
|
|
presto-geospatial-toolkit/src/main/java/io/prestosql/geospatial/KdbTree.java/SplitResult/SplitResult
class SplitResult: private SplitResult(T left, T right)
{
this.left = requireNonNull(left, "left is null");
this.right = requireNonNull(right, "right is null");
}
|
negative_train_query0_00067
|
|
presto-geospatial-toolkit/src/main/java/io/prestosql/geospatial/KdbTree.java/SplitResult/getRight
class SplitResult: public T getRight()
{
return right;
}
|
negative_train_query0_00068
|
|
presto-geospatial-toolkit/src/main/java/io/prestosql/geospatial/KdbTree.java/SplitResult/getLeft
class SplitResult: public T getLeft()
{
return left;
}
|
negative_train_query0_00069
|
|
presto-geospatial-toolkit/src/main/java/io/prestosql/geospatial/serde/JtsGeometrySerde.java/JtsGeometrySerde/readGeometry
class JtsGeometrySerde: private static Geometry readGeometry(BasicSliceInput input, GeometrySerializationType type)
{
switch (type) {
case POINT:
return readPoint(input);
case MULTI_POINT:
return readMultiPoint(input);
case LINE_STRING:
return readPolyline(input, false);
case MULTI_LINE_STRING:
return readPolyline(input, true);
case POLYGON:
return readPolygon(input, false);
case MULTI_POLYGON:
return readPolygon(input, true);
case GEOMETRY_COLLECTION:
return readGeometryCollection(input);
case ENVELOPE:
return readEnvelope(input);
default:
throw new UnsupportedOperationException("Unexpected type: " + type);
}
}
|
negative_train_query0_00070
|
|
presto-geospatial-toolkit/src/main/java/io/prestosql/geospatial/serde/JtsGeometrySerde.java/JtsGeometrySerde/skipEnvelope
class JtsGeometrySerde: private static void skipEnvelope(SliceInput input)
{
requireNonNull(input, "input is null");
int skipLength = 4 * SIZE_OF_DOUBLE;
verify(input.skip(skipLength) == skipLength);
}
|
negative_train_query0_00071
|
|
presto-geospatial-toolkit/src/main/java/io/prestosql/geospatial/serde/JtsGeometrySerde.java/JtsGeometrySerde/writeMultiPoint
class JtsGeometrySerde: private static void writeMultiPoint(MultiPoint geometry, SliceOutput output)
{
output.writeByte(GeometrySerializationType.MULTI_POINT.code());
output.writeInt(EsriShapeType.MULTI_POINT.code);
writeEnvelope(geometry, output);
output.writeInt(geometry.getNumPoints());
for (Coordinate coordinate : geometry.getCoordinates()) {
writeCoordinate(coordinate, output);
}
}
|
negative_train_query0_00072
|
|
presto-geospatial-toolkit/src/main/java/io/prestosql/geospatial/serde/JtsGeometrySerde.java/JtsGeometrySerde/readPoint
class JtsGeometrySerde: private static Point readPoint(SliceInput input)
{
Coordinate coordinates = readCoordinate(input);
if (isNaN(coordinates.x) || isNaN(coordinates.y)) {
return GEOMETRY_FACTORY.createPoint();
}
return GEOMETRY_FACTORY.createPoint(coordinates);
}
|
negative_train_query0_00073
|
|
presto-geospatial-toolkit/src/main/java/io/prestosql/geospatial/serde/JtsGeometrySerde.java/JtsGeometrySerde/readCoordinate
class JtsGeometrySerde: private static Coordinate readCoordinate(SliceInput input)
{
requireNonNull(input, "input is null");
return new Coordinate(input.readDouble(), input.readDouble());
}
|
negative_train_query0_00074
|
|
presto-geospatial-toolkit/src/main/java/io/prestosql/geospatial/serde/JtsGeometrySerde.java/JtsGeometrySerde/writePolyline
class JtsGeometrySerde: private static void writePolyline(Geometry geometry, SliceOutput output, boolean multitype)
{
int numParts;
int numPoints = geometry.getNumPoints();
if (multitype) {
numParts = geometry.getNumGeometries();
output.writeByte(GeometrySerializationType.MULTI_LINE_STRING.code());
}
else {
numParts = numPoints > 0 ? 1 : 0;
output.writeByte(GeometrySerializationType.LINE_STRING.code());
}
output.writeInt(EsriShapeType.POLYLINE.code);
writeEnvelope(geometry, output);
output.writeInt(numParts);
output.writeInt(numPoints);
int partIndex = 0;
for (int i = 0; i < numParts; i++) {
output.writeInt(partIndex);
partIndex += geometry.getGeometryN(i).getNumPoints();
}
writeCoordinates(geometry.getCoordinates(), output);
}
|
negative_train_query0_00075
|
|
presto-geospatial-toolkit/src/main/java/io/prestosql/geospatial/serde/JtsGeometrySerde.java/JtsGeometrySerde/readPolygon
class JtsGeometrySerde: private static Geometry readPolygon(SliceInput input, boolean multitype)
{
skipEsriType(input);
skipEnvelope(input);
int partCount = input.readInt();
if (partCount == 0) {
if (multitype) {
return GEOMETRY_FACTORY.createMultiPolygon();
}
return GEOMETRY_FACTORY.createPolygon();
}
int pointCount = input.readInt();
int[] startIndexes = new int[partCount];
for (int i = 0; i < partCount; i++) {
startIndexes[i] = input.readInt();
}
int[] partLengths = new int[partCount];
if (partCount > 1) {
partLengths[0] = startIndexes[1];
for (int i = 1; i < partCount - 1; i++) {
partLengths[i] = startIndexes[i + 1] - startIndexes[i];
}
}
partLengths[partCount - 1] = pointCount - startIndexes[partCount - 1];
LinearRing shell = null;
List<LinearRing> holes = new ArrayList<>();
List<Polygon> polygons = new ArrayList<>();
for (int i = 0; i < partCount; i++) {
Coordinate[] coordinates = readCoordinates(input, partLengths[i]);
if (isClockwise(coordinates)) {
// next polygon has started
if (shell != null) {
polygons.add(GEOMETRY_FACTORY.createPolygon(shell, holes.toArray(new LinearRing[0])));
holes.clear();
}
else {
verify(holes.isEmpty(), "shell is null but holes found");
}
shell = GEOMETRY_FACTORY.createLinearRing(coordinates);
}
else {
verifyNotNull(shell, "shell is null but hole found");
holes.add(GEOMETRY_FACTORY.createLinearRing(coordinates));
}
}
polygons.add(GEOMETRY_FACTORY.createPolygon(shell, holes.toArray(new LinearRing[0])));
if (multitype) {
return GEOMETRY_FACTORY.createMultiPolygon(polygons.toArray(new Polygon[0]));
}
return getOnlyElement(polygons);
}
|
negative_train_query0_00076
|
|
presto-geospatial-toolkit/src/main/java/io/prestosql/geospatial/serde/JtsGeometrySerde.java/JtsGeometrySerde/writeEnvelope
class JtsGeometrySerde: private static void writeEnvelope(Geometry geometry, SliceOutput output)
{
if (geometry.isEmpty()) {
for (int i = 0; i < 4; i++) {
output.writeDouble(NaN);
}
return;
}
Envelope envelope = geometry.getEnvelopeInternal();
output.writeDouble(envelope.getMinX());
output.writeDouble(envelope.getMinY());
output.writeDouble(envelope.getMaxX());
output.writeDouble(envelope.getMaxY());
}
|
negative_train_query0_00077
|
|
presto-geospatial-toolkit/src/main/java/io/prestosql/geospatial/serde/JtsGeometrySerde.java/JtsGeometrySerde/readGeometryCollection
class JtsGeometrySerde: private static Geometry readGeometryCollection(BasicSliceInput input)
{
List<Geometry> geometries = new ArrayList<>();
while (input.available() > 0) {
// skip length
input.readInt();
GeometrySerializationType type = GeometrySerializationType.getForCode(input.readByte());
geometries.add(readGeometry(input, type));
}
return GEOMETRY_FACTORY.createGeometryCollection(geometries.toArray(new Geometry[0]));
}
|
negative_train_query0_00078
|
|
presto-geospatial-toolkit/src/main/java/io/prestosql/geospatial/serde/JtsGeometrySerde.java/JtsGeometrySerde/canonicalizePolygonCoordinates
class JtsGeometrySerde: private static void canonicalizePolygonCoordinates(Coordinate[] coordinates, int start, int end, boolean isShell)
{
boolean isClockwise = isClockwise(coordinates, start, end);
if ((isShell && !isClockwise) || (!isShell && isClockwise)) {
// shell has to be counter clockwise
reverse(coordinates, start, end);
}
}
|
negative_train_query0_00079
|
|
presto-geospatial-toolkit/src/main/java/io/prestosql/geospatial/serde/JtsGeometrySerde.java/JtsGeometrySerde/EsriShapeType
class JtsGeometrySerde: EsriShapeType(int code)
{
this.code = code;
}
|
negative_train_query0_00080
|
|
presto-geospatial-toolkit/src/main/java/io/prestosql/geospatial/serde/JtsGeometrySerde.java/JtsGeometrySerde/readEnvelope
class JtsGeometrySerde: private static Geometry readEnvelope(SliceInput input)
{
verify(input.available() > 0);
double xMin = input.readDouble();
double yMin = input.readDouble();
double xMax = input.readDouble();
double yMax = input.readDouble();
Coordinate[] coordinates = new Coordinate[5];
coordinates[0] = new Coordinate(xMin, yMin);
coordinates[1] = new Coordinate(xMin, yMax);
coordinates[2] = new Coordinate(xMax, yMax);
coordinates[3] = new Coordinate(xMax, yMin);
coordinates[4] = coordinates[0];
return GEOMETRY_FACTORY.createPolygon(coordinates);
}
|
negative_train_query0_00081
|
|
presto-geospatial-toolkit/src/main/java/io/prestosql/geospatial/serde/JtsGeometrySerde.java/JtsGeometrySerde/writeGeometry
class JtsGeometrySerde: private static void writeGeometry(Geometry geometry, DynamicSliceOutput output)
{
switch (geometry.getGeometryType()) {
case "Point":
writePoint((Point) geometry, output);
break;
case "MultiPoint":
writeMultiPoint((MultiPoint) geometry, output);
break;
case "LineString":
writePolyline(geometry, output, false);
break;
case "MultiLineString":
writePolyline(geometry, output, true);
break;
case "Polygon":
writePolygon(geometry, output, false);
break;
case "MultiPolygon":
writePolygon(geometry, output, true);
break;
case "GeometryCollection":
writeGeometryCollection(geometry, output);
break;
default:
throw new IllegalArgumentException("Unsupported geometry type : " + geometry.getGeometryType());
}
}
|
negative_train_query0_00082
|
|
presto-geospatial-toolkit/src/main/java/io/prestosql/geospatial/serde/JtsGeometrySerde.java/JtsGeometrySerde/writeCoordinate
class JtsGeometrySerde: private static void writeCoordinate(Coordinate coordinate, SliceOutput output)
{
output.writeDouble(translateToAVNaN(coordinate.x));
output.writeDouble(translateToAVNaN(coordinate.y));
}
|
negative_train_query0_00083
|
|
presto-geospatial-toolkit/src/main/java/io/prestosql/geospatial/serde/JtsGeometrySerde.java/JtsGeometrySerde/isClockwise
class JtsGeometrySerde: private static boolean isClockwise(Coordinate[] coordinates)
{
return isClockwise(coordinates, 0, coordinates.length);
}
|
negative_train_query0_00084
|
|
presto-geospatial-toolkit/src/main/java/io/prestosql/geospatial/serde/JtsGeometrySerde.java/JtsGeometrySerde/deserialize
class JtsGeometrySerde: public static Geometry deserialize(Slice shape)
{
requireNonNull(shape, "shape is null");
BasicSliceInput input = shape.getInput();
verify(input.available() > 0);
GeometrySerializationType type = GeometrySerializationType.getForCode(input.readByte());
return readGeometry(input, type);
}
|
negative_train_query0_00085
|
|
presto-geospatial-toolkit/src/main/java/io/prestosql/geospatial/serde/JtsGeometrySerde.java/JtsGeometrySerde/skipEsriType
class JtsGeometrySerde: private static void skipEsriType(SliceInput input)
{
input.readInt();
}
|
negative_train_query0_00086
|
|
presto-geospatial-toolkit/src/main/java/io/prestosql/geospatial/serde/JtsGeometrySerde.java/JtsGeometrySerde/writePoint
class JtsGeometrySerde: private static void writePoint(Point point, SliceOutput output)
{
output.writeByte(GeometrySerializationType.POINT.code());
if (!point.isEmpty()) {
writeCoordinate(point.getCoordinate(), output);
}
else {
output.writeDouble(NaN);
output.writeDouble(NaN);
}
}
|
negative_train_query0_00087
|
|
presto-geospatial-toolkit/src/main/java/io/prestosql/geospatial/serde/JtsGeometrySerde.java/JtsGeometrySerde/writeCoordinates
class JtsGeometrySerde: private static void writeCoordinates(Coordinate[] coordinates, SliceOutput output)
{
for (Coordinate coordinate : coordinates) {
writeCoordinate(coordinate, output);
}
}
|
negative_train_query0_00088
|
|
presto-geospatial-toolkit/src/main/java/io/prestosql/geospatial/serde/JtsGeometrySerde.java/JtsGeometrySerde/reverse
class JtsGeometrySerde: private static void reverse(Coordinate[] coordinates, int start, int end)
{
verify(start <= end, "start must be less or equal than end");
for (int i = start; i < start + ((end - start) / 2); i++) {
Coordinate buffer = coordinates[i];
coordinates[i] = coordinates[start + end - i - 1];
coordinates[start + end - i - 1] = buffer;
}
}
|
negative_train_query0_00089
|
|
presto-geospatial-toolkit/src/main/java/io/prestosql/geospatial/serde/JtsGeometrySerde.java/JtsGeometrySerde/readMultiPoint
class JtsGeometrySerde: private static Geometry readMultiPoint(SliceInput input)
{
skipEsriType(input);
skipEnvelope(input);
int pointCount = input.readInt();
Point[] points = new Point[pointCount];
for (int i = 0; i < pointCount; i++) {
points[i] = readPoint(input);
}
return GEOMETRY_FACTORY.createMultiPoint(points);
}
|
negative_train_query0_00090
|
|
presto-geospatial-toolkit/src/main/java/io/prestosql/geospatial/serde/JtsGeometrySerde.java/JtsGeometrySerde/serialize
class JtsGeometrySerde: public static Slice serialize(Geometry geometry)
{
requireNonNull(geometry, "input is null");
DynamicSliceOutput output = new DynamicSliceOutput(100);
writeGeometry(geometry, output);
return output.slice();
}
|
negative_train_query0_00091
|
|
presto-geospatial-toolkit/src/main/java/io/prestosql/geospatial/serde/JtsGeometrySerde.java/JtsGeometrySerde/writePolygon
class JtsGeometrySerde: private static void writePolygon(Geometry geometry, SliceOutput output, boolean multitype)
{
int numGeometries = geometry.getNumGeometries();
int numParts = 0;
int numPoints = geometry.getNumPoints();
for (int i = 0; i < numGeometries; i++) {
Polygon polygon = (Polygon) geometry.getGeometryN(i);
if (polygon.getNumPoints() > 0) {
numParts += polygon.getNumInteriorRing() + 1;
}
}
if (multitype) {
output.writeByte(GeometrySerializationType.MULTI_POLYGON.code());
}
else {
output.writeByte(GeometrySerializationType.POLYGON.code());
}
output.writeInt(EsriShapeType.POLYGON.code);
writeEnvelope(geometry, output);
output.writeInt(numParts);
output.writeInt(numPoints);
if (numParts == 0) {
return;
}
int[] partIndexes = new int[numParts];
boolean[] shellPart = new boolean[numParts];
int currentPart = 0;
int currentPoint = 0;
for (int i = 0; i < numGeometries; i++) {
Polygon polygon = (Polygon) geometry.getGeometryN(i);
partIndexes[currentPart] = currentPoint;
shellPart[currentPart] = true;
currentPart++;
currentPoint += polygon.getExteriorRing().getNumPoints();
int holesCount = polygon.getNumInteriorRing();
for (int holeIndex = 0; holeIndex < holesCount; holeIndex++) {
partIndexes[currentPart] = currentPoint;
shellPart[currentPart] = false;
currentPart++;
currentPoint += polygon.getInteriorRingN(holeIndex).getNumPoints();
}
}
for (int partIndex : partIndexes) {
output.writeInt(partIndex);
}
Coordinate[] coordinates = geometry.getCoordinates();
canonicalizePolygonCoordinates(coordinates, partIndexes, shellPart);
writeCoordinates(coordinates, output);
}
|
negative_train_query0_00092
|
|
presto-geospatial-toolkit/src/main/java/io/prestosql/geospatial/serde/JtsGeometrySerde.java/JtsGeometrySerde/JtsGeometrySerde
class JtsGeometrySerde: private JtsGeometrySerde() {}
|
negative_train_query0_00093
|
|
presto-geospatial-toolkit/src/main/java/io/prestosql/geospatial/serde/JtsGeometrySerde.java/JtsGeometrySerde/readPolyline
class JtsGeometrySerde: private static Geometry readPolyline(SliceInput input, boolean multitype)
{
skipEsriType(input);
skipEnvelope(input);
int partCount = input.readInt();
if (partCount == 0) {
if (multitype) {
return GEOMETRY_FACTORY.createMultiLineString();
}
return GEOMETRY_FACTORY.createLineString();
}
int pointCount = input.readInt();
int[] startIndexes = new int[partCount];
for (int i = 0; i < partCount; i++) {
startIndexes[i] = input.readInt();
}
int[] partLengths = new int[partCount];
if (partCount > 1) {
partLengths[0] = startIndexes[1];
for (int i = 1; i < partCount - 1; i++) {
partLengths[i] = startIndexes[i + 1] - startIndexes[i];
}
}
partLengths[partCount - 1] = pointCount - startIndexes[partCount - 1];
LineString[] lineStrings = new LineString[partCount];
for (int i = 0; i < partCount; i++) {
lineStrings[i] = GEOMETRY_FACTORY.createLineString(readCoordinates(input, partLengths[i]));
}
if (multitype) {
return GEOMETRY_FACTORY.createMultiLineString(lineStrings);
}
verify(lineStrings.length == 1);
return lineStrings[0];
}
|
negative_train_query0_00094
|
|
presto-geospatial-toolkit/src/main/java/io/prestosql/geospatial/serde/JtsGeometrySerde.java/JtsGeometrySerde/writeGeometryCollection
class JtsGeometrySerde: private static void writeGeometryCollection(Geometry collection, DynamicSliceOutput output)
{
output.appendByte(GeometrySerializationType.GEOMETRY_COLLECTION.code());
for (int geometryIndex = 0; geometryIndex < collection.getNumGeometries(); geometryIndex++) {
Geometry geometry = collection.getGeometryN(geometryIndex);
int startPosition = output.size();
// leave 4 bytes for the shape length
output.appendInt(0);
writeGeometry(geometry, output);
int endPosition = output.size();
int length = endPosition - startPosition - Integer.BYTES;
output.getUnderlyingSlice().setInt(startPosition, length);
}
}
|
negative_train_query0_00095
|
|
presto-geospatial-toolkit/src/main/java/io/prestosql/geospatial/serde/JtsGeometrySerde.java/JtsGeometrySerde/readCoordinates
class JtsGeometrySerde: private static Coordinate[] readCoordinates(SliceInput input, int count)
{
requireNonNull(input, "input is null");
verify(count > 0);
Coordinate[] coordinates = new Coordinate[count];
for (int i = 0; i < count; i++) {
coordinates[i] = readCoordinate(input);
}
return coordinates;
}
|
negative_train_query0_00096
|
|
presto-geospatial-toolkit/src/main/java/io/prestosql/geospatial/serde/JtsGeometrySerde.java/EsriShapeType/EsriShapeType
class EsriShapeType: EsriShapeType(int code)
{
this.code = code;
}
|
negative_train_query0_00097
|
End of preview. Expand
in Data Studio
Multilingual Software Issue Localization.
Task category | t2t |
Domains | Programming, Written |
Reference | https://amazon-science.github.io/SWE-PolyBench/ |
Source datasets:
How to evaluate on this task
You can evaluate an embedding model on this dataset using the following code:
import mteb
task = mteb.get_task("SWEPolyBenchRR")
evaluator = mteb.MTEB([task])
model = mteb.get_model(YOUR_MODEL)
evaluator.run(model)
To learn more about how to run models on mteb
task check out the GitHub repository.
Citation
If you use this dataset, please cite the dataset as well as mteb, as this dataset likely includes additional processing as a part of the MMTEB Contribution.
@misc{rashid2025swepolybenchmultilanguagebenchmarkrepository,
archiveprefix = {arXiv},
author = {Muhammad Shihab Rashid and Christian Bock and Yuan Zhuang and Alexander Buchholz and Tim Esler and Simon Valentin and Luca Franceschi and Martin Wistuba and Prabhu Teja Sivaprasad and Woo Jung Kim and Anoop Deoras and Giovanni Zappella and Laurent Callot},
eprint = {2504.08703},
primaryclass = {cs.SE},
title = {SWE-PolyBench: A multi-language benchmark for repository level evaluation of coding agents},
url = {https://arxiv.org/abs/2504.08703},
year = {2025},
}
@article{enevoldsen2025mmtebmassivemultilingualtext,
title={MMTEB: Massive Multilingual Text Embedding Benchmark},
author={Kenneth Enevoldsen and Isaac Chung and Imene Kerboua and Márton Kardos and Ashwin Mathur and David Stap and Jay Gala and Wissam Siblini and Dominik Krzemiński and Genta Indra Winata and Saba Sturua and Saiteja Utpala and Mathieu Ciancone and Marion Schaeffer and Gabriel Sequeira and Diganta Misra and Shreeya Dhakal and Jonathan Rystrøm and Roman Solomatin and Ömer Çağatan and Akash Kundu and Martin Bernstorff and Shitao Xiao and Akshita Sukhlecha and Bhavish Pahwa and Rafał Poświata and Kranthi Kiran GV and Shawon Ashraf and Daniel Auras and Björn Plüster and Jan Philipp Harries and Loïc Magne and Isabelle Mohr and Mariya Hendriksen and Dawei Zhu and Hippolyte Gisserot-Boukhlef and Tom Aarsen and Jan Kostkan and Konrad Wojtasik and Taemin Lee and Marek Šuppa and Crystina Zhang and Roberta Rocca and Mohammed Hamdy and Andrianos Michail and John Yang and Manuel Faysse and Aleksei Vatolin and Nandan Thakur and Manan Dey and Dipam Vasani and Pranjal Chitale and Simone Tedeschi and Nguyen Tai and Artem Snegirev and Michael Günther and Mengzhou Xia and Weijia Shi and Xing Han Lù and Jordan Clive and Gayatri Krishnakumar and Anna Maksimova and Silvan Wehrli and Maria Tikhonova and Henil Panchal and Aleksandr Abramov and Malte Ostendorff and Zheng Liu and Simon Clematide and Lester James Miranda and Alena Fenogenova and Guangyu Song and Ruqiya Bin Safi and Wen-Ding Li and Alessia Borghini and Federico Cassano and Hongjin Su and Jimmy Lin and Howard Yen and Lasse Hansen and Sara Hooker and Chenghao Xiao and Vaibhav Adlakha and Orion Weller and Siva Reddy and Niklas Muennighoff},
publisher = {arXiv},
journal={arXiv preprint arXiv:2502.13595},
year={2025},
url={https://arxiv.org/abs/2502.13595},
doi = {10.48550/arXiv.2502.13595},
}
@article{muennighoff2022mteb,
author = {Muennighoff, Niklas and Tazi, Nouamane and Magne, Loïc and Reimers, Nils},
title = {MTEB: Massive Text Embedding Benchmark},
publisher = {arXiv},
journal={arXiv preprint arXiv:2210.07316},
year = {2022}
url = {https://arxiv.org/abs/2210.07316},
doi = {10.48550/ARXIV.2210.07316},
}
Dataset Statistics
Dataset Statistics
The following code contains the descriptive statistics from the task. These can also be obtained using:
import mteb
task = mteb.get_task("SWEPolyBenchRR")
desc_stats = task.metadata.descriptive_stats
{}
This dataset card was automatically generated using MTEB
- Downloads last month
- 44