HOME


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

*�Kg����dZdZgd�ZddlZddlZddlZddl	Z		ddl
m
ZmZn#e
$r	d�Zd�ZYnwxYwdZd	Zd
ZdZdZd
ZdZGd�de��Zd�ZGd�de��ZGd�de��ZGd�de��ZGd�de��ZGd�de��Zd�ZGd�de��ZGd�d e��Z Gd!�d"e��Z!Gd#�d$e!��Z"Gd%�d&e!��Z#Gd'�d(e!��Z$Gd)�d*e$��Z%Gd+�d,e$��Z&Gd-�d.e!��Z'Gd/�d0e!��Z(Gd1�d2e!��Z)Gd3�d4e!��Z*Gd5�d6e!��Z+Gd7�d8e!��Z,Gd9�d:e'��Z-Gd;�d<e��Z.Gd=�d>e��Z/Gd?�d@e��Z0GdA�dBe0��Z1GdC�dDe1��Z2GdE�dFee0��Z3dS)Ga�
Command-line parsing library

This module is an optparse-inspired command-line parsing library that:

    - handles both optional and positional arguments
    - produces highly informative usage messages
    - supports parsers that dispatch to sub-parsers

The following is a simple usage example that sums integers from the
command-line and writes the result to a file::

    parser = argparse.ArgumentParser(
        description='sum the integers at the command line')
    parser.add_argument(
        'integers', metavar='int', nargs='+', type=int,
        help='an integer to be summed')
    parser.add_argument(
        '--log', default=sys.stdout, type=argparse.FileType('w'),
        help='the file where the sum should be written')
    args = parser.parse_args()
    args.log.write('%s' % sum(args.integers))
    args.log.close()

The module contains the following public classes:

    - ArgumentParser -- The main entry point for command-line parsing. As the
        example above shows, the add_argument() method is used to populate
        the parser with actions for optional and positional arguments. Then
        the parse_args() method is invoked to convert the args at the
        command-line into an object with attributes.

    - ArgumentError -- The exception raised by ArgumentParser objects when
        there are errors with the parser's actions. Errors raised while
        parsing the command-line are caught by ArgumentParser and emitted
        as command-line messages.

    - FileType -- A factory for defining types of files to be created. As the
        example above shows, instances of FileType are typically passed as
        the type= argument of add_argument() calls.

    - Action -- The base class for parser actions. Typically actions are
        selected by passing strings like 'store_true' or 'append_const' to
        the action= argument of add_argument(). However, for greater
        customization of ArgumentParser actions, subclasses of Action may
        be defined and passed as the action= argument.

    - HelpFormatter, RawDescriptionHelpFormatter, RawTextHelpFormatter,
        ArgumentDefaultsHelpFormatter -- Formatter classes which
        may be passed as the formatter_class= argument to the
        ArgumentParser constructor. HelpFormatter is the default,
        RawDescriptionHelpFormatter and RawTextHelpFormatter tell the parser
        not to change the formatting for help text, and
        ArgumentDefaultsHelpFormatter adds information about argument defaults
        to the help.

All other classes in this module are considered implementation details.
(Also note that HelpFormatter and RawDescriptionHelpFormatter are only
considered public as object names -- the API of the formatter objects is
still considered an implementation detail.)
z1.1)�ArgumentParser�
ArgumentError�ArgumentTypeError�BooleanOptionalAction�FileType�
HelpFormatter�ArgumentDefaultsHelpFormatter�RawDescriptionHelpFormatter�RawTextHelpFormatter�MetavarTypeHelpFormatter�	Namespace�Action�ONE_OR_MORE�OPTIONAL�PARSER�	REMAINDER�SUPPRESS�ZERO_OR_MORE�N)�gettext�ngettextc��|S�N�)�messages �/usr/lib/python3.11/argparse.py�_ras����c��|dkr|S|S�N�r)�singular�plural�ns   rrrcs����6�6��O��Mrz==SUPPRESS==�?�*�+zA...�...�_unrecognized_argsc�$�eZdZdZd�Zd�Zd�ZdS)�_AttributeHolderaAbstract base class that provides __repr__.

    The __repr__ method returns a string in the format::
        ClassName(attr=name, attr=name, ...)
    The attributes are determined either by a class-level attribute,
    '_kwarg_names', or by inspecting the instance __dict__.
    c���t|��j}g}i}|���D]$}|�t	|�����%|���D]9\}}|���r|�|�d|�����4|||<�:|r%|�dt	|��z��|�dd�|���d�S)N�=z**%s�(�, �))�type�__name__�	_get_args�append�repr�_get_kwargs�isidentifier�join)�self�	type_name�arg_strings�	star_args�arg�name�values       r�__repr__z_AttributeHolder.__repr__s�����J�J�'�	����	��>�>�#�#�	*�	*�C����t�C�y�y�)�)�)�)��+�+�-�-�	(�	(�K�D�%�� � �"�"�
(��"�"�d�d�d�E�E�#:�;�;�;�;�"'�	�$����	9����v��Y���7�8�8�8�$�9�9�d�i�i��&<�&<�&<�&<�=�=rc�N�t|j�����Sr)�list�__dict__�items�r8s rr5z_AttributeHolder._get_kwargs�s���D�M�'�'�)�)�*�*�*rc��gSrrrDs rr2z_AttributeHolder._get_args�s���	rN)r1�
__module__�__qualname__�__doc__r?r5r2rrrr*r*vsK��������
>�
>�
>�+�+�+�����rr*c�|�|�gSt|��tur
|dd�Sddl}|�|��S�Nr)r0rA�copy)rCrKs  r�_copy_itemsrL�sG���}��	��E�{�{�d����Q�Q�Q�x���K�K�K��9�9�U���rc���eZdZdZ			d!d�Zd�Zd�ZGd�d	e��Zd
�Z	d�Z
d�Zd
�Zd"d�Z
d�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd �ZdS)#rz�Formatter for generating usage messages and argument help strings.

    Only the name of this class is considered a public API. All the methods
    provided by the class are considered an implementation detail.
    ��Nc���|�6	ddl}|���j}|dz}n#t$rd}YnwxYw||_||_t
|t|dz
|dz����|_||_	d|_
d|_d|_|�
|d��|_|j|_t!jdt j��|_t!jd��|_dS)NrrN�F�z\s+z\n\n\n+)�shutil�get_terminal_size�columns�ImportError�_prog�_indent_increment�min�max�_max_help_position�_width�_current_indent�_level�_action_max_length�_Section�
_root_section�_current_section�_re�compile�ASCII�_whitespace_matcher�_long_break_matcher)r8�prog�indent_increment�max_help_position�width�_shutils      r�__init__zHelpFormatter.__init__�s	���=�
�(�(�(�(��1�1�3�3�;����
�����
�
�
�����
������
�!1���"%�&7�&)�%�"�*�6F��6J�&K�&K�#M�#M������ ������"#���!�]�]�4��6�6��� $� 2���#&�;�v�s�y�#A�#A�� �#&�;�z�#:�#:�� � � s�"'�6�6c�P�|xj|jz
c_|xjdz
c_dSr�r]rXr^rDs r�_indentzHelpFormatter._indent�s-������ 6�6������q�����rc�z�|xj|jzc_|jdks
Jd���|xjdzc_dS)NrzIndent decreased below 0.r rorDs r�_dedentzHelpFormatter._dedent�sJ������ 6�6����#�q�(�(�(�*E�(�(�(����q�����rc��eZdZdd�Zd�ZdS)�HelpFormatter._SectionNc�>�||_||_||_g|_dSr)�	formatter�parent�headingrC)r8rvrwrxs    rrmzHelpFormatter._Section.__init__�s"��&�D�N� �D�K�"�D�L��D�J�J�Jrc�V�|j�|j���|jj}|d�|jD����}|j�|j���|sdS|jtur!|j�|jj}d|d|jfz}nd}|d||dg��S)Nc��g|]
\}}||���Srr)�.0�func�argss   r�
<listcomp>z6HelpFormatter._Section.format_help.<locals>.<listcomp>�s"��G�G�G�j�d�D�d�d�D�k�G�G�Gr�z%*s%s:
�
)	rwrvrp�_join_partsrCrrrxrr])r8r7�	item_help�current_indentrxs     r�format_helpz"HelpFormatter._Section.format_help�s����{�&���&�&�(�(�(��>�-�D���G�G�D�J�G�G�G�H�H�I��{�&���&�&�(�(�(��
��r��|�8�+�+���0H�!%��!?��$���D�L�'I�I������4��w�	�4�8�9�9�9rr)r1rFrGrmr�rrrr`rt�s7������	�	�	�	�	:�	:�	:�	:�	:rr`c�H�|jj�||f��dSr)rbrCr3)r8r|r}s   r�	_add_itemzHelpFormatter._add_item�s&����#�*�*�D�$�<�8�8�8�8�8rc��|���|�||j|��}|�|jg��||_dSr)rpr`rbr�r�)r8rx�sections   r�
start_sectionzHelpFormatter.start_section�sL���������-�-��d�&;�W�E�E�����w�*�B�/�/�/� '����rc�P�|jj|_|���dSr)rbrwrrrDs r�end_sectionzHelpFormatter.end_sections!�� $� 5� <����������rc�\�|tur |� |�|j|g��dSdSdSr)rr��_format_text)r8�texts  r�add_textzHelpFormatter.add_texts?���x���D�$4��N�N�4�,�t�f�5�5�5�5�5� ��$4�$4rc�^�|tur#||||f}|�|j|��dSdSr)rr��
_format_usage)r8�usage�actions�groups�prefixr}s      r�	add_usagezHelpFormatter.add_usages@���� � ��'�6�6�1�D��N�N�4�-�t�4�4�4�4�4�!� rc�|�|jtur�|j}||��g}|�|��D] }|�||�����!tt
t|����}||jz}t|j	|��|_	|�
|j|g��dSdSr)�helpr�_format_action_invocation�_iter_indented_subactionsr3rZ�map�lenr]r_r��_format_action)r8�action�get_invocation�invocations�	subaction�invocation_length�
action_lengths       r�add_argumentzHelpFormatter.add_arguments����;�h�&�&�"�;�N�)�>�&�1�1�2�K�!�;�;�F�C�C�
>�
>�	��"�"�>�>�)�#<�#<�=�=�=�=�!$�C��[�$9�$9� :� :��-��0D�D�M�&)�$�*A�*7�'9�'9�D�#�
�N�N�4�.���9�9�9�9�9�'�&rc�:�|D]}|�|���dSr)r�)r8r�r�s   r�
add_argumentszHelpFormatter.add_arguments"s2���	&�	&�F����f�%�%�%�%�	&�	&rc��|j���}|r3|j�d|��}|�d��dz}|S)N�

