code: def _host_id_to_tf_device(host_id, external_worker):
      assert isinstance(host_id, int)
      if external_worker:
          return "/job:tpu_worker/task:{}/device:CPU:0".format(host_id)
      else:
          return "/task:{}/device:CPU:0".format(host_id)
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import collections
  import threading
  import time
  import numpy
  from six.moves import range
  from six.moves import zip
  import tensorflow.compat.v1
  from tensorflow.python.framework import ops
  from tensorflow.python.tpu import tpu_feed
label_desc: Use image node_id 2 for calling a global function with example usage: _host_id_to_tf_device(host_id, external_worker) and returns: str, str