code: def _has_len(data: Union[Sequence, Iterable]) -> bool:
      """Duck typing check to see if the argument supports getting the length.
  
      Args:
          data: The object to check for length support.
  
      """
      try:
          len(data)
          return True
      except (TypeError, NotImplementedError):
          return False
  
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 2 for calling a global function with example usage: _has_len(data) and returns: True, False