code: def _apply_color(code, content):
          
  
          normal = u'\x1B[0m'
          seq = u'\x1B[%sm' % code
  
          # Replace any normal sequences with this sequence to support nested colors
          return seq + (normal + seq).join(content.split(normal)) + normal
docs: Apply a color code to text