class_docstr: This is a preliminary implementation to centralize and validate the configuration.
  May be altered in the future.
  
  A helper class to validate configurations from yaml file.
  
  This serves the following purposes:
      1. Ensure all the options in the yaml are defined, raise error if not.
      2. when type mismatches are found, the validator will raise an error.
      3. a central place to store and display helpful messages for supported configurations.
class_docstr_tok: ["This","is","a","preliminary","implementation","to","centralize","and","validate","the","configuration",".","May","be","altered","in","the","future",".","A","helper","class","to","validate","configurations","from","yaml","file",".","This","serves","the","following","purposes",":","1",".","Ensure","all","the","options","in","the","yaml","are","defined",",","raise","error","if","not",".","2.","when","type","mismatches","are","found",",","the","validator","will","raise","an","error",".","3.","a","central","place","to","store","and","display","helpful","messages","for","supported","configurations","."]
docstr: Convert yaml config (dict-like) to list, required by argparse.
docstr_tok: ["Convert","yaml","config","(","dict-like",")","to","list",",","required","by","argparse","."]
code: def validate(self, config=None):
      """
      Convert yaml config (dict-like) to list, required by argparse.
      """
      for k, v in config.items():
          assert (
              k in self.arguments
          ), f"""{k} is not a valid argument. Support arguments are {self.format_arguments()}."""
  
          if self.arguments[k].type is not None:
              try:
                  self.arguments[k].val = self.arguments[k].type(v)
              except ValueError:
                  raise ValueError(
                      f"{k} is not a valid {self.arguments[k].type}."
                  )
  
          if self.arguments[k].choices is not None:
              assert (
                  v in self.arguments[k].choices
              ), f"""{k} must be one of {self.arguments[k].choices}."""
  
      return config
  
imports: import logging
  import json
  from typing import Dict
  from omegaconf import OmegaConf
  from lavis.common.registry import registry
label_desc: Use image node_id 5 for calling the ConfigValidator obj's underlying member method code with example usage: obj.validate(config) and returns: config