class_docstr: A class that enables online (streaming) clustering based diarization.
  
  - The instance created from `OnlineClusteringDiarizer` sets aside a certain amount of memory
    to provide the upcoming inference with history information
  
  - There are two major modules involved: `OnlineSegmentor` and `OnlineSpeakerClustering`.
      OnlineSegmentor: Take the VAD-timestamps and generate segments for each scale
      OnlineSpeakerClustering: Update the entire speaker labels of the given online session
                               while updating the speaker labels of the streaming inputs.
  
  - The overall diarization process is done by calling `diarize_step` function.
    `diarize_step` function goes through the following steps:
      (1) Segmentation (`OnlineSegmentor` class)
      (2) Embedding extraction (`_extract_online_embeddings` function call)
      (3) Online speaker counting and speaker clustering (`OnlineClusteringDiarizer` class)
      (4) Label generation (`generate_cluster_labels` function call)
docstr: A function for a unit diarization step. Each diarization step goes through the following steps:
  
  1. Segmentation:
      Using `OnlineSegmentor` class, call `run_online_segmentation` method to get the segments.
  2. Embedding Extraction:
      Extract multiscale embeddings from the extracted speech segments.
  3. Online Clustering & Counting
      Perform online speaker clustering by using `OnlineSpeakerClustering` class.
  4. Generate speaker labels:
      Generate start and end timestamps of speaker labels based on the diarization results.
  
  c.f.) Also see method `diarize` in `ClusteringDiarizer` class.
  
  Args:
      audio_buffer (Tensor):
          Tensor variable containing the time series signal at the current frame
          Dimensions: (Number of audio time-series samples) x 1
      vad_timestamps (Tensor):
          List containing VAD timestamps.
          Dimensions: (Number of segments) x 2
          Example:
              >>> vad_timestamps = torch.Tensor([[0.05, 2.52], [3.12, 6.85]])
  
  Returns:
      diar_hyp (Tensor):
          Speaker label hypothesis from the start of the session to the current position
