def verify_task_queue_add_request(app_id, request, now):
 if (request.eta_usec() < 0):
  return taskqueue_service_pb.TaskQueueServiceError.INVALID_ETA
 eta = datetime.datetime.utcfromtimestamp(_usec_to_sec(request.eta_usec()))
 max_eta = (now + MAX_ETA)
 if (eta > max_eta):
  return taskqueue_service_pb.TaskQueueServiceError.INVALID_ETA
 if (request.has_crontimetable() and (app_id is None)):
  return taskqueue_service_pb.TaskQueueServiceError.PERMISSION_DENIED
 if (request.mode() == taskqueue_service_pb.TaskQueueMode.PULL):
  max_task_size_bytes = MAX_PULL_TASK_SIZE_BYTES
 else:
  max_task_size_bytes = MAX_PUSH_TASK_SIZE_BYTES
 if (request.ByteSize() > max_task_size_bytes):
  return taskqueue_service_pb.TaskQueueServiceError.TASK_TOO_LARGE
 return taskqueue_service_pb.TaskQueueServiceError.SKIPPED

def verify_task_queue_add_request ( app_id , request , now ) : if ( request . eta_usec ( ) < 0 ) : return taskqueue_service_pb . TaskQueueServiceError . INVALID_ETA eta = datetime . datetime . utcfromtimestamp ( _usec_to_sec ( request . eta_usec ( ) ) ) max_eta = ( now + MAX_ETA ) if ( eta > max_eta ) : return taskqueue_service_pb . TaskQueueServiceError . INVALID_ETA if ( request . has_crontimetable ( ) and ( app_id is None ) ) : return taskqueue_service_pb . TaskQueueServiceError . PERMISSION_DENIED if ( request . mode ( ) == taskqueue_service_pb . TaskQueueMode . PULL ) : max_task_size_bytes = MAX_PULL_TASK_SIZE_BYTES else : max_task_size_bytes = MAX_PUSH_TASK_SIZE_BYTES if ( request . ByteSize ( ) > max_task_size_bytes ) : return taskqueue_service_pb . TaskQueueServiceError . TASK_TOO_LARGE return taskqueue_service_pb . TaskQueueServiceError . SKIPPED
checks that a taskqueueaddrequest is valid .