class_docstr: Class which stores vertex and edge properties that can be used to construct
  Graphs from individual property selections and used later to annotate graph
  algorithm results with corresponding properties.
class_docstr_tok: ["Class","which","stores","vertex","and","edge","properties","that","can","be","used","to","construct","Graphs","from","individual","property","selections","and","used","later","to","annotate","graph","algorithm","results","with","corresponding","properties","."]
docstr: Renumber vertex IDs to be contiguous by type.
  
  Parameters
  ----------
  prev_id_column : str, optional
      Column name to save the vertex ID before renumbering.
  
  Returns a DataFrame with the start and stop IDs for each vertex type.
  Stop is *inclusive*.
docstr_tok: ["Renumber","vertex","IDs","to","be","contiguous","by","type",".","Parameters","--","--","--","--","--","prev_id_column",":","str",",","optional","Column","name","to","save","the","vertex","ID","before","renumbering",".","Returns","a","DataFrame","with","the","start","and","stop","IDs","for","each","vertex","type",".","Stop","is","*","inclusive","*","."]
code: def renumber_vertices_by_type(self, prev_id_column=None):
      """Renumber vertex IDs to be contiguous by type.
  
      Parameters
      ----------
      prev_id_column : str, optional
          Column name to save the vertex ID before renumbering.
  
      Returns a DataFrame with the start and stop IDs for each vertex type.
      Stop is *inclusive*.
      """
      # Check if some vertex IDs exist only in edge data
      TCN = self.type_col_name
      default = self._default_type_name
      if (
          self.__edge_prop_dataframe is not None
          and self.get_num_vertices(default, include_edge_data=True)
          != self.get_num_vertices(default, include_edge_data=False)
      ):
          raise NotImplementedError(
              "Currently unable to renumber vertices when some vertex "
              "IDs only exist in edge data"
          )
      if self.__vertex_prop_dataframe is None:
          return None
      if (
          prev_id_column is not None
          and prev_id_column in self.__vertex_prop_dataframe
      ):
          raise ValueError(
              f"Can't save previous IDs to existing column {prev_id_column!r}"
          )
  
      # Use categorical dtype for the type column
      if self.__series_type is dask_cudf.Series:
          cat_class = cudf.CategoricalDtype
      else:
          cat_class = pd.CategoricalDtype
  
      is_cat = isinstance(
          self.__vertex_prop_dataframe.dtypes[TCN], cat_class
      )
      if not is_cat:
          cat_dtype = cat_class([TCN], ordered=False)
          self.__vertex_prop_dataframe[
              TCN
          ] = self.__vertex_prop_dataframe[TCN].astype(cat_dtype)
  
      df = self.__vertex_prop_dataframe
      index_dtype = df.index.dtype
  
      # FIXME DASK_CUDF: https://github.com/rapidsai/cudf/issues/11795
      cat_dtype = df.dtypes[TCN]
      df[TCN] = df[TCN].astype(str)
  
      # Include self.vertex_col_name when sorting by values to ensure we can
      # evenly distribute the data across workers.
      df = df.reset_index().persist()
      if len(cat_dtype.categories) > 1 and len(self.vertex_types) > 1:
          # `self.vertex_types` is currently not cheap, b/c it looks at edge df
          df = df.sort_values(
              by=[TCN, self.vertex_col_name], ignore_index=True
          ).persist()
      if self.__edge_prop_dataframe is not None:
          new_name = f"new_{self.vertex_col_name}"
          df[new_name] = 1
          df[new_name] = df[new_name].cumsum() - 1
          mapper = df[[self.vertex_col_name, new_name]]
          edge_index_dtype = self.__edge_prop_dataframe.index.dtype
          self.__edge_prop_dataframe = (
              self.__edge_prop_dataframe
              # map src_col_name IDs
              .merge(
                  mapper,
                  left_on=self.src_col_name,
                  right_on=self.vertex_col_name,
              )
              .drop(columns=[self.src_col_name, self.vertex_col_name])
              .rename(columns={new_name: self.src_col_name})
              # map dst_col_name IDs
              .merge(
                  mapper,
                  left_on=self.dst_col_name,
                  right_on=self.vertex_col_name,
              )
              .drop(columns=[self.dst_col_name, self.vertex_col_name])
              .rename(columns={new_name: self.dst_col_name})
          )
          self.__edge_prop_dataframe.index = (
              self.__edge_prop_dataframe.index.astype(edge_index_dtype)
          )
          self.__edge_prop_dataframe.index = (
              self.__edge_prop_dataframe.index.rename(
                  self.edge_id_col_name
              )
          )
          if prev_id_column is None:
              df[self.vertex_col_name] = df[new_name]
              del df[new_name]
          else:
              df = df.rename(
                  columns={
                      new_name: self.vertex_col_name,
                      self.vertex_col_name: prev_id_column,
                  }
              )
      else:
          if prev_id_column is not None:
              df[prev_id_column] = df[self.vertex_col_name]
          df[self.vertex_col_name] = 1
          df[self.vertex_col_name] = (
              df[self.vertex_col_name].cumsum() - 1
          )
  
      # FIXME DASK_CUDF: https://github.com/rapidsai/cudf/issues/11795
      df[TCN] = df[TCN].astype(cat_dtype)
  
      df[self.vertex_col_name] = df[self.vertex_col_name].astype(
          index_dtype
      )
      self.__vertex_prop_dataframe = (
          df.persist()
          .set_index(self.vertex_col_name, sorted=True)
          .persist()
      )
  
      # FIXME DASK_CUDF: https://github.com/rapidsai/cudf/issues/11795
      df = self._vertex_type_value_counts
      cat_dtype = df.index.dtype
      df.index = df.index.astype(str)
  
      # self._vertex_type_value_counts
      rv = df.sort_index().cumsum().to_frame("stop")
  
      # FIXME DASK_CUDF: https://github.com/rapidsai/cudf/issues/11795
      df.index = df.index.astype(cat_dtype)
  
      rv["start"] = rv["stop"].shift(1, fill_value=0)
      rv["stop"] -= 1  # Make inclusive
      return rv[["start", "stop"]]
  
imports: import cudf
  import cupy
  import cugraph
  import dask_cudf
  import cugraph.dask
  from cugraph.utilities.utils import import_optional, create_list_series_from_2d_ar
  from typing import Union
label_desc: Use image node_id 30 for calling the EXPERIMENTAL__MGPropertyGraph obj's underlying member method code with example usage: obj.renumber_vertices_by_type(prev_id_column) and returns: rv, None