code: def read_kaldi_matrix(matrix_file):
      """This function reads a kaldi matrix stored in text format from
      'matrix_file' and stores it as a list of rows, where each row is a list.
      """
      try:
          lines = [x.split() for x in open(matrix_file).readlines()]
          first_field = lines[0][0]
          last_field = lines[-1][-1]
          lines[0] = lines[0][1:]
          lines[-1] = lines[-1][:-1]
          if not (first_field == "[" and last_field == "]"):
              raise Exception(
                  "Kaldi matrix file has incorrect format, "
                  "only text format matrix files can be read by this script"
              )
          for i in range(len(lines)):
              lines[i] = [int(float(x)) for x in lines[i]]
          return lines
      except IOError:
          raise Exception(
              "Error while reading the kaldi matrix file "
              "{0}".format(matrix_file)
          )
  
imports: from __future__ import print_function
  from __future__ import division
  import argparse
  import logging
  import math
  import os
  import subprocess
  import sys
  import threading
label_desc: Use image node_id 16 for calling a global function with example usage: read_kaldi_matrix(matrix_file) and returns: lines