code: def test_out_shape(path_rgb_byte_tif, shape, indexes):
      """Test read(out_shape) and read_masks(out_shape).  The tests are identical
      aside from the method call.
  
      The pytest parameters are:
  
          * shape - tuple passed to out_shape
          * indexes - The bands to read
  
      The resulting images have been decimated by a factor of 10.
      """
  
      with rasterio.open(path_rgb_byte_tif) as src:
          for attr in "read", "read_masks":
              reader = getattr(src, attr)
  
              out_shape = reader(indexes, out_shape=shape)
              out = reader(
                  indexes, out=np.empty(shape, dtype=src.dtypes[0])
              )
  
              assert out_shape.shape == out.shape
              assert (out_shape == out).all()
  
              # Sanity check fo the test itself
              assert shape[-2:] == (72, 80)
  
imports: from hashlib import md5
  import unittest
  import numpy
  import pytest
  import rasterio
  from rasterio.errors import DatasetIOShapeError
label_desc: Use image node_id 1 for calling a global function with example usage: test_out_shape(path_rgb_byte_tif, shape, indexes) without return types