code: def load_data(filename, label=False):
      with gzip.open(filename) as gz:
          struct.unpack("I", gz.read(4))
          n_items = struct.unpack(">I", gz.read(4))
          if not label:
              n_rows = struct.unpack(">I", gz.read(4))[0]
              n_cols = struct.unpack(">I", gz.read(4))[0]
              res = np.frombuffer(
                  gz.read(n_items[0] * n_rows * n_cols), dtype=np.uint8
              )
              res = res.reshape(n_items[0], n_rows * n_cols)
          else:
              res = np.frombuffer(gz.read(n_items[0]), dtype=np.uint8)
              res = res.reshape(n_items[0], 1)
      return res
  
imports: import gzip
  import numpy
  import struct
label_desc: Use image node_id 1 for calling a global function with example usage: load_data(filename, label) and returns: res