code: def print_line(text):
      
      try:
          signal.signal(signal.SIGPIPE, signal.SIG_DFL)
      except ValueError:
          pass
  
      try:
          sys.stdout.write(text)
          if not text.endswith('\n'):
              sys.stdout.write('\n')
          sys.stdout.flush()
      except IOError:
          sys.exit(0)
docs: Print the given line to stdout