def METHOD_NAME(item: ostr, accepted: str) -> None:
    """Ensure item contains only valid chars or is None"""
    if item is None:
        return
    for c in item:
        if c not in accepted:
            raise ValueError("Invalid characters")