def METHOD_NAME(d):
    """Returns (Height, Width) of a given dataset/datarray"""
    dim_names = (("y", "x"), ("latitude", "longitude"))
    dims = set(d.dims)
    h, w = None, None
    for n1, n2 in dim_names:
        if n1 in dims and n2 in dims:
            h, w = (d.coords[n].shape[0] for n in (n1, n2))
            break
    if h is None:
        raise ValueError(
            f"Can't determine shape from dimension names: {' '.join(dims)}"
        )
    return h, w