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: Load an Opt from disk.
docstr_tok: ["Load","an","Opt","from","disk","."]
code: def load(cls, optfile: str) -> Opt:
      """
      Load an Opt from disk.
      """
      try:
          # try json first
          with PathManager.open(
              optfile, "r", encoding="utf-8"
          ) as t_handle:
              dct = json.load(t_handle)
      except UnicodeDecodeError:
          # oops it's pickled
          with PathManager.open(optfile, "rb") as b_handle:
              dct = pickle.load(b_handle)
      for key in __AUTOCLEAN_KEYS__:
          if key in dct:
              del dct[key]
      return cls(dct)
  
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 10 for calling the Opt obj's underlying member method code with example usage: obj.load(cls, optfile) and returns: cls