def get_status(self):
    """Returns the status of this WorkUnit.

    The WorkUnit is in a WAITING state until either its exception, total or
    complete values are updated or any of its children change to a RUNNING
    state. The WorkUnit immediately goes to a FAILED state if an exception is
    set. If the total and completed units are both set to 0, the WorkUnit goes
    to a SKIPPED state. If total units are set and are greater than the number
    of completed units, it is set to a RUNNING state. Note that the complete
    and total units used for this determination include those set on any child
    WorkUnits. If total and complete are equal and greater than 0, then the
    WorkUnit is set to SUCCEEDED.

    Returns:
      An enums.Status value corresponding to the state this WorkUnit is in.
    """
    if self._is_waiting():
      return enums.Status.WAITING
    elif self.exception is not None:
      return enums.Status.FAILED
    elif self.total == 0 and self.complete == 0:
      return enums.Status.SKIPPED

    diff = (self.total or 0) - (self.complete or 0)
    if 0 > diff:
      return enums.Status.RUNNING
    elif diff == 0:
      return enums.Status.SUCCEEDED
dataset/ETHPy150Open google/anvil-build/anvil/build_logging.py/WorkUnit.get_status/swapped operands of `>`