code: def reindex_edgelist(df, src, dst):
      """Since DGL needs integer contiguous node labels, this relabels as pre-processing step
  
      :eg
          df, ordered_nodes_dict = reindex_edgelist(df, 'to_node', 'from_node')
          creates new columns given by config.SRC and config.DST
      :param df: edge dataFrame
      :param src: source column of dataframe
      :param dst: destination column of dataframe
  
      :returns
          df, pandas DataFrame with new edges.
          ordered_nodes_dict, dict ordered from most common src and dst nodes.
      """
      srclist = df[src]
      dstlist = df[dst]
      cnt = Counter(
          pd.concat([srclist, dstlist], axis=0)
      )  # can also use pd.Factorize but doesn't order by count, which is satisfying
      ordered_nodes_dict = {
          k: i for i, (k, c) in enumerate(cnt.most_common())
      }
      df[config.SRC] = df[src].apply(lambda x: ordered_nodes_dict[x])
      df[config.DST] = df[dst].apply(lambda x: ordered_nodes_dict[x])
      return df, ordered_nodes_dict
  
imports: from collections import Counter
  from typing import Dict, Optional, TYPE_CHECKING, Tuple
  import numpy
  import pandas
  from .None import constants
  from .feature_utils import FeatureEngine, FeatureMixin, resolve_feature_engine, XSymbolic, YSymbolic, resolve_X, resolve_y
  from .util import setup_logger
label_desc: Use image node_id 5 for calling a global function with example usage: reindex_edgelist(df, src, dst) and returns: df,  ordered_nodes_dict