code: def normalize_query(query_string,
                      findterms=re.compile(r'"([^"]+)"|(\S+)').findall,
                      normspace=re.compile(r'\s{2,}').sub):
      
  
      return [normspace(' ', (t[0] or t[1]).strip()) for t in findterms(query_string)]
docs: Split the query string into individual keywords, discarding spaces
      and grouping quoted words together.
  
      >>> normalize_query('  some random  words "with   quotes  " and   spaces')
      ['some', 'random', 'words', 'with quotes', 'and', 'spaces']