def read(self, amt):
        '''Read up to `amt` bytes off the pipeline.

        May raise PipelineCloseRequest if the pipeline is
        empty and the connected stream should be closed.
        '''
        if not self.current and not self.line:
            if self.want_close:
                raise PipelineCloseRequest()
            return ''

        if not self.current:
            _, self.current = self.line.pop(0)
            self.current.reset()

        out = ''
        while len(out) < amt:
            try:
                data = self.current.read(len(out) - amt)
            except ValueError:
                data = ''
            if data == '':
                if not self.line:
                    self.current = None
                    break
                _, self.current = self.line.pop(0)
                self.current.reset()
            else:
                out += data

        # eagerly evict and EOF that's been read _just_ short of 
        # the EOF '' read() call.. so that we know we're empty,
        # and we don't bother with useless iterations
        if self.current and self.current.done:
            self.current = None

        return out
dataset/ETHPy150Open dieseldev/diesel/diesel/pipeline.py/Pipeline.read/swapped operands of `-`