code: def normalize_output(data):
      # Some operating systems do conversions on newline.  We could possibly fix
      # that by doing the appropriate termios.tcsetattr()s.  I couldn't figure out
      # the right combo on Tru64.  So, just normalize the output and doc the
      # problem O/Ses by allowing certain combinations for some platforms, but
      # avoid allowing other differences (like extra whitespace, trailing garbage,
      # etc.)
  
      # This is about the best we can do without getting some feedback
      # from someone more knowledgable.
  
      # OSF/1 (Tru64) apparently turns \n into \r\r\n.
      if data.endswith(b"\r\r\n"):
          return data.replace(b"\r\r\n", b"\n")
  
      if data.endswith(b"\r\n"):
          return data.replace(b"\r\n", b"\n")
  
      return data
  
imports: from test.support import verbose, reap_children
  from test.support.import_helper import import_module
  import errno
  import os
  import pty
  import tty
  import sys
  import select
  import signal
  import socket
  import io
  import unittest
  import warnings
label_desc: Use image node_id 1 for calling a global function with example usage: normalize_output(data) and returns: data, data, data