def read_exactly(self, num_bytes):
output = b'<STR_LIT>'<EOL>remaining = num_bytes<EOL>while remaining > <NUM_LIT:0>:<EOL><INDENT>output += self.read(remaining)<EOL>remaining = num_bytes - len(output)<EOL><DEDENT>return output<EOL>
Reads exactly the specified number of bytes from the socket

:param num_bytes:
    An integer - the exact number of bytes to read

:return:
    A byte string of the data that was read