code: def _are_we_tracing() -> bool:
      if is_torchdynamo_compiling():
          return True
      # If functionalization is turned on, we are almost definitely compiling/tracing.
      # (In particular, AOTAutograd traces a model once with functionalization on
      #  but proxy tracing turned of, so this is how we detect it).
      if (
          torch._C._get_dispatch_mode(
              torch._C._TorchDispatchModeKey.FUNCTIONAL
          )
          is not None
      ):
          return True
      mode = get_innermost_proxy_mode()
      if mode is None:
          return False
      return mode.tracer is not None
  
imports: import sys
  import warnings
  from typing import cast, List, Optional, Tuple, TYPE_CHECKING, Union
  import torch
  import torch.distributed
  import torch.distributed.distributed_c10d
  from torch._custom_ops import impl_abstract
  from torch.distributed.device_mesh import DeviceMesh
  from torch.fx.experimental.proxy_tensor import get_innermost_proxy_mode
  from .None import _functional_collectives_impl
  from ._functional_collectives_impl import _register_tensor_wrapper
  from torch.distributed.distributed_c10d import all_gather_into_tensor, all_reduce, reduce_scatter_tensor
label_desc: Use image node_id 13 for calling a global function with example usage: _are_we_tracing() and returns: unknown, True, True, False