r�)rar�rg�sub�strip)r8r�s  rr�zHelpFormatter.format_help)sQ���!�-�-�/�/���	+��+�/�/���=�=�D��:�:�d�#�#�d�*�D��rc�@�d�d�|D����S)Nrc�(�g|]}|r|tu�
|��Sr)r)r{�parts  rr~z-HelpFormatter._join_parts.<locals>.<listcomp>1s5��:�:�:� ��:�$(��$8�$8��$8�$8�$8r)r7)r8�part_stringss  rr�zHelpFormatter._join_parts0s4���w�w�:�:�$0�:�:�:�;�;�	;rc�v��|�td��}|�|t|j���z}�n�|�|sdt|j���z}�ng|��ddt|j���z}g}g}|D]4}|jr|�|���|�|���5|j}	|	||z|��}
d�d�||
fD����}|j|jz
�t|��t|��z�k�r�d}|	||��}|	||��}
tj||��}tj||
��}d�|��|ksJ�d�|��|
ksJ�d�fd�	}t|��t|��zd�zkrpdt|��t|��zd	zz}|r1||g|z||��}|�|||����n�|r||g|z||��}n�|g}n|dt|��z}||z}|||��}t|��d	kr@g}|�|||����|�|||����|g|z}d
�|��}|�|�d�S)
Nzusage: �rhz%(prog)s� c��g|]}|�|��Srr)r{�ss  rr~z/HelpFormatter._format_usage.<locals>.<listcomp>Qs��C�C�C�A��C�a�C�C�Crz%\(.*?\)+(?=\s|$)|\[.*?\]+(?=\s|$)|\S+c���g}g}|�t|��dz
}nt|��dz
}|D]�}|dzt|��z�krA|r?|�|d�|��z��g}t|��dz
}|�|��|t|��dzz
}��|r+|�|d�|��z��|� |dt|��d�|d<|S)Nr r�r)r�r3r7)�parts�indentr��lines�line�line_lenr��
text_widths       �r�	get_linesz.HelpFormatter._format_usage.<locals>.get_lineses����E��D��)�#&�v�;�;��?���#&�v�;�;��?�� %�2�2��#�a�<�#�d�)�)�3�j�@�@�T�@�!�L�L��#�(�(�4�.�.�)@�A�A�A�#%�D�'*�6�{�{�Q��H����D�)�)�)� �C��I�I��M�1����>����V�c�h�h�t�n�n�%<�=�=�=��)�#(��8�C��K�K�L�L�#9��a�� �Lrg�?r r�r�r)
r�dictrW�option_stringsr3�_format_actions_usager7r\r]r�rc�findall�extend)r8r�r�r�r�rh�	optionals�positionalsr��format�action_usage�part_regexp�	opt_usage�	pos_usage�	opt_parts�	pos_partsr�r�r�r�r�s                    @rr�zHelpFormatter._format_usage5sE����>��y�\�\�F����D�d�j�1�1�1�1�E�E��]�7�]���4�:�!6�!6�!6�6�E�E��]���$�*� 5� 5� 5�5�D��I��K�!�
/�
/���(�/��$�$�V�,�,�,�,��&�&�v�.�.�.�.��/�F�!�6�)�k�"9�6�B�B�L��H�H�C�C�$��)=�C�C�C�D�D�E���t�';�;�J��6�{�{�S��Z�Z�'�*�4�4���
#�F�9�f�5�5�	�"�F�;��7�7�	��K��Y�?�?�	��K��Y�?�?�	��x�x�	�*�*�i�7�7�7�7��x�x�	�*�*�i�7�7�7�7�!�!�!�!�!�!�*�v�;�;��T���*�d�Z�.?�?�?� �C��K�K�#�d�)�)�$;�a�$?�@�F� �'� )�	�4�&�9�*<�f�f� M� M�����Y�Y�y�&�%A�%A�B�B�B�B�"�'� )�	�4�&�9�*<�f�f� M� M���!%����!�3�v�;�;�.�F�%�	�1�E�%�I�e�V�4�4�E��5�z�z�A�~�~� "�����Y�Y�y�&�%A�%A�B�B�B����Y�Y�y�&�%A�%A�B�B�B�!�F�U�N�E��	�	�%�(�(��$�V�U�U�U�+�+rc��t��}i}|D�]"}|jstd|�����	|�|jd��}|t	|j��z}|||�|jkr�|jD]}|�|���|js5||vr||xxdz
cc<nd||<||vr||xxdz
cc<n:d||<n4||vr||xxdz
cc<nd||<||vr||xxdz
cc<nd||<t|d	z|��D]}	d
||	<���#t$rY�� wxYwg}
t|��D�]\}	}|j	tury|
�d��|�|	��d
kr|�
|	���X|�|	d	z��d
kr|�
|	d	z����|jsg|�|��}|�||��}||vr"|ddkr|ddkr
|d	d�}|
�|����|jd}
|jdkr|���}n2|�|��}|�||��}|
�d|��}|js	||vrd
|z}|
�|�����t)|d���D]}	||	g|
|	|	�<�d�d�|
D����}d}d}t-jd|zd|��}t-jd|zd|��}t-j|�d|��d|��}t-jdd|��}|���}|S)Nzempty group rz [�[�]z (r-r/r �|���r��[%s]T)�reversec��g|]}|�|��Srr)r{�items  rr~z7HelpFormatter._format_actions_usage.<locals>.<listcomp>�s��D�D�D�$�4�3C��3C�3C�3Crz[\[(]z[\])]z(%s) z\1� (%s)z *rz\(([^|]*)\))�set�_group_actions�
ValueError�indexr��add�required�range�	enumerater�rr3�get�popr��#_get_default_metavar_for_positional�_format_args�nargs�format_usage�!_get_default_metavar_for_optional�sortedr7rcr�r�)r8r�r��
group_actions�inserts�group�start�endr��ir��defaultr��
option_string�args_stringr��open�closes                  rr�z#HelpFormatter._format_actions_usage�sI�����
���� 	)� 	)�E��'�
9� �!7��!7�!7�8�8�8�
)��
�
�e�&:�1�&=�>�>���c�%�"6�7�7�7���5��9�%��)=�=�=�"'�"6�2�2��%�)�)�&�1�1�1�1� �>�/� �G�+�+�#�E�N�N�N�d�2�N�N�N�N�-0�G�E�N��'�>�>�#�C�L�L�L�C�/�L�L�L�L�+.�G�C�L�L� �G�+�+�#�E�N�N�N�d�2�N�N�N�N�-0�G�E�N��'�>�>�#�C�L�L�L�C�/�L�L�L�L�+.�G�C�L�"�5�1�9�c�2�2�)�)��%(���
�
���5�
�
�
���
����:��"�7�+�+�-	#�-	#�I�A�v��{�h�&�&����T�"�"�"��;�;�q�>�>�S�(�(��K�K��N�N�N�N��[�[��Q��'�'�3�.�.��K�K��A��&�&�&���*�!
#��B�B�6�J�J���(�(���9�9���]�*�*��A�w�#�~�~�$�r�(�c�/�/�#�A�b�D�z�����T�"�"�"�"�!'� 5�a� 8�
��<�1�$�$�!�.�.�0�0�D�D�
#�D�D�V�L�L�G�"&�"3�"3�F�G�"D�"D�K�&3�m�m�[�[�A�D���)�6��+F�+F�!�D�=�D����T�"�"�"�"����.�.�.�	&�	&�A�!�!�*��E�!�A�#�J�J��x�x�D�D�%�D�D�D�E�E�������w�x�$���t�4�4���w�x�%�'���5�5���w�D�D�D�%�%�0�#�t�<�<���w�~�u�d�3�3���z�z�|�|���s� D&�&
D4�3D4c��d|vr|t|j���z}t|j|jz
d��}d|jz}|�|||��dzS)Nz%(prog)r��r�r�)r�rWrZr\r]�
_fill_text)r8r�r�r�s    rr�zHelpFormatter._format_text�se�������$�D�J�/�/�/�/�D����t�';�;�R�@�@�
��t�+�+�����t�Z��8�8�6�A�Arc�~�t|jdz|j��}t|j|z
d��}||jz
dz
}|�|��}|js|jd|f}d|z}n7t|��|kr|jd||f}d|z}d}n|jd|f}d|z}|}|g}|jr�|j�	��rw|�
|��}	|	r_|�|	|��}
|�d|d|
dfz��|
dd�D]}|�d|d|fz���n*|�
d��s|�d��|�|��D]*}|�|�|�����+|�|��S)	NrNr�rz%*s%s
z	%*s%-*s  rr r�)rYr_r[rZr\r]r�r�r�r��_expand_help�_split_linesr3�endswithr�r�r�)
r8r��
help_position�
help_width�action_width�
action_header�tup�indent_firstr��	help_text�
help_linesr�r�s
             rr�zHelpFormatter._format_actions���D�3�a�7� �3�5�5�
����}�4�b�9�9�
�$�t�';�;�a�?���6�6�v�>�>�
��{�	)��&��M�9�C�%��O�M�M���
�
�<�
/�
/��&��L�-�G�C�'�#�-�M��L�L��&��M�9�C�%��O�M�(�L�����;�
	�6�;�,�,�.�.�
	��)�)�&�1�1�I��
