code: def hilite(s, ok=True, bold=False):
      
      if not term_supports_colors():
          return s
      attr = []
      if ok is None:  # no color
          pass
      elif ok:   # green
          attr.append('32')
      else:   # red
          attr.append('31')
      if bold:
          attr.append('1')
      return '\x1b[%sm%s\x1b[0m' % (';'.join(attr), s)
docs: Return an highlighted version of 'string'.