code: def run_net(
      X,
      y,
      batch_size,
      dnn,
      data_layer_name,
      label_layer_name,
      loss_layer,
      accuracy_layer,
      accuracy_sink,
      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
      accuracy_layer.reset = True  # Reset previous statistics
  
      for X_batch, y_batch in irnn_data_iterator(
          X, y, batch_size, math_engine
      ):
          run_iter(
              {data_layer_name: X_batch, label_layer_name: y_batch}
          )
          total_loss += loss.last_loss * y_batch.batch_width
          accuracy_layer.reset = (
              False  # Don't reset statistics within one epoch
          )
  
      avg_loss = total_loss / y.shape[0]
      acc = accuracy_sink.get_blob().asarray()[0]
      run_time = time.time() - start
      return avg_loss, acc, run_time
  
imports: import numpy
  import neoml
  import time
  from sklearn.datasets import fetch_openml
label_desc: Use image node_id 2 for calling a global function with example usage: run_net(X, y, batch_size, dnn, data_layer_name, label_layer_name, loss_layer, accuracy_layer, accuracy_sink, is_train) and returns: avg_loss,  acc,  run_time