code: def __read_block(self, size):
          
          buf = b""
          if len(self.__read_buffer):
              limit = (
                  size if size <= len(self.__read_buffer) else
                  len(self.__read_buffer)
              )
              buf = self.__read_buffer[:limit]
              self.__read_buffer = self.__read_buffer[limit:]
              size -= limit
          if not size:
              return buf
          try:
              buf += self.sock.recv(size)
          except (socket.timeout, ssl.SSLError):
              raise Error("Failed to read %d bytes from the server" % size)
          self.__dprint(buf)
          return buf
docs: Read a block of 'size' bytes from the server.
  
          An internal buffer is used to read data from the server. If
          enough data is available from it, we return that data.
  
          Eventually, we try to grab the missing part from the server
          for Client.read_timeout seconds. If no data can be
          retrieved, it is considered as a fatal error and an 'Error'
          exception is raised.
  
          :param size: number of bytes to read
          :rtype: string
          :returns: the read block (can be empty)