def _validate_origin(origin: str) ->None:
    """
    Checks that origin has a valid value. One of:
        - unknown: edge exists for an unknown reason;
        - learned: edge was created as the output of a machine-learning process;
        - expert: edge was created by a domain expert.

    Args:
        origin: the value to validate.

    Raises:
        ValueError: if origin is not valid.
    """
    allowed = {'unknown', 'learned', 'expert'}
    if origin not in allowed:
        raise ValueError(
            'Unknown origin: must be one of {allowed} - got `{origin}`.'.
            format(allowed=allowed, origin=origin))
