code: def fetch_inventory_group(
      name: str | None,
      uri: str,
      invs: tuple[str | None, ...],
      cache: dict[str, InventoryCacheEntry],
      app: Sphinx,
      now: int,
  ) -> bool:
      cache_time = now - app.config.intersphinx_cache_limit * 86400
      failures = []
      try:
          for inv in invs:
              if not inv:
                  inv = posixpath.join(uri, INVENTORY_FILENAME)
              # decide whether the inventory must be read: always read local
              # files; remote ones only if the cache time is expired
              if (
                  "://" not in inv
                  or uri not in cache
                  or cache[uri][1] < cache_time
              ):
                  safe_inv_url = _get_safe_url(inv)
                  logger.info(
                      __("loading intersphinx inventory from %s..."),
                      safe_inv_url,
                  )
                  try:
                      invdata = fetch_inventory(app, uri, inv)
                  except Exception as err:
                      failures.append(err.args)
                      continue
                  if invdata:
                      cache[uri] = name, now, invdata
                      return True
          return False
      finally:
          if failures == []:
              pass
          elif len(failures) < len(invs):
              logger.info(
                  __(
                      "encountered some issues with some of the inventories,"
                      " but they had working alternatives:"
                  )
              )
              for fail in failures:
                  logger.info(*fail)
          else:
              issues = "\n".join(f[0] % f[1:] for f in failures)
              logger.warning(
                  __(
                      "failed to reach any of the inventories "
                      "with the following issues:"
                  )
                  + "\n"
                  + issues
              )
  
imports: from __future__ import annotations
  import concurrent.futures
  import functools
  import posixpath
  import re
  import sys
  import time
  from os import path
  from typing import TYPE_CHECKING, cast
  from urllib.parse import urlsplit, urlunsplit
  from docutils import nodes
  from docutils.utils import relative_path
  import sphinx
  from sphinx.addnodes import pending_xref
  from sphinx.builders.html import INVENTORY_FILENAME
  from sphinx.errors import ExtensionError
  from sphinx.locale import _, __
  from sphinx.transforms.post_transforms import ReferencesResolver
  from sphinx.util import logging, requests
  from sphinx.util.docutils import CustomReSTDispatcher, SphinxRole
  from sphinx.util.inventory import InventoryFile
label_desc: Use image node_id 5 for calling a global function with example usage: fetch_inventory_group(name, uri, invs, cache, app, now) and returns: False, True