code: def save_arg_dict(opts, filename="settings.txt"):
      def _format_value(v):
          if isinstance(v, float):
              return "{:.4f}".format(v)
          elif isinstance(v, int):
              return "{:d}".format(v)
          else:
              return "{}".format(v)
  
      save_path = os.path.join(opts["log_dir"], filename)
      with open(save_path, "w") as f:
          for key, value in opts.items():
              f.write("{}\t{}\n".format(key, _format_value(value)))
      print("Saved settings to {}".format(save_path))
  
file_path: dgl/examples/pytorch/dgmg/utils.py
imports: import datetime
  import os
  import random
  from pprint import pprint
  import matplotlib.pyplot
  import torch
  import torch.backends.cudnn
  import torch.nn
  import torch.nn.init
label_desc: Use image node_id 4 for calling a global function with example usage: save_arg_dict(opts, filename) and returns: str, str, str