docstr: Given a collection of external vertex ids, return the internal vertex
  ids combined with the input data.
  If a series-type input is provided then the series will be in a column
  named '0'. Otherwise the input column names in the DataFrame will be
  preserved.
  
  Parameters
  ----------
  df: cudf.DataFrame, cudf.Series, dask_cudf.DataFrame, dask_cudf.Series
      Contains a list of external vertex identifiers that will be
      converted into internal vertex identifiers
  
  id_column_name: string, optional (default="id")
      The name to be applied to the column containing the id
  
  col_names: list of strings, optional (default=None)
      This list of 1 or more strings contain the names
      of the columns that uniquely identify an external
      vertex identifier
  
  drop: boolean, optional (default=False)
      If True, drop the column names specified in col_names from
      the returned DataFrame.
  
  preserve_order: boolean, optional (default=False)
      If True, do extra sorting work to preserve the order
      of the input DataFrame.
  
  Returns
  ---------
  df : cudf.DataFrame or dask_cudf.DataFrame
      A DataFrame containing the input data (DataFrame or series)
      with an additional column containing the internal vertex id.
      Note that there is no guarantee of the order or partitioning
      of elements in the returned DataFrame.
docstr_tok: ["Given","a","collection","of","external","vertex","ids",",","return","the","internal","vertex","ids","combined","with","the","input","data",".","If","a","series-type","input","is","provided","then","the","series","will","be","in","a","column","named","'","0","'",".","Otherwise","the","input","column","names","in","the","DataFrame","will","be","preserved",".","Parameters","--","--","--","--","--","df",":","cudf.DataFrame",",","cudf.Series",",","dask_cudf.DataFrame",",","dask_cudf.Series","Contains","a","list","of","external","vertex","identifiers","that","will","be","converted","into","internal","vertex","identifiers","id_column_name",":","string",",","optional","(","default=","''","id","''",")","The","name","to","be","applied","to","the","column","containing","the","id","col_names",":","list","of","strings",",","optional","(","default=None",")","This","list","of","1","or","more","strings","contain","the","names","of","the","columns","that","uniquely","identify","an","external","vertex","identifier","drop",":","boolean",",","optional","(","default=False",")","If","True",",","drop","the","column","names","specified","in","col_names","from","the","returned","DataFrame",".","preserve_order",":","boolean",",","optional","(","default=False",")","If","True",",","do","extra","sorting","work","to","preserve","the","order","of","the","input","DataFrame",".","Returns","--","--","--","--","-","df",":","cudf.DataFrame","or","dask_cudf.DataFrame","A","DataFrame","containing","the","input","data","(","DataFrame","or","series",")","with","an","additional","column","containing","the","internal","vertex","id",".","Note","that","there","is","no","guarantee","of","the","order","or","partitioning","of","elements","in","the","returned","DataFrame","."]
code: def add_internal_vertex_id(
      self,
      df,
      id_column_name="id",
      col_names=None,
      drop=False,
      preserve_order=False,
  ):
      """
      Given a collection of external vertex ids, return the internal vertex
      ids combined with the input data.
      If a series-type input is provided then the series will be in a column
      named '0'. Otherwise the input column names in the DataFrame will be
      preserved.
  
      Parameters
      ----------
      df: cudf.DataFrame, cudf.Series, dask_cudf.DataFrame, dask_cudf.Series
          Contains a list of external vertex identifiers that will be
          converted into internal vertex identifiers
  
      id_column_name: string, optional (default="id")
          The name to be applied to the column containing the id
  
      col_names: list of strings, optional (default=None)
          This list of 1 or more strings contain the names
          of the columns that uniquely identify an external
          vertex identifier
  
      drop: boolean, optional (default=False)
          If True, drop the column names specified in col_names from
          the returned DataFrame.
  
      preserve_order: boolean, optional (default=False)
          If True, do extra sorting work to preserve the order
          of the input DataFrame.
  
      Returns
      ---------
      df : cudf.DataFrame or dask_cudf.DataFrame
          A DataFrame containing the input data (DataFrame or series)
          with an additional column containing the internal vertex id.
          Note that there is no guarantee of the order or partitioning
          of elements in the returned DataFrame.
      """
      tmp_df = None
      tmp_col_names = None
      can_drop = True
      if type(df) is cudf.Series:
          tmp_df = df.to_frame("0")
          tmp_col_names = ["0"]
          can_drop = False
      elif type(df) is dask_cudf.Series:
          tmp_df = df.to_frame("0")
          tmp_col_names = ["0"]
          can_drop = False
      else:
          tmp_df = df
  
          if isinstance(col_names, list):
              tmp_col_names = col_names
          else:
              tmp_col_names = [col_names]
  
      return self.implementation.add_internal_vertex_id(
          tmp_df,
          id_column_name,
          tmp_col_names,
          (drop and can_drop),
          preserve_order,
      )
  
file_path: cugraph/python/cugraph/cugraph/structure/number_map.py
imports: from collections.abc import Iterable
  import dask_cudf
  import numpy
  import cudf
  import warnings
label_desc: Use image node_id 6 for calling the NumberMap obj's underlying member method code with example usage: obj.add_internal_vertex_id(df, id_column_name, col_names, drop, preserve_order) and returns: self