code: def __make_collates(
      input_transform: InputTransform,
      on_device: bool,
      collate: Callable,
  ) -> Tuple[Callable, Callable]:
      """Returns the appropriate collate functions based on whether the transforms happen in a DataLoader worker or on the
      device (main process)."""
      if on_device:
          return input_transform._identity, collate
      return collate, input_transform._identity
  
imports: import inspect
  from dataclasses import dataclass
  from functools import partial
  from typing import Any, Callable, Dict, List, Optional, Sequence, Tuple
  from pytorch_lightning.utilities import rank_zero_warn
  from pytorch_lightning.utilities.enums import LightningEnum
  from flash.core.data.callback import ControlFlow
  from flash.core.data.utilities.collate import default_collate
  from flash.core.data.utils import _STAGES_PREFIX
  from flash.core.utilities.stages import RunningStage
  from flash.core.utilities.types import INPUT_TRANSFORM_TYPE
label_desc: Use image node_id 2 for calling a global function with example usage: __make_collates(input_transform, on_device, collate) and returns: collate,  input_transform, input_transform,  collate