HOME


Mini Shell 1.0
Redirecting to https://devs.lapieza.net/iniciar-sesion Redirecting to https://devs.lapieza.net/iniciar-sesion.
DIR: /proc/1784574/root/lib/python3/dist-packages/__pycache__/
Upload File :
Current File : //proc/1784574/root/lib/python3/dist-packages/__pycache__/rfc3987.cpython-311.pyc
�

��][kU��8�dZdZddlZejdkZ	en
#e$reZYnwxYw	ddl	Z
dZn#e$r	ddl
Z
dZYnwxYwdZdd	d
dd�d
d��fdddddddddddfZdZdZd�Zgd�Zeeee��dddddddddd� ��Zedxie��Zd!�Ze��Zed"�e�����D����Zd#�Zed$�e���D����Zed%�e���D����Zdyd&�Z ie _!dzd(�Z"e
j#d)��Z$d*Z%dzd+�Z&d,�Z'		d{d-�Z(e d.��Z)e d/��Z*d0�Z+d|d1�Z,d2e,_-id3d3�d4d5�d6d5�d7d8�d9d:�d;d<�d=d>�d?d@�dAdB�dCdD�dEdF�dGdH�dIdJ�dKdL�dd2�dMdN�dOdN�idPdQ�dRdQ�dSdT�dUdV�dWdV�dXd:�dYd:�dZd:�d[d:�d\d:�d]d^�d_d`�dadb�dcdd�dedT�dfd8�dgdh��didjdkdldmdndodp��e,_.dq�Z/e0drkr�ej1dsd�s4e2dt��e2du�3e4e������dSej1dsdvkr&eD]!Z5e2e5dwz��e2ee5���"dSej1dsd�D]Z5e2ee5���dSdS)}uu	
Parsing and validation of URIs (RFC 3986) and IRIs (RFC 3987).

This module provides regular expressions according to `RFC 3986 "Uniform
Resource Identifier (URI): Generic Syntax"
<http://tools.ietf.org/html/rfc3986>`_ and `RFC 3987 "Internationalized
Resource Identifiers (IRIs)" <http://tools.ietf.org/html/rfc3987>`_, and
utilities for composition and relative resolution of references.


API
---

**match** (string, rule='IRI_reference')
    {match.__doc__}

**parse** (string, rule='IRI_reference')
    {parse.__doc__}

**compose** (\*\*parts)
    {compose.__doc__}

**resolve** (base, uriref, strict=True, return_parts=False)
    {resolve.__doc__}

**patterns**
    A dict of regular expressions with useful group names.
    Compilable (with regex_ only) without need for any particular compilation
    flag.

**[bmp_][u]patterns[_no_names]**
    Alternative versions of `patterns`.
    [u]nicode strings without group names for the re_ module.
    BMP only for narrow builds.

**get_compiled_pattern** (rule, flags=0)
    {get_compiled_pattern.__doc__}

**format_patterns** (\*\*names)
    {format_patterns.__doc__}


Dependencies
------------

Some features require regex_.

This package's docstrings are tested on python 2.6, 2.7, and 3.2 to 3.6.
Note that in python<=3.2, characters beyond the Basic Multilingual Plane are
not supported on narrow builds (see `issue12729
<http://bugs.python.org/issue12729>`_).


Release notes
-------------

version 1.3.8:

- fixed deprecated escape sequence

version 1.3.6:

- fixed a bug in IPv6 pattern:

  >>> assert match('::0:0:0:0:0.0.0.0', 'IPv6address')

version 1.3.4:

- allowed for lower case percent encoding

version 1.3.3:

- fixed a bug in `resolve` which left "../" at the beginning of some paths

version 1.3.2:

- convenience function `match`
- patterns restricted to the BMP for narrow builds
- adapted doctests for python 3.3
- compatibility with python 2.6 (thanks to Thijs Janssen)

version 1.3.1:

- some re_ compatibility: get_compiled_pattern, parse
- dropped regex_ from setup.py requirements

version 1.3.0:

- python 3.x compatibility
- format_patterns

version 1.2.1:

- compose, resolve


.. _re: http://docs.python.org/library/re
.. _regex: http://pypi.python.org/pypi/regex


Support
-------
This is free software. You may show your appreciation with a `donation`_.

.. _donation: http://danielgerber.net/¤#Thanks-for-python-package-rfc3987

z1.3.8�Ni��TF)�get_compiled_pattern�parse�format_patterns�patterns�compose�resolve�match)�schemez[a-zA-Z][a-zA-Z0-9+.-]*)�portz[0-9]*)�
IP_literalz!\[(?:{IPv6address}|{IPvFuture})\]�IPv6addressa�(?:                             (?:{h16}:){{6}} {ls32}|                            :: (?:{h16}:){{5}} {ls32}| (?:                {h16})? :: (?:{h16}:){{4}} {ls32}| (?:(?:{h16}:)?     {h16})? :: (?:{h16}:){{3}} {ls32}| (?:(?:{h16}:){{,2}}{h16})? :: (?:{h16}:){{2}} {ls32}| (?:(?:{h16}:){{,3}}{h16})? :: (?:{h16}:)      {ls32}| (?:(?:{h16}:){{,4}}{h16})? ::                 {ls32}| (?:(?:{h16}:){{,5}}{h16})? ::                 {h16} | (?:(?:{h16}:){{,6}}{h16})? ::                      )� �)�ls32z(?:{h16}:{h16}|{IPv4address}))�h16z{hexdig}{{1,4}})�IPv4addressz!(?:{dec_octet}\.){{3}}{dec_octet})�	dec_octetz((?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?))�	IPvFuturez,v{hexdig}+\.(?:{unreserved}|{sub_delims}|:)+)�
unreservedz[a-zA-Z0-9_.~-])�reservedz(?:{gen_delims}|{sub_delims}))�pct_encodedz%{hexdig}{{2}})�
gen_delimsz
[:/?#[\]@])�
sub_delimsz
[!$&'()*+,;=])�hexdigz[0-9A-Fa-f]))�
URI_referencez(?:{URI}|{relative_ref}))�URIz{absolute_URI}(?:\#{fragment})?)�absolute_URIz"{scheme}:{hier_part}(?:\?{query})?)�relative_refz.{relative_part}(?:\?{query})?(?:\#{fragment})?)�	hier_partzL(?://{authority}{path_abempty}|{path_absolute}|{path_rootless}|{path_empty}))�
relative_partzL(?://{authority}{path_abempty}|{path_absolute}|{path_noscheme}|{path_empty}))�	authorityz"(?:{userinfo}@)?{host}(?::{port})?)�hostz)(?:{IP_literal}|{IPv4address}|{reg_name}))�userinfoz.(?:{unreserved}|{pct_encoded}|{sub_delims}|:)*)�reg_namez,(?:{unreserved}|{pct_encoded}|{sub_delims})*)�pathzO(?:{path_abempty}|{path_absolute}|{path_noscheme}|{path_rootless}|{path_empty}))�path_abemptyz(?:/{segment})*)�
path_absolutez!/(?:{segment_nz}(?:/{segment})*)?)�
path_noschemez{segment_nz_nc}(?:/{segment})*)�
path_rootlessz{segment_nz}(?:/{segment})*)�
path_emptyr)�segmentz{pchar}*)�
segment_nzz{pchar}+)�
segment_nz_ncz.(?:{unreserved}|{pct_encoded}|{sub_delims}|@)+)�query�(?:{pchar}|/|\?)*)�fragmentr/)�pcharz/(?:{unreserved}|{pct_encoded}|{sub_delims}|:|@)))�
IRI_referencez(?:{IRI}|{irelative_ref}))�IRIz {absolute_IRI}(?:\#{ifragment})?)�absolute_IRIz${scheme}:{ihier_part}(?:\?{iquery})?)�
irelative_refz5(?:{irelative_part}(?:\?{iquery})?(?:\#{ifragment})?))�
ihier_partzQ(?://{iauthority}{ipath_abempty}|{ipath_absolute}|{ipath_rootless}|{ipath_empty}))�irelative_partzQ(?://{iauthority}{ipath_abempty}|{ipath_absolute}|{ipath_noscheme}|{ipath_empty}))�
iauthorityz$(?:{iuserinfo}@)?{ihost}(?::{port})?)�	iuserinfoz/(?:{iunreserved}|{pct_encoded}|{sub_delims}|:)*)�ihostz*(?:{IP_literal}|{IPv4address}|{ireg_name}))�	ireg_namez-(?:{iunreserved}|{pct_encoded}|{sub_delims})*)�ipathzT(?:{ipath_abempty}|{ipath_absolute}|{ipath_noscheme}|{ipath_rootless}|{ipath_empty}))�ipath_emptyr)�ipath_rootlessz{isegment_nz}(?:/{isegment})*)�ipath_noschemez {isegment_nz_nc}(?:/{isegment})*)�ipath_absolutez#/(?:{isegment_nz}(?:/{isegment})*)?)�
ipath_abemptyz(?:/{isegment})*)�isegment_nz_ncz/(?:{iunreserved}|{pct_encoded}|{sub_delims}|@)+)�isegment_nzz	{ipchar}+)�isegmentz	{ipchar}*)�iqueryz(?:{ipchar}|{iprivate}|/|\?)*)�	ifragmentz(?:{ipchar}|/|\?)*)�ipcharz0(?:{iunreserved}|{pct_encoded}|{sub_delims}|:|@))�iunreservedz(?:[a-zA-Z0-9._~-]|{ucschar}))�iprivatez9[\uE000-\uF8FF\U000F0000-\U000FFFFD\U00100000-\U0010FFFD])�ucscharaM[\xA0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF\U00010000-\U0001FFFD\U00020000-\U0002FFFD\U00030000-\U0003FFFD\U00040000-\U0004FFFD\U00050000-\U0005FFFD\U00060000-\U0006FFFD\U00070000-\U0007FFFD\U00080000-\U0008FFFD\U00090000-\U0009FFFD\U000A0000-\U000AFFFD\U000B0000-\U000BFFFD\U000C0000-\U000CFFFD\U000D0000-\U000DFFFD\U000E1000-\U000EFFFD]c��i}tddd�tddd�ztddd�zD]E\}}||vr,||}t|��r||��}n	d|�d|�d�}|jdi|��||<�F|S)a�Returns a dict of patterns (regular expressions) keyed by
    `rule names for URIs`_ and `rule names for IRIs`_.

    See also the module level dicts of patterns, and `get_compiled_pattern`.

    To wrap a rule in a named capture group, pass it as keyword argument:
    rule_name='group_name'. By default, the formatted patterns contain no
    named groups.

    Patterns are `str` instances (be it in python 2.x or 3.x) containing ASCII
    characters only.

    Caveats:

      - with re_, named capture groups cannot occur on multiple branches of an
        alternation

      - with re_ before python 3.3, ``\u`` and ``\U`` escapes must be
        preprocessed (see `issue3665 <http://bugs.python.org/issue3665>`_)

      - on narrow builds, character ranges beyond BMP are not supported

    .. _rule names for URIs: http://tools.ietf.org/html/rfc3986#appendix-A
    .. _rule names for IRIs: http://tools.ietf.org/html/rfc3987#section-2.2
    N���z(?P<�>�)�)�
