code: def _load_model_config_from_yaml_rec(
      cfg: DictConfig, config_path: str
  ) -> DictConfig:
      cfg_loaded = OmegaConf.load(config_path)
      cfg_model_loaded = None
      if "model_factory_ImplicitronModelFactory_args" in cfg_loaded:
          factory_args = (
              cfg_loaded.model_factory_ImplicitronModelFactory_args
          )
          if "model_GenericModel_args" in factory_args:
              cfg_model_loaded = factory_args.model_GenericModel_args
      defaults = cfg_loaded.pop("defaults", None)
      if defaults is not None:
          for default_name in defaults:
              if default_name in ("_self_", "default_config"):
                  continue
              default_name = os.path.splitext(default_name)[0]
              defpath = os.path.join(
                  os.path.dirname(config_path), default_name + ".yaml"
              )
              cfg = _load_model_config_from_yaml_rec(cfg, defpath)
              if cfg_model_loaded is not None:
                  cfg = OmegaConf.merge(cfg, cfg_model_loaded)
      elif cfg_model_loaded is not None:
          cfg = OmegaConf.merge(cfg, cfg_model_loaded)
      return cfg
  
imports: import os
  import unittest
  import torch
  from omegaconf import DictConfig, OmegaConf
  from pytorch3d.implicitron.models.generic_model import GenericModel
  from pytorch3d.implicitron.models.renderer.base import EvaluationMode
  from pytorch3d.implicitron.tools.config import expand_args_fields, get_default_args
  from pytorch3d.renderer.cameras import look_at_view_transform, PerspectiveCameras
  from tests.common_testing import get_pytorch3d_dir
  from .common_resources import provide_resnet34
label_desc: Use image node_id 3 for calling a global function with example usage: _load_model_config_from_yaml_rec(cfg, config_path) and returns: cfg