code: def _load_plugin_from_file(filepath: str) -> "LightningPlugin":
      from lightning.app.plugin.plugin import LightningPlugin
  
      # TODO: Plugin should be run in the context of the created main module here
      plugins, _ = _load_objects_from_file(
          filepath,
          LightningPlugin,
          raise_exception=True,
          mock_imports=False,
      )
  
      if len(plugins) > 1:
          raise RuntimeError(
              f"There should not be multiple plugins instantiated within the file. Found {plugins}"
          )
      if len(plugins) == 1:
          return plugins[0]
  
      raise RuntimeError(
          f"The provided file {filepath} does not contain a Plugin."
      )
  
imports: import inspect
  import os
  import sys
  import traceback
  import types
  from contextlib import contextmanager
  from copy import copy
  from typing import TYPE_CHECKING, Any, Dict, List, Tuple, Type, Union
  from lightning.app.utilities.exceptions import MisconfigurationException
  from lightning.app.utilities.app_helpers import Logger, _mock_missing_imports
label_desc: Use image node_id 3 for calling a global function with example usage: _load_plugin_from_file(filepath) and returns: plugins