_common_rules�
_uri_rules�
_iri_rules�callable�format)�names�	formatted�name�pat�ns     �)/usr/lib/python3/dist-packages/rfc3987.pyrr!s���4�I�"�4�4�R�4�(�:�d�d��d�+;�;�j���2��>N�N�2�2�	��c��5�=�=��d��A���{�{�
.��a��f�f���
.�'(�a�a����-��$�#�*�1�1�y�1�1�	�$�����)r
rr
rrrrrrr r!r"r#r$r.r0r2r3r4r5r7r8r:r9r;rErFr%r<)
r&r'r(r)r*rAr@r?r>r=c�R�|�d���d��S)N�asciizraw-unicode-escape)�encode�decode)�strings rZ�_interpret_unicode_escapesra^s#���=�=��!�!�(�(�)=�>�>�>r[c#�>K�|]\}}|t|��fV��dS�N)ra��.0�k�vs   rZ�	<genexpr>rhesD����8�8���1�1�8��;�;�<�8�8�8�8�8�8r[c�.�tjdd|��S)Nz\\U[0-9A-F]{8}-\\U[0-9A-F]{8}r)�_re�sub)�ss rZ�<lambda>rmhs����9�2�q�A�A�r[c#�>K�|]\}}|t|��fV��dSrc)�_bmprds   rZrhrhks0����=�=�S�Q�q�Q��Q���L�=�=�=�=�=�=r[c#�XK�|]%\}}|tt|����fV��&dSrc)rarords   rZrhrhmsV����D�D�"%�!�A� !�"<�T�!�W�W�"E�"E�F�D�D�D�D�D�Dr[c��tj||f}}||vrdtrtrtnt
}ntrtnt}|�|��p||z}tj
||��||<||S)a�Returns a compiled pattern object for a rule name or template string.

    Usage for validation::

        >>> uri = get_compiled_pattern('^%(URI)s$')
        >>> assert uri.match('http://tools.ietf.org/html/rfc3986#appendix-A')
        >>> assert not get_compiled_pattern('^%(relative_ref)s$').match('#f#g')
        >>> from unicodedata import lookup
        >>> smp = 'urn:' + lookup('OLD ITALIC LETTER A')  # U+00010300
        >>> assert not uri.match(smp)
        >>> m = get_compiled_pattern('^%(IRI)s$').match(smp)

    On narrow builds, non-BMP characters are (incorrectly) excluded::

        >>> assert NARROW_BUILD == (not m)

    For parsing, some subcomponents are captured in named groups (*only if*
    regex_ is available, otherwise see `parse`)::

        >>> match = uri.match('http://tools.ietf.org/html/rfc3986#appendix-A')
        >>> d = match.groupdict()
        >>> if REGEX:
        ...     assert all([ d['scheme'] == 'http',
        ...                  d['authority'] == 'tools.ietf.org',
        ...                  d['path'] == '/html/rfc3986',
        ...                  d['query'] == None,
        ...                  d['fragment'] == 'appendix-A' ])

        >>> for r in patterns.keys():
        ...     assert get_compiled_pattern(r)

    )r�cache�NARROW_BUILD�REGEX�bmp_patterns�bmp_upatterns_no_namesr�upatterns_no_names�getrj�compile)�rule�flagsrr�key�pats�ps      rZrrqs��B&�+�d�E�]�3�E�
