code: def discover_post_import_hooks(group):
      # New in 3.9: https://docs.python.org/3/library/importlib.resources.html#importlib.resources.files
      if sys.version_info.major > 2 and sys.version_info.minor > 8:
          from importlib.resources import (
              files,
          )  # pylint: disable=lazy-builtin-import
  
          for entrypoint in (
              resource.name
              for resource in files(group).iterdir()
              if resource.is_file()
          ):
              callback = _create_import_hook_from_entrypoint(entrypoint)
              register_post_import_hook(callback, entrypoint.name)
      else:
          from importlib.resources import (
              contents,
          )  # pylint: disable=lazy-builtin-import
  
          for entrypoint in contents(group):
              callback = _create_import_hook_from_entrypoint(entrypoint)
              register_post_import_hook(callback, entrypoint.name)
  
imports: import importlib
  import sys
  import threading
label_desc: Use image node_id 7 for calling a global function with example usage: discover_post_import_hooks(group) without return types