<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def stop(self):
 """ Stops the ``Pipers`` according to pipeline topology. """

        self.log.debug('%s begins stopping routine' % repr(self))
        self.log.debug('%s triggers stopping in input pipers' % repr(self))
        inputs = self.get_inputs()
        for piper in inputs:
            piper.stop(forced=True)
        self.log.debug('%s pulls output pipers until stop' % repr(self))
        outputs = self.get_outputs()
        while outputs:
            for piper in outputs:
                try:
                    # for i in xrange(stride)?
                    piper.next()
                except StopIteration:
                    outputs.remove(piper)
                    self.log.debug("%s stopped output piper: %s" % \
                                   (repr(self), repr(piper)))
                    continue
                except Exception, excp:
                    self.log.debug("%s %s raised an exception: %s" % \
                                   (repr(self), piper, excp))
        self.log.debug("%s stops the remaining pipers" % repr(self))
        postorder = self.postorder()
        for piper in postorder:
            if piper not in inputs:
                piper.stop(ends=[0])
        self.log.debug("%s finishes stopping of input pipers" % repr(self))
        for piper in inputs:
            if hasattr(piper.imap, 'stop'):
                piper.imap.stop(ends=[0])
        self.log.debug('%s finishes stopping routine' % repr(self))