python (3.12.0)

(root)/
lib/
python3.12/
__pycache__/
pprint.cpython-312.opt-1.pyc

ˑe^dZddlZddlZddlZddlZddlZ	ddl
mZgdZ
ddddddZdddddd	Zdd
dZdZd
ZdZGddZdZGddZeeeeeeeedhZdZ dZ!y)a/Support to pretty-print lists, tuples, & dictionaries recursively.

Very simple, but useful, especially in debugging data structures.

Classes
-------

PrettyPrinter()
    Handle pretty-printing operations onto a stream using a configured
    set of formatting parameters.

Functions
---------

pformat()
    Format a Python object into a pretty-printed representation.

pprint()
    Pretty-print a Python object to a stream [default is sys.stdout].

saferepr()
    Generate a 'standard' repr()-like value, but protect against recursive
    data structures.

N)StringIO)pprintpformat
isreadableisrecursivesaferepr
PrettyPrinterppFTcompact
sort_dictsunderscore_numbersc	Jt|||||||}|j|y)zAPretty-print a Python object to a stream [default is sys.stdout].)streamindentwidthdepthrr
rN)r	r)	objectrrrrrr
rprinters	         :/BuggyBox/python/3.12.0/bootstrap/lib/python3.12/pprint.pyrr0s-fEJ-/GNN6cBt||||||j|S)z<Format a Python object into a pretty-printed representation.)rrrrr
r)r	r)rrrrrr
rs       rrr9s*e5!(Z,>@@GPr)r
c&t|g|d|i|y)zPretty-print a Python objectr
N)r)rr
argskwargss    rr
r
@s
6:D:Z:6:rc@tj|idddS)z=Version of repr() which can handle recursive data structures.Nrr	
_safe_reprrs rrrD ?%%fb$:1==rc@tj|idddS)z4Determine if saferepr(object) is readable by eval().Nrrrs rrrHr rc@tj|idddS)z8Determine if object requires a recursive representation.Nrrrs rrrLr rc"eZdZdZdgZdZdZy)	_safe_keyaUHelper function for key functions when sorting unorderable objects.

    The wrapped-object will fallback to a Py2.x style comparison for
    unorderable types (sorting first comparing the type name and then by
    the obj ids).  Does not work recursively, so dict.items() must have
    _safe_key applied to both the key and the value.

    objc||_yN)r')selfr's  r__init__z_safe_key.__init__\s	rc"	|j|jkS#t$rjtt|jt	|jftt|jt	|jfkcYSwxYwr))r'	TypeErrorstrtypeid)r*others  r__lt__z_safe_key.__lt___sm	;88eii''	;dhh("TXX,7eii)2eii=9:
;	;sA0B
BN)__name__
__module____qualname____doc__	__slots__r+r2rrr&r&PsI;rr&c:t|dt|dfS)z&Helper function for comparing 2-tuplesrr")r&)ts r_safe_tupler;fsQqT?IadO++rceZdZd#dddddZdZdZdZd	Zd
ZdZ	iZ
dZee
ej<d
Zee
ej j<dZee
ej<dZee
ej<dZee
ej<ee
ej<dZee
ej<dZee
ej<dZee
ej<dZee
ej@j<dZ!e!e
ejDj<dZ#dZ$dZ%dZ&dZ'dZ(e(e
ejRj<dZ*e*e
ejVj<dZ,e,e
ejZj<dZ.e.e
ej^j<dZ0e0e
ejbj<d Z2e2e
ejfj<d!Z4e4e
ejjj<d"Z6y)$r	NFTrc2t|}t|}|dkrtd||dkrtd|std||_||_||_|||_ntj|_t||_	||_
||_y)aHandle pretty printing operations onto a stream using a set of
        configured parameters.

        indent
            Number of spaces to indent for each level of nesting.

        width
            Attempted maximum number of columns in the output.

        depth
            The maximum depth to print out nested structures.

        stream
            The desired output stream.  If omitted (or false), the standard
            output stream available at construction will be used.

        compact
            If true, several items will be combined in one line.

        sort_dicts
            If true, dict keys are sorted.

        rzindent must be >= 0Nzdepth must be > 0zwidth must be != 0)int
ValueError_depth_indent_per_level_width_stream_sysstdoutbool_compact_sort_dicts_underscore_numbers)r*rrrrrr
rs        rr+zPrettyPrinter.__init__ks2VE
A:233!011122!'!DL;;DLW

