code: def scp2array_dic(
      scp_path,
      array_dic=None,
      ark_path=None,
      compression_method=None,
      append=False,
  ):
      """
      read array_dic from ark indexed by scp or
      write array_dic to ark while create scp to index
      :param scp_path: filepath of scp
      :param array_dic: dic of array
      :param ark_path: filepath of ark, default is scppath.replace('.scp', '.ark')
      :param compression_method: compression method, default=None,
                  kAutomaticMethod=1, kSpeechFeature=2,
                  kTwoByteAuto=3,kTwoByteSignedInteger=4, kOneByteAuto=5,
                  kOneByteUnsignedInteger=6, kOneByteZeroOne=7
      :param append: if True, append, else write
      :return: dic of numpy array for read while None for write
      """
      if array_dic is None:
          array_dic = kaldiio.load_scp(scp_path)
          return array_dic
      else:
          if ark_path is None:
              ark_path = scp_path.replace(".scp", ".ark")
          else:
              pass
          kaldiio.save_ark(
              ark=ark_path,
              array_dict=array_dic,
              scp=scp_path,
              compression_method=compression_method,
              append=append,
          )
          return None
  
file_path: espnet/egs2/misp2021/avsr1/local/concatenate_feature.py
imports: import argparse
  import codecs
  import os
  import kaldiio
  import numpy
  from tqdm import tqdm
label_desc: Use image node_id 1 for calling a global function with example usage: scp2array_dic(scp_path, array_dic, ark_path, compression_method, append) and returns: array_dic, None