code: import tensorflow as tf
  from tensorflow.python.client import device_lib
  
  def scatter_update(ref, indices, updates):
      """Update the value of `ref` at indecies to `updates`.
      """
      return tf.scatter_update(ref, indices, updates)
  
  def hasGPU():
      devs = device_lib.list_local_devices()
      return any([dev.device_type == u'GPU' for dev in devs])
  
apis: tensorflow.scatter_update tensorflow.python.client.device_lib.list_local_devices
api_extract: [(7, 'tensorflow.scatter_update', 'tf.scatter_update', (['ref', 'indices', 'updates'], {}), True, 'import tensorflow as tf\n'), (10, 'tensorflow.python.client.device_lib.list_local_devices', 'device_lib.list_local_devices', ([], {}), False, 'from tensorflow.python.client import device_lib\n')]