def METHOD_NAME(invitation_url: HttpUrl) -> str:
    """Parses url and extracts invitation"""
    try:
        query_params = dict(parse.parse_qsl(URL(invitation_url.fragment).query))
        invitation_code: str = query_params["invitation"]
        return invitation_code
    except KeyError as err:
        logger.debug("Invalid invitation: %s", err)
        raise InvalidInvitationCode from err