code: def next(self):
          
          # do not acquire lock if NuMap is not finished.
          if self.finished:
              raise StopIteration
          # get per-tee lock
          self.piper.tee_locks[self.i].acquire()
          # get result or exception
          exception = True
          try:
              result = self.piper.tees[self.i].next()
              exception = False
          except StopIteration, result:
              self.finished = True
          except Exception, result:
              pass
          # release per-tee lock either self or next
          if self.s == self.stride or self.finished:
              self.s = 1
              self.piper.tee_locks[(self.i + 1) % len(self.piper.tees)].release()
  
          else:
              self.s += 1
              self.piper.tee_locks[self.i].release()
          if exception:
              raise result
          else:
              return result
docs: (internal) returns the next result from the ``itertools.tee`` object for
          the wrapped ``Piper`` instance or re-raises an ``Exception``.