code: def realign(
      dir,
      iter,
      feat_dir,
      lang,
      prev_egs_dir,
      cur_egs_dir,
      prior_subset_size,
      num_archives,
      run_opts,
      online_ivector_dir=None,
  ):
      raise Exception(
          "Realignment stage has not been implemented in nnet3"
      )
      logger.info(
          "Getting average posterior for purposes of adjusting "
          "the priors."
      )
      # Note: this just uses CPUs, using a smallish subset of data.
      # always use the first egs archive, which makes the script simpler;
      # we're using different random subsets of it.
  
      avg_post_vec_file = compute_average_posterior(
          dir=dir,
          iter=iter,
          egs_dir=prev_egs_dir,
          num_archives=num_archives,
          prior_subset_size=prior_subset_size,
          run_opts=run_opts,
      )
  
      avg_post_vec_file = "{dir}/post.{iter}.vec".format(
          dir=dir, iter=iter
      )
      logger.info("Re-adjusting priors based on computed posteriors")
      model = "{0}/{1}.mdl".format(dir, iter)
      adjust_am_priors(dir, model, avg_post_vec_file, model, run_opts)
  
      alidir = align(
          dir, feat_dir, lang, run_opts, iter, online_ivector_dir
      )
      common_lib.execute_command(
          """steps/nnet3/relabel_egs.sh --cmd "{command}" --iter {iter} \
                  {alidir} {prev_egs_dir} {cur_egs_dir}""".format(
              command=run_opts.command,
              iter=iter,
              dir=dir,
              alidir=alidir,
              prev_egs_dir=prev_egs_dir,
              cur_egs_dir=cur_egs_dir,
          )
      )
  
imports: from __future__ import print_function
  from __future__ import division
  import glob
  import logging
  import math
  import os
  import random
  import time
  import libs.common
  import libs.nnet3.train.common
label_desc: Use image node_id 9 for calling a global function with example usage: realign(dir, iter, feat_dir, lang, prev_egs_dir, cur_egs_dir, prior_subset_size, num_archives, run_opts, online_ivector_dir) without return types