code: def _generate_extension_api():
      """Auto detect all available extensions and generate an API from them"""
      from datalad.support.entrypoints import iter_entrypoints
      from datalad.interface.base import (
          get_api_name,
          load_interface,
      )
  
      import logging
  
      lgr = logging.getLogger("datalad.api")
  
      for ename, _, (grp_descr, interfaces) in iter_entrypoints(
          "datalad.extensions", load=True
      ):
          for intfspec in interfaces:
              # turn the interface spec into an instance
              intf = load_interface(intfspec[:2])
              if intf is None:
                  lgr.error(
                      "Skipping unusable command interface '%s.%s' from extension %r",
                      intfspec[0],
                      intfspec[1],
                      ename,
                  )
                  continue
              api_name = get_api_name(intfspec)
              if api_name in globals():
                  lgr.debug(
                      "Command %s from extension %s is replacing a previously loaded implementation",
                      api_name,
                      ename,
                  )
              globals()[api_name] = intf.__call__
  
label_desc: Use image node_id 2 for calling a global function with example usage: _generate_extension_api() without return types