docstr_tok: ["A","function","for","a","unit","diarization","step",".","Each","diarization","step","goes","through","the","following","steps",":","1",".","Segmentation",":","Using","`","OnlineSegmentor","`","class",",","call","`","run_online_segmentation","`","method","to","get","the","segments",".","2",".","Embedding","Extraction",":","Extract","multiscale","embeddings","from","the","extracted","speech","segments",".","3",".","Online","Clustering","&","Counting","Perform","online","speaker","clustering","by","using","`","OnlineSpeakerClustering","`","class",".","4",".","Generate","speaker","labels",":","Generate","start","and","end","timestamps","of","speaker","labels","based","on","the","diarization","results",".","c.f",".",")","Also","see","method","`","diarize","`","in","`","ClusteringDiarizer","`","class",".","Args",":","audio_buffer","(","Tensor",")",":","Tensor","variable","containing","the","time","series","signal","at","the","current","frame","Dimensions",":","(","Number","of","audio","time-series","samples",")","x","1","vad_timestamps","(","Tensor",")",":","List","containing","VAD","timestamps",".","Dimensions",":","(","Number","of","segments",")","x","2","Example",":",">",">",">","vad_timestamps","=","torch.Tensor","(","[","[","0.05",",","2.52","]",",","[","3.12",",","6.85","]","]",")","Returns",":","diar_hyp","(","Tensor",")",":","Speaker","label","hypothesis","from","the","start","of","the","session","to","the","current","position"]
code: def diarize_step(
      self, audio_buffer: torch.Tensor, vad_timestamps: torch.Tensor
  ) -> torch.Tensor:
      """
      A function for a unit diarization step. Each diarization step goes through the following steps:
  
      1. Segmentation:
          Using `OnlineSegmentor` class, call `run_online_segmentation` method to get the segments.
      2. Embedding Extraction:
          Extract multiscale embeddings from the extracted speech segments.
      3. Online Clustering & Counting
          Perform online speaker clustering by using `OnlineSpeakerClustering` class.
      4. Generate speaker labels:
          Generate start and end timestamps of speaker labels based on the diarization results.
  
      c.f.) Also see method `diarize` in `ClusteringDiarizer` class.
  
      Args:
          audio_buffer (Tensor):
              Tensor variable containing the time series signal at the current frame
              Dimensions: (Number of audio time-series samples) x 1
          vad_timestamps (Tensor):
              List containing VAD timestamps.
              Dimensions: (Number of segments) x 2
              Example:
                  >>> vad_timestamps = torch.Tensor([[0.05, 2.52], [3.12, 6.85]])
  
      Returns:
          diar_hyp (Tensor):
              Speaker label hypothesis from the start of the session to the current position
      """
      self._transfer_timestamps_to_segmentor()
  
      # In case buffer is not filled or there is no speech activity in the input
      if self.buffer_start < 0 or len(vad_timestamps) == 0:
          return self._get_interim_output()
  
      # Segmentation: (c.f. see `diarize` function in ClusteringDiarizer class)
      for scale_idx, (window, shift) in self.multiscale_args_dict[
          "scale_dict"
      ].items():
          # Step 1: Get subsegments for embedding extraction.
          (
              audio_sigs,
              segment_ranges,
              range_inds,
          ) = self.online_segmentor.run_online_segmentation(
              audio_buffer=audio_buffer,
              vad_timestamps=vad_timestamps,
              segment_raw_audio=self.segment_raw_audio[scale_idx],
              segment_range_ts=self.segment_range_ts[scale_idx],
              segment_indexes=self.segment_indexes[scale_idx],
              window=window,
              shift=shift,
          )
          self.segment_raw_audio[scale_idx] = audio_sigs
          self.segment_range_ts[scale_idx] = segment_ranges
          self.segment_indexes[scale_idx] = range_inds
  
          # Step 2-1: Extract speaker embeddings from the extracted subsegment timestamps.
          embeddings = self._extract_online_embeddings(
              audio_signal=self.segment_raw_audio[scale_idx],
              segment_ranges=self.segment_range_ts[scale_idx],
              embeddings=self.emb_vectors[scale_idx],
          )
  
          # Step 2-2:Save the embeddings and segmentation timestamps in memory
          self.emb_vectors[scale_idx] = embeddings
  
          self.multiscale_embeddings_and_timestamps[scale_idx] = [
              {self.uniq_id: embeddings},
              {self.uniq_id: segment_ranges},
          ]
  
      embs_and_timestamps = get_embs_and_timestamps(
          self.multiscale_embeddings_and_timestamps,
          self.multiscale_args_dict,
      )
  
      # Step 3 - Clustering: Perform an online version of clustering algorithm
      cluster_label_hyp = self._perform_online_clustering(
          embs_and_timestamps[self.uniq_id],
          cuda=self.cuda,
      )
  
      # Step 4: Generate RTTM style diarization labels from segment ranges and cluster labels
      diar_hyp, _ = generate_cluster_labels(
          self.memory_segment_ranges[self.base_scale_index],
          cluster_label_hyp,
      )
      return diar_hyp
  
imports: import os
  import time
  from copy import deepcopy
  from typing import Dict
  import torch
  from omegaconf import DictConfig
  from nemo.collections.asr.models import ClusteringDiarizer
  from nemo.collections.asr.parts.utils.offline_clustering import get_scale_interpolated_embs, split_input_data
  from nemo.collections.asr.parts.utils.online_clustering import OnlineSpeakerClustering
  from nemo.collections.asr.parts.utils.speaker_utils import OnlineSegmentor, audio_rttm_map, generate_cluster_labels, get_embs_and_timestamps
  from nemo.utils import logging, model_utils
label_desc: Use image node_id 17 for calling the OnlineClusteringDiarizer obj's underlying member method code with example usage: obj.diarize_step(audio_buffer, vad_timestamps) and returns: diar_hyp, self