(self)
return matches
Return a dictionary with the ``userinfo``, ``host``, and ``port``.

        If the authority is not valid, it will raise a
        :class:`~rfc3986.exceptions.InvalidAuthority` Exception.

        :returns:
            ``{'userinfo': 'username:password', 'host': 'www.example.com',
            'port': '80'}``
        :rtype: dict
        :raises rfc3986.exceptions.InvalidAuthority:
            If the authority is not ``None`` and can not be parsed.
Return a dictionary with the ``userinfo``, ``host``, and ``port``.
Return a dictionary with the userinfo host and port .
def authority_info(self):
        """Return a dictionary with the ``userinfo``, ``host``, and ``port``.

        If the authority is not valid, it will raise a
        :class:`~rfc3986.exceptions.InvalidAuthority` Exception.

        :returns:
            ``{'userinfo': 'username:password', 'host': 'www.example.com',
            'port': '80'}``
        :rtype: dict
        :raises rfc3986.exceptions.InvalidAuthority:
            If the authority is not ``None`` and can not be parsed.
        """
        if not self.authority:
            return {'userinfo': None, 'host': None, 'port': None}

        match = self._match_subauthority()

        if match is None:
            # In this case, we have an authority that was parsed from the URI
            # Reference, but it cannot be further parsed by our
            # misc.SUBAUTHORITY_MATCHER. In this case it must not be a valid
            # authority.
            raise exc.InvalidAuthority(self.authority.encode(self.encoding))

        # We had a match, now let's ensure that it is actually a valid host
        # address if it is IPv4
        matches = match.groupdict()
        host = matches.get('host')

        if (host and misc.IPv4_MATCHER.match(host) and not
                validators.valid_ipv4_host_address(host)):
            # If we have a host, it appears to be IPv4 and it does not have
            # valid bytes, it is an InvalidAuthority.
            raise exc.InvalidAuthority(self.authority.encode(self.encoding))

        return matches
def authority_info ( self ) : if not self . authority : return { 'userinfo' : None , 'host' : None , 'port' : None } match = self . _match_subauthority ( ) if match is None : # In this case, we have an authority that was parsed from the URI # Reference, but it cannot be further parsed by our # misc.SUBAUTHORITY_MATCHER. In this case it must not be a valid # authority. raise exc . InvalidAuthority ( self . authority . encode ( self . encoding ) ) # We had a match, now let's ensure that it is actually a valid host # address if it is IPv4 matches = match . groupdict ( ) host = matches . get ( 'host' ) if ( host and misc . IPv4_MATCHER . match ( host ) and not validators . valid_ipv4_host_address ( host ) ) : # If we have a host, it appears to be IPv4 and it does not have # valid bytes, it is an InvalidAuthority. raise exc . InvalidAuthority ( self . authority . encode ( self . encoding ) ) return matches