code: def get_offset_and_duration(AUDIO_RTTM_MAP, uniq_id, decimals=5):
      """
      Extract offset and duration information from AUDIO_RTTM_MAP dictionary.
      If duration information is not specified, a duration value is extracted from the audio file directly.
  
      Args:
          AUDIO_RTTM_MAP (dict):
              Dictionary containing RTTM file information, which is indexed by unique file id.
          uniq_id (str):
              Unique file id
      Returns:
          offset (float):
              The offset value that determines the beginning of the audio stream.
          duration (float):
              The length of audio stream that is expected to be used.
      """
      audio_path = AUDIO_RTTM_MAP[uniq_id]["audio_filepath"]
      if AUDIO_RTTM_MAP[uniq_id].get("duration", None):
          duration = round(
              AUDIO_RTTM_MAP[uniq_id]["duration"], decimals
          )
          offset = round(AUDIO_RTTM_MAP[uniq_id]["offset"], decimals)
      else:
          sound = sf.SoundFile(audio_path)
          duration = sound.frames / sound.samplerate
          offset = 0.0
      return offset, duration
  
imports: import gc
  import json
  import math
  import os
  import shutil
  from copy import deepcopy
  from typing import Dict, List, Tuple, Union
  import numpy
  import omegaconf
  import soundfile
  import torch
  from pyannote.core import Annotation, Segment
  from tqdm import tqdm
  from nemo.collections.asr.data.audio_to_label import repeat_signal
  from nemo.collections.asr.parts.utils.longform_clustering import LongFormSpeakerClustering
  from nemo.collections.asr.parts.utils.offline_clustering import SpeakerClustering, get_argmin_mat, split_input_data
  from nemo.utils import logging
label_desc: Use image node_id 19 for calling a global function with example usage: get_offset_and_duration(AUDIO_RTTM_MAP, uniq_id, decimals) and returns: offset,  duration