def METHOD_NAME(self, data, **_):
    if "slice_timing" not in data or "repetition_time" not in data:
        return  # nothing to validate
    if "slice_timing_code" in data and data["slice_timing_code"] is not None:
        raise ValidationError(
            "Cannot specify both slice_timing and slice_timing_code at the same time"
        )