def METHOD_NAME(name: Optional[str]) -> bool:
    """Verify given string is a valid ncname."""
    if not name:
        return False
    char = name[0]
    if not char.isalpha() and not char == "_":
        return False
    for char in name[1:]:
        if char.isalpha() or char.isdigit() or char in NCNAME_PUNCTUATION:
            continue
        else:
            return False
    return True