H�!�.�.�y�*�E�E�
����Y�,��J�q�M�)J�J�K�K�K�&�q�r�r�N�H�H�D��L�L��m�R��-F�!F�G�G�G�G���'�'��-�-�	��L�L������7�7��?�?�	9�	9�I��L�L��,�,�Y�7�7�8�8�8�8�����&�&�&rc��|js8|�|��}|�||��d��\}|Sg}|jdkr|�|j��nO|�|��}|�||��}|jD]}|�|�d|�����d�|��S)Nr rr�r.)	r�r��_metavar_formatterr�r�r�r�r3r7)r8r�r��metavarr�r�r�s       rr�z'HelpFormatter._format_action_invocation6s����$�	$��>�>�v�F�F�G�?�t�.�.�v�w�?�?��B�B�H�G��N��E��|�q� � ����V�2�3�3�3�3�
�@�@��H�H��"�/�/���@�@��%+�%:�I�I�M��L�L�M�M�M�;�;�!G�H�H�H�H��9�9�U�#�#�#rc���|j�|j�n3|j�*d�|jD��}dd�|��z�n|��fd�}|S)Nc�,�g|]}t|����Sr��str)r{�choices  rr~z4HelpFormatter._metavar_formatter.<locals>.<listcomp>Rs��D�D�D�6�3�v�;�;�D�D�Drz{%s}�,c�>��t�t��r�S�f|zSr)�
isinstance�tuple)�
tuple_size�results �rr�z0HelpFormatter._metavar_formatter.<locals>.formatWs'����&�%�(�(�
/��
��z�J�.�.r)r�choicesr7)r8r��default_metavar�choice_strsr�rs     @rr�z HelpFormatter._metavar_formatterNsn����>�%��^�F�F�
�^�
'�D�D�V�^�D�D�D�K��c�h�h�{�3�3�3�F�F�$�F�	/�	/�	/�	/�	/�
�
rc��|�||��}|j�d|d��z}�n"|jtkrd|d��z}�n|jtkr*|d��}t	|��dkrd|z}n�d|z}n�|jt
krd|d��z}n�|jtkrd}n�|jtkrd	|d��z}nw|jtkrd
}nd	d�t|j��D��}n#t$rtd��d�wxYwd
�|��||j��z}|S)N�%sr r�rNz
[%s [%s ...]]z[%s ...]z%s [%s ...]r'z%s ...rc��g|]}d��S)rr)r{rs  rr~z.HelpFormatter._format_args.<locals>.<listcomp>ts��=�=�=�A�4�=�=�=rzinvalid nargs valuer�)
r�r�rrr�rrrrr��	TypeErrorr�r7)r8r�r
�get_metavarrr�formatss       rr�zHelpFormatter._format_args^s}���-�-�f�o�F�F���<���K�K��N�N�*�F�F�
�\�X�
%�
%��k�k�!�n�n�,�F�F�
�\�\�
)�
)�!�k�!�n�n�G��7�|�|�q� � �(�7�2���#�g�-���
�\�[�
(�
(�"�[�[��^�^�3�F�F�
�\�Y�
&�
&��F�F�
�\�V�
#�
#����A���.�F�F�
�\�X�
%�
%��F�F�
B�=�=��v�|�)<�)<�=�=�=�����
B�
B�
B� �!6�7�7�T�A�
B�����X�X�g�&�&���V�\�)B�)B�B�F��
s�-D�D'c��tt|��|j���}t|��D]}||tur||=�t|��D](}t||d��r||j||<�)|�d���*d�d�|dD����}||d<|�	|��|zS)Nr�r1rr.c�,�g|]}t|����Srr)r{�cs  rr~z.HelpFormatter._expand_help.<locals>.<listcomp>�s��$G�$G�$G��S��V�V�$G�$G�$Gr)
r��varsrWrAr�hasattrr1r�r7�_get_help_string)r8r��paramsr=�choices_strs     rr�zHelpFormatter._expand_helpzs����d�6�l�l���4�4�4����L�L�	!�	!�D��d�|�x�'�'��4�L����L�L�	5�	5�D��v�d�|�Z�0�0�
5�%�d�|�4��t����:�:�i� � �,��)�)�$G�$G�V�I�5F�$G�$G�$G�H�H�K� +�F�9���$�$�V�,�,�v�5�5rc#�K�	|j}|���|��Ed{V��|���dS#t$rYdSwxYwr)�_get_subactionsrprr�AttributeError)r8r��get_subactionss   rr�z'HelpFormatter._iter_indented_subactions�sw����	�#�3�N�
�L�L�N�N�N�%�~�'�'�'�'�'�'�'�'�'��L�L�N�N�N�N�N���	�	�	��D�D�	���s�A�
A�Ac��|j�d|�����}ddl}|�||��S)Nr�r)rfr�r��textwrap�wrap)r8r�rkr"s    rr�zHelpFormatter._split_lines�sE���'�+�+�C��6�6�<�<�>�>��	�����}�}�T�5�)�)�)rc��|j�d|�����}ddl}|�||||���S)Nr�r)�initial_indent�subsequent_indent)rfr�r�r"�fill)r8r�rkr�r"s     rr�zHelpFormatter._fill_text�sT���'�+�+�C��6�6�<�<�>�>�������}�}�T�5�,2�/5��7�7�	7rc��|jSr)r��r8r�s  rrzHelpFormatter._get_help_string��
���{�rc�4�|j���Sr)�dest�upperr)s  rr�z/HelpFormatter._get_default_metavar_for_optional�s���{� � �"�"�"rc��|jSr)r,r)s  rr�z1HelpFormatter._get_default_metavar_for_positional�r*r)rNrONr) r1rFrGrHrmrprr�objectr`r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rr�r�rrrrr�s���������#$�#%��	;�;�;�;�D������
:�:�:�:�:�6�:�:�:�>9�9�9�(�(�(����6�6�6�5�5�5�5�
:�:�:�$&�&�&����;�;�;�
^,�^,�^,�@h�h�h�TB�B�B�.'�.'�.'�`$�$�$�0��� ���86�6�6����*�*�*�7�7�7����#�#�#�����rrc��eZdZdZd�ZdS)r	z�Help message formatter which retains any formatting in descriptions.

    Only the name of this class is considered a public API. All the methods
    provided by the class are considered an implementation detail.
    c�n��d��fd�|�d���D����S)Nrc3�"�K�|]	}�|zV��
dSrr)r{r�r�s  �r�	<genexpr>z9RawDescriptionHelpFormatter._fill_text.<locals>.<genexpr>�s'�����P�P��v��}�P�P�P�P�P�PrT)�keepends)r7�
splitlines)r8r�rkr�s   `rr�z&RawDescriptionHelpFormatter._fill_text�s8����w�w�P�P�P�P����$��1O�1O�P�P�P�P�P�PrN)r1rFrGrHr�rrrr	r	�s2��������Q�Q�Q�Q�Qrr	c��eZdZdZd�ZdS)r
z�Help message formatter which retains formatting of all help text.

    Only the name of this class is considered a public API. All the methods
    provided by the class are considered an implementation detail.
    c�*�|���Sr)r5)r8r�rks   rr�z!RawTextHelpFormatter._split_lines�s����� � � rN)r1rFrGrHr�rrrr
r
�s-��������!�!�!�!�!rr
c��eZdZdZd�ZdS)rz�Help message formatter which adds default values to argument help.

    Only the name of this class is considered a public API. All the methods
    provided by the class are considered an implementation detail.
    c��|j}|�d}d|vr1|jtur#ttg}|js	|j|vr|dz
}|S)a6
        Add the default value to the option help message.

        ArgumentDefaultsHelpFormatter and BooleanOptionalAction when it isn't
        already present. This code will do that, detecting cornercases to
        prevent duplicates or cases where it wouldn't make sense to the end
        user.
        Nrz
%(default)z (default: %(default)s))r�r�rrrr�r�)r8r�r��defaulting_nargss    rrz.ArgumentDefaultsHelpFormatter._get_help_string�s`���{���<��D��t�#�#��~�X�-�-�$,�l�#;� ��(�6�F�L�<L�,L�,L��5�5�D��rN)r1rFrGrHrrrrrr�s-������������rrc��eZdZdZd�Zd�ZdS)raHelp message formatter which uses the argument 'type' as the default
    metavar value (instead of the argument 'dest')

    Only the name of this class is considered a public API. All the methods
    provided by the class are considered an implementation detail.
    c��|jjSr�r0r1r)s  rr�z:MetavarTypeHelpFormatter._get_default_metavar_for_optional��
���{�#�#rc��|jjSrr=r)s  rr�z<MetavarTypeHelpFormatter._get_default_metavar_for_positional�r>rN)r1rFrGrHr�r�rrrrr�s<��������$�$�$�$�$�$�$�$rrc��|�dS|jrd�|j��S|jdtfvr|jS|jdtfvr|jS|jr dd�|j��zdzSdS)N�/�{r�})r�r7rrr,r)�arguments r�_get_action_namerE�s������t�	�	 �	��x�x��/�0�0�0�	�	�$��!1�	1�	1����	��t�X�.�	.�	.��}��	�	���S�X�X�h�.�/�/�/�#�5�5��trc��eZdZdZd�Zd�ZdS)rz�An error from creating or using an argument (optional or positional).

    The string value of this exception is the message, augmented with
    information about the argument that caused it.
    c�<�t|��|_||_dSr)rE�
argument_namer)r8rDrs   rrmzArgumentError.__init__s��-�h�7�7�������rc�p�|j�d}ntd��}|t|j|j���zS)Nz%(message)sz'argument %(argument_name)s: %(message)s)rrH)rHrr�r)r8r�s  r�__str__zArgumentError.__str__	sH����%�"�F�F��@�A�A�F���T�\�+/�+=�?�?�?�?�	?rN)r1rFrGrHrmrJrrrrr�s<�����������?�?�?�?�?rrc��eZdZdZdS)rz@An error from trying to convert a command line string to a type.N)r1rFrGrHrrrrrs������J�J��Drrc�>�eZdZdZ								dd�Zd�Zd�Zd	d�ZdS)
r
a\	Information about how to convert command line strings to Python objects.

    Action objects are used by an ArgumentParser to represent the information
    needed to parse a single argument from one or more strings from the
    command line. The keyword arguments to the Action constructor are also
    all attributes of Action instances.

    Keyword Arguments:

        - option_strings -- A list of command-line option strings which
            should be associated with this action.

        - dest -- The name of the attribute to hold the created object(s)

        - nargs -- The number of command-line arguments that should be
            consumed. By default, one argument will be consumed and a single
            value will be produced.  Other values include:
                - N (an integer) consumes N arguments (and produces a list)
                - '?' consumes zero or one arguments
                - '*' consumes zero or more arguments (and produces a list)
                - '+' consumes one or more arguments (and produces a list)
            Note that the difference between the default and nargs=1 is that
            with the default, a single value will be produced, while with
            nargs=1, a list containing a single value will be produced.

        - const -- The value to be produced if the option is specified and the
            option uses an action that takes no values.

        - default -- The value to be produced if the option is not specified.

        - type -- A callable that accepts a single string argument, and
            returns the converted value.  The standard Python types str, int,
            float, and complex are useful examples of such callables.  If None,
            str is used.

        - choices -- A container of values that should be allowed. If not None,
            after a command-line argument has been converted to the appropriate
            type, an exception will be raised if it is not a member of this
            collection.

        - required -- True if the action must always be specified at the
            command line. This is only meaningful for optional command-line
            arguments.

        - help -- The help string describing the argument.

        - metavar -- The name to be used for the option's argument with the
            help string. If None, the 'dest' value will be used as the name.
    NFc��||_||_||_||_||_||_||_||_|	|_|
|_	dSr�
r�r,r��constr�r0rr�r�r)r8r�r,r�rOr�r0rr�r�rs           rrmzAction.__init__NsO��-�����	���
���
������	���� ��
���	�����rc�(��gd�}�fd�|D��S)NrNc�4��g|]}|t�|��f��Sr��getattr�r{r=r8s  �rr~z&Action._get_kwargs.<locals>.<listcomp>q�(���>�>�>���w�t�T�*�*�+�>�>�>rr�r8�namess` rr5zAction._get_kwargsds0���
�
�
��?�>�>�>��>�>�>�>rc��|jdSrJ�r�rDs rr�zAction.format_usagess���"�1�%�%rc�:�ttd�����)Nz.__call__() not defined)�NotImplementedErrorr�r8�parser�	namespace�valuesr�s     r�__call__zAction.__call__vs��!�!�$=�">�">�?�?�?r�NNNNNFNNr)r1rFrGrHrmr5r�r`rrrr
r
s�������0�0�j������������,
?�
?�
?�&�&�&�@�@�@�@�@�@rr
c�:��eZdZ						d�fd�	Zdd�Zd�Z�xZS)rNFc	���g}	|D]N}
|	�|
��|
�d��r"d|
dd�z}
|	�|
���Ot���|	|d||||||��	�	dS)N�--�--no-rNr)	r�r,r�r�r0rr�r�r)r3�
startswith�superrm)r8r�r,r�r0rr�r�r�_option_stringsr��	__class__s           �rrmzBooleanOptionalAction.__init__{s������+�	6�	6�M��"�"�=�1�1�1��'�'��-�-�
6� '�-����*;� ;�
��&�&�}�5�5�5��
�����*���������	�		�		�		�		�		rc�p�||jvr,t||j|�d����dSdS)Nre)r��setattrr,rfr\s     rr`zBooleanOptionalAction.__call__�sC���D�/�/�/��I�t�y�m�.F�.F�w�.O�.O�*O�P�P�P�P�P�0�/rc�6�d�|j��S)Nz | )r7r�rDs rr�z"BooleanOptionalAction.format_usage�s���z�z�$�-�.�.�.r)NNNFNNr)r1rFrGrmr`r��
__classcell__�ris@rrrzsx�������������������<Q�Q�Q�Q�/�/�/�/�/�/�/rrc�8��eZdZ								d�fd�	Zdd�Z�xZS)�_StoreActionNFc����|dkrtd���|�"|tkrtdtz���tt|���|||||||||	|
��
�
dS)Nrz�nargs for store actions must be != 0; if you have nothing to store, actions such as store true or store const may be more appropriate� nargs must be %r to supply constrN)r�rrgrprm�r8r�r,r�rOr�r0rr�r�rris           �rrmz_StoreAction.__init__�s�����A�:�:��K�L�L�
L����(�!2�!2��?�(�J�K�K�K�
�l�D�!�!�*�*�)����������	+�
	�
	�
	�
	�
	rc�2�t||j|��dSr)rkr,r\s     rr`z_StoreAction.__call__�s���	�4�9�f�-�-�-�-�-rrar�r1rFrGrmr`rmrns@rrprp�sk�������
��������������:.�.�.�.�.�.�.�.rrpc�2��eZdZ					d�fd�	Zdd�Z�xZS)�_StoreConstActionNFc	�f��tt|���||d||||���dS)Nr)r�r,r�rOr�r�r�)rgrwrm�	r8r�r,rOr�r�r�rris	        �rrmz_StoreConstAction.__init__�sL���	���&�&�/�/�)�������	0�	�	�	�	�	rc�<�t||j|j��dSr)rkr,rOr\s     rr`z_StoreConstAction.__call__�s���	�4�9�d�j�1�1�1�1�1r�NNFNNrrurns@rrwrw�sb�������
�����������"2�2�2�2�2�2�2�2rrwc�&��eZdZ			d�fd�	Z�xZS)�_StoreTrueActionFNc�d��tt|���||d|||���dS)NT�r�r,rOr�r�r�)rgr}rm�r8r�r,r�r�r�ris      �rrmz_StoreTrueAction.__init__�sI���	���%�%�.�.�)������
	/�	�	�	�	�	r)FFN�r1rFrGrmrmrns@rr}r}�sH�������
������������rr}c�&��eZdZ			d�fd�	Z�xZS)�_StoreFalseActionTFNc�d��tt|���||d|||���dS)NFr)rgr�rmr�s      �rrmz_StoreFalseAction.__init__�sI���	���&�&�/�/�)������
	0�	�	�	�	�	r)TFNr�rns@rr�r��sH�������
������������rr�c�8��eZdZ								d�fd�	Zdd�Z�xZS)�
_AppendActionNFc����|dkrtd���|�"|tkrtdtz���tt|���|||||||||	|
��
�
dS)Nrz�nargs for append actions must be != 0; if arg strings are not supplying the value to append, the append const action may be more appropriaterrrN)r�rrgr�rmrss           �rrmz_AppendAction.__init__�s�����A�:�:��O�P�P�
P����(�!2�!2��?�(�J�K�K�K�
�m�T�"�"�+�+�)����������	,�
	�
	�
	�
	�
	rc��t||jd��}t|��}|�|��t	||j|��dSr)rSr,rLr3rk�r8r]r^r_r�rCs      rr`z_AppendAction.__call__�N���	�4�9�d�3�3���E�"�"��
���V�����	�4�9�e�,�,�,�,�,rrarrurns@rr�r��sk�������
��������������:-�-�-�-�-�-�-�-rr�c�2��eZdZ					d�fd�	Zdd�Z�xZS)�_AppendConstActionNFc
�h��tt|���||d|||||���dS)Nr)r�r,r�rOr�r�r�r)rgr�rmrys	        �rrmz_AppendConstAction.__init__%sO���	� �$�'�'�0�0�)��������	1�	�	�	�	�	rc��t||jd��}t|��}|�|j��t||j|��dSr)rSr,rLr3rOrkr�s      rr`z_AppendConstAction.__call__7sP���	�4�9�d�3�3���E�"�"��
���T�Z� � � ��	�4�9�e�,�,�,�,�,rr{rrurns@rr�r�#sb�������
�����������$-�-�-�-�-�-�-�-rr�c�.��eZdZ			d�fd�	Zdd�Z�xZS)�_CountActionNFc�d��tt|���||d|||���dS)Nr)r�r,r�r�r�r�)rgr�rmr�s      �rrmz_CountAction.__init__@sH���	�l�D�!�!�*�*�)������
	+�	�	�	�	�	rc�l�t||jd��}|�d}t||j|dz��dS�Nrr )rSr,rk)r8r]r^r_r��counts      rr`z_CountAction.__call__Ns=���	�4�9�d�3�3���=��E��	�4�9�e�a�i�0�0�0�0�0r)NFNrrurns@rr�r�>s\�������
���������1�1�1�1�1�1�1�1rr�c�.��eZdZeedf�fd�	Zdd�Z�xZS)�_HelpActionNc�b��tt|���|||d|���dS�Nr)r�r,r�r�r�)rgr�rm)r8r�r,r�r�ris     �rrmz_HelpAction.__init__WsE���
	�k�4� � �)�)�)�����	*�	�	�	�	�	rc�V�|���|���dSr)�
print_help�exitr\s     rr`z_HelpAction.__call__cs%�����������
�
�
�
�
rr�r1rFrGrrmr`rmrns@rr�r�Us\��������!��	
�
�
�
�
�
��������rr�c�0��eZdZdeedf�fd�	Zdd�Z�xZS)�_VersionActionNz&show program's version number and exitc�p��tt|���|||d|���||_dSr�)rgr�rm�version)r8r�r�r,r�r�ris      �rrmz_VersionAction.__init__jsH���	�n�d�#�#�,�,�)�����	-�	�	�	�����rc��|j}|�|j}|���}|�|��|�|���t
j��|���dSr)r��_get_formatterr��_print_messager��_sys�stdoutr�)r8r]r^r_r�r�rvs       rr`z_VersionAction.__call__xso���,���?��n�G��)�)�+�+�	����7�#�#�#����i�3�3�5�5�t�{�C�C�C����
�
�
�
�
rrr�rns@rr�r�hs_���������!�>��������������rr�c�X��eZdZGd�de��Zedddf�fd�	Zd�Zd�Zd	d�Z	�xZ
S)
�_SubParsersActionc���eZdZ�fd�Z�xZS)�&_SubParsersAction._ChoicesPseudoActionc���|x}}|r|dd�|��zz
}ttj|��}|�g|||���dS)Nr�r.)r�r,r�r)r7rgr��_ChoicesPseudoActionrm)r8r=�aliasesr�rr,�supris       �rrmz/_SubParsersAction._ChoicesPseudoAction.__init__�sq���!�!�G�d��
8��7�T�Y�Y�w�%7�%7�7�7���)�>��E�E�C��L�L���D�!(�
�
*�
*�
*�
*�
*rr�rns@rr�r��s8�������	*�	*�	*�	*�	*�	*�	*�	*�	*rr�FNc	���||_||_i|_g|_t	t
|���||t|j|||���dS)N)r�r,r�rr�r�r)�_prog_prefix�
_parser_class�_name_parser_map�_choices_actionsrgr�rmr)	r8r�rh�parser_classr,r�r�rris	        �rrmz_SubParsersAction.__init__�so���!���)��� "��� "���
���&�&�/�/�)����)����	0�	�	�	�	�	rc��|�d���|j�d|��|d<|�dd��}||jvr t	|td��|z���|D]+}||jvr t	|td��|z����,d|vrF|�d��}|�|||��}|j�|��|j	di|��}||j|<|D]}||j|<�
|S)Nrhr�r�rzconflicting subparser: %szconflicting subparser alias: %sr�)
r�r�r�r�rrr�r�r3r�)r8r=�kwargsr��aliasr��
choice_actionr]s        r�
add_parserz_SubParsersAction.add_parser�sQ���:�:�f���%�(,�(9�(9�(9�4�4�@�F�6�N��*�*�Y��+�+���4�(�(�(���a�(C�&D�&D�t�&K�L�L�L��	H�	H�E���-�-�-�#��!�=�>�>��F�H�H�H�.�
�V����:�:�f�%�%�D� �5�5�d�G�T�J�J�M��!�(�(��7�7�7�$��#�-�-�f�-�-��&,���d�#��	2�	2�E�+1�D�!�%�(�(��
rc��|jSr)r�rDs rrz!_SubParsersAction._get_subactions�s���$�$rc�t�|d}|dd�}|jturt||j|��	|j|}nM#t$r@|d�|j��d�}t
d��|z}t||���wxYw|�|d��\}	}t|	���
��D]\}
}t||
|���|rRt|���tg��t|t���|��dSdS)Nrr r.)�parser_namerz5unknown parser %(parser_name)r (choices: %(choices)s))r,rrkr��KeyErrorr7rr�parse_known_argsrrC�
setdefault�_UNRECOGNIZED_ARGS_ATTRrSr�)r8r]r^r_r�r�r:r}�msg�subnamespace�keyr>s            rr`z_SubParsersAction.__call__�s_���Q�i���Q�R�R�j���9�H�$�$��I�t�y�+�6�6�6�	+��*�;�7�F�F���	+�	+�	+�#.�#�y�y��)>�?�?�A�A�D��K�L�L�t�S�C���c�*�*�*�		+����%+�$;�$;�K��$N�$N�!��k��|�,�,�2�2�4�4�	+�	+�J�C���I�s�E�*�*�*�*��	L���O�O�&�&�'>��C�C�C��I�6�7�7�>�>�{�K�K�K�K�K�	L�	Ls�
A�A
Br)r1rFrGr
r�rrmr�rr`rmrns@rr�r��s��������*�*�*�*�*�v�*�*�*�����������.���<%�%�%�L�L�L�L�L�L�L�Lrr�c��eZdZdd�ZdS)�
_ExtendActionNc��t||jd��}t|��}|�|��t	||j|��dSr)rSr,rLr�rkr�s      rr`z_ExtendAction.__call__�r�rr)r1rFrGr`rrrr�r��s(������-�-�-�-�-�-rr�c�&�eZdZdZdd�Zd�Zd�ZdS)	ra�Factory for creating file object types

    Instances of FileType are typically passed as type= arguments to the
    ArgumentParser add_argument() method.

    Keyword Arguments:
        - mode -- A string indicating how the file is to be opened. Accepts the
            same values as the builtin open() function.
        - bufsize -- The file's desired buffer size. Accepts the same values as
            the builtin open() function.
        - encoding -- The file's encoding. Accepts the same values as the
            builtin open() function.
        - errors -- A string indicating how encoding and decoding errors are to
            be handled. Accepts the same value as the builtin open() function.
    �rr�Nc�>�||_||_||_||_dSr)�_mode�_bufsize�	_encoding�_errors)r8�mode�bufsize�encoding�errorss     rrmzFileType.__init__s"����
���
�!�������rc���|dkr�d�jvr&d�jvrtjjntjSt	�fd�dD����r&d�jvrtjjntjSt
d���jz}t|���	t|�j�j	�j
�j��S#t$r+}||d�}t
d��}t||z���d}~wwxYw)	N�-r��bc3�*�K�|]
}|�jvV��dSr)r�)r{rr8s  �rr3z$FileType.__call__.<locals>.<genexpr>
s)�����4�4��Q�$�*�_�4�4�4�4�4�4r�waxzargument "-" with mode %r)�filename�errorz$can't open '%(filename)s': %(error)s)r�r��stdin�buffer�anyr�rr�r�r�r�r��OSErrorr)r8�stringr��er}rs`     rr`zFileType.__call__s����S�=�=��d�j� � �,/�4�:�,=�,=�t�z�(�(�4�:�M��4�4�4�4�e�4�4�4�4�4�
&�-0�D�J�->�->�t�{�)�)�D�K�O��3�4�4�t�z�A�� ��o�o�%�	4����
�D�M�4�>���&�&�
&���	4�	4�	4� &��3�3�D��>�?�?�G�#�G�d�N�3�3�3�����	4���s�&C�
C;�&C6�6C;c���|j|jf}d|jfd|jfg}d�d�|D��d�|D��z��}t|��j�d|�d�S)Nr�r�r.c�8�g|]}|dk�t|����S)r�)r4)r{r<s  rr~z%FileType.__repr__.<locals>.<listcomp>s#��E�E�E�C�3�"�9�9�d�3�i�i�9�9�9rc�&�g|]\}}|�|�d|����S)Nr,r)r{�kwr<s   rr~z%FileType.__repr__.<locals>.<listcomp> s3��2�2�2�g�b�#�!$��*,���S�S�1�!0��rr-r/)r�r�r�r�r7r0r1)r8r}r��args_strs    rr?zFileType.__repr__s����z�4�=�(���t�~�.��4�<�0H�I���9�9�E�E�4�E�E�E�2�2��2�2�2�2�3�3�� ��:�:�.�.�.����9�9r)r�r�NN)r1rFrGrHrmr`r?rrrrr�sP�������� ����4�4�4�(:�:�:�:�:rrc�$�eZdZdZd�Zd�Zd�ZdS)rz�Simple object for storing attributes.

    Implements equality by attribute names and values, and provides a simple
    string representation.
    c�>�|D]}t||||���dSr)rk)r8r�r=s   rrmzNamespace.__init__/s4���	.�	.�D��D�$��t��-�-�-�-�	.�	.rc�z�t|t��stSt|��t|��kSr)rr�NotImplementedr)r8�others  r�__eq__zNamespace.__eq__3s1���%��+�+�	"�!�!��D�z�z�T�%�[�[�(�(rc��||jvSr)rB)r8r�s  r�__contains__zNamespace.__contains__8s���d�m�#�#rN)r1rFrGrHrmr�r�rrrrr(sK��������.�.�.�)�)�)�
