code: def load_bundle_config(
      bundle_path: str, *config_names: str, **load_kw_args: Any
  ) -> Any:
      """
      Load the metadata and nominated configuration files from a MONAI bundle without loading the network itself.
  
      This function will load the information from the bundle, which can be a directory or a zip file containing a
      directory or a Torchscript bundle, and return the parser object with the information. This saves having to load
      the model if only the information is wanted, and can work on any sort of bundle format.
  
      Args:
          bundle_path: path to the bundle directory or zip file
          config_names: names of configuration files with extensions to load, should not be full paths but just name+ext
          load_kw_args: keyword arguments to pass to the ConfigParser object when loading
  
      Returns:
          ConfigParser object containing the parsed information
      """
  
      from monai.bundle.config_parser import (
          ConfigParser,
      )  # avoids circular import
  
      parser = ConfigParser()
  
      if not os.path.exists(bundle_path):
          raise ValueError(
              f"Cannot find bundle file/directory '{bundle_path}'"
          )
  
      # bundle is a directory, read files directly
      if os.path.isdir(bundle_path):
          conf_data = []
          parser.read_meta(
              f=os.path.join(bundle_path, "configs", "metadata.json"),
              **load_kw_args,
          )
  
          for cname in config_names:
              cpath = os.path.join(bundle_path, "configs", cname)
              if not os.path.exists(cpath):
                  raise ValueError(f"Cannot find config file '{cpath}'")
  
              conf_data.append(cpath)
  
          parser.read_config(f=conf_data, **load_kw_args)
      else:
          # bundle is a zip file which is either a zipped directory or a Torchscript archive
  
          name, _ = os.path.splitext(os.path.basename(bundle_path))
  
          archive = zipfile.ZipFile(bundle_path, "r")
  
          all_files = archive.namelist()
  
          zip_meta_name = f"{name}/configs/metadata.json"
  
          if zip_meta_name in all_files:
              prefix = f"{name}/configs/"  # zipped directory location for files
          else:
              zip_meta_name = f"{name}/extra/metadata.json"
              prefix = (
                  f"{name}/extra/"  # Torchscript location for files
              )
  
          meta_json = json.loads(archive.read(zip_meta_name))
          parser.read_meta(f=meta_json)
  
          for cname in config_names:
              full_cname = prefix + cname
              if full_cname not in all_files:
                  raise ValueError(
                      f"Cannot find config file '{full_cname}'"
                  )
  
              ardata = archive.read(full_cname)
  
              if full_cname.lower().endswith("json"):
                  cdata = json.loads(ardata, **load_kw_args)
              elif full_cname.lower().endswith(("yaml", "yml")):
                  cdata = yaml.safe_load(ardata, **load_kw_args)
  
              parser.read_config(f=cdata)
  
      return parser
  
file_path: MONAI/monai/bundle/utils.py
imports: from __future__ import annotations
  import json
  import os
  import zipfile
  from typing import Any
  from monai.config.deviceconfig import get_config_values
  from monai.utils import optional_import
label_desc: Use image node_id 1 for calling a global function with example usage: load_bundle_config(bundle_path) and returns: parser