code: def run_net(X, y, batch_size, dnn, is_train):
      """Runs dnn on given data"""
      start = time.time()
      total_loss = 0.0
      run_iter = dnn.learn if is_train else dnn.run
      math_engine = dnn.math_engine
      layers = dnn.layers
      loss = layers["loss"]
      accuracy = layers["accuracy"]
      sink = layers["accuracy_sink"]
  
      accuracy.reset = True  # Reset previous statistics
      for X_batch, y_batch in cifar10_blob_iter(
          X, y, batch_size, math_engine
      ):
          run_iter({"data": X_batch, "labels": y_batch})
          total_loss += loss.last_loss * y_batch.batch_width
          accuracy.reset = (
              False  # Don't reset statistics within one epoch
          )
  
      avg_loss = total_loss / y.shape[0]
      avg_acc = sink.get_blob().asarray()[0]
      run_time = time.time() - start
      return avg_loss, avg_acc, run_time
  
file_path: neoml/NeoML/samples/python/cifar10.py
imports: import neoml
  import numpy
  import os
  import time
  import tarfile
label_desc: Use image node_id 7 for calling a global function with example usage: run_net(X, y, batch_size, dnn, is_train) and returns: avg_loss,  avg_acc,  run_time