def parse_ivorn(ivorn):
    """
    Takes an IVORN of the form

        ivo://authorityID/resourceKey#local_ID

    and returns (authorityID, resourceKey, local_ID). Raise if that isn't
    possible.

    Refer to the IVOA Identifiers Recommendation (1.12) for justification, but
    note that document is not as clear as unambiguous as one might hope. We
    have assumed that anything which is not explicitly permitted is forbitten
    in the authority and the resource name, while anything which would be
    permitted in an RFC-3986 URI is permitted in the fragment.
    """
    try:
        return IVORN_RE.match(ivorn).groups()
    except __HOLE__ as e:
        log.debug("Failed to parse as IVORN: ", str(e))
        raise Exception("Invalid IVORN: %s" % (ivorn,))
dataset/ETHPy150Open jdswinbank/Comet/comet/utility/voevent.py/parse_ivorn