code: def _is_init_context(
      component: Union["LightningFlow", "LightningWork"]
  ) -> bool:
      """Checks whether the call to a component originates from within the context of the component's ``__init__``
      method."""
      return _is_method_context(component, "__init__")
  
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 2 for calling a global function with example usage: _is_init_context(component) and returns: _is_method_context