code: def eval_tflite(model_path):
      """Evaluate mnist in TFLite for accuracy."""
  
      interpreter = tf.lite.Interpreter(model_path=model_path)
      interpreter.allocate_tensors()
      input_index = interpreter.get_input_details()[0]["index"]
      input_shape = interpreter.get_input_details()[0]["shape"]
      output_index = interpreter.get_output_details()[0]["index"]
  
      _, _, x_test, y_test = preprocessed_data()
      # Testing the entire dataset is too slow. Verifying only 300 of 10k samples.
      x_test = x_test[0:300, :]
      y_test = y_test[0:300, :]
  
      total_seen = 0
      num_correct = 0
  
      for img, label in zip(x_test, y_test):
          inp = img.reshape(input_shape)
          total_seen += 1
          interpreter.set_tensor(input_index, inp)
          interpreter.invoke()
          predictions = interpreter.get_tensor(output_index)
          if np.argmax(predictions) == np.argmax(label):
              num_correct += 1
  
      return float(num_correct) / float(total_seen)
  
file_path: model-optimization/tensorflow_model_optimization/python/core/keras/testing/test_utils_mnist.py
imports: import numpy
  import tensorflow
  from tensorflow import keras
label_desc: Use image node_id 6 for calling a global function with example usage: eval_tflite(model_path) and returns: unknown