class_docstr: Base class for binary predicates that are defined in terms of the equals
  basic predicate.  `EqualsPredicateBase` implements utility functions that
  are used within many equals-related binary predicates.
  
  Used by:
  (Point, Point)
  (Point, Polygon)
  (LineString, Polygon)
  (Polygon, Point)
  (Polygon, MultiPoint)
  (Polygon, LineString)
  (Polygon, Polygon)
class_docstr_tok: ["Base","class","for","binary","predicates","that","are","defined","in","terms","of","the","equals","basic","predicate",".","`","EqualsPredicateBase","`","implements","utility","functions","that","are","used","within","many","equals-related","binary","predicates",".","Used","by",":","(","Point",",","Point",")","(","Point",",","Polygon",")","(","LineString",",","Polygon",")","(","Polygon",",","Point",")","(","Polygon",",","MultiPoint",")","(","Polygon",",","LineString",")","(","Polygon",",","Polygon",")"]
docstr: Sort xy according to bins defined by offset. Sort order is a list
  of column names to sort by.
  
  `_sort_interleaved_points_by_offset` creates a dataframe with the
  following columns:
  "sizes": an index for each object represented in `coords`.
  "points": an index for each point in `coords`.
  "xy_key": an index that maintains x/y ordering.
  "xy": the x/y coordinates in `coords`.
  
  The dataframe is sorted according to keys passed in by the caller.
  For sorting multipoints, the keys in order are "object_key", "xy",
  "xy_key". This sorts the points in each multipoint into the same
  bin defined by "object_key", then sorts the points in each bin by
  x/y coordinates, and finally sorts the points in each bin by the
  `xy_key` which maintains that the x coordinate precedes the y
  coordinate.
  
  For sorting linestrings, the keys in order are "object_key",
  "point_key", "xy_key". This sorts the points in each linestring
  into the same bin defined by "object_key", then sorts the points
  in each bin by point ordering, and finally sorts the points in
  each bin by x/y ordering.
  
  Parameters
  ----------
  coords : cudf.Series
      interleaved x,y coordinates
  offsets : cudf.Series
      offsets into coords
  sort_order : list
      list of column names to sort by. One of "object_key", "point_key",
      "xy_key", and "xy".
  
  Returns
  -------
  cudf.Series
      sorted interleaved x,y coordinates
docstr_tok: ["Sort","xy","according","to","bins","defined","by","offset",".","Sort","order","is","a","list","of","column","names","to","sort","by",".","`","_sort_interleaved_points_by_offset","`","creates","a","dataframe","with","the","following","columns",":","''","sizes","''",":","an","index","for","each","object","represented","in","`","coords","`",".","``","points","''",":","an","index","for","each","point","in","`","coords","`",".","``","xy_key","''",":","an","index","that","maintains","x\/y","ordering",".","``","xy","''",":","the","x\/y","coordinates","in","`","coords","`",".","The","dataframe","is","sorted","according","to","keys","passed","in","by","the","caller",".","For","sorting","multipoints",",","the","keys","in","order","are","``","object_key","''",",","``","xy","''",",","''","xy_key","''",".","This","sorts","the","points","in","each","multipoint","into","the","same","bin","defined","by","``","object_key","''",",","then","sorts","the","points","in","each","bin","by","x\/y","coordinates",",","and","finally","sorts","the","points","in","each","bin","by","the","`","xy_key","`","which","maintains","that","the","x","coordinate","precedes","the","y","coordinate",".","For","sorting","linestrings",",","the","keys","in","order","are","``","object_key","''",",","''","point_key","''",",","``","xy_key","''",".","This","sorts","the","points","in","each","linestring","into","the","same","bin","defined","by","``","object_key","''",",","then","sorts","the","points","in","each","bin","by","point","ordering",",","and","finally","sorts","the","points","in","each","bin","by","x\/y","ordering",".","Parameters","--","--","--","--","--","coords",":","cudf.Series","interleaved","x",",","y","coordinates","offsets",":","cudf.Series","offsets","into","coords","sort_order",":","list","list","of","column","names","to","sort","by",".","One","of","``","object_key","''",",","``","point_key","''",",","``","xy_key","''",",","and","``","xy","''",".","Returns","--","--","--","-","cudf.Series","sorted","interleaved","x",",","y","coordinates"]
code: def _sort_interleaved_points_by_offset(
      self, coords, offsets, sort_order
  ):
      """Sort xy according to bins defined by offset. Sort order is a list
      of column names to sort by.
  
      `_sort_interleaved_points_by_offset` creates a dataframe with the
      following columns:
      "sizes": an index for each object represented in `coords`.
      "points": an index for each point in `coords`.
      "xy_key": an index that maintains x/y ordering.
      "xy": the x/y coordinates in `coords`.
  
      The dataframe is sorted according to keys passed in by the caller.
      For sorting multipoints, the keys in order are "object_key", "xy",
      "xy_key". This sorts the points in each multipoint into the same
      bin defined by "object_key", then sorts the points in each bin by
      x/y coordinates, and finally sorts the points in each bin by the
      `xy_key` which maintains that the x coordinate precedes the y
      coordinate.
  
      For sorting linestrings, the keys in order are "object_key",
      "point_key", "xy_key". This sorts the points in each linestring
      into the same bin defined by "object_key", then sorts the points
      in each bin by point ordering, and finally sorts the points in
      each bin by x/y ordering.
  
      Parameters
      ----------
      coords : cudf.Series
          interleaved x,y coordinates
      offsets : cudf.Series
          offsets into coords
      sort_order : list
          list of column names to sort by. One of "object_key", "point_key",
          "xy_key", and "xy".
  
      Returns
      -------
      cudf.Series
          sorted interleaved x,y coordinates
      """
      sizes = offsets[1:] - offsets[:-1]
      object_key = (
          cudf.Series(cp.arange(len(sizes)))
          .repeat(sizes * 2)
          .reset_index(drop=True)
      )
      point_key = cp.arange(len(coords) // 2).repeat(2)[::-1]
      xy_key = cp.tile([0, 1], len(coords) // 2)
      sorting_df = cudf.DataFrame(
          {
              "object_key": object_key,
              "point_key": point_key,
              "xy_key": xy_key,
              "xy": coords,
          }
      )
      sorted_df = sorting_df.sort_values(by=sort_order).reset_index(
          drop=True
      )
      return sorted_df["xy"]
  
imports: from __future__ import annotations
  from typing import Generic, TypeVar
  import cupy
  import cudf
  from cudf import Series
  import cuspatial
  from cuspatial.core.binpreds.binpred_interface import BinPred, EqualsOpResult, ImpossiblePredicate, NotImplementedPredicate, PreprocessorResult
  from cuspatial.utils.binpred_utils import LineString, MultiPoint, Point, Polygon, _false_series
label_desc: Use image node_id 2 for calling the EqualsPredicateBase obj's underlying member method code with example usage: obj._sort_interleaved_points_by_offset(coords, offsets, sort_order) and returns: sorted_df