docstr: Prepare the allpairs result of a contains_properly call as
  the first step of postprocessing. An allpairs result is reindexed
  by replacing the polygon index with the original index of the
  polygon from the lhs.
  
  Parameters
  ----------
  lhs : GeoSeries
      The left-hand side of the binary predicate.
  op_result : ContainsProperlyOpResult
      The result of the contains_properly call.
  
  Returns
  -------
  cudf.DataFrame
      A cudf.DataFrame with two columns: `polygon_index` and
      `point_index`. The `polygon_index` column contains the index
      of the polygon from the original lhs that contains the point,
      and the `point_index` column contains the index of the point
      from the preprocessor final_rhs input to point-in-polygon.
docstr_tok: ["Prepare","the","allpairs","result","of","a","contains_properly","call","as","the","first","step","of","postprocessing",".","An","allpairs","result","is","reindexed","by","replacing","the","polygon","index","with","the","original","index","of","the","polygon","from","the","lhs",".","Parameters","--","--","--","--","--","lhs",":","GeoSeries","The","left-hand","side","of","the","binary","predicate",".","op_result",":","ContainsProperlyOpResult","The","result","of","the","contains_properly","call",".","Returns","--","--","--","-","cudf.DataFrame","A","cudf.DataFrame","with","two","columns",":","`","polygon_index","`","and","`","point_index","`",".","The","`","polygon_index","`","column","contains","the","index","of","the","polygon","from","the","original","lhs","that","contains","the","point",",","and","the","`","point_index","`","column","contains","the","index","of","the","point","from","the","preprocessor","final_rhs","input","to","point-in-polygon","."]
code: def _reindex_allpairs(self, lhs, op_result) -> DataFrame:
      """Prepare the allpairs result of a contains_properly call as
      the first step of postprocessing. An allpairs result is reindexed
      by replacing the polygon index with the original index of the
      polygon from the lhs.
  
      Parameters
      ----------
      lhs : GeoSeries
          The left-hand side of the binary predicate.
      op_result : ContainsProperlyOpResult
          The result of the contains_properly call.
  
      Returns
      -------
      cudf.DataFrame
          A cudf.DataFrame with two columns: `polygon_index` and
          `point_index`. The `polygon_index` column contains the index
          of the polygon from the original lhs that contains the point,
          and the `point_index` column contains the index of the point
          from the preprocessor final_rhs input to point-in-polygon.
      """
      # Convert the quadtree part indices df into a polygon indices df
      polygon_indices = (
          self._convert_quadtree_result_from_part_to_polygon_indices(
              lhs, op_result.pip_result
          )
      )
      # Because the quadtree contains_properly call returns a list of
      # points that are contained in each part, parts can be duplicated
      # once their index is converted to a polygon index.
      allpairs_result = polygon_indices.drop_duplicates()
  
      # TODO: This is slow and needs optimization
      # Replace the polygon index with the original index
      allpairs_result["polygon_index"] = allpairs_result[
          "polygon_index"
      ].replace(Series(lhs.index, index=cp.arange(len(lhs.index))))
  
      return allpairs_result
  
file_path: cuspatial/python/cuspatial/cuspatial/core/binpreds/contains_geometry_processor.py
imports: import cupy
  import cudf
  from cudf.core.dataframe import DataFrame
  from cudf.core.series import Series
  from cuspatial.core._column.geocolumn import GeoColumn
  from cuspatial.core.binpreds.binpred_interface import BinPred, PreprocessorResult
  from cuspatial.utils.binpred_utils import _count_results_in_multipoint_geometries, _false_series, _true_series
  from cuspatial.utils.column_utils import contains_only_linestrings, contains_only_multipoints, contains_only_polygons
label_desc: Use image node_id 3 for calling the ContainsGeometryProcessor obj's underlying member method code with example usage: obj._reindex_allpairs(lhs, op_result) and returns: allpairs_result