code: def test_copy(tmpdir, path_rgb_byte_tif, pass_handle):
      """Ensure ``rasterio.shutil.copy()`` can read from a path to a file on disk
      and an open dataset handle.
      """
  
      outfile = str(tmpdir.join("test_copy.tif"))
  
      if pass_handle:
          src = rasterio.open(path_rgb_byte_tif)
      else:
          src = path_rgb_byte_tif
  
      rasterio.shutil.copy(
          src,
          outfile,
          # Test a mix of boolean, ints, and strings to make sure creation
          # options passed as Python types are properly cast.
          tiled=True,
          blockxsize=512,
          BLOCKYSIZE="256",
      )
  
      if isinstance(src, str):
          src = rasterio.open(path_rgb_byte_tif)
  
      with rasterio.open(outfile) as dst:
          assert dst.driver == "GTiff"
          assert set(dst.block_shapes) == {(256, 512)}
  
          src_data = src.read()
          dst_data = dst.read()
  
          assert numpy.array_equal(src_data, dst_data)
  
      src.close()
  
file_path: rasterio/tests/test_shutil.py
imports: import os
  import numpy
  import pytest
  import rasterio
  import rasterio.shutil
  from rasterio._err import CPLE_NotSupportedError
  from rasterio.errors import DriverRegistrationError, RasterioIOError
label_desc: Use image node_id 6 for calling a global function with example usage: test_copy(tmpdir, path_rgb_byte_tif, pass_handle) without return types