def __init__(self,
               url,
               params,
               name=None,
               eta=None,
               countdown=None,
               parent=None,
               headers=None):
    """Init.

    Args:
      url: task url in str.
      params: a dict from str to str.
      name: task name.
      eta: task eta.
      countdown: task countdown.
      parent: parent entity of huge task's payload.
      headers: a dict of headers for the task.

    Raises:
      ValueError: when payload is too big even for datastore, or parent is
    not specified when payload is stored in datastore.
    """
    self.url = url
    self.name = name
    self.eta = eta
    self.countdown = countdown
    self._headers = {
        "Content-Type": "application/octet-stream",
        self.PAYLOAD_VERSION_HEADER: self.PAYLOAD_VERSION
    }
    if headers:
      self._headers.update(headers)


    payload_str = urllib.urlencode(params)
    compressed_payload = ""
    if len(payload_str) > self.MAX_TASK_PAYLOAD:
      compressed_payload = zlib.compress(payload_str)


    if not compressed_payload:
      self._payload = payload_str

    elif self.MAX_TASK_PAYLOAD < len(compressed_payload):
      self._payload = self.PAYLOAD_PARAM + compressed_payload
    elif len(compressed_payload) > self.MAX_DB_PAYLOAD:
      raise ValueError(
          "Payload from %s to big to be stored in database: %s" %
          (self.name, len(compressed_payload)))

    else:
      if not parent:
        raise ValueError("Huge tasks should specify parent entity.")

      payload_entity = _HugeTaskPayload(payload=compressed_payload,
                                        parent=parent)
      payload_key = payload_entity.put()
      self._payload = self.PAYLOAD_KEY_PARAM + str(payload_key)
dataset/ETHPy150Open GoogleCloudPlatform/python-compat-runtime/appengine-compat/exported_appengine_sdk/google/appengine/ext/mapreduce/model.py/HugeTask.__init__/swapped operands of `<`