code: def fprint(fmt, *args, **kwargs):
      
      if not fmt:
          return
  
      hascolor = False
      target = kwargs.get("target", sys.stdout)
  
      # Format the string before feeding it to the parser
      fmt = fmt.format(*args, **kwargs)
  
      for txt, markups in _color_format_parser.parse(fmt):
          if markups != (None, None):
              _color_manager.set_color(*markups)
              hascolor = True
          else:
              if hascolor:
                  _color_manager.set_defaults()
                  hascolor = False
  
          target.write(txt)
          target.flush()  # Needed for Python 3.x
  
      _color_manager.set_defaults()
      target.write(kwargs.get('end', '\n'))
      _color_manager.set_defaults()
docs: Parse and print a colored and perhaps formatted string.
  
      The remaining keyword arguments are the same as for Python's built-in print
      function. Colors are returning to their defaults before the function
      returns.