def METHOD_NAME(data, dset, group, key, chunks):
    """Write data to zarr format."""
    if isinstance(data, da.Array):
        if data.chunks != dset.chunks:
            data = data.rechunk(dset.chunks)
        # lock=False is necessary with the distributed scheduler
        data.store(dset, lock=False)
    else:
        dset[:] = data