def calculate_age_at(dob, date):
    """
    Calculate the age of a person from his date of birth.
    """
    return (
        date.year - dob.year - ((date.month, date.day) < (dob.month, dob.day))
    )