parameters: (
      obj: DataFrameOrSeries,
      labels: Union[ColumnLike, abc.Iterable, str],
      level: Union[int, str],
      errors: str,
  )
docstring: Remove rows specified by `labels`. If `errors=True`, an error is raised
      if some items in `labels` do not exist in `obj._index`.
  
      Will raise if level(int) is greater or equal to index nlevels
docstring_summary: Remove rows specified by `labels`. If `errors=True`, an error is raised
      if some items in `labels` do not exist in `obj._index`.
docstring_tokens: Remove rows specified by labels . If errors = True an error is raised if some items in labels do not exist in obj . _index .
function: def _drop_rows_by_labels(
      obj: DataFrameOrSeries,
      labels: Union[ColumnLike, abc.Iterable, str],
      level: Union[int, str],
      errors: str,
  ) -> DataFrameOrSeries:
      """Remove rows specified by `labels`. If `errors=True`, an error is raised
      if some items in `labels` do not exist in `obj._index`.
  
      Will raise if level(int) is greater or equal to index nlevels
      """
      if isinstance(level, int) and level >= obj.index.nlevels:
          raise ValueError("Param level out of bounds.")
  
      if not isinstance(labels, cudf.core.single_column_frame.SingleColumnFrame):
          labels = as_column(labels)
  
      if isinstance(obj._index, cudf.MultiIndex):
          if level is None:
              level = 0
  
          levels_index = obj.index.get_level_values(level)
          if errors == "raise" and not labels.isin(levels_index).all():
              raise KeyError("One or more values not found in axis")
  
          if isinstance(level, int):
              ilevel = level
          else:
              ilevel = obj._index.names.index(level)
  
          # 1. Merge Index df and data df along column axis:
          # | id | ._index df | data column(s) |
          idx_nlv = obj._index.nlevels
          working_df = obj._index.to_frame(index=False)
          working_df.columns = [i for i in range(idx_nlv)]
          for i, col in enumerate(obj._data):
              working_df[idx_nlv + i] = obj._data[col]
          # 2. Set `level` as common index:
          # | level | ._index df w/o level | data column(s) |
          working_df = working_df.set_index(level)
  
          # 3. Use "leftanti" join to drop
          # TODO: use internal API with "leftanti" and specify left and right
          # join keys to bypass logic check
          to_join = cudf.DataFrame(index=cudf.Index(labels, name=level))
          join_res = working_df.join(to_join, how="leftanti")
  
          # 4. Reconstruct original layout, and rename
          join_res.insert(
              ilevel, name=join_res._index.name, value=join_res._index
          )
          join_res = join_res.reset_index(drop=True)
  
          midx = cudf.MultiIndex.from_frame(
              join_res.iloc[:, 0:idx_nlv], names=obj._index.names
          )
  
          if isinstance(obj, cudf.Series):
              return obj.__class__._from_data(
                  join_res.iloc[:, idx_nlv:]._data, index=midx, name=obj.name
              )
          else:
              return obj.__class__._from_data(
                  join_res.iloc[:, idx_nlv:]._data,
                  index=midx,
                  columns=obj.columns,
              )
  
      else:
          if errors == "raise" and not labels.isin(obj.index).all():
              raise KeyError("One or more values not found in axis")
  
          key_df = cudf.DataFrame(index=labels)
          if isinstance(obj, cudf.Series):
              res = obj.to_frame(name="tmp").join(key_df, how="leftanti")["tmp"]
              res.name = obj.name
              return res
          else:
              return obj.join(key_df, how="leftanti")
function_tokens: def _drop_rows_by_labels ( obj : DataFrameOrSeries , labels : Union [ ColumnLike , abc . Iterable , str ] , level : Union [ int , str ] , errors : str , ) -> DataFrameOrSeries : if isinstance ( level , int ) and level >= obj . index . nlevels : raise ValueError ( "Param level out of bounds." ) if not isinstance ( labels , cudf . core . single_column_frame . SingleColumnFrame ) : labels = as_column ( labels ) if isinstance ( obj . _index , cudf . MultiIndex ) : if level is None : level = 0 levels_index = obj . index . get_level_values ( level ) if errors == "raise" and not labels . isin ( levels_index ) . all ( ) : raise KeyError ( "One or more values not found in axis" ) if isinstance ( level , int ) : ilevel = level else : ilevel = obj . _index . names . index ( level ) # 1. Merge Index df and data df along column axis: # | id | ._index df | data column(s) | idx_nlv = obj . _index . nlevels working_df = obj . _index . to_frame ( index = False ) working_df . columns = [ i for i in range ( idx_nlv ) ] for i , col in enumerate ( obj . _data ) : working_df [ idx_nlv + i ] = obj . _data [ col ] # 2. Set `level` as common index: # | level | ._index df w/o level | data column(s) | working_df = working_df . set_index ( level ) # 3. Use "leftanti" join to drop # TODO: use internal API with "leftanti" and specify left and right # join keys to bypass logic check to_join = cudf . DataFrame ( index = cudf . Index ( labels , name = level ) ) join_res = working_df . join ( to_join , how = "leftanti" ) # 4. Reconstruct original layout, and rename join_res . insert ( ilevel , name = join_res . _index . name , value = join_res . _index ) join_res = join_res . reset_index ( drop = True ) midx = cudf . MultiIndex . from_frame ( join_res . iloc [ : , 0 : idx_nlv ] , names = obj . _index . names ) if isinstance ( obj , cudf . Series ) : return obj . __class__ . _from_data ( join_res . iloc [ : , idx_nlv : ] . _data , index = midx , name = obj . name ) else : return obj . __class__ . _from_data ( join_res . iloc [ : , idx_nlv : ] . _data , index = midx , columns = obj . columns , ) else : if errors == "raise" and not labels . isin ( obj . index ) . all ( ) : raise KeyError ( "One or more values not found in axis" ) key_df = cudf . DataFrame ( index = labels ) if isinstance ( obj , cudf . Series ) : res = obj . to_frame ( name = "tmp" ) . join ( key_df , how = "leftanti" ) [ "tmp" ] res . name = obj . name return res else : return obj . join ( key_df , how = "leftanti" )