AlkantarClanX12

Your IP : 3.12.148.180


Current Path : /opt/alt/python310/lib64/python3.10/__pycache__/
Upload File :
Current File : //opt/alt/python310/lib64/python3.10/__pycache__/pprint.cpython-310.opt-2.pyc

o

6��f|_�	@s�	ddlZddlZddlZddlZddlZddl	m
Zgd�Zd#dddd�d	d
�Z
d$dddd�dd�Zdd
�dd�Zdd�Zdd�Zdd�ZGdd�d�Zdd�ZGdd�d�Zeeeeeeeed�h�Zdd�Zd%dd�Z d d!�Z!e"d"kr{e �dSdS)&�N)�StringIO)�pprint�pformat�
isreadable�isrecursive�saferepr�
PrettyPrinter�pp��PFT��compact�
sort_dicts�underscore_numbersc		Cs&	t|||||||d�}|�|�dS)N)�stream�indent�width�depthr
rr)rr)	�objectrrrrr
rrZprinter�r�-/opt/alt/python310/lib64/python3.10/pprint.pyr0s�rcCs	t||||||d��|�S)N)rrrr
rr)rr)rrrrr
rrrrrr9s��r)rcOs 	t|g|�Rd|i|��dS)Nr)r)rr�args�kwargsrrrr	@sr	cCs	t��|idd�dS�Nr�r�
_safe_repr�rrrrrD�rcC�	t��|idd�dS�Nrr
rrrrrrHrrcCr�Nr�rrrrrrLrrc@s$eZdZ	dgZdd�Zdd�ZdS)�	_safe_key�objcCs
||_dS�N)r#)�selfr#rrr�__init__\s
z_safe_key.__init__cCsRz|j|jkWSty(tt|j��t|j�ftt|j��t|j�fkYSwr$)r#�	TypeError�str�type�id)r%�otherrrr�__lt___s��z_safe_key.__lt__N)�__name__�
__module__�__qualname__�	__slots__r&r,rrrrr"Ps
	r"cCs	t|d�t|d�fSr)r")�trrr�_safe_tuplefsr2c@s�eZdZdCdddd�dd�Zd	d
�Zdd�Zd
d�Zdd�Zdd�Zdd�Z	iZ
dd�Zee
ej
<dd�Zee
ejj
<dd�Zee
ej
<dd�Zee
ej
<dd�Zee
ej
<ee
ej
<dd �Zee
ej
<d!d"�Zee
ej
<d#d$�Zee
ej
<d%d&�Zee
ej j
<d'd(�Z!e!e
ej"j
<d)d*�Z#d+d,�Z$d-d.�Z%d/d0�Z&d1d2�Z'd3d4�Z(e(e
ej)j
<d5d6�Z*e*e
ej+j
<d7d8�Z,e,e
ej-j
<d9d:�Z.e.e
ej/j
<d;d<�Z0e0e
ej1j
<d=d>�Z2e2e
ej3j
<d?d@�Z4e4e
ej5j
<dAdB�Z6dS)Drr
rNFTrcCs�	t|�}t|�}|dkrtd��|dur|dkrtd��|s#td��||_||_||_|dur4||_ntj|_t|�|_	||_
||_dS)Nrzindent must be >= 0zdepth must be > 0zwidth must be != 0)�int�
ValueError�_depth�_indent_per_level�_width�_stream�_sys�stdout�bool�_compact�_sort_dicts�_underscore_numbers)r%rrrrr
rrrrrr&ks$

