def EncloseAnsiText(text):
  return sgr_re.sub(lambda x: ANSI_START + x.group(1) + ANSI_END, text)
Enclose ANSI/SGR escape sequences with ANSI_START and ANSI_END.
dataset/ETHPy150Open google/textfsm/terminal.py/EncloseAnsiText