code: def get_parser():
      parser = argparse.ArgumentParser(
          description="""
      Replaces spk_embeds in a specified spk_embed directory with the average spk_embed
      for a given speaker.
      The spk_embeds generally reside in
          dump/${spk_embed_tag}/<data_subset>/${spk_embed_tag}.scp, whereas
      speaker-averaged spk_embeds reside in
          dump/${spk_embed_tag}/<data_subset>/spk_${spk_embed_tag}.scp.
  
      The old spk_embed.scp file will be renamed to spk_embed.scp.bak and
      the corresponding .ark files are left unchanged.
      If no speaker id is provided, the average spk_embed for the speaker who
      the utterance belongs to will be used in each case.
  
      At inference time in a TTS task, you are unlikely to have the spk_embed
      for that sentence in particular. Thus, using average spk_embeds
      during training may yield better performance at inference time.
  
      This is also useful for conditioning inference on a particular speaker.
  
      To transform the training data, this script should be run after
      spk_embeds are extracted (stage 3), but before training commences (stage 7).
      """
      )
      parser.add_argument(
          "--utt-embed-path",
          type=str,
          required=True,
          help="Path to the spk_embed file to be modified.",
      )
      group = parser.add_mutually_exclusive_group(required=True)
      group.add_argument(
          "--spk-id",
          type=str,
          help="The id of the speaker whose average spk_id should be used",
      )
      group.add_argument(
          "--utt2spk",
          type=str,
          help="Path to the relevant utt2spk file, if the source speakers are used",
      )
      parser.add_argument(
          "--spk-embed-path",
          type=str,
          required=True,
          help="The path to the spk_{spk_embed_tag}.scp for the speakers being used.",
      )
      return parser
  
imports: import argparse
  import os
  import shutil
  import sys
label_desc: Use image node_id 1 for calling a global function with example usage: get_parser() and returns: parser