code: def test_tobytes():
      def tobytes(mode):
          return Image.new(mode, (1, 1), 1).tobytes()
  
      order = 1 if Image._ENDIAN == "<" else -1
  
      assert tobytes("L") == b"\x01"
      assert tobytes("I;16") == b"\x01\x00"
      assert tobytes("I;16B") == b"\x00\x01"
      assert tobytes("I") == b"\x01\x00\x00\x00"[::order]
  
imports: from PIL import Image
  from .helper import hopper
label_desc: Use image node_id 3 for calling a global function with example usage: test_tobytes() and returns: Image