code: def test_save_stdout(buffer):
      old_stdout = sys.stdout
  
      if buffer:
  
          class MyStdOut:
              buffer = BytesIO()
  
          mystdout = MyStdOut()
      else:
          mystdout = BytesIO()
  
      sys.stdout = mystdout
  
      with Image.open(TEST_FILE) as im:
          im.save(sys.stdout, "PPM")
  
      # Reset stdout
      sys.stdout = old_stdout
  
      if buffer:
          mystdout = mystdout.buffer
      with Image.open(mystdout) as reloaded:
          assert_image_equal_tofile(reloaded, TEST_FILE)
  
file_path: pillow-simd/Tests/test_file_ppm.py
imports: import sys
  from io import BytesIO
  import pytest
  from PIL import Image
  from .helper import assert_image_equal_tofile, assert_image_similar, hopper
label_desc: Use image node_id 8 for calling a global function with example usage: test_save_stdout(buffer) without return types