code: def forward_bytes_to_stdout(val):
      """
      Forward bytes from a subprocess call to the console, without attempting to
      decode them.
  
      The assumption is that the subprocess call already returned bytes in
      a suitable encoding.
      """
      if hasattr(sys.stdout, "buffer"):
          # use the underlying binary output if there is one
          sys.stdout.buffer.write(val)
      elif hasattr(sys.stdout, "encoding"):
          # round-trip the encoding if necessary
          sys.stdout.write(val.decode(sys.stdout.encoding))
      else:
          # make a best-guess at the encoding
          sys.stdout.write(val.decode("utf8", errors="replace"))
  
file_path: numpy/numpy/distutils/exec_command.py
imports: import os
  import sys
  import subprocess
  import locale
  import warnings
  from numpy.distutils.misc_util import is_sequence, make_temp_file
  from numpy.distutils import log
label_desc: Use image node_id 2 for calling a global function with example usage: forward_bytes_to_stdout(val) without return types