code: def test_save_to_bytes():
      output = io.BytesIO()
      im = hopper()
      im.save(output, "ico", sizes=[(32, 32), (64, 64)])
  
      # The default image
      output.seek(0)
      with Image.open(output) as reloaded:
          assert reloaded.info["sizes"] == {(32, 32), (64, 64)}
  
          assert im.mode == reloaded.mode
          assert (64, 64) == reloaded.size
          assert reloaded.format == "ICO"
          assert_image_equal(
              reloaded,
              hopper().resize((64, 64), Image.Resampling.LANCZOS),
          )
  
      # The other one
      output.seek(0)
      with Image.open(output) as reloaded:
          reloaded.size = (32, 32)
  
          assert im.mode == reloaded.mode
          assert (32, 32) == reloaded.size
          assert reloaded.format == "ICO"
          assert_image_equal(
              reloaded,
              hopper().resize((32, 32), Image.Resampling.LANCZOS),
          )
  
imports: from __future__ import annotations
  import io
  import os
  import pytest
  from PIL import IcoImagePlugin, Image, ImageDraw
  from .helper import assert_image_equal, assert_image_equal_tofile, hopper
label_desc: Use image node_id 6 for calling a global function with example usage: test_save_to_bytes() without return types