code: def test_read_1_bit_png_consistency(shape, mode, tmpdir):
      np_rng = np.random.RandomState(0)
      image_path = os.path.join(tmpdir, f"test_{shape}.png")
      pixels = np_rng.rand(*shape) > 0.5
      img = Image.fromarray(pixels)
      img.save(image_path)
      img1 = read_image(image_path, mode)
      img2 = read_image(image_path, mode)
      assert_equal(img1, img2)
  
imports: import glob
  import io
  import os
  import sys
  from pathlib import Path
  import numpy
  import pytest
  import torch
  import torchvision.transforms.functional
  from common_utils import assert_equal, needs_cuda
  from PIL import __version__, Image
  from torchvision.io.image import _read_png_16, decode_image, decode_jpeg, decode_png, encode_jpeg, encode_png, ImageReadMode, read_file, read_image, write_file, write_jpeg, write_png
label_desc: Use image node_id 19 for calling a global function with example usage: test_read_1_bit_png_consistency(shape, mode, tmpdir) without return types