code: def test_basic(tmp_path):
      # PIL 1.1 has limited support for 16-bit image data.  Check that
      # create/copy/transform and save works as expected.
  
      def basic(mode):
          imIn = original.convert(mode)
          verify(imIn)
  
          w, h = imIn.size
  
          imOut = imIn.copy()
          verify(imOut)  # copy
  
          imOut = imIn.transform((w, h), Image.EXTENT, (0, 0, w, h))
          verify(imOut)  # transform
  
          filename = str(tmp_path / "temp.im")
          imIn.save(filename)
  
          with Image.open(filename) as imOut:
              verify(imIn)
              verify(imOut)
  
          imOut = imIn.crop((0, 0, w, h))
          verify(imOut)
  
          imOut = Image.new(mode, (w, h), None)
          imOut.paste(imIn.crop((0, 0, w // 2, h)), (0, 0))
          imOut.paste(imIn.crop((w // 2, 0, w, h)), (w // 2, 0))
  
          verify(imIn)
          verify(imOut)
  
          imIn = Image.new(mode, (1, 1), 1)
          assert imIn.getpixel((0, 0)) == 1
  
          imIn.putpixel((0, 0), 2)
          assert imIn.getpixel((0, 0)) == 2
  
          if mode == "L":
              maximum = 255
          else:
              maximum = 32767
  
          imIn = Image.new(mode, (1, 1), 256)
          assert imIn.getpixel((0, 0)) == min(256, maximum)
  
          imIn.putpixel((0, 0), 512)
          assert imIn.getpixel((0, 0)) == min(512, maximum)
  
      basic("L")
  
      basic("I;16")
      basic("I;16B")
      basic("I;16L")
  
      basic("I")
  
imports: from PIL import Image
  from .helper import hopper
label_desc: Use image node_id 2 for calling a global function with example usage: test_basic(tmp_path) without return types