code: def gen_config_yaml(
      manifest_root: Path,
      spm_filename: Optional[str] = None,
      vocab_name: Optional[str] = None,
      yaml_filename: str = "config.yaml",
      specaugment_policy: Optional[str] = "lb",
      prepend_tgt_lang_tag: bool = False,
      sampling_alpha: Optional[float] = None,
      input_channels: Optional[int] = 1,
      input_feat_per_channel: Optional[int] = 80,
      audio_root: str = "",
      cmvn_type: str = "utterance",
      gcmvn_path: Optional[Path] = None,
      extra=None,
  ):
      manifest_root = manifest_root.absolute()
      writer = S2TDataConfigWriter(manifest_root / yaml_filename)
      assert spm_filename is not None or vocab_name is not None
      vocab_name = (
          spm_filename.replace(".model", ".txt")
          if vocab_name is None
          else vocab_name
      )
      writer.set_vocab_filename(vocab_name)
      if input_channels is not None:
          writer.set_input_channels(input_channels)
      if input_feat_per_channel is not None:
          writer.set_input_feat_per_channel(input_feat_per_channel)
      specaugment_setters = {
          "lb": writer.set_specaugment_lb_policy,
          "ld": writer.set_specaugment_ld_policy,
          "sm": writer.set_specaugment_sm_policy,
          "ss": writer.set_specaugment_ss_policy,
      }
      specaugment_setter = specaugment_setters.get(
          specaugment_policy, None
      )
      if specaugment_setter is not None:
          specaugment_setter()
      if spm_filename is not None:
          writer.set_bpe_tokenizer(
              {
                  "bpe": "sentencepiece",
                  "sentencepiece_model": (
                      manifest_root / spm_filename
                  ).as_posix(),
              }
          )
      if prepend_tgt_lang_tag:
          writer.set_prepend_tgt_lang_tag(True)
      if sampling_alpha is not None:
          writer.set_sampling_alpha(sampling_alpha)
  
      if cmvn_type not in ["global", "utterance"]:
          raise NotImplementedError
  
      if specaugment_policy is not None:
          writer.set_feature_transforms(
              "_train", [f"{cmvn_type}_cmvn", "specaugment"]
          )
      writer.set_feature_transforms("*", [f"{cmvn_type}_cmvn"])
  
      if cmvn_type == "global":
          if gcmvn_path is None:
              raise ValueError(
                  "Please provide path of global cmvn file."
              )
          else:
              writer.set_global_cmvn(gcmvn_path.as_posix())
  
      if len(audio_root) > 0:
          writer.set_audio_root(audio_root)
  
      if extra is not None:
          writer.set_extra(extra)
      writer.flush()
  
imports: import csv
  from pathlib import Path
  import zipfile
  from functools import reduce
  from multiprocessing import cpu_count
  from typing import Any, Dict, List, Optional, Union
  import io
  import numpy
  import pandas
  import sentencepiece
  from fairseq.data.audio.audio_utils import convert_waveform, _get_kaldi_fbank, _get_torchaudio_fbank, is_npy_data, is_sf_audio_data
  import torch
  import soundfile
  from tqdm import tqdm
label_desc: Use image node_id 5 for calling a global function with example usage: gen_config_yaml(manifest_root, spm_filename, vocab_name, yaml_filename, specaugment_policy, prepend_tgt_lang_tag, sampling_alpha, input_channels, input_feat_per_channel, audio_root, cmvn_type, gcmvn_path, extra) without return types