def is_valid(edtf_candidate):
    """isValid takes a candidate date and returns if it is valid or not"""

    if (
        isLevel0(edtf_candidate) or
        isLevel1(edtf_candidate) or
        isLevel2(edtf_candidate)
    ):
        if '/' in edtf_candidate:
            return is_valid_interval(edtf_candidate)
        else:
            return True
    else:
        return False
isValid takes a candidate date and returns if it is valid or not