class_docstr: Class for tracking options.
  
  Functions like a dict, but allows us to track the history of arguments as they are
  set.
class_docstr_tok: ["Class","for","tracking","options",".","Functions","like","a","dict",",","but","allows","us","to","track","the","history","of","arguments","as","they","are","set","."]
docstr: Save the opt to disk.
  
  Attempts to 'clean up' any residual values automatically.
docstr_tok: ["Save","the","opt","to","disk",".","Attempts","to","'clean","up","'","any","residual","values","automatically","."]
code: def save(self, filename: str) -> None:
      """
      Save the opt to disk.
  
      Attempts to 'clean up' any residual values automatically.
      """
      # start with a shallow copy
      dct = dict(self)
  
      # clean up some things we probably don't want to save
      for key in __AUTOCLEAN_KEYS__:
          if key in dct:
              del dct[key]
  
      with PathManager.open(filename, "w", encoding="utf-8") as f:
          json.dump(dct, fp=f, indent=4)
          # extra newline for convenience of working with jq
          f.write("\n")
  
imports: from __future__ import annotations
  import copy
  import json
  import pickle
  import traceback
  import os
  import pkg_resources
  import parlai.utils.logging
  from typing import List
  from parlai.utils.io import PathManager
label_desc: Use image node_id 9 for calling the Opt obj's underlying member method code with example usage: obj.save(filename) without return types