code: def like_handler(ctx, param, value):
      """Copy a dataset's meta property to the command context for access
      from other callbacks."""
      if ctx.obj is None:
          ctx.obj = {}
      if value:
          with rasterio.open(value) as src:
              metadata = src.meta
              ctx.obj["like"] = metadata
              ctx.obj["like"]["transform"] = metadata["transform"]
              ctx.obj["like"]["tags"] = src.tags()
              ctx.obj["like"]["colorinterp"] = src.colorinterp
          return True
      else:  # pragma: no cover
          return False
  
file_path: rasterio/rasterio/rio/options.py
imports: import logging
  import os
  import re
  import click
  import rasterio
  import rasterio.shutil
  from rasterio._path import _parse_path, _UnparsedPath
label_desc: Use image node_id 7 for calling a global function with example usage: like_handler(ctx, param, value) and returns: True, False