code: def df_score_to_dictionary(df, k, v="vertex"):
      """
      Convert a dataframe to a dictionary
  
      Parameters
      ----------
       df : cudf.DataFrame
          GPU data frame containing two cudf.Series of size V: the vertex
          identifiers and the corresponding score values.
          Please note that the resulting the 'vertex' column might not be
          in ascending order.
  
          df['vertex'] : cudf.Series
              Contains the vertex identifiers
          df[..] : cudf.Series
              Contains the scores of the vertices
  
      k : str
          score column name
      v : str
          the vertex column name. Default is "vertex"
  
  
      Returns
      -------
      dict : Dictionary of vertices and score
  
      """
      df = df.sort_values(by=v)
      return df.to_pandas().set_index(v).to_dict()[k]
  
file_path: cugraph/python/cugraph/cugraph/utilities/nx_factory.py
imports: import cugraph
  from .utils import import_optional
  import cudf
  from cudf import from_pandas
  from cudf.api.types import is_integer_dtype
label_desc: Use image node_id 5 for calling a global function with example usage: df_score_to_dictionary(df, k, v) and returns: df