code: def check_image_file_header(filename):
      """Validate that filename corresponds to images for the MNIST dataset."""
      with tf.io.gfile.Gfile(filename, "rb") as f:
          magic = read32(f)
          read32(f)  # num_images, unused
          rows = read32(f)
          cols = read32(f)
          if magic != 2051:
              raise ValueError(
                  "Invalid magic number %d in MNIST file %s"
                  % (magic, f.name)
              )
          if rows != 28 or cols != 28:
              raise ValueError(
                  "Invalid MNIST file %s: Expected 28x28 images, found %dx%d"
                  % (f.name, rows, cols)
              )
  
file_path: tensorflow-upstream/tensorflow/lite/tutorials/dataset.py
imports: import gzip
  import os
  import shutil
  import tempfile
  import urllib
  import numpy
  import tensorflow
label_desc: Use image node_id 2 for calling a global function with example usage: check_image_file_header(filename) without return types