def receive_bytes(self, length):
        """Receives multiple bytes. Retries read when we couldn't receive the
        specified amount.

        Raises:
            ConnectionTerminatedException: when read returns empty string.
        """

        read_bytes = []
        while length > 0:
            new_read_bytes = self._read(length)
            read_bytes.append(new_read_bytes)
            length -= len(new_read_bytes)
        return ''.join(read_bytes)
dataset/ETHPy150Open google/pywebsocket/mod_pywebsocket/_stream_base.py/StreamBase.receive_bytes/original