def r(self, proto, handler, buf):
            parts = buf.split(';')
            if len(parts) == 1:
                handler.setScrollRegion(None, None)
            elif len(parts) == 2:
                try:
                    if parts[0]:
                        pt = int(parts[0])
                    else:
                        pt = None
                    if parts[1]:
                        pb = int(parts[1])
                    else:
                        pb = None
                except ValueError:
                    handler.unhandledControlSequence('\x1b[' + buf + 'r')
                else:
                    handler.setScrollRegion(pt, pb)
            else:
                handler.unhandledControlSequence('\x1b[' + buf + 'r')
dataset/ETHPy150Open kuri65536/python-for-android/python-modules/twisted/twisted/conch/insults/insults.py/ClientProtocol.ControlSequenceParser.r/original