code: def model_argmax(sess, x, predictions, samples, feed=None):
      """
      Helper function that computes the current class prediction
      :param sess: TF session
      :param x: the input placeholder
      :param predictions: the model's symbolic output
      :param samples: numpy array with input samples (dims must match x)
      :param feed: An optional dictionary that is appended to the feeding
               dictionary before the session runs. Can be used to feed
               the learning phase of a Keras model for instance.
      :return: the argmax output of predictions, i.e. the current predicted class
      """
      feed_dict = {x: samples}
      if feed is not None:
          feed_dict.update(feed)
      probabilities = sess.run(predictions, feed_dict)
  
      if samples.shape[0] == 1:
          return np.argmax(probabilities)
      else:
          return np.argmax(probabilities, axis=1)
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from __future__ import unicode_literals
  import logging
  import math
  import os
  import time
  import warnings
  import numpy
  import six
  from six.moves import xrange
  import tensorflow
  from cleverhans.compat import device_lib
  from cleverhans.compat import reduce_sum, reduce_mean
  from cleverhans.compat import reduce_max
  from cleverhans.compat import softmax_cross_entropy_with_logits
  from cleverhans.utils import batch_indices, _ArgsWrapper, create_logger
label_desc: Use image node_id 7 for calling a global function with example usage: model_argmax(sess, x, predictions, samples, feed) and returns: np, np