code: def load_plugins_from_plugin_directory():
      """Load and register Airflow Plugins from plugins directory."""
      global import_errors
      log.debug(
          "Loading plugins from directory: %s", settings.PLUGINS_FOLDER
      )
  
      for file_path in find_path_from_directory(
          settings.PLUGINS_FOLDER, ".airflowignore"
      ):
          path = Path(file_path)
          if not path.is_file() or path.suffix != ".py":
              continue
          mod_name = path.stem
  
          try:
              loader = importlib.machinery.SourceFileLoader(
                  mod_name, file_path
              )
              spec = importlib.util.spec_from_loader(mod_name, loader)
              mod = importlib.util.module_from_spec(spec)
              sys.modules[spec.name] = mod
              loader.exec_module(mod)
              log.debug("Importing plugin module %s", file_path)
  
              for mod_attr_value in (
                  m for m in mod.__dict__.values() if is_valid_plugin(m)
              ):
                  plugin_instance = mod_attr_value()
                  plugin_instance.source = PluginsDirectorySource(
                      file_path
                  )
                  register_plugin(plugin_instance)
          except Exception as e:
              log.exception("Failed to import plugin %s", file_path)
              import_errors[file_path] = str(e)
  
imports: from __future__ import annotations
  import importlib
  import importlib.machinery
  import importlib.util
  import inspect
  import logging
  import os
  import sys
  import types
  from pathlib import Path
  from typing import TYPE_CHECKING, Any, Iterable
  from airflow import settings
  from airflow.utils.entry_points import entry_points_with_dist
  from airflow.utils.file import find_path_from_directory
  from airflow.utils.module_loading import import_string, qualname
label_desc: Use image node_id 4 for calling a global function with example usage: load_plugins_from_plugin_directory() without return types