code: def pipeline(use_old_model=False):
      # Data iterators
      (
          training_iterator,
          validation_iterator,
          test_iterator,
          handle,
          x,
          y_,
      ) = inputs(
          FLAGS.batch_size,
          FLAGS.epochs,
          VALIDATION_SIZE,
          TEST_BATCH_SIZE,
      )
  
      # Get explainer conditional input
      explainer = AttributionPriorExplainer()
      cond_input_op, train_eg = explainer.input_to_samples_delta(x)
  
      # Predict
      y, train_pl = get_model(cond_input_op)
  
      # Get explanations
      expected_gradients_op = explainer.shap_value_op(
          y, cond_input_op, sparse_labels_op=y_
      )
      expected_gradients_op = batch_standardize(expected_gradients_op)
  
      learning_rate = get_learning_rate(FLAGS.eta, FLAGS.batch_size)
      global_step = tf.train.get_or_create_global_step()
  
      loss = tf.reduce_mean(
          tf.nn.sparse_softmax_cross_entropy_with_logits(
              labels=y_, logits=y
          )
      )
      train_step = tf.train.AdamOptimizer(learning_rate).minimize(
          (1.0 - FLAGS.lamb) * loss, global_step=global_step
      )
  
      eg_loss = tf.reduce_mean(
          tf.image.total_variation(
              expected_gradients_op, name="variation"
          )
      )
      eg_train = tf.train.AdamOptimizer(learning_rate).minimize(
          FLAGS.lamb * eg_loss, global_step=global_step
      )
  
      y_pred = tf.argmax(y, 1)
      accuracy_op, accuracy_update_op = tf.metrics.accuracy(y_pred, y_)
      reset_metrics_op = tf.variables_initializer(
          tf.get_collection(tf.GraphKeys.METRIC_VARIABLES)
      )
  
      return (
          cond_input_op,
          x,
          y,
          y_,
          train_pl,
          loss,
          train_step,
          eg_loss,
          eg_train,
          train_eg,
          accuracy_op,
          accuracy_update_op,
          reset_metrics_op,
          training_iterator,
          validation_iterator,
          test_iterator,
          handle,
      )
  
file_path: attributionpriors/attributionpriors/mnist/mnist_train.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import numpy
  import tensorflow
  import numpy
  import tensorflow.contrib.slim
  import datetime
  import mnist_model
  import mnist_reader
  from attributionpriors.ops import AttributionPriorExplainer
label_desc: Use image node_id 5 for calling a global function with example usage: pipeline(use_old_model) and returns: cond_input_op,  x,  y,  y_,  train_pl,  loss,  train_step,  eg_loss,  eg_train,  train_eg,  accuracy_op,  accuracy_update_op,  reset_metrics_op,  training_iterator,  validation_iterator,  test_iterator,  handle