code: def __init__(self, root: str, config_cls: NamedTuple):
      self.root = root
      self.path = op.join(root, self.JSON_FILENAME)
      if op.exists(self.path):
          self.cfg = VizSeqJson.load_from_path(self.path)
      else:
          self.cfg = config_cls()._asdict()
          VizSeqJson.dump_to_path(self.cfg, self.path)
  
imports: import os.path
  from typing import List, NamedTuple, Any
  from vizseq._utils.json import VizSeqJson
  from vizseq.scorers import get_scorer_ids
  from .tokenizers import VizSeqTokenization
label_desc: Use image node_id 1 to create a new VizSeqBaseConfigManager object from inherited base classes: object with example: obj = VizSeqBaseConfigManager(root, config_cls)