code: def set_outcome(self, outcome):
      
      if outcome not in range(0, 5):
        raise Exception('Invalid outcome: {}'.format(outcome))
  
      if outcome < self._outcome:
        self._outcome = outcome
        if self.parent: self.parent.set_outcome(self._outcome)
docs: Set the outcome of this work unit.
  
      We can set the outcome on a work unit directly, but that outcome will also be affected by
      those of its subunits. The right thing happens: The outcome of a work unit is the
      worst outcome of any of its subunits and any outcome set on it directly.