code: def _validate_input(input: "InputBase") -> None:
      """Helper function to validate that the type of an ``InputBase.data`` is appropriate for the type of ``InputBase``
      being used.
  
      Args:
          input: The ``InputBase`` instance to validate.
  
      Raises:
          RuntimeError: If the ``input`` is of type ``Input`` and it's ``data`` attribute does not support ``len``.
          RuntimeError: If the ``input`` is of type ``IterableInput`` and it's ``data`` attribute does support ``len``.
  
      """
      if input.data is not None:
          if isinstance(input, Input) and not _has_len(input.data):
              raise RuntimeError(
                  "`Input.data` is not a sequence with a defined length. Use `IterableInput` instead."
              )
          if isinstance(input, IterableInput) and _has_len(input.data):
              raise RuntimeError(
                  "`IterableInput.data` is a sequence with a defined length. Use `Input` instead."
              )
  
imports: import functools
  import os
  from enum import Enum
  from typing import Any, Dict, Iterable, List, Sequence, Tuple, Union, cast
  from pytorch_lightning.utilities.enums import LightningEnum
  from torch.utils.data import Dataset
  from flash.core.data.properties import Properties
  from flash.core.data.utils import _STAGES_PREFIX
  from flash.core.utilities.stages import RunningStage
label_desc: Use image node_id 3 for calling a global function with example usage: _validate_input(input) without return types