code: def _get_len(
      struct: Union[Struct, List[Struct]]
  ) -> int:  # pragma: no cover
      """
      Returns the length (usually corresponds to the batch size) of the input structure.
      """
      # pyre-ignore[6]
      if not _is_ray_bundle(struct):
          # pyre-ignore[6]
          return len(struct)
      if _is_heterogeneous_ray_bundle(struct):
          # pyre-ignore[16]
          return len(struct.camera_counts)
      # pyre-ignore[16]
      return len(struct.directions)
  
imports: import warnings
  from typing import Dict, List, NamedTuple, Optional, Tuple, Union
  import plotly.graph_objects
  import torch
  from plotly.subplots import make_subplots
  from pytorch3d.renderer import HeterogeneousRayBundle, ray_bundle_to_ray_points, RayBundle, TexturesAtlas, TexturesVertex
  from pytorch3d.renderer.camera_utils import camera_to_eye_at_up
  from pytorch3d.renderer.cameras import CamerasBase
  from pytorch3d.structures import join_meshes_as_scene, Meshes, Pointclouds
label_desc: Use image node_id 1 for calling a global function with example usage: _get_len(struct) and returns: len, len, len