def escape_query(text):
    text = force_text(text)
    text = RE_SPACE.sub(" ", text)  # Standardize spacing.
    text = RE_NON_WORD.sub(" ", text)  # Replace harmful characters with space.
    text = text.strip()
    return text
normalizes the query text to a format that can be consumed
dataset/ETHPy150Open etianen/django-watson/src/watson/backends.py/escape_query