$�$�$�$�$rrc���eZdZ�fd�Zd�Zdd�Zd�Zd�Zd�Zd�Z	d	�Z
d
�Zd�Zd�Z
d
�Zd�Zdd�Zd�Zd�Zd�Zd�Z�xZS)�_ActionsContainerc����tt|�����||_||_||_||_i|_|�ddt��|�ddt��|�ddt��|�ddt��|�ddt��|�ddt��|�ddt��|�ddt��|�dd	t ��|�dd
t"��|�ddt$��|�ddt&��|���g|_i|_g|_g|_i|_t5jd
��|_g|_dS)Nr��store�store_const�
store_true�store_falser3�append_constr�r�r��parsersr�z^-\d+$|^-\d*\.\d+$)rgr�rm�description�argument_default�prefix_chars�conflict_handler�_registries�registerrprwr}r�r�r�r�r�r�r�r��_get_handler�_actions�_option_string_actions�_action_groups�_mutually_exclusive_groups�	_defaultsrcrd�_negative_number_matcher�_has_negative_number_optionals)r8r�r�r�r�ris     �rrmz_ActionsContainer.__init__>s����
	���&�&�/�/�1�1�1�&��� 0���(��� 0������	
�
�
�h��l�3�3�3��
�
�h���6�6�6��
�
�h�
�/@�A�A�A��
�
�h��.>�?�?�?��
�
�h�
�/@�A�A�A��
�
�h��-�8�8�8��
�
�h��0B�C�C�C��
�
�h���6�6�6��
�
�h���4�4�4��
�
�h�	�>�:�:�:��
�
�h�	�+<�=�=�=��
�
�h��-�8�8�8�	
��������
�&(��#�!���*,��'����),��4I�(J�(J��%�/1��+�+�+rc�F�|j�|i��}|||<dSr)r�r�)r8�
registry_namer>r/�registrys     rr�z_ActionsContainer.registerss'���#�.�.�}�b�A�A�� �����rNc�D�|j|�||��Sr)r�r�)r8rr>r�s    r�
_registry_getz_ActionsContainer._registry_getws ����
�.�2�2�5�'�B�B�Brc��|j�|��|jD]}|j|vr||j|_�dSr)r��updater�r,r�)r8r�r�s   r�set_defaultsz_ActionsContainer.set_defaults}sQ������f�%�%�%��m�	5�	5�F��{�f�$�$�!'���!4����	5�	5rc��|jD]}|j|kr|j�	|jcS�|j�|d��Sr)r�r,r�r�r�)r8r,r�s   r�get_defaultz_ActionsContainer.get_default�sN���m�	&�	&�F��{�d�"�"�v�~�'A��~�%�%�%���~�!�!�$��-�-�-rc�8�|j}|r#t|��dkr3|dd|vr#|rd|vrtd���|j|i|��}n
|j|i|��}d|vr3|d}||jvr|j||d<n|j�
|j|d<|�|��}t|��std|�d����|di|��}|�	d	|j
|j
��}t|��st|�d
����|turt|�d����t|d��rG	|�
���|d��n#t$rtd
���wxYw|�|��S)z�
        add_argument(dest, ..., name=value, ...)
        add_argument(option_string, option_string, ..., name=value, ...)
        r rr,z+dest supplied twice for positional argumentr�Nzunknown action "�"r0z is not callablez: is a FileType class object, instance of it must be passedr�z,length of metavar tuple does not match nargsr)r�r�r��_get_positional_kwargs�_get_optional_kwargsr�r��_pop_action_class�callablerr0rrr�r�r�_add_action)r8r}r��charsr,�action_classr��	type_funcs        rr�z_ActionsContainer.add_argument�s���!���	@�s�4�y�y�A�~�~�$�q�'�!�*�E�*A�*A��
P��&�(�(� �!N�O�O�O�0�T�0�$�A�&�A�A�F�F�/�T�.��?��?�?�F��F�"�"��&�>�D��t�~�%�%�$(�N�4�$8��y�!�!��&�2�$(�$9��y�!��-�-�f�5�5����%�%�	F��*�l�l�l�D�E�E�E���'�'��'�'���&�&�v�v�{�F�K�H�H�	��	�"�"�	B��Y�Y�Y�@�A�A�A��� � ��2;�)�)�>�?�?�
?��4�)�*�*�	Q�
Q��#�#�%�%�2�2�6�4�@�@�@�@���
Q�
Q�
Q� �!O�P�P�P�
Q��������'�'�'s�(E*�*Fc�Z�t|g|�Ri|��}|j�|��|Sr)�_ArgumentGroupr�r3)r8r}r�r�s    r�add_argument_groupz$_ActionsContainer.add_argument_group�s;���t�5�d�5�5�5�f�5�5����"�"�5�)�)�)��rc�T�t|fi|��}|j�|��|Sr)�_MutuallyExclusiveGroupr�r3)r8r�r�s   r�add_mutually_exclusive_groupz._ActionsContainer.add_mutually_exclusive_group�s3��'��7�7��7�7���'�.�.�u�5�5�5��rc�$�|�|��|j�|��||_|jD]}||j|<�
|jD]=}|j�|��r!|js|j�d���>|S)NT)	�_check_conflictr�r3�	containerr�r�r�matchr)r8r�r�s   rrz_ActionsContainer._add_action�s������V�$�$�$�	
�
���V�$�$�$����$�2�	@�	@�M�9?�D�'�
�6�6�$�2�	E�	E�M��,�2�2�=�A�A�
E��:�E��7�>�>�t�D�D�D���
rc�:�|j�|��dSr)r��remover)s  r�_remove_actionz _ActionsContainer._remove_action�s���
���V�$�$�$�$�$rc��i}|jD];}|j|vr&td��}t||jz���|||j<�<i}|jD]T}|j|vr/|�|j|j|j���||j<|jD]}||j||<��U|jD],}|�	|j
���}|jD]}|||<��-|jD]+}|�||���
|���,dS)Nz.cannot merge actions - two groups are named %r)�titler�r�)r�)r�r$rr�rr�r�r�r�rr�r�r�r)r8r�title_group_mapr�r��	group_mapr��mutex_groups        r�_add_container_actionsz(_ActionsContainer._add_container_actions�s������(�	1�	1�E��{�o�-�-��H�I�I�� ����!4�5�5�5�+0�O�E�K�(�(��	��-�	A�	A�E��{�/�1�1�/3�/F�/F��+� %� 1�%*�%;�0G�0=�0=����,� �.�
A�
A��$3�E�K�$@�	�&�!�!�
A��9�	0�	0�E��;�;���<�)�)�K� �.�
0�
0��$/�	�&�!�!�
0� �(�	<�	<�F��M�M�&�$�'�'�3�3�F�;�;�;�;�	<�	<rc��d|vrtd��}t|���|�d��ttfvrd|d<|�d��tkr	d|vrd|d<t||g���S)Nr�z1'required' is an invalid argument for positionalsr�Tr��r,r�)rrr�rrr�)r8r,r�r�s    rrz(_ActionsContainer._get_positional_kwargs
s��������G�H�H�C��C�.�.� ��:�:�g���x��&>�>�>�!%�F�:���:�:�g���,�.�.�9�F�3J�3J�!%�F�:���F��b�9�9�9�9rc�@�g}g}|D]�}|d|jvr+||jd�}td��}t||z���|�|��t	|��dkr$|d|jvr|�|����|�dd��}|�f|r	|d}n|d}|�|j��}|s!td��}t||z���|�dd��}t|||�	��S)
Nr)�optionr�zNinvalid option string %(option)r: must start with a character %(prefix_chars)rr r,z%dest= is required for options like %rr�rr*)	r�rr�r3r�r��lstrip�replacer�)	r8r}r�r��long_option_stringsr�r�r,�dest_option_strings	         rrz&_ActionsContainer._get_optional_kwargssa���� ��!�	:�	:�M� ��#�t�'8�8�8�"/�(,�(9�;�;���G�H�H�� ��t��,�,�,�
�!�!�-�0�0�0��=�!�!�A�%�%�-��*:�d�>O�*O�*O�#�*�*�=�9�9�9���z�z�&�$�'�'���<�"�
7�%8��%;�"�"�%3�A�%6�"�%�,�,�T�->�?�?�D��
6��?�@�@�� ��}�!4�5�5�5��<�<��S�)�)�D��F��n�E�E�E�Erc�\�|�d|��}|�d||��S)Nr�)r�r)r8r�r�r�s    rrz#_ActionsContainer._pop_action_class?s-�����H�g�.�.���!�!�(�F�F�;�;�;rc��d|jz}	t||��S#t$r'td��}t	||jz���wxYw)Nz_handle_conflict_%sz%invalid conflict_resolution value: %r)r�rSrrr�)r8�handler_func_namer�s   rr�z_ActionsContainer._get_handlerCse��1�D�4I�I��	:��4�!2�3�3�3���	:�	:�	:��;�<�<�C��S�4�#8�8�9�9�9�	:���s	��1A
c��g}|jD]/}||jvr$|j|}|�||f���0|r"|���}|||��dSdSr)r�r�r3r�)r8r��confl_optionalsr��confl_optionalr�s      rrz!_ActionsContainer._check_conflictLs�����#�2�	H�	H�M��� ;�;�;�!%�!<�]�!K���&�&�
�~�'F�G�G�G���	6�#�0�0�2�2����V�_�5�5�5�5�5�	6�	6rc��tddt|����}d�d�|D����}t|||z���)Nzconflicting option string: %szconflicting option strings: %sr.c��g|]\}}|��Srr)r{r�r�s   rr~z<_ActionsContainer._handle_conflict_error.<locals>.<listcomp>^s,��%=�%=�%=�)>���&3�%=�%=�%=r)rr�r7r)r8r��conflicting_actionsr�conflict_strings     r�_handle_conflict_errorz(_ActionsContainer._handle_conflict_errorZsk���:�;��2�3�3�5�5���)�)�%=�%=�(;�%=�%=�%=�>�>���F�G�o�$=�>�>�>rc���|D][\}}|j�|��|j�|d��|js|j�|���\dSr)r�r!r�r�rr")r8r�r9r�s    r�_handle_conflict_resolvez*_ActionsContainer._handle_conflict_resolvecsy��&9�		8�		8�!�M�6�
�!�(�(��7�7�7��'�+�+�M�4�@�@�@��(�
8�� �/�/��7�7�7��		8�		8rr)r1rFrGrmr�rr	rr�rrrr"r(rrrr�rr;r=rmrns@rr�r�<sL�������01�01�01�01�01�j!�!�!�C�C�C�C�5�5�5�.�.�.�1(�1(�1(�f���
���
���*%�%�%�&<�&<�&<�P:�:�:�  F� F� F�D<�<�<�<�:�:�:�6�6�6�?�?�?�8�8�8�8�8�8�8rr�c�>��eZdZd�fd�	Z�fd�Z�fd�Z�fd�Z�xZS)rNc�p��|j}|d|j��|d|j��|d|j��t	t
|��j}|dd|i|��||_g|_|j	|_	|j
|_
|j|_|j|_|j
|_
|j|_dS)Nr�r�r�r�r)r�r�r�r�rgrrmr$r�r�r�r�r�rr�)r8rr$r�r�r�
super_initris       �rrmz_ArgumentGroup.__init__ts�����"����!�9�#=�>�>�>���~�y�5�6�6�6���!�9�#=�>�>�>��>�4�0�0�9�
��
�5�5�{�5�f�5�5�5���
� ���%�0���!�*��
�&/�&F��#�"�,����4�	
�+�*3�*N��'�'�'rc���tt|���|��}|j�|��|Sr)rgrrr�r3�r8r�ris  �rrz_ArgumentGroup._add_action�s<����~�t�,�,�8�8��@�@����"�"�6�*�*�*��
rc���tt|���|��|j�|��dSr)rgrr"r�r!rBs  �rr"z_ArgumentGroup._remove_action�s>���
�n�d�#�#�2�2�6�:�:�:���"�"�6�*�*�*�*�*rc�n��tjdtd���t��j|i|��S)Nz&Nesting argument groups is deprecated.rN��category�
stacklevel)�warnings�warn�DeprecationWarningrgr�r8r}r�ris   �rrz!_ArgumentGroup.add_argument_group�sC����
�4�'��	
�	
�	
�	
�
*�u�w�w�)�4�:�6�:�:�:r�NN)r1rFrGrmrr"rrmrns@rrrrs��������O�O�O�O�O�O�,�����
+�+�+�+�+�;�;�;�;�;�;�;�;�;rrc�6��eZdZd�fd�	Zd�Zd�Z�fd�Z�xZS)rFc�t��tt|���|��||_||_dSr)rgrrmr��
_container)r8rr�ris   �rrmz _MutuallyExclusiveGroup.__init__�s4���
�%�t�,�,�5�5�i�@�@�@� ��
�#����rc��|jrtd��}t|���|j�|��}|j�|��|S)Nz-mutually exclusive arguments must be optional)r�rr�rOrr�r3)r8r�r�s   rrz#_MutuallyExclusiveGroup._add_action�sW���?�	"��C�D�D�C��S�/�/�!���,�,�V�4�4����"�"�6�*�*�*��
rc�n�|j�|��|j�|��dSr)rOr"r�r!r)s  rr"z&_MutuallyExclusiveGroup._remove_action�s5����&�&�v�.�.�.���"�"�6�*�*�*�*�*rc�n��tjdtd���t��j|i|��S)Nz0Nesting mutually exclusive groups is deprecated.rNrE)rHrIrJrgrrKs   �rrz4_MutuallyExclusiveGroup.add_mutually_exclusive_group�sC����
�>�'��	
�	
�	
�	
�
4�u�w�w�3�T�D�V�D�D�Dr)F)r1rFrGrmrr"rrmrns@rrr�s}�������$�$�$�$�$�$�
���+�+�+�E�E�E�E�E�E�E�E�Errc
���eZdZdZddddgedddddddf
�fd�	Zd�Zd�Zd	�Zd
�Z	d�Z
d$d�Zd$d
�Zd�Z
d�Zd�Zd�Zd�Zd�Zd�Zd�Zd$d�Zd$d�Zd�Zd�Zd�Zd�Zd�Zd�Zd%d�Zd%d�Zd%d �Zd&d"�Z d#�Z!�xZ"S)'raKObject for parsing command line strings into Python objects.

    Keyword Arguments:
        - prog -- The name of the program (default:
            ``os.path.basename(sys.argv[0])``)
        - usage -- A usage message (default: auto-generated from arguments)
        - description -- A description of what the program does
        - epilog -- Text following the argument descriptions
        - parents -- Parsers whose arguments should be copied into this one
        - formatter_class -- HelpFormatter class for printing help messages
        - prefix_chars -- Characters that prefix optional arguments
        - fromfile_prefix_chars -- Characters that prefix files containing
            additional arguments
        - argument_default -- The default value for all arguments
        - conflict_handler -- String indicating how to handle conflicts
        - add_help -- Add a -h/-help option
        - allow_abbrev -- Allow long options to be abbreviated unambiguously
        - exit_on_error -- Determines whether or not ArgumentParser exits with
            error info when an error occurs
    Nr�r�Tc	���tt|��j}||||	|