%#5 rc|j<|j||jddid|jjdyy)Nr
)rC_formatwriter*rs  rrzPrettyPrinter.pprints=<<#LLq!R;LLt$$rcbt}|j||ddid|jSNr)	_StringIOrLgetvalue)r*rsios   rrzPrettyPrinter.pformats+kVS!QA.||~rc0|j|idddS)Nrr$formatrNs  rrzPrettyPrinter.isrecursives{{62q!,Q//rc@|j|idd\}}}|xr|SrPrU)r*rsreadable	recursives     rrzPrettyPrinter.isreadables*!%VRA!>8Y)	M)rc
t|}||vr)|jt|d|_d|_y|j|||}|j|z
|z
}	t||	kDr|jjt|jd}
|
d||<|
|||||||dz||=ytj|rt|tsp|jj rZt#|jdrDd|jj$j&vr"d||<|j)||||||dz||=y|j|y)NTFr"__wrapped__
__create_fn__)r0rM
_recursion
_recursive	_readable_reprrBlen	_dispatchgetr/__repr___dataclassesis_dataclass
isinstance__dataclass_params__reprhasattrr\r5_pprint_dataclass)r*rrr	allowancecontextlevelobjidrep	max_widthps           rrLzPrettyPrinter._formatsA6
GLLF+,"DO"DNjj%0KK&(94	s8i""4<#8#8$?A}!"$	7EAINEN++F3 .--22&//=9!V__%@%@%M%MM!"&&vvvy'SX[\S\]ENSrcp|jj}|t|dzz
}tj|Dcgc]1}|j
s|jt||jf3}	}|j|dz|j|	||||||jdycc}w)Nr"())
	__class__r3rbrffieldsrjnamegetattrrM_format_namespace_items)
r*rrrrmrnrocls_namefitemss
          rrlzPrettyPrinter._pprint_dataclasss##,,#h-!##<H<O<OPV<Wbq[\[a[a!&&'&!&&12bbX^$$$UFFIwPUVScsB3$B3cN|j}|d|jdkDr||jdz
