code: def dict_to_json(dict, fname):
      """Dump a :python:`Python` dictionary to a JSON file.
  
      Args:
          dict (dict): The :python:`Python` dictionary.
          fname (str): The output file name.
      """
      with open(fname, "a") as f:
          json.dump(dict, f)
          f.write("\n")
  
file_path: pytorch_geometric/torch_geometric/graphgym/utils/io.py
imports: import ast
  import json
  import os
  import os.path
  from torch_geometric.io import fs
label_desc: Use image node_id 2 for calling a global function with example usage: dict_to_json(dict, fname) without return types