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: Like load, but also looks in opt_presets folders.
  
  optfile may also be a comma-separated list of multiple presets/files.
docstr_tok: ["Like","load",",","but","also","looks","in","opt_presets","folders",".","optfile","may","also","be","a","comma-separated","list","of","multiple","presets\/files","."]
code: def load_init(cls, optfile: str) -> Opt:
      """
      Like load, but also looks in opt_presets folders.
  
      optfile may also be a comma-separated list of multiple presets/files.
      """
      if "," in optfile:
          # load and combine each of the individual files
          new_opt = cls()
          for subopt in optfile.split(","):
              new_opt.update(cls.load_init(subopt))
          return new_opt
  
      oa_filename = os.path.join("opt_presets", optfile + ".opt")
      user_filename = os.path.join(
          os.path.expanduser(f"~/.parlai"), oa_filename
      )
      if PathManager.exists(optfile):
          return cls.load(optfile)
      elif PathManager.exists(user_filename):
          # use a user's custom opt preset
          return cls.load(user_filename)
      else:
          # Maybe a bundled opt preset
          for root in ["parlai", "parlai_internal", "parlai_fb"]:
              try:
                  if pkg_resources.resource_exists(root, oa_filename):
                      return cls.load(
                          pkg_resources.resource_filename(
                              root, oa_filename
                          )
                      )
              except ModuleNotFoundError:
                  continue
  
      # made it through without a return path so raise the error
      raise FileNotFoundError(
          f"Could not find filename '{optfile} or opt preset '{optfile}.opt'. "
          "Please check https://parl.ai/docs/opt_presets.html for a list "
          "of available opt presets."
      )
  
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 11 for calling the Opt obj's underlying member method code with example usage: obj.load_init(cls, optfile) and returns: new_opt, cls, cls, cls