code: def per_speaker_normalize(
      sentence_audio: torch.Tensor,
      splits: List[List[int]],
      speaker_turn: int,
      volume: List[float],
      device: torch.device,
  ) -> torch.Tensor:
      """
      Normalize time-series audio signal per speaker.
  
      Args:
          sentence_audio (torch.Tensor): Time-series audio signal.
          splits (List[List[int]]): List of integer split points in the sentence audio.
          speaker_turn (int): Speaker ID of the current speaker.
          volume (List[float]): List of volume levels for each speaker.
          device (torch.device): Device to use for computations.
  
      Returns:
          sentence_audio (torch.Tensor): Normalized time-series audio signal.
      """
      split_length = torch.tensor(0).to(device).double()
      split_sum = torch.tensor(0).to(device).double()
      for split in splits:
          split_length += len(sentence_audio[split[0] : split[1]])
          split_sum += torch.sum(
              sentence_audio[split[0] : split[1]] ** 2
          )
      average_rms = torch.sqrt(split_sum * 1.0 / split_length)
      sentence_audio = (
          sentence_audio / (1.0 * average_rms) * volume[speaker_turn]
      )
      return sentence_audio
  
imports: import copy
  import os
  import shutil
  from collections import defaultdict
  from typing import IO, Dict, List, Optional, Tuple
  import numpy
  import torch
  from scipy.stats import beta, gamma
  from tqdm import tqdm
  from nemo.collections.asr.parts.preprocessing.perturb import AudioAugmentor
  from nemo.collections.asr.parts.preprocessing.segment import AudioSegment
  from nemo.collections.asr.parts.utils.manifest_utils import get_ctm_line, read_manifest, write_ctm, write_manifest, write_text
  from nemo.collections.asr.parts.utils.speaker_utils import labels_to_rttmfile
  from nemo.utils import logging
label_desc: Use image node_id 19 for calling a global function with example usage: per_speaker_normalize(sentence_audio, splits, speaker_turn, volume, device) and returns: sentence_audio