code: def _compute_time(index, align_type, timings):
      """Compute start and end time of utterance.
      Adapted from https://github.com/lumaku/ctc-segmentation
  
      Args:
          index:  frame index value
          align_type:  one of ["begin", "end"]
  
      Return:
          start/end time of utterance in seconds
      """
      middle = (timings[index] + timings[index - 1]) / 2
      if align_type == "begin":
          return max(timings[index + 1] - 0.5, middle)
      elif align_type == "end":
          return min(timings[index - 1] + 0.5, middle)
  
file_path: NeMo/tools/ctc_segmentation/scripts/utils.py
imports: import logging
  import logging.handlers
  import math
  import os
  import sys
  from pathlib import PosixPath
  from typing import List, Tuple, Union
  import ctc_segmentation
  import numpy
  from tqdm import tqdm
  from nemo.collections.common.tokenizers.sentencepiece_tokenizer import SentencePieceTokenizer
label_desc: Use image node_id 5 for calling a global function with example usage: _compute_time(index, align_type, timings) and returns: max, min