def METHOD_NAME(mode: str) -> bool:
  """Maybe run tf.data service servers.
  If running in 'tf_data_service_dispatcher' or
  'tf_data_service_worker' mode, this function runs those servers, and
  blocks until the server has shut down, and returns True to the
  caller.
  Otherwise returns False immediately.
  Args:
    mode: if this is equal to either 'tf_data_service_dispatcher' or
      'tf_data_service_worker', runs the corresponding tf.data service server.
  Returns:
    True if a tf.data service server was run. (Callers would probably
    want to exit from main in this case.)
  """
  if mode == 'tf_data_service_dispatcher':
    logging.info('run_tf_data_service(mode=%s)', mode)
    dispatcher = tf.data.experimental.service.DispatchServer(
        config=_get_dispatcher_config()
    )
    dispatcher.join()
    logging.warning('Done.')
    return True
  if mode == 'tf_data_service_worker':
    logging.info('run_tf_data_service(mode=%s)', mode)
    worker = tf.data.experimental.service.WorkerServer(
        config=_get_worker_config()
    )
    worker.join()
    logging.warning('Done.')
    return True
  return False