code: def test_calculate_downsample():
      im = Image.new("RGB", (100, 100))
      assert calculate_downsample(im, max_size=(50, 50)) == (50, 50)
      assert calculate_downsample(im, max_pixels=2500) == (50, 50)
      assert calculate_downsample(im, max_bytes=10000) == (50, 50)
      assert calculate_downsample(im, max_bytes=100000) == (100, 100)
  
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 2 for calling a global function with example usage: test_calculate_downsample() without return types