�%����	=�#(�D�<�<�.D�D�D�$�<�8�8�*<�D��H�H�T�N�N�)�d�T�k���[��E�*�*��c�
���:�r[r2c�L�td|z���|��S)a	Convenience function for checking if `string` matches a specific rule.

    Returns a match object or None::

        >>> assert match('%C7X', 'pct_encoded') is None
        >>> assert match('%C7', 'pct_encoded')
        >>> assert match('%c7', 'pct_encoded')

    z	^%%(%s)s$)rr	)r`rzs  rZr	r	�s%�� ��d� 2�3�3�9�9�&�A�A�Ar[zm^((?P<scheme>[^:/?#]+):)?(//(?P<authority>[^/?#]*))?(?P<path>[^?#]*)(\?(?P<query>[^#]*))?(#(?P<fragment>.*))?)
r2r3r4r5r7rrrrr c�X�ts|r|tvrt|���|rOt||��}|st|�d|�d����tr!t	|�����St	t�|�������S)aDParses `string` according to `rule` into a dict of subcomponents.

    If `rule` is None, parse an IRI_reference `without validation
    <http://tools.ietf.org/html/rfc3986#appendix-B>`_.

    If regex_ is available, any rule is supported; with re_, `rule` must be
    'IRI_reference' or some special case thereof ('IRI', 'absolute_IRI',
    'irelative_ref', 'irelative_part', 'URI_reference', 'URI', 'absolute_URI',
    'relative_ref', 'relative_part'). ::

        >>> d = parse('http://tools.ietf.org/html/rfc3986#appendix-A',
        ...           rule='URI')
        >>> assert all([ d['scheme'] == 'http',
        ...              d['authority'] == 'tools.ietf.org',
        ...              d['path'] == '/html/rfc3986',
        ...              d['query'] == None,
        ...              d['fragment'] == 'appendix-A' ])

    z is not a valid �.)rt�REFERENCE_RULES�
