def next(self):
        """
        (internal) returns the next result from the ``itertools.tee`` object for
        the wrapped ``Piper`` instance or re-raises an ``Exception``.
        
        """
        # 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
def next ( self ) : if self . finished : raise StopIteration self . piper . tee_locks [ self . i ] . acquire ( ) exception = True try : result = self . piper . tees [ self . i ] . next ( ) exception = False except StopIteration , result : self . finished = True except Exception , result : pass 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
(internal) returns the next result from the ``itertools.tee`` object for
        the wrapped ``Piper`` instance or re-raises an ``Exception``.