class_docstr: Provide methods to save, load, and overrides an omegaconf config object
  which may contain definition of lazily-constructed objects.
class_docstr_tok: ["Provide","methods","to","save",",","load",",","and","overrides","an","omegaconf","config","object","which","may","contain","definition","of","lazily-constructed","objects","."]
docstr: In-place override contents of cfg.
  
  Args:
      cfg: an omegaconf config object
      overrides: list of strings in the format of "a=b" to override configs.
          See https://hydra.cc/docs/next/advanced/override_grammar/basic/
          for syntax.
  
  Returns:
      the cfg object
docstr_tok: ["In-place","override","contents","of","cfg",".","Args",":","cfg",":","an","omegaconf","config","object","overrides",":","list","of","strings","in","the","format","of","``","a=b","''","to","override","configs",".","See","https",":","\/\/hydra.cc\/docs\/next\/advanced\/override_grammar\/basic\/","for","syntax",".","Returns",":","the","cfg","object"]
code: def apply_overrides(cfg, overrides: List[str]):
      """
      In-place override contents of cfg.
  
      Args:
          cfg: an omegaconf config object
          overrides: list of strings in the format of "a=b" to override configs.
              See https://hydra.cc/docs/next/advanced/override_grammar/basic/
              for syntax.
  
      Returns:
          the cfg object
      """
  
      def safe_update(cfg, key, value):
          parts = key.split(".")
          for idx in range(1, len(parts)):
              prefix = ".".join(parts[:idx])
              v = OmegaConf.select(cfg, prefix, default=None)
              if v is None:
                  break
              if not OmegaConf.is_config(v):
                  raise KeyError(
                      f"Trying to update key {key}, but {prefix} "
                      f"is not a config, but has type {type(v)}."
                  )
          OmegaConf.update(cfg, key, value, merge=True)
  
      try:
          from hydra.core.override_parser.overrides_parser import (
              OverridesParser,
          )
  
          has_hydra = True
      except ImportError:
          has_hydra = False
  
      if has_hydra:
          parser = OverridesParser.create()
          overrides = parser.parse_overrides(overrides)
          for o in overrides:
              key = o.key_or_group
              value = o.value()
              if o.is_delete():
                  # TODO support this
                  raise NotImplementedError(
                      "deletion is not yet a supported override"
                  )
              safe_update(cfg, key, value)
      else:
          # Fallback. Does not support all the features and error checking like hydra.
          for o in overrides:
              key, value = o.split("=")
              try:
                  value = eval(value, {})
              except NameError:
                  pass
              safe_update(cfg, key, value)
      return cfg
  
imports: import ast
  import builtins
  import collections.abc
  import importlib
  import inspect
  import logging
  import os
  import uuid
  from contextlib import contextmanager
  from copy import deepcopy
  from dataclasses import is_dataclass
  from typing import List, Tuple, Union
  import cloudpickle
  import yaml
  from omegaconf import DictConfig, ListConfig, OmegaConf, SCMode
  from detectron2.utils.file_io import PathManager
  from detectron2.utils.registry import _convert_target_to_string
label_desc: Use image node_id 4 for calling the LazyConfig obj's underlying member method code with example usage: obj.apply_overrides(cfg, overrides) and returns: cfg