code: def _color_text(text, color):
      
      color_mapping = {
          'black': '0;30',
          'red': '0;31',
          'green': '0;32',
          'brown': '0;33',
          'blue': '0;34',
          'magenta': '0;35',
          'cyan': '0;36',
          'lightgrey': '0;37',
          'default': '0;39',
          'darkgrey': '1;30',
          'lightred': '1;31',
          'lightgreen': '1;32',
          'yellow': '1;33',
          'lightblue': '1;34',
          'lightmagenta': '1;35',
          'lightcyan': '1;36',
          'white': '1;37'}
  
      if sys.platform == 'win32' and OutStream is None:
          # On Windows do not colorize text unless in IPython
          return text
  
      color_code = color_mapping.get(color, '0;39')
      return '\033[{0}m{1}\033[0m'.format(color_code, text)
docs: Returns a string wrapped in ANSI color codes for coloring the
      text in a terminal::
  
          colored_text = color_text('Here is a message', 'blue')
  
      This won't actually effect the text until it is printed to the
      terminal.
  
      Parameters
      ----------
      text : str
          The string to return, bounded by the color codes.
      color : str
          An ANSI terminal color name. Must be one of:
          black, red, green, brown, blue, magenta, cyan, lightgrey,
          default, darkgrey, lightred, lightgreen, yellow, lightblue,
          lightmagenta, lightcyan, white, or '' (the empty string).