def METHOD_NAME(cls, v, values):
    if v > values["limit"]:
        msg = f"count {v} bigger than limit {values['limit']}, please check"
        raise ValueError(msg)
    if v > values["total"]:
        msg = (
            f"count {v} bigger than expected total {values['total']}, please check"
        )
        raise ValueError(msg)
    if "offset" in values and (values["offset"] + v) > values["total"]:
        msg = f"offset {values['offset']} + count {v} is bigger than allowed total {values['total']}, please check"
        raise ValueError(msg)
    return v