def parse_query_string(s, model_cls):
 message = u'Query is not unicode: {0!r}'.format(s)
 assert isinstance(s, six.text_type), message
 try:
  parts = util.shlex_split(s)
 except ValueError as exc:
  raise dbcore.InvalidQueryError(s, exc)
 return parse_query_parts(parts, model_cls)

def parse_query_string ( s , model_cls ) : message = u'Query is not unicode: {0!r}' . format ( s ) assert isinstance ( s , six . text_type ) , message try : parts = util . shlex_split ( s ) except ValueError as exc : raise dbcore . InvalidQueryError ( s , exc ) return parse_query_parts ( parts , model_cls )
given a beets query string .