code: def strip_ansi(source):
      """
      Remove ansi escape codes from text.
  
      Parameters
      ----------
      source : str
          Source to remove the ansi from
      """
      return re.sub(r"\033\[(\d|;)+?m", "", source)
  
imports: from __future__ import absolute_import
  import os
  import re
  import sys
  import textwrap
  from string import Formatter
  from IPython.testing.skipdoctest import skip_doctest_py3, skip_doctest
  from IPython.utils import py3compat
label_desc: Use image node_id 10 for calling a global function with example usage: strip_ansi(source) and returns: re