def next_larger(self):
        int_seg = int(self.seg, 16)
        assert int_seg <= 0xFF

        if int_seg == 0xFF:
            # Seg is at the maximum value, carry the increment into
            # 'log'.
            #
            # NB: older versions of Postgres won't generate a seg
            # value of 0xFF, so a gap has to be treated
            # conservatively.
            int_log = int(self.log, 16)

            # Blow up if int_log would otherwise overflow.  Almost
            # certainly a bug...or Postgres is going to exhaust its
            # XLog addressing, too.
            assert int_log < 0xFFFFFFFF

            l_log = SegmentNumber._integer_to_name(int_log + 1)
            l_seg = SegmentNumber._integer_to_name(0)

            return self.__class__(l_log, l_seg)
        else:
            l_log = self.log
            l_seg = SegmentNumber._integer_to_name(int_seg + 1)

            return self.__class__(l_log, l_seg)

        assert False
dataset/ETHPy150Open wal-e/wal-e/wal_e/storage/base.py/SegmentNumber.next_larger/original