def METHOD_NAME(dataset_path: str,
                   storage_options: Dict[str, Any],
                   metadata: Dict[str, Any],
                   dry_run: bool):
    import zarr
    LOG.info(f'Opening {dataset_path}...')
    zarr_store = _open_zarr_store(dataset_path, storage_options)
    group = zarr.open(zarr_store, mode='r+' if not dry_run else 'r')
    for k, v in metadata.items():
        parts = k.split('/')
        item = None
        if len(parts) == 1:
            item = group
        else:
            item_name, _ = parts
            if item_name in group:
                item = group[item_name]
            else:
                warnings.warn(f'Ignoring metadata entry {k}:'
                              f' not found in dataset')
        if item is not None:
            upd_count = 0
            del_count = 0
            for ak, av in v.items():
                if av == DELETE_ATTR_VALUE:
                    if ak in item.attrs:
                        if not dry_run:
                            del item.attrs[ak]
                        del_count += 1
                else:
                    if not dry_run:
                        item.attrs[ak] = av
                    upd_count += 1
            if upd_count and del_count:
                LOG.info(f'{k}:'
                         f' {upd_count} attribute(s) updated,'
                         f' {del_count} deleted')
            elif upd_count:
                LOG.info(f'{k}: {upd_count} attribute(s) updated')
            elif del_count:
                LOG.info(f'{k}: {del_count} attribute(s) deleted')
    if not dry_run:
        zarr.convenience.consolidate_metadata(zarr_store)
    LOG.info(f'Consolidated {dataset_path}')