code: def infer_devices(devices=None):
      """
      Returns the list of devices that multi-replica code should use.
      :param devices: list of string device names, e.g. ["/GPU:0"]
          If the user specifies this, `infer_devices` checks that it is
          valid, and then uses this user-specified list.
          If the user does not specify this, infer_devices uses:
              - All available GPUs, if there are any
              - CPU otherwise
      """
      if devices is None:
          devices = get_available_gpus()
          if len(devices) == 0:
              warnings.warn("No GPUS, running on CPU")
              # Set device to empy string, tf will figure out whether to use
              # XLA or not, etc., automatically
              devices = [""]
      else:
          assert len(devices) > 0
          for device in devices:
              assert isinstance(device, six.string_types), type(device)
      return devices
  
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 16 for calling a global function with example usage: infer_devices(devices) and returns: devices