ValueErrorr	�_i2u�	groupdict�_iri_non_validating_re)r`rz�ms   rZrr�s���(��T��d�/�9�9�������'��&�$�����	G��������E�F�F�F��	'�����
�
�&�&�&��&�,�,�V�4�4�>�>�@�@�A�A�Ar[c�p�dD]2\}}|�|���|�|��||<�3|S)N))r!r8)r%r<)r.rE)r0rF)rx)�dicrW�inames   rZr�r��sA��J�'�'�
��u��7�7�4�=�=� �������C��I���Jr[c	��tt����d}
|�|
|dzz
}
|�|
d|zz
}
|
|pdz
}
|�|
d|zz
}
|�|
d|zz
}
|
S)zqReturns an URI composed_ from named parts.

    .. _composed: http://tools.ietf.org/html/rfc3986#section-5.3
    rN�:z//�?�#)r��locals)r
r!r%r.r0r8r<rErF�kw�ress           rZrr�s|��	����N�N�N�
�C�
���v��|������t�i�����4�:�2��C����s�U�{������s�X�~����Jr[z$^(?:\.{1,2}(?:/|$))+|(?<=/)\.(?:/|$)z/?%(segment)s/\.{2}(?:/|$)c��t�d|��}d}|r!t�d|d��\}}|�!|S)Nr��/)�
_dot_segmentsrk�_2dots_segments�subn)r%�cs  rZ�_remove_dot_segmentsr��sN�����b�$�'�'�D�	�A�
�6�"�'�'��T�1�5�5���a��6��Kr[c��t|t��rt|d��}ntt	|����}|�d��st
d|z���t|t��rt|d��}ntt	|����}|dr|s|d|dkr|}�ni}|d|d<|d�"|d|d<|d|d<|d|d<n�|d|d<|dr�|ddd	�d
kr|d|d<na|d�|dsd|dz|d<nBd�|d�d
��dd
���|dz|d<|d|d<n*|d|d<|d�|d|d<n|d|d<|d|d<t|d��|d<|r|Stdi|��S)a�Resolves_ an `URI reference` relative to a `base` URI.

    `Test cases <http://tools.ietf.org/html/rfc3986#section-5.4>`_::

        >>> base = resolve.test_cases_base
        >>> for relative, resolved in resolve.test_cases.items():
        ...     assert resolve(base, relative) == resolved

    If `return_parts` is True, returns a dict of named parts instead of
    a string.

    Examples::

        >>> assert resolve('urn:rootless', '../../name') == 'urn:name'
        >>> assert resolve('urn:root/less', '../../name') == 'urn:/name'
        >>> assert resolve('http://a/b', 'http:g') == 'http:g'
        >>> assert resolve('http://a/b', 'http:g', strict=False) == 'http://a/g'

    .. _Resolves: http://tools.ietf.org/html/rfc3986#section-5.2

    r3r
