# # coding=utf-8 """Shared utility functions""" from . import constants def strip_ansi(text: str) -> str: """Strip ANSI escape codes from a string. :param text: string which may contain ANSI escape codes :return: the same string with any ANSI escape codes removed """ return constants.ANSI_ESCAPE_RE.sub('', text)