def __contains__(self, value):
        """
        May raise TypeError if we encounter an open-ended range
        """
        for l, h in self.ranges:
            if l is None:
                raise TypeError(
                    "Can't determine membership; last value not set")
            if l <= value <= h:
                return True

        return False
dataset/ETHPy150Open nlloyd/SubliminalCollaborator/libs/twisted/mail/imap4.py/MessageSet.__contains__/original