code: def test_calculate_downsample_hypothesis(
      mode, im_w, im_h, max_x, max_y, max_bytes
  ):
      result = _calculate_downsample(
          (im_w, im_h),
          bytes_per_pixel(mode),
          max_size=(max_x, max_y),
          max_bytes=max_bytes,
      )
      assert result[0] <= max_x
      assert result[1] <= max_y
      assert result[0] * result[1] * bytes_per_pixel(mode) <= max_bytes
  
file_path: OCRmyPDF/tests/test_imageops.py
imports: from __future__ import annotations
  import hypothesis.strategies
  from hypothesis import given
  from PIL import Image
  from ocrmypdf.imageops import _calculate_downsample, bytes_per_pixel, calculate_downsample, downsample_image
label_desc: Use image node_id 3 for calling a global function with example usage: test_calculate_downsample_hypothesis(mode, im_w, im_h, max_x, max_y, max_bytes) without return types