def collapse_whitespace(text):
    if text is None:
        return None
    if hasattr(text, 'xpath'):
        text = text.xpath('string()')
    text = re.sub('\s+', ' ', text)
    return text.strip()
Get a list of Sprites in others that collide with self.
dataset/ETHPy150Open pudo/scrapekit/scrapekit/util.py/collapse_whitespace--crossover with--dataset/ETHPy150Open ardekantur/pyglet/experimental/sprite.py/Sprite.collide_list