class_docstr: Specification for a distributed task.
  
  It contains the job name, index of the task,
  the parameter servers and the worker servers. If you want to use the last worker
  for continuous evaluation you can call the method `use_last_worker_as_evaluator`
  which returns a new :class:`TaskSpecDef` object without the last worker in the
  cluster specification.
  
  Parameters
  ----------
  task_type : str
      Task type. One of `master`, `worker` or `ps`.
  index : int
      The zero-based index of the task. Distributed training jobs will have a single
      master task, one or more parameter servers, and one or more workers.
  trial : int
      The identifier of the trial being run.
  ps_hosts : str OR list of str
      A string with a coma separate list of hosts for the parameter servers
      or a list of hosts.
  worker_hosts : str OR list of str
      A string with a coma separate list of hosts for the worker servers
      or a list of hosts.
  master : str
      A string with the master hosts
  
  Notes
  ----------
  master might not be included in TF_CONFIG and can be None. The shard_index is adjusted
  in any case to assign 0 to master and >= 1 to workers.
  This implementation doesn't support sparse arrays in the `TF_CONFIG` variable as the
  official TensorFlow documentation shows, as it is not a supported by the json
  definition.
  
  References
  ----------
  - `ML-engine trainer considerations <https://cloud.google.com/ml-engine/docs/trainer-considerations#use_tf_config>`__
docstr: Returns true if this server is the master server
code: def is_master(self):
      """Returns true if this server is the master server"""
      return self._master
  
imports: import json
  import os
  import time
  import tensorflow
  from tensorflow.python.training import session_run_hook
  from tensorlayer import logging
  from tensorlayer.decorators import deprecated
  from tensorlayer.lazy_imports import LazyImport
label_desc: Use image node_id 4 for calling the TaskSpecDef obj's underlying member method code with example usage: obj.is_master() and returns: self