z&Expected an IRI (with scheme), not %r.r2r!Nr%r.r�r�z/%sr�r0rO)�
isinstance�
basestringrr��dictrxr��join�
rpartitionr�r)�base�uriref�strict�return_parts�B�R�Ts       rZrr�s*��.�$�
�#�#���$��������d�������5�5��?�?�J��A�D�H�I�I�I��&�*�%�%���&�/�*�*�����f������	��{�&��&�!�H�+��8��"<�"<�
�������k��(���[�>�%��{�^�A�k�N��&�	�A�f�I��7��A�g�J�J��{�^�A�k�N���y�
,��V�9�R�a�R�=�C�'�'� !�&�	�A�f�I�I��{�^�/��&�	�/� %��&�	� 1�A�f�I�I� "����&�	�(<�(<�S�(A�(A�"�1�"�(E� F� F��6�� R�A�f�I��w�Z��'�
�
��f�I��&�	��W�:�)�!"�7��A�g�J�J�!"�7��A�g�J��*�
��*�
�$�Q�v�Y�/�/�A�f�I������|�|��|�|�r[zhttp://a/b/c/d;p?qzg:h�gzhttp://a/b/c/gz./gzg/zhttp://a/b/c/g/z/gz
http://a/gz//gzhttp://gz?yzhttp://a/b/c/d;p?yzg?yzhttp://a/b/c/g?yz#szhttp://a/b/c/d;p?q#szg#szhttp://a/b/c/g#szg?y#szhttp://a/b/c/g?y#sz;xzhttp://a/b/c/;xzg;xzhttp://a/b/c/g;xzg;x?y#szhttp://a/b/c/g;x?y#sr�z
http://a/b/c/z./z..zhttp://a/b/z../z../gzhttp://a/b/gz../..z	http://a/z../../z../../gz
../../../gz
../../../../gz/./gz/../gzg.zhttp://a/b/c/g.z.gzhttp://a/b/c/.gzg..zhttp://a/b/c/g..z..gzhttp://a/b/c/..gz./../gz./g/.zg/./hzhttp://a/b/c/g/hzhttp://a/b/c/hzhttp://a/b/c/g;x=1/yzhttp://a/b/c/yzhttp://a/b/c/g?y/./xzhttp://a/b/c/g?y/../xzhttp://a/b/c/g#s/./xzhttp://a/b/c/g#s/../x)zg/../hz	g;x=1/./yz
g;x=1/../yzg?y/./xzg?y/../xzg#s/./xzg#s/../xc��t�)zSyntax-Based Normalization)�NotImplementedError)�uris rZ�	normalizer�os
���r[�__main__r�z/Valid arguments are "--all" or rule names from:z  z--allr�rO)r)r2)	NNNNNNNNN)TF)6�__doc__�__version__�sys�_sys�
maxunicodersr��	NameError�str�regexrjrt�ImportError�re�__all__�replacerPrQrRr�_GROUP_NAMES_BASEr��zip�DEFAULT_GROUP_NAMESrra�patterns_no_names�itemsrwrorurvrrrr	ryr�r�rr�rr�r�r�r�test_cases_base�
test_casesr��__name__�argv�printr��sortedrWrOr[rZ�<module>r�sU��&j�j�V��������&�(����J�J�������J�J�J�����������E�E�����������E�E�E�����*��1� �;��O� ���R�(�(�	*�7�(�:�A�E�*�7�(�$�'�%�A"�
�J)�
�\7�
�t#�#�#�L
�
�
���d�3�3�0�1B�C�C��v�V��V��'�'���	1�1�1���?�1�1�0�1�1��?�?�?�$�O�%�%���T�8�8�,�_�.�.�4�4�6�6�8�8�8�8�8��B�A���t�=�=�H�N�N�,<�,<�=�=�=�=�=����D�D�):�)@�)@�)B�)B�D�D�D�D�D��)�)�)�)�T ���
B�
B�
B�
B�%���A�B�B��4��
B�B�B�B�>���JN�@D�����(%�$�%L�M�M�
�&�&�'D�E�E�����D�D�D�D�L/���*�	�u�*��'�*�
�'�*�	�(�	*�
	�|�*�
�z�
*�	�+�*�
�)�*�	�-�*�
�)�*��+�*�	�(�*�
�)�*��-�*��+�*� ��!*�"	��#*�*�$	�}�%*�&
�}�'*�(�~�)*�*�{�+*�,
�{�-*�.�|�/*�0�|�1*�2�|�3*�4�|�5*�6�|�7*�8	�(�9*�:	�(�;*�<
�)�=*�>
�)�?*�@
�~�A*�B�(�C*�D�)�E*�*�F(�-�'�-�.�-�.�S*�*�*���Z����z����9�Q�R�R�=�	"�
��?�@�@�@�
��d�i�i���x�(�(�)�)�*�*�*�*�*�	
��1���	 �	 ��	"�	"�D��E�$��*�����E�(�4�.�!�!�!�!�	"�	"��I�a�b�b�M�	"�	"�D��E�(�4�.�!�!�!�!���	"�	"s��"�"�-�;�;