def fetch(self, ref=None, start=-1, end=-1, region=None):
        if region:
            print "Unsupported option!"
            sys.exit(1)
        self.__pos = 0
        tid = -1

        if ref and start > -1 and end > -1:
            for i, val in enumerate(self._refs):
                if val == ref:
                    tid = i
                    break
            if tid == -1:
                raise ValueError("Missing reference: %s" % ref)

        for k in self._read_keys:
            self.__pos += 1
            read = self._reads[k]
            if tid == -1:  # no limits, return them all
                yield read
            else:
                if self._reads[k].tid == tid:
                    if start <= read.pos <= end or start <= read.aend <= end or (start < read.pos and read.aend > end):
                        yield read
dataset/ETHPy150Open ngsutils/ngsutils/ngsutils/bam/t/__init__.py/MockBam.fetch/swapped operands of `<`