code: def save_config(opt, save_dir):
      if not os.path.exists(save_dir):
          os.makedirs(save_dir, exist_ok=True)
      with open(os.path.join(save_dir, "opt.pkl"), "wb") as f:
          pickle.dump(opt, f)
  
file_path: graph4nlp/examples/pytorch/nmt/utils.py
imports: import logging
  import math
  import os
  import pickle
  import torch
  import torchtext.vocab
  from torch.optim.lr_scheduler import LambdaLR
  from graph4nlp.pytorch.modules.utils.vocab_utils import Vocab
label_desc: Use image node_id 1 for calling a global function with example usage: save_config(opt, save_dir) without return types