code: def test_autocontrast_mask_real_input():
      # Test the autocontrast with a rectangular mask
      with Image.open("Tests/images/iptc.jpg") as img:
          rect_mask = Image.new("L", img.size, 0)
          draw = ImageDraw.Draw(rect_mask)
          x0, y0 = img.size[0] // 2, img.size[1] // 2
          x1, y1 = img.size[0] - 40, img.size[1]
          draw.rectangle((x0, y0, x1, y1), fill=255)
  
          result = ImageOps.autocontrast(img, mask=rect_mask)
          result_nomask = ImageOps.autocontrast(img)
  
          assert result_nomask != result
          assert_tuple_approx_equal(
              ImageStat.Stat(result, mask=rect_mask).median,
              [195, 202, 184],
              threshold=2,
              msg="autocontrast with mask pixel incorrect",
          )
          assert_tuple_approx_equal(
              ImageStat.Stat(result_nomask).median,
              [119, 106, 79],
              threshold=2,
              msg="autocontrast without mask pixel incorrect",
          )
  
imports: from __future__ import annotations
  import pytest
  from PIL import Image, ImageDraw, ImageOps, ImageStat, features
  from .helper import assert_image_equal, assert_image_similar, assert_image_similar_tofile, assert_tuple_approx_equal, hopper
label_desc: Use image node_id 21 for calling a global function with example usage: test_autocontrast_mask_real_input() without return types