class_docstr: SeparateSpeech class
  
  Examples:
      >>> import soundfile
      >>> separate_speech = SeparateSpeech("enh_config.yml", "enh.pth")
      >>> audio, rate = soundfile.read("speech.wav")
      >>> separate_speech(audio)
      [separated_audio1, separated_audio2, ...]
docstr: Calculate the permutation between seaprated streams in two adjacent segments.
  
  Args:
      ref_wavs (List[torch.Tensor]): [(Batch, Nsamples)]
      enh_wavs (List[torch.Tensor]): [(Batch, Nsamples)]
      criterion (str): one of ("si_snr", "mse", "corr)
  Returns:
      perm (torch.Tensor): permutation for enh_wavs (Batch, num_spk)
docstr_tok: ["Calculate","the","permutation","between","seaprated","streams","in","two","adjacent","segments",".","Args",":","ref_wavs","(","List","[","torch.Tensor","]",")",":","[","(","Batch",",","Nsamples",")","]","enh_wavs","(","List","[","torch.Tensor","]",")",":","[","(","Batch",",","Nsamples",")","]","criterion","(","str",")",":","one","of","(","``","si_snr","''",",","``","mse","''",",","``","corr",")","Returns",":","perm","(","torch.Tensor",")",":","permutation","for","enh_wavs","(","Batch",",","num_spk",")"]
code: def cal_permumation(self, ref_wavs, enh_wavs, criterion="si_snr"):
      """Calculate the permutation between seaprated streams in two adjacent segments.
  
      Args:
          ref_wavs (List[torch.Tensor]): [(Batch, Nsamples)]
          enh_wavs (List[torch.Tensor]): [(Batch, Nsamples)]
          criterion (str): one of ("si_snr", "mse", "corr)
      Returns:
          perm (torch.Tensor): permutation for enh_wavs (Batch, num_spk)
      """
  
      criterion_class = {
          "si_snr": SISNRLoss,
          "mse": FrequencyDomainMSE,
      }[criterion]
  
      pit_solver = PITSolver(criterion=criterion_class())
  
      _, _, others = pit_solver(ref_wavs, enh_wavs)
      perm = others["perm"]
      return perm
  
imports: import argparse
  import logging
  import sys
  from itertools import chain
  from pathlib import Path
  from typing import Any, List, Optional, Sequence, Tuple, Union
  import humanfriendly
  import numpy
  import torch
  import yaml
  from tqdm import trange
  from typeguard import check_argument_types
  from espnet2.enh.diffusion_enh import ESPnetDiffusionModel
  from espnet2.enh.loss.criterions.tf_domain import FrequencyDomainMSE
  from espnet2.enh.loss.criterions.time_domain import SISNRLoss
  from espnet2.enh.loss.wrappers.pit_solver import PITSolver
  from espnet2.fileio.sound_scp import SoundScpWriter
  from espnet2.tasks.enh import EnhancementTask
  from espnet2.tasks.enh_s2t import EnhS2TTask
  from espnet2.torch_utils.device_funcs import to_device
  from espnet2.torch_utils.set_all_random_seed import set_all_random_seed
  from espnet2.train.abs_espnet_model import AbsESPnetModel
  from espnet2.utils import config_argparse
  from espnet2.utils.types import str2bool, str2triple_str, str_or_none
  from espnet.utils.cli_utils import get_commandline_args
label_desc: Use image node_id 3 for calling the SeparateSpeech obj's underlying member method code with example usage: obj.cal_permumation(ref_wavs, enh_wavs, criterion) and returns: perm