code: def read_image_file(path):
      with gzip.open(path, "rb") as f:
          data = f.read()
          assert get_int(data[:4]) == 2051
          length = get_int(data[4:8])
          num_rows = get_int(data[8:12])
          num_cols = get_int(data[12:16])
          parsed = np.frombuffer(
              data, dtype=np.uint8, offset=16
          ).reshape((length, 1, num_rows, num_cols))
          return parsed
  
file_path: singa/examples/model_selection/TRAILS-Database-Native-Model-Selection/internal/ml/model_selection/src/eva_engine/phase1/algo/singa_ms/cnn_ms/data/mnist.py
imports: import numpy
  import os
  import sys
  import gzip
  import codecs
label_desc: Use image node_id 5 for calling a global function with example usage: read_image_file(path) and returns: parsed