dzt|}|rU|jr t	|jt}	n|j}	|j|	|||dz|||dy)N{r" key})rMrArbrHsortedr~r;_format_dict_items)
r*rrrrmrnrorMlengthr~s
          r_pprint_dictzPrettyPrinter._pprint_dicts
c
!!A%4))A-45Vv||~;?##E669q=$+U
4
c
rcXt|s|jt|y|j}|j|jdz|jt
|j||t|jzdz|dz|||jdy)Nrur"rv)rbrMrjrwr3rLlistr~)r*rrrrmrnroclss        r_pprint_ordered_dictz"PrettyPrinter._pprint_ordered_dicts6{LLf&S\\C'(T&,,.)6c#,,//!3Y]e	%	Srcz|jd|j||||dz|||jdy)N[r"])rM
_format_itemsr*rrrrmrnros       r_pprint_listzPrettyPrinter._pprint_lists9S6669q="E	+Src	|jdt|dk(rdnd}|j||||t|z|||j|y)Nrur"z,)rv)rMrbr)r*rrrrmrnroendchars        r
_pprint_tuplezPrettyPrinter._pprint_tuplesPSf+*$6669s7|3K"E	+Wrc	t|s|jt|y|j}|tur|jdd}n;|j|j
dzd}|t|j
dzz
}t
|t}|j||||t|z|||j|y)Nrr({})r"r)	rbrMrjrwsetr3rr&r)	r*rrrrmrnrotyprs	         r_pprint_setzPrettyPrinter._pprint_sets6{LLf&#:LLGLL,-Gc#,,'!++FI.6669s7|3K"E	+Wrc|j}t|s|t|yg}|jd}	|dk(r
|dz
}|dz
}|j|z
x}
}t|	D]\}}
t|
}|t|	dz
k(r|
|z}
t||
kr|j
|Htjd|
}|j|}d}t|D]i\}}||z}|t|dz
k(r|t|	dz
k(r||z}tt||kDr|r|j
t||}h|}k|s|j
t|t|dk(r	|y|dk(r|dt|D] \}}|dkDr|dd|zz||"|dk(r	|d	yy)
NTr"z\S*\s*rurrKrrv)
rMrbrj
splitlinesrB	enumerateappendrefindallpop)r*rrrrmrnrorMchunkslines
max_width1rrilinerqparts
max_width2currentjpart	candidates                     r_pprint_strzPrettyPrinter._pprint_strs6{$v,!!$'A:aKFNI!%v!55
Y '	1GAtt*CCJN"i'
3x:%

c"

9d3		&
(/	,GAt '$ICJN*qCJN/B"i/
4	?+j8""MM$w-8"&"+	,MM$w-03	14v;!#JA:#J'	FAs1udSZ'(#J	A:#Jrc|j}t|dkr|t|y|dk(}|r|dz
}|dz
}|dd}	t||j|z
|D]}
||	||
|	rdd|zz}	|r	|dyy)Nr"rurrKrrv)rMrbrj_wrap_bytes_reprrB)r*rrrrmrnrorMparensdelimrqs           r
_pprint_byteszPrettyPrinter._pprint_bytesDsv;!$v,!aKFNI#J#FDKK&,@)L	*C%L#Js6z)		*
#Jrc	|j}|d|jt|||dz|dz||dz|dy)Nz
bytearray(
r"rv)rMrbytes)r*rrrrmrnrorMs        r_pprint_bytearrayzPrettyPrinter._pprint_bytearrayYsE
l5=&&2+$q='519	>
c
rc|jd|j|j||dz|dz|||jdy)Nz
mappingproxy(
r"rv)rMrLcopyrs       r_pprint_mappingproxyz"PrettyPrinter._pprint_mappingproxybsA_%V[[]FFRKQe	%Src8t|tjurd}n|jj}|t|dzz
}|jj}|j|dz|j|||||||jdy)N	namespacer"rurv)
r/_typesSimpleNamespacerwr3rb__dict__r~rMr{)	r*rrrrmrnror|r~s	         r_pprint_simplenamespacez%PrettyPrinter._pprint_simplenamespacejs<6111#H''00H#h-!##%%'X^$$$UFFIwPUVSrc	J|j}||jz
}dd|zz}t|dz
}	t|D]d\}
\}}|
|	k(}
|j	|||}|||d|j|||t|zdz|
r|nd|||
r]||fy)N,
rr": r$)rMrArbrrarL)r*r~rrrmrnrorMdelimnl
last_indexrrentlastrqs               rrz PrettyPrinter._format_dict_itemsys$(((#,&Z!^
&u-		MAzS
?D**S'51C#J$KLLffs3x&7!&;&* %
)g		rc	2|j}dd|zz}t|dz
}	t|D]g\}
\}}|
|	k(}
|||dt||vr	|dn)|j	|||t|zdz|
r|nd|||
r`||iy)Nrrr"=...)rMrbrr0rL)r*r~rrrmrnrorMrrrrrrs              rr{z%PrettyPrinter._format_namespace_itemss#,&Z!^
&u-
	MAzS
?D#J#J#w'!eS&&3s8*;a*?*.YA$e-g
	rcd|j}||jz
}|jdkDr||jdz
dzdd|zz}d}	|j|z
dzx}
}t|}	t	|}
d}|s|
}	t	|}
|jrI|j|||}t|dz}|
|kr|}
|	r|}	|
|k\r|
|z}
||	d}	||e||	|}	|j||||r|nd|||syy#t
$rYywxYw#t
$rd}||z}|
|z}
YwxYw)	Nr"rrrFTr$, )
rMrArBiternext
StopIterationrGrarbrL)r*r~rrrmrnrorMrrrrritnext_entrrrqws                  rrzPrettyPrinter._format_itemssn$(((!!A%4))A-45#,& KK&0144	
%[	BxHC
#8
}}jjgu5HqL19%E 'A:QJE%L E#J%LELLff&* %
)/		!
#Y&	"
#s$-D?D	DDD/.D/c|j||j|j|\}}}|sd|_|rd|_|S)NFT)rVrr@r`r_)r*rrnrorjrYrZs       rrazPrettyPrinter._reprsD$(KK04U%D!h	"DN"DOrc*|j||||S)zFormat object for a specific context, returning a string
        and flags indicating whether the representation is 'readable'
        and whether the object represents a recursive construct.
        )r)r*rrn	maxlevelsros     rrVzPrettyPrinter.formats
vw	5AArcxt|s|jt|y|j|j||}|j
}|t|jdzz
}|j|jd|dd|z|j||||dz|||jdy)Nr"rurrrv)rbrMrjradefault_factoryrwr3r)	r*rrrrmrnrordfrs	         r_pprint_default_dictz"PrettyPrinter._pprint_default_dicts6{LLf&jj//%@#cll#a''S\\3fEF&&&)a-%PSrct|s|jt|y|j}|j|jdz|j
dkDr!|j|j
dz
dz|j
}|j|||t|jzdz|dz|||jdy)Nrr"rr$r)rbrMrjrwr3rAmost_commonr)	r*rrrrmrnrorr~s	         r_pprint_counterzPrettyPrinter._pprint_counters6{LLf&S\\D()!!A%LL$0014;<""$v &S\\): :Q >	A
 '	0	Trc	t|js|jt|y|j}|j|j
