def METHOD_NAME(cls, values: Mapping[str, Any]):
    if values.get("base_image") and values.get("dockerfile"):
        raise ValueError(
            "Either `base_image` or `dockerfile` should be provided, but not both"
        )
    return values