code: def test_promote():
      im = Image.new("L", (1, 1), 1)
      assert im.getpixel((0, 0)) == 1
  
      im.putalpha(2)
      assert im.mode == "LA"
      assert im.getpixel((0, 0)) == (1, 2)
  
      im = Image.new("P", (1, 1), 1)
      assert im.getpixel((0, 0)) == 1
  
      im.putalpha(2)
      assert im.mode == "PA"
      assert im.getpixel((0, 0)) == (1, 2)
  
      im = Image.new("RGB", (1, 1), (1, 2, 3))
      assert im.getpixel((0, 0)) == (1, 2, 3)
  
      im.putalpha(4)
      assert im.mode == "RGBA"
      assert im.getpixel((0, 0)) == (1, 2, 3, 4)
  
imports: from __future__ import annotations
  from PIL import Image
label_desc: Use image node_id 2 for calling a global function with example usage: test_promote() without return types