code: def generate_chain_egs(
      dir,
      data,
      lat_dir,
      egs_dir,
      left_context,
      right_context,
      run_opts,
      stage=0,
      left_tolerance=None,
      right_tolerance=None,
      left_context_initial=-1,
      right_context_final=-1,
      frame_subsampling_factor=3,
      alignment_subsampling_factor=3,
      online_ivector_dir=None,
      frames_per_iter=20000,
      frames_per_eg_str="20",
      srand=0,
      egs_opts=None,
      cmvn_opts=None,
  ):
      """Wrapper for steps/nnet3/chain/get_egs.sh
  
      See options in that script.
      """
  
      common_lib.execute_command(
          """steps/nnet3/chain/get_egs.sh {egs_opts} \
                  --cmd "{command}" \
                  --cmvn-opts "{cmvn_opts}" \
                  --online-ivector-dir "{ivector_dir}" \
                  --left-context {left_context} \
                  --right-context {right_context} \
                  --left-context-initial {left_context_initial} \
                  --right-context-final {right_context_final} \
                  --left-tolerance '{left_tolerance}' \
                  --right-tolerance '{right_tolerance}' \
                  --frame-subsampling-factor {frame_subsampling_factor} \
                  --alignment-subsampling-factor {alignment_subsampling_factor} \
                  --stage {stage} \
                  --frames-per-iter {frames_per_iter} \
                  --frames-per-eg {frames_per_eg_str} \
                  --srand {srand} \
                  {data} {dir} {lat_dir} {egs_dir}""".format(
              command=run_opts.egs_command,
              cmvn_opts=cmvn_opts if cmvn_opts is not None else "",
              ivector_dir=(
                  online_ivector_dir
                  if online_ivector_dir is not None
                  else ""
              ),
              left_context=left_context,
              right_context=right_context,
              left_context_initial=left_context_initial,
              right_context_final=right_context_final,
              left_tolerance=(
                  left_tolerance if left_tolerance is not None else ""
              ),
              right_tolerance=(
                  right_tolerance if right_tolerance is not None else ""
              ),
              frame_subsampling_factor=frame_subsampling_factor,
              alignment_subsampling_factor=alignment_subsampling_factor,
              stage=stage,
              frames_per_iter=frames_per_iter,
              frames_per_eg_str=frames_per_eg_str,
              srand=srand,
              data=data,
              lat_dir=lat_dir,
              dir=dir,
              egs_dir=egs_dir,
              egs_opts=egs_opts if egs_opts is not None else "",
          )
      )
  
file_path: espnet/egs2/chime2/enh1/steps/libs/nnet3/train/chain_objf/acoustic_model.py
imports: from __future__ import division
  from __future__ import print_function
  import logging
  import math
  import os
  import sys
  import libs.common
  import libs.nnet3.train.common
label_desc: Use image node_id 3 for calling a global function with example usage: generate_chain_egs(dir, data, lat_dir, egs_dir, left_context, right_context, run_opts, stage, left_tolerance, right_tolerance, left_context_initial, right_context_final, frame_subsampling_factor, alignment_subsampling_factor, online_ivector_dir, frames_per_iter, frames_per_eg_str, srand, egs_opts, cmvn_opts) without return types