dz|t|j
dzz
}t
|jD]x\}}	|t|jdz
k(r+|j|	|||dz|||jdL|j|	||d|||jdd|zzzy)Nrur"rvrr)rbmapsrMrjrwr3rrL)
r*rrrrmrnrorrms
          r_pprint_chain_mapzPrettyPrinter._pprint_chain_maps6;;LLf&S\\C'(#cll#a''fkk*	3DAqC$q((Q	A
wNS!Q7EBUS6\12
	3rct|s|jt|y|j}|j|jdz|t|jdzz
}|jd|j
+|j
||||dz|||jdy|j
|||d|||j|j
||}|jdd|zd|d	y)
Nrur"rr$z])z],
rzmaxlen=rv)rbrMrjrwr3maxlenrra)	r*rrrrmrnrorrmls	         r
_pprint_dequezPrettyPrinter._pprint_deques6{LLf&S\\C'(#cll#a''S== vvvy1}&
/LLvvvq&
/**V]]GU;CLLsV|SABrc	J|j|j|||||dz
yNr"rLdatars       r_pprint_user_dictzPrettyPrinter._pprint_user_dict V[[&&)WeaiPrc	J|j|j|||||dz
yrrrs       r_pprint_user_listzPrettyPrinter._pprint_user_listrrc	J|j|j|||||dz
yrrrs       r_pprint_user_stringz!PrettyPrinter._pprint_user_string"rrcjt|}|tvrt|ddfSt|dd}t	|t
r3|t
jur!|jr|dddfSt|ddfSt	|tr
|tjur|syt|}|r||k\rdd||vfS||vrt|ddfSd||<d}d}	g}
|
j}|dz
}|jr t|jt}n|j}|D]S\}
}|j!|
|||\}}}|j!||||\}}}||d	||xr|xr|}|s|sRd}	U||=d
dj#|
z||	fSt	|t$r|t$jus"t	|t&r|t&jurt	|t$r|syd
}nt)|dk(rd}n|syd}t|}|r||k\r
|dzd||vfS||vrt|ddfSd||<d}d}	g}
|
j}|dz
}|D]+}|j!||||\}}}|||sd}|s*d}	-||=|dj#|
z||	fSt|}||xr|j+ddfS)NTFre_d)z{}TFz{...}r"rrz{%s}r)z[]TFz[%s]z(%s,))z()TFz(%s)r<)r/_builtin_scalarsrjrz
issubclassr>rerIdictr0r^rrHrr~r;rVjoinrtuplerb
startswith)r*rrnrrorrrprYrZ
componentsrr~kvkrepr	kreadablekrecurvrepr	vreadablevrecurrVoorepr	oreadableorecurrqs                           rrzPrettyPrinter._safe_repr's6l""<u,,CT*c3A$5'' tU22F|T500c4 Q$--%7(vJEUi/u'777!&)5$66GENHIJ&&FQJEv||~;?
%1+/;;w	5,2(y&+/;;w	5,2(y&5%01#?	?iV $I
%DIIj118YFFsD!a4==&8sE"qENN':#t$,V! ,vJEUi/~uew.>>>!&)5$66GENHIJ&&FQJE
%+/;;w	5,2(y&u
 $H $I
%DIIj118YFF6lS4!44u<<r)r"PNN)7r3r4r5r+rrrrrLrlrcrrrer_collectionsOrderedDictrrrrrr	frozensetrr.rrr	bytearrayrrMappingProxyTyperrrr{rrarVrdefaultdictrCounterrChainMaprdequerUserDictrUserListr
UserStringrr8rrr	r	js.*64E*6X%

0*8I
 ,Idmm	4HIl&&//0 ,Idmm!.Ienn"*Icll$/Ii  !/b*Icll&!.Ienn%6Ii  !3GIf%%../2IIf$$--."&')RB	4HIl&&//00?Il""++,
31BIl##,,-C$.;Il  ))*Q1BIl##,,-Q1BIl##,,-Q3FIl%%../O=rr	cLdt|jdt|dS)Nz<Recursion on z	 with id=>)r/r3r0rs rr^r^{sF|$$bj
23rc#Kd}t|dzdz}tdt|dD]D}|||dz}||z}||k(r||z}tt||kDr|r
t||}C|}F|rt|yyw)Nrrr)rbrangerj)rrrmrrrrrs        rrrsGv;!aD
1c&k1
%
 a1~dN	9YEtI%'7m#GG
 7msBB)Nr"r	N)r"r	N)"r6collectionsr
dataclassesrfrsysrDtypesriorrQ__all__rrr
rrrr&r;r	rr.rr
floatcomplexrFr/rr^rr8rr<module>r"s4#"	$"TePduP"';>>>;;,,L=L=\c5)UG"DJ013
r