code: def _QueryHash(self, nsrl_socket, digest):
      
      try:
        query = 'QUERY {0:s}\n'.format(digest).encode('ascii')
      except UnicodeDecodeError:
        logger.error('Unable to encode digest: {0!s} to ASCII.'.format(digest))
        return False
  
      response = None
  
      try:
        nsrl_socket.sendall(query)
        response = nsrl_socket.recv(self._RECEIVE_BUFFER_SIZE)
  
      except socket.error as exception:
        logger.error('Unable to query nsrlsvr with error: {0!s}.'.format(
            exception))
  
      if not response:
        return False
  
      # Strip end-of-line characters since they can differ per platform on which
      # nsrlsvr is running.
      response = response.strip()
      # nsrlsvr returns "OK 1" if the has was found or "OK 0" if not.
      return response == b'OK 1'
docs: Queries nsrlsvr for a specific hash.
  
      Args:
        nsrl_socket (socket._socketobject): socket of connection to nsrlsvr.
        digest (str): hash to look up.
  
      Returns:
        bool: True if the hash was found, False if not or None on error.