code: def _get_overlap_for_time_range_pair(
      t1_start: float, t1_stop: float, t2_start: float, t2_stop: float
  ) -> Optional[Tuple[float, float]]:
      """
      Calculates the overlap between two time ranges, if one exists.
  
      Returns:
          (Optional[Tuple]) A tuple of <overlap_start_time, overlap_stop_time> if
          an overlap is found, or None otherwise.
      """
      # Check if there is an overlap
      if (t1_start <= t2_stop) and (t2_start <= t1_stop):
          # Calculate the overlap period
          overlap_start_time = max(t1_start, t2_start)
          overlap_stop_time = min(t1_stop, t2_stop)
          return (overlap_start_time, overlap_stop_time)
      else:
          return None
  
imports: import logging
  import math
  import random
  import time
  from dataclasses import dataclass
  from enum import Enum
  from typing import Any, Callable, Dict, List, Optional, Tuple
  import numpy
  import torch
  from iopath.common.file_io import g_pathmgr
  from PIL import Image
  from pytorchvideo.data.dataset_manifest_utils import ImageDataset, ImageFrameInfo, VideoClipInfo, VideoDataset, VideoDatasetType
  from pytorchvideo.data.utils import DataclassFieldCaster, load_dataclass_dict_from_csv
  from pytorchvideo.data.video import Video
label_desc: Use image node_id 2 for calling a global function with example usage: _get_overlap_for_time_range_pair(t1_start, t1_stop, t2_start, t2_stop) and returns: overlap_start_time,  overlap_stop_time, None