<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def outstanding(self):
 """Returns whether or not this barrier has pending work."""

        # Allow the same WorkItem to be yielded multiple times but not
        # count towards blocking the barrier.
        done_count = 0
        for item in self:
            if not self.wait_any and item.fire_and_forget:
                # Only count fire_and_forget items as done if this is
                # *not* a WaitAny barrier. We only want to return control
                # to the caller when at least one of the blocking items
                # has completed.
                done_count += 1
            elif item.done:
                done_count += 1

        if self.wait_any and done_count > 0:
            return False

        if done_count == len(self):
            return False

        return True