code: def test_downsample_image():
      im = Image.new("RGB", (100, 100))
      im.info["dpi"] = (300, 300)
      ds = downsample_image(im, (50, 50))
      assert ds.size == (50, 50)
      assert ds.info["dpi"] == (150, 150)
  
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 4 for calling a global function with example usage: test_downsample_image() without return types