code: def _context(ctx: str) -> Generator[None, None, None]:
      """Set the global component context for the block below this context manager.
  
      The context is used to determine whether the current process is running for a LightningFlow or for a LightningWork.
      See also :func:`_get_context`, :func:`_set_context`. For internal use only.
  
      """
      prev = _get_context()
      _set_context(ctx)
      yield
      _set_context(prev)
  
imports: import os
  from contextlib import contextmanager
  from typing import TYPE_CHECKING, Any, Dict, Generator, Optional
  from deepdiff.helper import NotPresent
  from lightning_utilities.core.apply_func import apply_to_collection
  from lightning.app.utilities.app_helpers import is_overridden
  from lightning.app.utilities.enum import ComponentContext
  from lightning.app.utilities.packaging.cloud_compute import CloudCompute
  from lightning.app.utilities.tree import breadth_first
label_desc: Use image node_id 12 for calling a global function with example usage: _context(ctx) without return types