code: def calculate_session_cpWER_bruteforce(
      spk_hypothesis: List[str], spk_reference: List[str]
  ) -> Tuple[float, str, str]:
      """
      Calculate cpWER with actual permutations in brute-force way when LSA algorithm cannot deliver the correct result.
  
      Args:
          spk_hypothesis (list):
              List containing the hypothesis transcript for each speaker. A list containing the sequence
              of words is assigned for each speaker.
  
              Example:
              >>> spk_hypothesis = ["hey how are you we that's nice", "i'm good yes hi is your sister"]
  
          spk_reference (list):
              List containing the reference transcript for each speaker. A list containing the sequence
              of words is assigned for each speaker.
  
              Example:
              >>> spk_reference = ["hi how are you well that's nice", "i'm good yeah how is your sister"]
  
      Returns:
          cpWER (float):
              cpWER value for the given session.
          min_perm_hyp_trans (str):
              Hypothesis transcript containing the permutation that minimizes WER. Words are separated by spaces.
          ref_trans (str):
              Reference transcript in an arbitrary permutation. Words are separated by spaces.
      """
      p_wer_list, permed_hyp_lists = [], []
      ref_word_list = []
  
      # Concatenate the hypothesis transcripts into a list
      for spk_id, word_list in enumerate(spk_reference):
          ref_word_list.append(word_list)
      ref_trans = " ".join(ref_word_list)
  
      # Calculate WER for every permutation
      for hyp_word_list in permutations(spk_hypothesis):
          hyp_trans = " ".join(hyp_word_list)
          permed_hyp_lists.append(hyp_trans)
  
          # Calculate a WER value of the permuted and concatenated transcripts
          p_wer = word_error_rate(
              hypotheses=[hyp_trans], references=[ref_trans]
          )
          p_wer_list.append(p_wer)
  
      # Find the lowest WER and its hypothesis transcript
      argmin_idx = np.argmin(p_wer_list)
      min_perm_hyp_trans = permed_hyp_lists[argmin_idx]
      cpWER = p_wer_list[argmin_idx]
      return cpWER, min_perm_hyp_trans, ref_trans
  
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 6 for calling a global function with example usage: calculate_session_cpWER_bruteforce(spk_hypothesis, spk_reference) and returns: cpWER,  min_perm_hyp_trans,  ref_trans