def _read_number(self):
        if self._read_position + 1 > len(self._data):
            raise ValueError(
                'Cannot read the first byte of number field')

        number = ord(self._data[self._read_position])
        if number & 0x80 == 0x80:
            raise ValueError(
                'The most significant bit of the first byte of number should '
                'be unset')
        self._read_position += 1
        pos = self._read_position
        if number == 127:
            if pos + 8 > len(self._data):
                raise ValueError('Invalid number field')
            self._read_position += 8
            number = struct.unpack('!Q', self._data[pos:pos+8])[0]
            if number > 0x7FFFFFFFFFFFFFFF:
                raise ValueError('Encoded number(%d) >= 2^63' % number)
            if number <= 0xFFFF:
                raise ValueError(
                    '%d should not be encoded by 9 bytes encoding' % number)
            return number
        if number == 126:
            if pos + 2 > len(self._data):
                raise ValueError('Invalid number field')
            self._read_position += 2
            number = struct.unpack('!H', self._data[pos:pos+2])[0]
            if number <= 125:
                raise ValueError(
                    '%d should not be encoded by 3 bytes encoding' % number)
        return number
dataset/ETHPy150Open google/pywebsocket/mod_pywebsocket/mux.py/_MuxFramePayloadParser._read_number/original