���|�/tj�tjd��}||_||_	||_
||_||_||_
||_|
|_|j}|t#d����|_|t#d����|_d|_d�}|�dd|��d|vrdn|d}|j
r5|�|dz|d	zd
zd
t.t#d�����|D]I}|�|��	|j}|j�|���:#t6$rY�FwxYwdS)
N)r�r�r�r�rzpositional arguments�optionsc��|Srr)r�s r�identityz)ArgumentParser.__init__.<locals>.identity�s���Mrr0r��hrNr�zshow this help message and exit)r�r�r�)rgrrm�_os�path�basenamer��argvrhr��epilog�formatter_class�fromfile_prefix_chars�add_help�allow_abbrev�
exit_on_errorrr�_positionals�
_optionals�_subparsersr�r�rr(r�rr)r8rhr�r�r]�parentsr^r�r_r�r�r`rarb�	superinit�	add_grouprW�default_prefixrw�defaultsris                    �rrmzArgumentParser.__init__�s�����.�$�/�/�8�	��	�k�+�#3�#3�	5�	5�	5�	5��<��8�$�$�T�Y�q�\�2�2�D���	���
����.���%:��"� ��
�(���*����+�	�%�I�a�(>�&?�&?�@�@���#�)�A�i�L�L�1�1������	�	�	��
�
�f�d�H�-�-�-�!$�|� 3� 3����a����=�	;�����s�"�N�1�$4�V�$;��x��8�9�9�
�
;�
;�
;��	0�	0�F��'�'��/�/�/�
0�!�+����%�%�h�/�/�/�/��"�
�
�
���
����		0�	0s�E<�<
F	�F	c�(��gd�}�fd�|D��S)N)rhr�r�r^r�r`c�4��g|]}|t�|��f��SrrRrTs  �rr~z.ArgumentParser._get_kwargs.<locals>.<listcomp>rUrrrVs` rr5zArgumentParser._get_kwargss0���
�
�
��?�>�>�>��>�>�>�>rc��|j�"|�td����|�dt	|����d|vsd|vrbt|�dd����}t|�dd����}|�||��|_n|j|_|�d���u|�	��}|�
��}|j}|�|j
||d��|������|d<|�|d��}|d
d	gi|��}|j�|��|S)Nz(cannot have multiple subparser argumentsr�r$r��subcommandsrhrr�r�r)rer�rr�r0r�rrcr�r��_get_positional_actionsr�r�r�r�r�rr)	r8r�r$r�rvr�r��
parsers_classr�s	         r�add_subparserszArgumentParser.add_subparserss����'��J�J�q�C�D�D�E�E�E�	���.�$�t�*�*�5�5�5��f���
�� 7� 7��f�j�j��-�8�8�9�9�E��F�J�J�}�d�;�;�<�<�K�#�6�6�u�k�J�J�D���#�0�D���:�:�f���%��+�+�-�-�I��6�6�8�8�K��4�F�����
�K���D�D�D�&�2�2�4�4�:�:�<�<�F�6�N��.�.�v�y�A�A�
���;�;�b�;�F�;�;����$�$�V�,�,�,��
rc�~�|jr|j�|��n|j�|��|Sr)r�rdrrcr)s  rrzArgumentParser._add_action=sB��� �	2��O�'�'��/�/�/�/���)�)�&�1�1�1��
rc�$�d�|jD��S)Nc� �g|]}|j�	|��SrrY�r{r�s  rr~z8ArgumentParser._get_optional_actions.<locals>.<listcomp>Es0��*�*�*���(�*��*�*�*r�r�rDs r�_get_optional_actionsz$ArgumentParser._get_optional_actionsDs%��*�*�"�m�*�*�*�	*rc�$�d�|jD��S)Nc� �g|]}|j�	|��SrrYrus  rr~z:ArgumentParser._get_positional_actions.<locals>.<listcomp>Js0��.�.�.���,�.��.�.�.rrvrDs rroz&ArgumentParser._get_positional_actionsIs%��.�.�"�m�.�.�.�	.rc��|�||��\}}|r:td��}|�|d�|��z��|S�Nzunrecognized arguments: %sr�)r�rr�r7�r8r}r^r\r�s     r�
parse_argszArgumentParser.parse_argsQsW���*�*�4��;�;�
��d��	-��0�1�1�C��J�J�s�S�X�X�d�^�^�+�,�,�,��rc��|�tjdd�}nt|��}|�t��}|jD]N}|jtur>t||j��s)|jturt||j|j���O|j
D].}t||��st|||j
|���/|jrT	|�||��\}}nR#t$r,}|�t|����Yd}~n!d}~wwxYw|�||��\}}t|t ��r=|�t%|t ����t'|t ��||fSr)r�r\rArr�r,rrr�rkr�rb�_parse_known_argsrr�rr�r�rS�delattr)r8r}r^r�r,�errs      rr�zArgumentParser.parse_known_argsXs����<��9�Q�R�R�=�D�D���:�:�D���!���I��m�	H�	H�F��{�(�*�*��y�&�+�6�6�H��~�X�5�5��	�6�;���G�G�G���N�	?�	?�D��9�d�+�+�
?��	�4����)=�>�>�>����	F�
%�"&�"8�"8��y�"I�"I��	�4�4�� �
%�
%�
%��
�
�3�s�8�8�$�$�$�$�$�$�$�$�����
%����#�4�4�T�9�E�E�O�I�t��9�5�6�6�	8��K�K��	�+B�C�C�D�D�D��I�6�7�7�7��$��s�C%�%
D�/"D�Dc	�n����������� �!��j�������i��jD]v}|j}t	|j��D]X\}}��|g��}|�|d|���|�||dzd����Y�wi�g}t���}	t	|	��D]q\}}
|
dkr0|�d��|	D]}
|�d����;��	|
��}|�d}n|�|<d}|�|���rd�
|���t���t���d�����fd�	�!������!fd�}
����������!fd	�}g�d
� �rt���}nd}� |krmt� fd��D����}� |kr|� ��}|� kr|� �;|� � �vr!�� |�}��|��|� |
� ��� � |k�m|� ��}���|d���g}�jD]�}|�vr�|jr#|�t#|�����0|j�zt'|jt(��r`t+�|j��rK|jt/�|j��ur/t1�|j��||j������|r8��t7d
��d�
|��z���jD]d}|jr[|jD]}|�vrnL�	d�|jD��}t7d��}��|d�
|��z���e��fS)Nr rdr��A�Orc�h���	�|����||��}||jurc�
�|����|g��D]7}|�
vr1t	d��}t|��}t
|||z����8|tur|��||��dSdS)Nznot allowed with argument %s)r��_get_valuesr�r�rrErr)r��argument_stringsr��argument_values�conflict_actionr��action_name�action_conflictsr^�seen_actions�seen_non_default_actionsr8s       �����r�take_actionz5ArgumentParser._parse_known_args.<locals>.take_action�s�������V�$�$�$�"�.�.�v�7G�H�H�O�
�f�n�4�4�(�,�,�V�4�4�4�'7�';�';�F�B�'G�'G�G�G�O�&�*B�B�B�� >�?�?��&6��&G�&G��+�F�C�+�4E�F�F�F�C��h�.�.���t�Y���G�G�G�G�G�/�.rc����|}|\}}}�j}g}	|� ���|��|dzS|��||d��}�j}|dkr|d|vru|dkro|�|g|f��|d}	|	|dz}|dd�pd}
�j}||vr||}|
}n�t	d��}t|||z���|dkr!|dz}
|g}|�|||f��ngt	d��}t|||z���|dz}�|d�}|||��}||z}
�||
�}|�|||f��n��J|sJ�|D]\}}}�|||���|
S)NTr r�rrzignored explicit argument %r)�_match_argumentr3r�r�rr)�start_index�option_tupler�r��explicit_arg�match_argument�
action_tuples�	arg_countr�char�new_explicit_arg�
optionals_mapr��stopr}r��selected_patternsr:�arg_strings_pattern�extras�option_string_indicesr8r�s                 ������r�consume_optionalz:ArgumentParser._parse_known_args.<locals>.consume_optional�s3���1��=�L�2>�/�F�M�<�"�1�N��M�9
��>��M�M�+�k�":�;�;�;�&��?�*� �+� .��v�s� ;� ;�I�
!�-�E�!�Q���)�!�,�E�9�9�(�B�.�.�%�,�,�f�b�-�-H�I�I�I�,�Q�/��(,�|�A��(>�
�+7����+;�+C�t�(�(,�(C�
�(�M�9�9�%2�=�%A�F�+;�L�L�"#�$B�"C�"C�C�"/���l�8J�"K�"K�K�#�a���*�Q��� ,�~��%�,�,�f�d�M�-J�K�K�K��
 � >�?�?��+�F�C�,�4F�G�G�G�(�!�O�E�(;�E�F�F�(C�%� .��v�7H� I� I�I� �9�,�D�&�u�T�z�2�D�!�(�(�&�$�
�)F�G�G�G��s9
�z!� � � �/<�
9�
9�+���m���F�D�-�8�8�8�8��Krc�����
j}�|d�}|�	|��}t�	|��D]#\}}�|||z�}||z
}�||���$�	t|��d��	dd�<|Sr)�_match_arguments_partial�zipr�)r��
match_partial�selected_pattern�
arg_countsr�r�r}r:r�r�r8r�s       �����r�consume_positionalsz=ArgumentParser._parse_known_args.<locals>.consume_positionalss���� �9�M�2�;�<�<�@��&��{�4D�E�E�J�&)��j�%A�%A�
*�
*�!��	�"�;��i�0G�#G�H���y�(����F�D�)�)�)�)�)��Z���)9�)9�:�K����N��rrr�c� ��g|]
}|�k�|��Srr)r{r�r�s  �rr~z4ArgumentParser._parse_known_args.<locals>.<listcomp>0s.���,)�,)�,)���K�'�'��'�'�'rz(the following arguments are required: %sr.c�H�g|]}|jtu�t|���� Sr)r�rrErus  rr~z4ArgumentParser._parse_known_args.<locals>.<listcomp>os7��=�=�=�!'� &��8� ;� ;�.�f�5�5� ;� ;� ;rz#one of the arguments %s is requiredr�r)r_�_read_args_from_filesr�r�r�r�r��iterr3�_parse_optionalr7r�rorZrYr�r�rEr�rrrr,rSrk�
_get_valuer�r)"r8r:r^r'r�r��mutex_action�	conflicts�arg_string_pattern_parts�arg_strings_iter�
arg_stringr��patternr�r��max_option_string_index�next_option_string_index�positionals_end_index�strings�
stop_index�required_actionsr�r�rWr�r�r�r�r�r�r�r�r�r�s"```                      @@@@@@@@@rrz ArgumentParser._parse_known_args~sU���������������%�1��4�4�[�A�A�K����:�	8�	8�K�'�6�M�#,�[�-G�#H�#H�
8�
8���<�,�7�7��b�I�I�	�� � ��r��r�!2�3�3�3�� � ��q�1�u�v�v�!6�7�7�7�7�
8�!#��#%� ���,�,��&�'7�8�8�	9�	9�M�A�z��T�!�!�(�/�/��4�4�4�"2�9�9�J�,�3�3�C�8�8�8�8�9� $�3�3�J�?�?���'�!�G�G�/;�)�!�,�!�G�(�/�/��8�8�8�8�!�g�g�&>�?�?���u�u��#&�5�5� �	H�	H�	H�	H�	H�	H�	H�	H�	H�	H�*J	�J	�J	�J	�J	�J	�J	�J	�J	�J	�\�2�2�4�4��	�	�	�	�	�	�	�	�	�(���� �	)�&)�*?�&@�&@�#�#�&(�#��4�4�4�(+�,)�,)�,)�,)�2�,)�,)�,)�(*�(*�$��6�6�6�(;�(;�K�(H�(H�%�)�;�6�6�"7�K��"7�K��"7�7�7�%�k�2J�&J�K���
�
�g�&�&�&�6��+�*�;�7�7�K�5�4�4�4�:)�(��5�5�
�	�
�
�k�*�+�+�.�/�/�/����m�	I�	I�F��\�)�)��?�I�$�+�+�,<�V�,D�,D�E�E�E�E���2�"�6�>�3�7�7�3��	�6�;�7�7�3���'�)�V�[�*I�*I�I�I��	�6�;� $������ G� G�I�I�I���	4��J�J�q�C�D�D��y�y�!1�2�2�3�
4�
4�
4��4�	6�	6�E��~�
6�#�2�
6�
6�F��!9�9�9���:�
=�=�+0�+?�=�=�=�E��A�B�B�C��J�J�s�S�X�X�e�_�_�4�5�5�5���&� � rc�<�g}|D�]}|r|d|jvr|�|���*	t|dd���5}g}|������D]/}|�|��D]}|�|����0|�|��}|�|��ddd��n#1swxYwY��#t$r-}|�	t|����Yd}~��d}~wwxYw|Sr�)r_r3r��readr5�convert_arg_line_to_argsr�r�r�r�r)r8r:�new_arg_stringsr��	args_file�arg_liner<r�s        rr�z$ArgumentParser._read_args_from_filesxs�����%�	)�	)�J��
)��A��d�6P�!P�!P��&�&�z�2�2�2�2�	)��j����n�-�-�<��&(��(1���(8�(8�(C�(C�(E�(E�8�8�H�'+�'D�'D�X�'N�'N�8�8�� +� 2� 2�3� 7� 7� 7� 7�8�&*�&@�&@��&M�&M��'�.�.�{�;�;�;�
<�<�<�<�<�<�<�<�<�<�<����<�<�<�<����)�)�)��J�J�s�3�x�x�(�(�(�(�(�(�(�(�����)�����s<�C"�BC�
C"�C	�C"�C	�C"�"
D�,"D�Dc��|gSrr)r8r�s  rr�z'ArgumentParser.convert_arg_line_to_args�s
���z�rc��|�|��}tj||��}|��dtd��ttd��t
td��i}|�|j��}|�tdd|j��|jz}t||���t|�d����S)Nzexpected one argumentzexpected at most one argumentzexpected at least one argumentzexpected %s argumentzexpected %s argumentsr )�_get_nargs_patternrcrrrrr�r�rrr�r�)r8r�r��
nargs_patternr�nargs_errorsr�s       rr�zArgumentParser._match_argument�s����/�/��7�7�
��	�-�)<�=�=���=��a�/�0�0��!�;�<�<��Q�?�@�@��L�
�"�"�6�<�0�0�C��{��5�6�%�|�-�-�/5�|�<�� ���,�,�,��5�;�;�q�>�>�"�"�"rc�8��g}tt|��dd��D]w}|d|�}d��fd�|D����}tj||��}|�3|�d�|���D����n�x|S)Nrr�rc�:��g|]}��|����Sr)r�)r{r�r8s  �rr~z;ArgumentParser._match_arguments_partial.<locals>.<listcomp>�s7���<�<�<�#)� $�6�6�v�>�>�<�<�<rc�,�g|]}t|����Sr)r�)r{r�s  rr~z;ArgumentParser._match_arguments_partial.<locals>.<listcomp>�s��H�H�H�v�s�6�{�{�H�H�Hr)r�r�r7rcrr�r�)r8r�r�rr��
actions_slicer�rs`       rr�z'ArgumentParser._match_arguments_partial�s�������s�7�|�|�Q��+�+�	�	�A�#�B�Q�B�K�M��g�g�<�<�<�<�-:�<�<�<�=�=�G��I�g�':�;�;�E�� ��
�
�H�H������H�H�H�I�I�I���!�
�
rc�r�|sdS|d|jvrdS||jvr|j|}||dfSt|��dkrdSd|vr4|�dd��\}}||jvr|j|}|||fS|�|��}t|��dkrLd�d�|D����}||d�}t
d��}|�||z��nt|��dkr|\}	|	S|j�	|��r	|j
sdSd|vrdSd|dfS)	Nrr r,r.c��g|]\}}}|��	Srr)r{r�r�r�s    rr~z2ArgumentParser._parse_optional.<locals>.<listcomp>�s4��!J�!J�!J�7�F�M�<�"/�!J�!J�!Jr)r,�matchesz4ambiguous option: %(option)s could match %(matches)sr�)r�r�r��split�_get_option_tuplesr7rr�rrr)
r8r�r�r�r��
option_tuplesrUr}r�r�s
          rr�zArgumentParser._parse_optional�s����	��4��!�}�� 1�1�1��4���4�4�4��0��<�F��:�t�+�+��z�?�?�a����4��*���*4�*:�*:�3��*B�*B�'�M�<��� ;�;�;��4�]�C���}�l�:�:��/�/�
�;�;�
��}����!�!��i�i�!J�!J�;H�!J�!J�!J�K�K�G�(�W�=�=�D��J�K�K�C��J�J�s�T�z�"�"�"�"���
�
�1�
$�
$�)�M�L���
�(�.�.�z�:�:�	��6�
��t��*����4��Z��%�%rc��g}|j}|d|vrz|d|vrp|jrhd|vr|�dd��\}}n|}d}|jD]>}|�|��r'|j|}|||f}|�|���?n�|d|vr�|d|vr�|}d}|dd�}|dd�}	|jD]l}||kr(|j|}|||	f}|�|���0|�|��r'|j|}|||f}|�|���mn%|�td��|z��|S)Nrr r,rNzunexpected option string: %s)r�rar�r�rfr3r�r)
r8r�rr�
option_prefixr�r�r��short_option_prefix�short_explicit_args
          rr�z!ArgumentParser._get_option_tuples�s������!�����u�$�$��q�)9�U�)B�)B�� �

+��-�'�'�2?�2E�2E�c�1�2M�2M�/�M�<�<�$1�M�#'�L�%)�%@�+�+�M�$�/�/�
�>�>�+�!%�!<�]�!K��$�m�\�A���
�
�c�*�*�*���
�1�
��
&�
&�=��+;�5�+H�+H�)�M��L�"/����"3��!.�q�r�r�!2��!%�!<�
'�
'�
� �$7�7�7�!�8��G�F� �-�1C�C�C��M�M�#�&�&�&�&�"�-�-�m�<�<�'�!�8��G�F� �-��=�C��M�M�#�&�&�&��
'�
�J�J�q�7�8�8�=�H�I�I�I��
rc�b�|j}|�d}no|tkrd}na|tkrd}nS|tkrd}nE|tkrd}n7|t
krd}n)|tkrd}ndd	�d
|z��z}|jr,|�	d	d��}|�	dd��}|S)
Nz(-*A-*)z(-*A?-*)z	(-*[A-]*)z
(-*A[A-]*)z([-AO]*)z(-*A[-AO]*)z(-*-*)z(-*%s-*)z-*r�rr�)
r�rrrrrrr7r�r.)r8r�r�r�s    rr�z!ArgumentParser._get_nargs_pattern!	s�������=�%�M�M��h�
�
�&�M�M��l�
"�
"�'�M�M��k�
!�
!�(�M�M��i�
�
�&�M�M��f�_�_�)�M�M��h�
�
�$�M�M�'����3��;�)?�)?�?�M�� �	;�)�1�1�$��;�;�M�)�1�1�#�r�:�:�M��rc��|�||��\}}|r:td��}|�|d�|��z��|Sr{)�parse_known_intermixed_argsrr�r7r|s     r�parse_intermixed_argsz$ArgumentParser.parse_intermixed_argsR	sW���5�5�d�I�F�F�
��d��	-��0�1�1�C��J�J�s�S�X�X�d�^�^�+�,�,�,��rc���|����d��D��}|rtd|djz����fd�|jD��rtd���	|j}	|j�!|���dd�|_�D]2}|j|_t|_|j|_	t|_�3|�
||��\}}�D]a}t||j��rJt||j��gkr1ddlm}|d|j�d	|����t!||j���b	�D]}|j|_|j	|_�n"#�D]}|j|_|j	|_�wxYw|���}	|D]}|j|_d
|_�|jD]}	|	j|	_d
|	_�|�
||��\}}
|D]}|j|_�|jD]}	|	j|	_�n,#|D]}|j|_�|jD]}	|	j|	_�wxYw	||_n#||_wxYw||
fS)Nc�<�g|]}|jttfv�|��Sr)r�rrrus  rr~z>ArgumentParser.parse_known_intermixed_args.<locals>.<listcomp>g	s3��
5�
5�
5������ 3�3�3��3�3�3rz3parse_intermixed_args: positional arg with nargs=%src�:��g|]}|jD]
}|�v�|j���Sr)r�r,)r{r�r�r�s   �rr~z>ArgumentParser.parse_known_intermixed_args.<locals>.<listcomp>m	sI���I�I�I�E��.�I�I��&�K�2G�2G�
�K�2G�2G�2G�2Grz;parse_intermixed_args: positional in mutuallyExclusiveGroup�)rIzDo not expect z in F)rorr�r�r�r��
save_nargsrr��save_defaultr�rr,rSrHrIr�rwr��
save_required)r8r}r^�a�
save_usager��remaining_argsrIr�r�r�r�s           @rr�z*ArgumentParser.parse_known_intermixed_argsY	sD����2�2�4�4��
5�
5�+�
5�
5�
5���	9��-�-.�q�T�Z�8�9�9�
9�I�I�I�I�T�%D�I�I�I�	7��6�7�7�
7�.	$���J�
9��:�%�!%�!2�!2�!4�!4�Q�R�R�!8�D�J�)�.�.�F�(.��F�%�#+�F�L�*0�.�F�'�%-�F�N�N�,0�,A�,A�$�BK�-M�-M�)�	�>�)�8�8�F��	�6�;�7�7�8� '�	�6�;� ?� ?�� C� C�1�1�1�1�1�1��������i�i�P�Q�Q�Q��	�6�;�7�7�7��
8�*�9�9�F�#)�#4�F�L�%+�%8�F�N�N�9��k�9�9�F�#)�#4�F�L�%+�%8�F�N�N�9�����2�2�4�4�I�
9�(�,�,�F�+1�?�F�(�&+�F�O�O�!�<�+�+�E�*/�.�E�'�%*�E�N�N�$(�$9�$9�.�:C�%E�%E�!�	�6�(�;�;�F�&,�&:�F�O�O�!�<�9�9�E�%*�%8�E�N�N�9��(�;�;�F�&,�&:�F�O�O�!�<�9�9�E�%*�%8�E�N�N�9����9�$�D�J�J���D�J�#�#�#�#��&� � s>�$I�,CE%�I�%F�I�AH�*(I�)H;�;I�	Ic�����jttfvr'	|�d��n#t$rYnwxYw|si�jt
krY�jr�j}n�j}t|t��r,���|��}���|���n3|s?�jtkr/�js(�j��j}n|}���|��n�t|��dkrA�jdt
fvr1|\}���|��}���|��n��jtkr��fd�|D��}n~�jtkr,��fd�|D��}���|d��nB�jtkrt}n*��fd�|D��}|D]}���|���|S)Nrdr c�<��g|]}���|����Sr�r��r{�vr�r8s  ��rr~z.ArgumentParser._get_values.<locals>.<listcomp>�	�'���E�E�E�A�T�_�_�V�Q�/�/�E�E�Erc�<��g|]}���|����Srr�r�s  ��rr~z.ArgumentParser._get_values.<locals>.<listcomp>�	r�rrc�<��g|]}���|����Srr�r�s  ��rr~z.ArgumentParser._get_values.<locals>.<listcomp>�	r�r)r�rrr!r�rr�rOr�rrr��_check_valuerr�r)r8r�r:r>r�r�s``    rr�zArgumentParser._get_values�	sA�����<��	�2�2�2�
��"�"�4�(�(�(�(���
�
�
���
�����*	-�v�|�x�7�7��$�
'���������%��%�%�
1������6�6���!�!�&�%�0�0�0���	-�&�,�,�">�">��'�#?��~�)�����#�����f�e�,�,�,�,���
�
��
"�
"�v�|��h�7G�'G�'G�%�K�J��O�O�F�J�7�7�E����f�e�,�,�,�,��\�Y�
&�
&�E�E�E�E�E��E�E�E�E�E��\�V�
#�
#�E�E�E�E�E��E�E�E�E����f�e�A�h�/�/�/�/��\�X�
%�
%��E�E�F�E�E�E�E��E�E�E�E��
-�
-���!�!�&�!�,�,�,�,��s�/�
<�<c�4�|�d|j|j��}t|��s"td��}t	|||z���	||��}n�#t
$rL}t
|jdt|j����}t|��}t	||���d}~wttf$rPt
|jdt|j����}||d�}td��}t	|||z���wxYw|S)Nr0z%r is not callabler1)r0r>z!invalid %(type)s value: %(value)r)rr0rrrrrSr4rrr�)	r8r�r�rr�rr�r=r}s	         rr�zArgumentParser._get_value�	s*���&�&�v�v�{�F�K�H�H�	��	�"�"�	9��(�)�)�C����i��8�8�8�	4��Y�z�*�*�F�F��!�	-�	-�	-��6�;�
�D���4E�4E�F�F�D��c�(�(�C����,�,�,������:�&�	4�	4�	4��6�;�
�D���4E�4E�F�F�D� �:�6�6�D��7�8�8�C����d�
�3�3�3�		4�����
s�A � 
D�*AB1�1A$Dc���|j�[||jvrT|d�tt|j����d�}t	d��}t|||z���dSdS)Nr.)r>rz3invalid choice: %(value)r (choose from %(choices)s))rr7r�r4rr)r8r�r>r}r�s     rr�zArgumentParser._check_value�	sr���>�%�%�v�~�*E�*E�"�#�y�y��T�6�>�)B�)B�C�C�E�E�D��I�J�J�C����d�
�3�3�3�	&�%�*E�*Erc��|���}|�|j|j|j��|���Sr)r�r�r�r�r�r�)r8rvs  rr�zArgumentParser.format_usage
sK���'�'�)�)�	����D�J��
� �;�	=�	=�	=��$�$�&�&�&rc���|���}|�|j|j|j��|�|j��|jD]d}|�|j	��|�|j��|�
|j��|����e|�|j
��|���Sr)r�r�r�r�r�r�r�r�r�r$r�r�r�r]r�)r8rv�action_groups   rr�zArgumentParser.format_help	
s����'�'�)�)�	�	���D�J��
� �;�	=�	=�	=�	���4�+�,�,�,�!�/�	$�	$�L��#�#�L�$6�7�7�7����|�7�8�8�8��#�#�L�$?�@�@�@��!�!�#�#�#�#�	���4�;�'�'�'��$�$�&�&�&rc�8�|�|j���S)Nr�)r^rhrDs rr�zArgumentParser._get_formatter 
s���#�#���#�3�3�3rc�r�|�tj}|�|���|��dSr)r�r�r�r��r8�files  r�print_usagezArgumentParser.print_usage&
s6���<��;�D����D�-�-�/�/��6�6�6�6�6rc�r�|�tj}|�|���|��dSr)r�r�r�r�r�s  rr�zArgumentParser.print_help+
s6���<��;�D����D�,�,�.�.��5�5�5�5�5rc�T�|r%|�tj}|�|��dSdSr)r��stderr�write)r8rr�s   rr�zArgumentParser._print_message0
s8���	 ��|��{���J�J�w������	 �	 rrc�r�|r |�|tj��tj|��dSr)r�r�r�r�)r8�statusrs   rr�zArgumentParser.exit9
s8���	6�������5�5�5��	�&�����rc��|�tj��|j|d�}|�dtd��|z��dS)z�error(message: string)

        Prints a usage message incorporating the message to stderr and
        exits.

        If you override this in a subclass, it should not return -- it
        should either exit or raise an exception.
        )rhrrNz%(prog)s: error: %(message)s
N)r�r�r�rhr�r)r8rr}s   rr�zArgumentParser.error>
sQ��	
�����%�%�%��	�g�6�6���	�	�!�Q�7�8�8�4�?�@�@�@�@�@rrLr)rN)#r1rFrGrHrrmr5rqrrwror}r�rr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rmrns@rrr�sR���������,��!���!.�!�'+�"&�")��"�#�=0�=0�=0�=0�=0�=0�D	?�	?�	?����>���*�*�*�
.�.�.�����$�$�$�$�Lx!�x!�x!�t���2���#�#�#�,��� 8&�8&�8&�t+�+�+�Z+�+�+�b����H!�H!�H!�H!�Z6�6�6�p���44�4�4�'�'�'�'�'�'�.4�4�4�7�7�7�7�
6�6�6�6�
 � � � �����
A�A�A�A�A�A�Arr)4rH�__version__�__all__�osrY�rerc�sysr�rHrrrrVrrrrrrr�r/r*rLrr	r
rrrE�	Exceptionrrr
rrprwr}r�r�r�r�r�r�r�r�rrr�rrrrrr�<module>rs���;�;�z������,����������������	�.�.�.�.�.�.�.�.�.��������������������������	���	�.�������v����>	�	�	�"@�@�@�@�@�F�@�@�@�FQ�Q�Q�Q�Q�-�Q�Q�Q�!�!�!�!�!�6�!�!�!������M����:$�$�$�$�$�}�$�$�$�&���?�?�?�?�?�I�?�?�?�(	�	�	�	�	�	�	�	�	�\@�\@�\@�\@�\@�
�\@�\@�\@�~$/�$/�$/�$/�$/�F�$/�$/�$/�N .� .� .� .� .�6� .� .� .�F2�2�2�2�2��2�2�2�.�����(����"�����)����"#-�#-�#-�#-�#-�F�#-�#-�#-�L-�-�-�-�-��-�-�-�61�1�1�1�1�6�1�1�1�.�����&����&�����V����4bL�bL�bL�bL�bL��bL�bL�bL�H-�-�-�-�-�M�-�-�-�1:�1:�1:�1:�1:�v�1:�1:�1:�n$�$�$�$�$� �$�$�$�(s8�s8�s8�s8�s8��s8�s8�s8�l	';�';�';�';�';�&�';�';�';�TE�E�E�E�E�n�E�E�E�8QA�QA�QA�QA�QA�%�'8�QA�QA�QA�QA�QAs�#�1�1