def normalize_query(
            self, 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)]

    # Apply keyword searches.
Splits the query string in invidual keywords, getting rid of unecessary spaces
dataset/ETHPy150Open django-bmf/django-bmf/djangobmf/views/mixins.py/ModuleSearchMixin.normalize_query