code: def output_message(text, file=sys.stderr):
      
      if file.encoding is None:
          # If the output file does not support Unicode, encode it to a byte
          # string. On some machines, this occurs when Python is redirecting to
          # file (or piping to something like Vim).
          text = text.encode('utf-8')
  
      print(text, file=file)
docs: Output message to terminal.