def set_to_provider_client(unparsed_set):
    """Take a oai set and convert into provider_id and client_id"""

    # Get both a provider and client_id from the set
    client_id = None
    provider_id = None

    if unparsed_set:
        # Strip any additional query
        if "~" in unparsed_set:
            unparsed_set, _ = unparsed_set.split("~")

    if unparsed_set:
        # DataCite API deals in lowercase
        unparsed_set = unparsed_set.lower()
        if "." in unparsed_set:
            provider_id, _ = unparsed_set.split(".")
            client_id = unparsed_set
        else:
            provider_id = unparsed_set

    return provider_id, client_id