code: def _check_first_dimension(x, tensor_name):
      message = "Tensor {} should have batch_size of 1.".format(
          tensor_name
      )
      if x.get_shape().as_list()[0] is None:
          check_batch = utils_tf.assert_equal(
              tf.shape(x)[0], 1, message=message
          )
          with tf.control_dependencies([check_batch]):
              x = tf.identity(x)
      elif x.get_shape().as_list()[0] != 1:
          raise ValueError(message)
  
imports: import logging
  import numpy
  import tensorflow
  from warnings import warn
  from cleverhans.attacks import Attack
  from cleverhans.model import CallableModelWrapper, Model, wrapper_warning_logits
  from cleverhans import utils, utils_tf
label_desc: Use image node_id 2 for calling a global function with example usage: _check_first_dimension(x, tensor_name) without return types