code: def _escaped(self, text, esc):
      if esc and self.hasmarkup:
          text = (
              "".join(["\x1b[%sm" % cod for cod in esc])
              + text
              + "\x1b[0m"
          )
      return text
  
imports: import sys, os, unicodedata
  import py
  from py.builtin import text, bytes
label_desc: Use image node_id 6 for calling the TerminalWriter obj's underlying member method code with example usage: obj._escaped(text, esc) and returns: text