code: def df_edge_score_to_dictionary(df, k, src="src", dst="dst"):
      """
      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[X] : cudf.Series
              Contains the scores of the vertices
  
      k : str
          score column name
  
      src : str
          source column name
      dst : str
          destination column name
  
      Returns
      -------
      dict : Dictionary of vertices and score
  
      """
      pdf = df.sort_values(by=[src, dst]).to_pandas()
      d = {}
      for i in range(len(pdf)):
          d[(pdf[src][i], pdf[dst][i])] = pdf[k][i]
  
      return d
  
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 6 for calling a global function with example usage: df_edge_score_to_dictionary(df, k, src, dst) and returns: d