code: def test_rpcs_write_read_rpcs(tmpdir):
      tiffname = str(tmpdir.join("test.tif"))
      rpcs = RPC.from_gdal(TEST_RPCS_FROM_GDAL)
  
      with rasterio.open(
          tiffname,
          "w",
          driver="GTiff",
          dtype="uint8",
          count=1,
          width=7449,
          height=11522,
          rpcs=rpcs,
      ) as dst:
          pass
  
      with rasterio.open(tiffname, "r+") as dst:
          rpcs = dst.rpcs
          assert rpcs
          assert isinstance(rpcs, RPC)
          expected = TEST_RPCS_FROM_GDAL.copy()
  
          # GDAL < 3.3 does not ensure ERR_BIAS and ERR_RAND are written out
          # so we wont either
          expected.pop("ERR_BIAS")
          expected.pop("ERR_RAND")
          rpcs.err_bias = None
          rpcs.err_rand = None
  
          assert sorted(rpcs.to_gdal().keys()) == sorted(
              expected.keys()
          )
  
          rpcs.lat_off = 48
          rpcs.long_off = -123
          dst.rpcs = rpcs
          assert dst.rpcs
          assert dst.rpcs.lat_off == 48
          assert dst.rpcs.long_off == -123
  
      # check changes were written to dataset.
      with rasterio.open(tiffname, "r") as dst:
          assert dst.rpcs
          assert dst.rpcs.lat_off == 48
          assert dst.rpcs.long_off == -123
  
file_path: rasterio/tests/test_rpcs.py
imports: import rasterio
  from rasterio.rpc import RPC
label_desc: Use image node_id 4 for calling a global function with example usage: test_rpcs_write_read_rpcs(tmpdir) without return types