zPrettyPrinter.__init__cCs&|�||jddid�|j�d�dS)Nr�
)�_formatr8�write�r%rrrrr�szPrettyPrinter.pprintcCs"t�}|�||ddid�|��Sr)�	_StringIOr@�getvalue)r%rZsiorrrr�szPrettyPrinter.pformatcCs|�|idd�dSr ��formatrBrrrr�szPrettyPrinter.isrecursivecCs |�|idd�\}}}|o|SrrE)r%r�s�readable�	recursiverrrr�s
zPrettyPrinter.isreadablec	Cs
t|�}||vr|�t|��d|_d|_dS|�|||�}|j||}	t|�|	kr~|j�	t
|�jd�}
|
durNd||<|
|||||||d�||=dSt�
|�r~t|t
�s~|jjr~t|jd�r~d|jjjvr~d||<|�||||||d�||=dS|�|�dS)NTFr
�__wrapped__Z
__create_fn__)r*rA�
_recursion�
_recursive�	_readable�_reprr7�len�	_dispatch�getr)�__repr__�_dataclassesZis_dataclass�
isinstanceZ__dataclass_params__�repr�hasattrrJr/�_pprint_dataclass)r%rrr�	allowance�context�level�objid�rep�	max_width�prrrr@�s8
��
�zPrettyPrinter._formatc	s`�jj}|t|�d7}�fdd�t���D�}|�|d�|�||||||�|�d�dS)Nr
cs$g|]}|jr|jt�|j�f�qSr)rU�name�getattr)�.0�frrr�
<listcomp>�s$z3PrettyPrinter._pprint_dataclass.<locals>.<listcomp>�(�))�	__class__r-rOrSZfieldsrA�_format_namespace_items�	r%rrrrXrYrZ�cls_name�itemsrrrrW�szPrettyPrinter._pprint_dataclassc
Csz|j}|d�|jdkr||jdd�t|�}|r7|jr't|��td�}	n|��}	|�|	|||d||�|d�dS)N�{r
� ��key�})rAr6rOr=�sortedrjr2�_format_dict_items)
r%rrrrXrYrZrAZlengthrjrrr�_pprint_dict�s
�zPrettyPrinter._pprint_dictcCslt|�s
|�t|��dS|j}|�|jd�|�t|���||t|j�d|d||�|�d�dS)Nrdr
re)rOrArUrfr-r@�listrj)r%rrrrXrYrZ�clsrrr�_pprint_ordered_dict�s�z"PrettyPrinter._pprint_ordered_dictcCs0|�d�|�||||d||�|�d�dS)N�[r
�])rA�
_format_items�r%rrrrXrYrZrrr�_pprint_list�s

�zPrettyPrinter._pprint_listcCsH|�d�t|�dkr
dnd}|�||||t|�||�|�|�dS)Nrdr
z,)re)rArOrx)r%rrrrXrYrZ�endcharrrr�
_pprint_tuple�s
�zPrettyPrinter._pprint_tuplec	Cs�t|�s
|�t|��dS|j}|tur|�d�d}n|�|jd�d}|t|j�d7}t|td�}|�||||t|�||�|�|�dS)Nrkro�({�})r
rm)	rOrArUrf�setr-rpr"rx)	r%rrrrXrYrZ�typr{rrr�_pprint_set�s
�zPrettyPrinter._pprint_setcCs�|j}t|�s|t|��dSg}|�d�}	|dkr"|d7}|d7}|j|}
}t|	�D]n\}}
t|
�}|t|	�dkrA|
|8}
t|�|
krM|�|�q-t�d|
�}|�	�|}d}t|�D]2\}}||}|t|�dkr{|t|	�dkr{||8}tt|��|kr�|r�|�t|��|}q_|}q_|r�|�t|��q-t|�dkr�||�dS|dkr�|d�t|�D]\}}|dkr�|dd|�||�q�|dkr�|d	�dSdS)
NTr
z\S*\s*�rdrr?rlre)
rArOrU�
splitlinesr7�	enumerate�append�re�findall�pop)r%rrrrXrYrZrAZchunks�linesZ
max_width1r]�i�liner\�partsZ
max_width2�current�j�part�	candidaterrr�_pprint_strsX
 �
�zPrettyPrinter._pprint_strcCs�|j}t|�dkr|t|��dS|dk}|r#|d7}|d7}|d�d}	t||j||�D]}
||	�||
�|	s@dd|}	q.|rI|d�dSdS)N�r
rdr�r?rlre)rArOrU�_wrap_bytes_reprr7)r%rrrrXrYrZrAZparens�delimr\rrr�
_pprint_bytesCs&��zPrettyPrinter._pprint_bytesc	Cs>|j}|d�|�t|�||d|d||d�|d�dS)Nz
bytearray(�
r
re)rAr��bytes)r%rrrrXrYrZrArrr�_pprint_bytearrayXs�zPrettyPrinter._pprint_bytearraycCs8|�d�|�|��||d|d||�|�d�dS)Nz
mappingproxy(�
r
re)rAr@�copyryrrr�_pprint_mappingproxyas

�z"PrettyPrinter._pprint_mappingproxyc	Csft|�tjur
d}n|jj}|t|�d7}|j��}|�|d�|�	||||||�|�d�dS)N�	namespacer
rdre)
r)�_types�SimpleNamespacerfr-rO�__dict__rjrArgrhrrr�_pprint_simplenamespaceis
z%PrettyPrinter._pprint_simplenamespacec	Cs�|j}||j7}dd|}t|�d}	t|�D]3\}
\}}|
|	k}
|�|||�}||�|d�|�|||t|�d|
r@|nd||�|
sK||�qdS)N�,
rlr
z: r!)rAr6rOr�rNr@)r%rjrrrXrYrZrA�delimnl�
last_indexr�rn�ent�lastr\rrrrqxs"

���z PrettyPrinter._format_dict_itemsc	Cs�|j}dd|}t|�d}	t|�D]7\}
\}}|
|	k}
||�|d�t|�|vr0|d�n|�|||t|�d|
r?|nd||�|
sJ||�qdS)Nr�rlr
�=�...)rArOr�r*r@)r%rjrrrXrYrZrAr�r�r�rnr�r�rrrrg�s"

���z%PrettyPrinter._format_namespace_itemscCsF|j}||j7}|jdkr||jdd�dd|}d}	|j|d}
}t|�}zt|�}
Wn
ty;YdSwd}|s�|
}zt|�}
Wnty[d}||8}|
|8}
Ynw|jr�|�|||�}t|�d}|
|krv|}
|	rv|}	|
|kr�|
|8}
||	�d}	||�q>||	�|}	|�	||||r�|nd||�|r@dSdS)	Nr
rlr�r�FTr!�, )
rAr6r7�iter�next�
StopIterationr<rNrOr@)r%rjrrrXrYrZrAr�r�rr]�itZnext_entr�r�r\�wrrrrx�sV

��

��zPrettyPrinter._format_itemscCs4|�||��|j|�\}}}|sd|_|rd|_|S)NFT)rFr�r5rMrL)r%rrYrZrUrHrIrrrrN�s
�zPrettyPrinter._reprcCs	|�||||�Sr$)r)r%rrY�	maxlevelsrZrrrrF�szPrettyPrinter.formatc	Cs�t|�s
|�t|��dS|�|j||�}|j}|t|j�d7}|�d|j|d|f�|�||||d||�|�d�dS)Nr
z	%s(%s,
%srlre)rOrArUrN�default_factoryrfr-rr)	r%rrrrXrYrZZrdfrtrrr�_pprint_default_dict�sz"PrettyPrinter._pprint_default_dictc	Cs�t|�s
|�t|��dS|j}|�|jd�|jdkr'|�|jdd�|��}|�|||t|j�d|d||�|�d�dS)Nr}r
rlr!r~)rOrArUrfr-r6�most_commonrq)	r%rrrrXrYrZrtrjrrr�_pprint_counter�s
�zPrettyPrinter._pprint_counterc
	Cs�t|j�s|�t|��dS|j}|�|jd�|t|j�d7}t|j�D]2\}}	|t|j�dkrF|�|	|||d||�|�d�q'|�|	||d||�|�dd|�q'dS)Nrdr
rer�rl)rO�mapsrArUrfr-r�r@)
r%rrrrXrYrZrtr��mrrr�_pprint_chain_map�s
�zPrettyPrinter._pprint_chain_mapc	Cs�t|�s
|�t|��dS|j}|�|jd�|t|j�d7}|�d�|jdur>|�||||d||�|�d�dS|�|||d||�|�|j||�}|�dd||f�dS)Nrdr
rvr!z])z],
%smaxlen=%s)rl)rOrArUrfr-�maxlenrxrN)	r%rrrrXrYrZrtZrmlrrr�
_pprint_deques"

��zPrettyPrinter._pprint_dequec	C�|�|j|||||d�dS�Nr
�r@�dataryrrr�_pprint_user_dict�zPrettyPrinter._pprint_user_dictc	Cr�r�r�ryrrr�_pprint_user_listr�zPrettyPrinter._pprint_user_listc	Cr�r�r�ryrrr�_pprint_user_string!r�z!PrettyPrinter._pprint_user_stringcCs�t|�}|tvrt|�ddfSt|dd�}t|t�r0|tjur0|jr)|d�ddfSt|�ddfSt|t�r�|tjur�|s>dSt	|�}|rO||krOdd||vfS||vrZt
|�ddfSd||<d}d}	g}
|
j}|d7}|jrwt
|��td�}n|��}|D].\}
}|�|
|||�\}}}|�||||�\}}}|d	||f�|o�|o�|}|s�|r�d}	q}||=d
d�|
�||	fSt|t�r�|tjus�t|t��rF|tju�rFt|t�r�|s�dSd
}nt|�dkr�d}n|s�dSd}t	|�}|r�||kr�|dd||vfS||v�r	t
|�ddfSd||<d}d}	g}
|
j}|d7}|D]}|�||||�\}}}||�|�s2d}|�r7d}	�q||=|d�|
�||	fSt|�}||�oS|�d�dfS)NTFrRZ_d)z{}TFz{...}r
rmz%s: %sz{%s}r�)z[]TFz[%s]z(%s,))z()TFz(%s)r��<)r)�_builtin_scalarsrUr`�
issubclassr3rRr>�dictr*rKr�r=rprjr2rF�joinrs�tuplerO�
startswith)r%rrYr�rZr��rr[rHrIZ
componentsr�rj�k�vZkreprZ	kreadableZkrecurZvreprZ	vreadableZvrecurrF�oZoreprZ	oreadableZorecurr\rrrr&s�
�
���


��zPrettyPrinter._safe_repr)r
rNN)7r-r.r/r&rrrrr@rWrPrrr�rRru�_collections�OrderedDictrzrsr|r�r�r�	frozensetr�r(r�r�r��	bytearrayr�r��MappingProxyTyper�r�rqrgrxrNrFr��defaultdictr��Counterr��ChainMapr��dequer��UserDictr��UserListr��
UserStringrrrrrrjsh�,





1


)	rcCsdt|�jt|�fS)Nz<Recursion on %s with id=%s>)r)r-r*rrrrrKzs�rKcCs�ddl}|durddddgddd�fgd	}t�}|��}|�|iddd
�|��}|�|�|��}td||�td||�dS)
Nr�string)r
r!�r���)��i��Tz_safe_repr:zpformat:)�timer�perf_counterrr�print)rr�r^�t1�t2Zt3rrr�
_perfchecks
r�ccs��d}t|�dd}tdt|�d�D]*}|||d�}||}||kr)||8}tt|��|kr;|r8t|�V|}q|}q|rGt|�VdSdS)N�r�r)rO�rangerU)rrrXr�r�r�r�r�rrrr��s �
�r��__main__)Nr
rN)r
rNr$)#�collectionsr�ZdataclassesrSr��sysr9�typesr��iorrC�__all__rrr	rrrr"r2rr�r(r�r��float�complexr;r)r�rKr�r�r-rrrr�<module>sD
�	��


