def get_task_args(self, request):
    """ Gets the task args used when making a task web request.
  
    Args:
      request: A taskqueue_service_pb.TaskQueueAddRequest
    Returns:
      A dictionary used by a task worker.
    """
    args = {}
    args['task_name'] = request.task_name()
    args['url'] = request.url()
    args['app_id'] = request.app_id()
    args['queue_name'] = request.queue_name()
    args['method'] = self.__method_mapping(request.method())
    args['body'] = request.body()
    args['payload'] = request.payload()
    args['description'] = request.description()

    # Set defaults.
    args['max_retries'] = self.DEFAULT_MAX_RETRIES
    args['expires'] = self.__when_to_expire(request)
    args['max_retries'] = self.DEFAULT_MAX_RETRIES
    args['max_backoff_sec'] = self.DEFAULT_MAX_BACKOFF 
    args['min_backoff_sec'] = self.DEFAULT_MIN_BACKOFF 
    args['max_doublings'] = self.DEFAULT_MAX_DOUBLINGS

    # Load queue info into cache.
    if request.app_id() not in self.__queue_info_cache:
      try:
        config = TaskQueueConfig(TaskQueueConfig.RABBITMQ, request.app_id())
        self.__queue_info_cache[request.app_id()] = \
          config.load_queues_from_file(request.app_id())
      except ValueError, value_error:
        logging.error("Unable to load queues for app id {0} using defaults."\
          .format(request.app_id()))
      except NameError, name_error:
        logging.error("Unable to load queues for app id {0} using defaults."\
          .format(request.app_id()))
      except Exception, exception:
        logging.error("******Unknown exception******")
        logging.exception(exception)
  
    # Use queue defaults.
    if request.app_id() in self.__queue_info_cache:
      queue_list = self.__queue_info_cache[request.app_id()]['queue']
      for queue in queue_list:
        if queue.get('name') == request.queue_name():
          if 'retry_parameters' in queue:
            retry_params = queue['retry_parameters']
            if 'task_retry_limit' in retry_params:
              args['max_retries'] = retry_params['task_retry_limit']
            if retry_params in 'min_backoff_seconds':
              args['min_backoff_sec'] = retry_params['min_backoff_seconds']
            if 'max_backoff_seconds' in retry_params: 
              args['max_backoff_sec'] = retry_params['max_backoff_seconds']
            if 'max_doublings' in retry_params:
              args['max_doublings'] = retry_params['max_doublings']
          break

    # Override defaults.
    if request.has_retry_parameters():
      retry_params = request.retry_parameters()
      if retry_params.has_retry_limit():
        args['max_retries'] = retry_params.retry_limit()
      if retry_params.has_min_backoff_sec():
        args['min_backoff_sec'] = request.\
                                  retry_parameters().min_backoff_sec()
      if retry_params.has_max_backoff_sec():
        args['max_backoff_sec'] = request.\
                                  retry_parameters().max_backoff_sec()
      if retry_params.has_max_doublings():
        args['max_doublings'] = request.\
                                  retry_parameters().max_doublings()
    return args
dataset/ETHPy150Open AppScale/appscale/AppTaskQueue/distributed_tq.py/DistributedTaskQueue.get_task_args/swapped operands of `in`