class_docstr: read the kaldi ark format file
class_docstr_tok: ["read","the","kaldi","ark","format","file"]
docstr: calculate the mean and variance of the feat
  args:
      feat_list: feat list such as [[key, array]...]
      is_end: if is the last feat_list, set it to True,
              else set it to False
  return:
      -1, []: failed
      0, []: when is_end is True, return the mean and variance list
             else return empty list
docstr_tok: ["calculate","the","mean","and","variance","of","the","feat","args",":","feat_list",":","feat","list","such","as","[","[","key",",","array","]","...","]","is_end",":","if","is","the","last","feat_list",",","set","it","to","True",",","else","set","it","to","False","return",":","-1",",","[","]",":","failed","0",",","[","]",":","when","is_end","is","True",",","return","the","mean","and","variance","list","else","return","empty","list"]
code: def calculate_mean_variance(self, feat_list, is_end=False):
      """
      calculate the mean and variance of the feat
      args:
          feat_list: feat list such as [[key, array]...]
          is_end: if is the last feat_list, set it to True,
                  else set it to False
      return:
          -1, []: failed
          0, []: when is_end is True, return the mean and variance list
                 else return empty list
      """
      if self._calutlate_mean_variance_start == True:
          self._meam_variance_list = [
              0,
              np.zeros([feat_list[0][1].shape[1]]),
              np.zeros([feat_list[0][1].shape[1]]),
          ]
          self._calutlate_mean_variance_start = False
  
      for tmp_feat_list in feat_list:
          self._meam_variance_list[0] += tmp_feat_list[1].shape[0]
          self._meam_variance_list[1] += np.sum(
              tmp_feat_list[1], axis=0
          )
          self._meam_variance_list[2] += np.sum(
              np.multiply(tmp_feat_list[1], tmp_feat_list[1]), axis=0
          )
  
      if is_end:
          self._calutlate_mean_variance_start = True
          final_mean = (
              self._meam_variance_list[1] / self._meam_variance_list[0]
          )
          final_variance = self._meam_variance_list[
              2
          ] / self._meam_variance_list[0] - np.multiply(
              final_mean, final_mean
          )
          output_list = [
              ["mean", final_mean],
              ["variance", final_variance],
          ]
          return 0, output_list
      return 0, []
  
file_path: delta/delta/data/utils/htk_reader_lib.py
imports: import os
  import math
  import numpy
label_desc: Use image node_id 4 for calling the HtkReaderIO obj's underlying member method code with example usage: obj.calculate_mean_variance(feat_list, is_end) and returns: int,  list, int,  output_list