HEX
Server: LiteSpeed
System: Linux s1049.use1.mysecurecloudhost.com 4.18.0-477.27.2.lve.el8.x86_64 #1 SMP Wed Oct 11 12:32:56 UTC 2023 x86_64
User: xedaptot (3356)
PHP: 8.3.31
Disabled: NONE
Upload Files
File: //proc/722141/root/lib/python3.6/site-packages/botocore/docs/__pycache__/example.cpython-36.pyc
3

�T_/"�@sLddlmZddlmZGdd�de�ZGdd�de�ZGdd�de�Zd	S)
�)�ShapeDocumenter)�
py_defaultc@steZdZddd�Zdd�Zddd�Zddd	�Zdd
d�Zddd
�Zddd�Z	dd�Z
ddd�Zddd�Zdd�Z
dS) �BaseExampleDocumenterNcCsBg}|jj�|jj�|dk	r*|j|�|j|||||d�dS)a]Generates an example based on a shape

        :param section: The section to write the documentation to.

        :param shape: The shape of the operation.

        :param prefix: Anything to be included before the example

        :type include: Dictionary where keys are parameter names and
            values are the shapes of the parameter names.
        :param include: The parameter shapes to include in the documentation.

        :type exclude: List of the names of the parameters to exclude.
        :param exclude: The names of the parameters to exclude from
            documentation.
        N)�section�shape�history�include�exclude)�style�new_lineZstart_codeblock�write�traverse_and_document_shape)�selfrr�prefixrr	r�r�/usr/lib/python3.6/example.py�document_examples


z&BaseExampleDocumenter.document_examplecKs|jd�dS)Nz{'... recursive ...'})r)rrr�kwargsrrr�document_recursive_shape-sz.BaseExampleDocumenter.document_recursive_shapecKs>|j|�}|dkrt|j�}|jjd�|kr0d}|j|�dS)NZstreaming_shapezStreamingBody())Z_get_special_py_defaultrZ	type_nameZ_context�getr)rrrrrr	rZpy_typerrr�document_shape_default0s

z,BaseExampleDocumenter.document_shape_defaultc	Kshd|jkrVxXt|jd�D]6\}}|jd|�|t|jd�dkr|jd�qWn|j|||�dS)N�enumz'%s'��|)Zmetadata�	enumerater�lenr)	rrrrrr	r�irrrr�document_shape_type_string:s
z0BaseExampleDocumenter.document_shape_type_stringcKsn|j}|jd�}|j|d�|jdd|jid�}	|j|	||d�|jd�}
|
jd�|jd	�}|j|d
�dS)Nz
list-value�[�memberr)�context)rrrzending-comma�,zending-bracket�])r�add_new_section�_start_nested_param�namer
r�_end_nested_param)rrrrrr	r�param_shapeZlist_section�
param_section�ending_comma_sectionZending_bracket_sectionrrr�document_shape_type_listDs


z.BaseExampleDocumenter.document_shape_type_listcKs�|js|jd�dS|jd�}|j|d�|j|j|�}x�t|�D]�\}}	|rX|	|krXqB|j|	�}
|
jd|	�||	}|
jdd|jid�}|j||||	d�|t|�d	krB|
jd
�}
|
jd�|
j	j
�qBW|j|dd�dS)
Nz{}zstructure-value�{z'%s': zmember-valuer)r )rrrr%rzending-commar!�})�membersrr#r$�_add_members_to_shaperr%r
rr
r�_end_structure)rrrrrr	r�
input_membersr�paramr(r'�param_value_sectionr)rrr�document_shape_type_structureSs.




z3BaseExampleDocumenter.document_shape_type_structurecKsz|jd�}|j|d�|j}|jdd|jjid�}	|	jd�|jdd|jid�}
|j|
||d�|jd	�}|j|d
�dS)Nz	map-valuer+�keyr)r z
'string': �value)rrrzending-bracketr,)r#r$r5r4r%rr
r&)rrrrrr	rZmap_sectionZvalue_shapeZkey_sectionZ
value_section�end_bracket_sectionrrr�document_shape_type_mapps


z-BaseExampleDocumenter.document_shape_type_mapcCs(|r$|j�}x|D]}|||j<qW|S)N)�copyr%)rr-rr1rrrr.s

z+BaseExampleDocumenter._add_members_to_shapecCs4|dk	r|j|�|jj�|jj�|jj�dS)N)rr
�indentr)rr�startrrrr$�s



z)BaseExampleDocumenter._start_nested_paramcCs4|jj�|jj�|jj�|dk	r0|j|�dS)N)r
�dedentrr)rr�endrrrr&�s



z'BaseExampleDocumenter._end_nested_paramcCsB|js(|j�|j||�|j|�n|jd�}|j||�dS)Nzending-bracket)Zavailable_sectionsZ
clear_textrr&r#)rrr:r<r6rrrr/�s
z$BaseExampleDocumenter._end_structure)NNN)NN)NN)NN)NN)NN)N)N)�__name__�
__module__�__qualname__rrrrr*r3r7r.r$r&r/rrrrrs



	




rc@seZdZdZdd�ZdS)�ResponseExampleDocumenterzresponse-examplecKs4|jd�|j|||f|�|jd�}|jd�dS)NzEventStream(zevent-stream-end�))rr3r#)rrrrrZend_sectionrrr� document_shape_type_event_stream�s

z:ResponseExampleDocumenter.document_shape_type_event_streamN)r=r>r?�
EVENT_NAMErBrrrrr@�sr@c@seZdZdZddd�ZdS)�RequestExampleDocumenterzrequest-exampleNcKsd}d}d}	d}
t|�dkr,d}d}	d}
d	}|jd
�}|j||	�|j|j|�}x�t|�D]�\}}
|rp|
|krpqZ|j|
�}|j||
�|j|�||
}|jdd|jid
�}|j||||
d�|t|�dkrZ|jd�}|jd�|j	j
�qZW|j||	|
�dS)Nz'%s'z: r+r,r�=�(rAz%szstructure-valuezmember-valuer)r )rrrr%zending-commar!)rr#r$r.r-rrr%r
r
rr/)rrrrrr	rZparam_format�operatorr:r<r0rr1r(r'r2r)rrrr3�s<




z6RequestExampleDocumenter.document_shape_type_structure)NN)r=r>r?rCr3rrrrrD�srDN)Zbotocore.docs.shaperZbotocore.docs.utilsrrr@rDrrrr�<module>
s