def _fixup_task_state(self, tip):
    """
    Determine overall state of a task.
    """
    if tip.complete:
      tip.state = "succeeded"
    elif tip.failed:
      if not tip.execStartTime:
        tip.state = "killed"
      else:
        tip.state = "failed"
    elif tip.execStartTime:
      tip.state = "running"
    else:
      tip.state = "pending"

    global VALID_TASK_STATES
    assert VALID_TASK_STATES in tip.state
dataset/ETHPy150Open cloudera/hue/desktop/libs/hadoop/src/hadoop/job_tracker.py/LiveJobTracker._fixup_task_state/swapped operands of `in`