code: def _auto_add_worker_init_fn(dataloader: object, rank: int) -> None:
      if not hasattr(dataloader, "worker_init_fn"):
          return
      if (
          int(os.environ.get("PL_SEED_WORKERS", 0))
          and dataloader.worker_init_fn is None
      ):
          dataloader.worker_init_fn = partial(
              pl_worker_init_function, rank=rank
          )
  
imports: import functools
  import inspect
  import os
  from collections import OrderedDict
  from contextlib import contextmanager
  from functools import partial
  from typing import Any, Callable, Dict, Generator, Iterable, Optional, Sized, Tuple, Type, Union
  from lightning_utilities.core.inheritance import get_all_subclasses
  from torch.utils.data import BatchSampler, DataLoader, IterableDataset, Sampler
  from typing_extensions import TypeGuard
  from lightning.fabric.utilities.enums import LightningEnum
  from lightning.fabric.utilities.exceptions import MisconfigurationException
  from lightning.fabric.utilities.rank_zero import rank_zero_warn
  from lightning.fabric.utilities.seed import pl_worker_init_function
label_desc: Use image node_id 7 for calling a global function with example usage: _auto_add_worker_init_fn(dataloader, rank) without return types