code: def get_partial_ref_labels(
      pred_labels: List[str], ref_labels: List[str]
  ) -> List[str]:
      """
      For evaluation of online diarization performance, generate partial reference labels
      from the last prediction time.
  
      Args:
          pred_labels (list[str]): list of partial prediction labels
          ref_labels (list[str]): list of full reference labels
  
      Returns:
          ref_labels_out (list[str]): list of partial reference labels
      """
      # If there is no reference, return empty list
      if len(ref_labels) == 0:
          return []
  
      # If there is no prediction, set the last prediction time to 0
      if len(pred_labels) == 0:
          last_pred_time = 0
      else:
          # The lastest prediction time in the prediction labels
          last_pred_time = max(
              [float(labels.split()[1]) for labels in pred_labels]
          )
      ref_labels_out = []
      for label in ref_labels:
          start, end, speaker = label.split()
          start, end = float(start), float(end)
          # If the current [start, end] interval extends beyond the end of hypothesis time stamps
          if start < last_pred_time:
              end_time = min(end, last_pred_time)
              label = f"{start} {end_time} {speaker}"
              ref_labels_out.append(label)
          # Other cases where the current [start, end] interval is before the last prediction time
          elif end < last_pred_time:
              ref_labels_out.append(label)
      return ref_labels_out
  
file_path: NeMo/nemo/collections/asr/metrics/der.py
imports: import itertools
  from itertools import permutations
  from typing import Dict, List, Optional, Tuple
  import numpy
  import torch
  from pyannote.core import Segment, Timeline
  from pyannote.metrics.diarization import DiarizationErrorRate
  from nemo.collections.asr.metrics.wer import word_error_rate
  from nemo.collections.asr.parts.utils.optimization_utils import linear_sum_assignment
  from nemo.utils import logging
label_desc: Use image node_id 1 for calling a global function with example usage: get_partial_ref_labels(pred_labels, ref_labels) and returns: ref_labels_out, list