code: def _is_run_context(
      component: Union["LightningFlow", "LightningWork"]
  ) -> bool:
      """Checks whether the call to a component originates from within the context of the component's ``run`` method."""
      return _is_method_context(component, "run") or _is_method_context(
          component, "load_state_dict"
      )
  
imports: import ast
  import inspect
  from pathlib import Path
  from typing import TYPE_CHECKING, Any, Dict, List, Optional, Set, Type, Union
label_desc: Use image node_id 3 for calling a global function with example usage: _is_run_context(component) and returns: unknown