code: def _distributed_is_initialized() -> bool:
      # `is_initialized` is only defined conditionally
      # https://github.com/pytorch/pytorch/blob/v2.1.0/torch/distributed/__init__.py#L25
      # this might happen to MacOS builds from source (default) or any build from source that sets `USE_DISTRIBUTED=0`
      return (
          torch.distributed.is_available()
          and torch.distributed.is_initialized()
      )
  
imports: import contextlib
  import logging
  import os
  import time
  from contextlib import nullcontext
  from pathlib import Path
  from typing import TYPE_CHECKING, Any, Iterable, Iterator, List, Optional, Sized, Union
  import torch
  import torch.nn.functional
  from lightning_utilities.core.imports import package_available
  from torch import Tensor
  from torch.utils.data import Dataset, DistributedSampler, Sampler
  from typing_extensions import override
  from lightning.fabric.utilities.cloud_io import _is_local_file_protocol
  from lightning.fabric.utilities.data import _num_cpus_available
  from lightning.fabric.utilities.rank_zero import rank_zero_info
  from lightning.fabric.utilities.types import _PATH, ReduceOp
label_desc: Use image node_id 11 for calling a global function with example usage: _distributed_is_initialized() and returns: unknown