code: def convert_conf(part_config):
      with open(part_config, "r+", encoding="utf-8") as f:
          config = json.load(f)
          logging.info(
              "Checking if the provided json file need to be changed."
          )
          if is_old_version(config):
              logging.info("Changing the partition configuration file.")
              canonical_etypes = {}
              if len(config[NTYPES_KEY]) == 1:
                  ntype = list(config[NTYPES_KEY].keys())[0]
                  canonical_etypes = {
                      CANONICAL_ETYPE_DELIMITER.join(
                          (ntype, etype, ntype)
                      ): eid
                      for etype, eid in config[ETYPES_KEY].items()
                  }
              else:
                  canonical_etypes = etype2canonical_etype(
                      part_config, config
                  )
              reverse_c_etypes = {
                  v: k for k, v in canonical_etypes.items()
              }
              # Convert edge_map keys from etype -> c_etype.
              new_edge_map = {}
              for e_type, range in config[EDGE_MAP_KEY].items():
                  eid = config[ETYPES_KEY][e_type]
                  c_etype = reverse_c_etypes[eid]
                  new_edge_map[c_etype] = range
              config[EDGE_MAP_KEY] = new_edge_map
              config[ETYPES_KEY] = canonical_etypes
              logging.info("Dumping the content to disk.")
              f.seek(0)
              json.dump(config, f, indent=4)
              f.truncate()
  
file_path: dgl/tools/change_etype_to_canonical_etype.py
imports: import argparse
  import json
  import logging
  import os
  import time
  import dgl
  import torch
  from dgl._ffi.base import DGLError
  from dgl.data.utils import load_graphs
  from dgl.utils import toindex
label_desc: Use image node_id 1 for calling a global function with example usage: convert_conf(part_config) without return types