QfxdZgdZddlZddlmZddlmZd dZGddZd Z eZ e jZ y) zGRedo the builtin repr() (representation) but with limits on most sizes.)Reprreprrecursive_reprN)islice) get_identcfd}|S)zGDecorator to make a repr function return fillvalue for a recursive callctfd}td|_td|_td|_td|_tdi|_tdd|_|S) Nct|tf}|vrSj| |}j||S#j|wxYwN)idradddiscard)selfkeyresult fillvalue repr_running user_functions ./opt/alt/python312/lib64/python3.12/reprlib.pywrapperz.decorating_function..wrapperscT(IK'Cl"    S ! *&t,$$S)M$$S)s A A __module____doc____name__ __qualname____annotations____type_params__)setgetattrrrrrrr)rrrrs` @rdecorating_functionz+recursive_repr..decorating_function suu  %]LA!-;"=*=&}nE")-9JB"O")-9JB"Or)rr s` rrr s. r!ceZdZdddddddddddddd d Zd Zd Zd Zdd ZdZdZ dZ dZ dZ dZ dZdZdZdZy)r(...N maxlevelmaxtuplemaxlistmaxarraymaxdictmaxset maxfrozensetmaxdeque maxstringmaxlongmaxotherrindentc ||_||_||_||_||_||_||_||_| |_| |_ | |_ | |_ | |_ yr r))rr*r+r,r-r.r/r0r1r2r3r4rr5s r__init__z Repr.__init__'s` !        (  "   " r!c:|j||jSr )repr1r*)rxs rrz Repr.repr:szz!T]]++r!ct|j}d|vr!|j}dj|}t |d|zrt |d|z||S|j ||S)N _repr_)typersplitjoinhasattrr repr_instance)rr:leveltypenamepartss rr9z Repr.repr1=sn7## (?NN$ExxH 48+ ,4748!34Q> >%%a/ /r!c|jdj|S|sy|j}t|tr|dkrt d|d|dz} d|j |z dz|zz}|jdg|ddt| xsdS#t $r}t d t||d}~wwxYw) Nz, rz(Repr.indent cannot be negative int (was )r<z, z,Repr.indent must be a str, int or None, not ) r5rA isinstanceint ValueErrorr* TypeErrorr?len)rpiecesrDr5seperrors r_joinz Repr._joinGs ;; 99V$ $ fc "z >vjJ cMF 4==5014>>C xx)f)b)*1c&k\-ATBB  >tF|nM  sB B= B88B=cPt|}|dkr|r |j}n{|dz } |j} t||D cgc] } | | |  } } ||kDr| j |j|j | |}|dk(r|r|j ||z}|||Scc} w)NrrJ)rOrr9rappendrSr5) rr:rDleftrightmaxitertrailnsnewlevelr9elemrPs r_repr_iterablezRepr._repr_iterable[s F A:!AqyHJJE8>q'8JK8JeD(+8JFK7{ dnn- 65)AAv%DKK$7 E** LsB#cB|j||dd|jdS)N(rI,)r^r+rr:rDs r repr_tuplezRepr.repr_tuplejs!""1eS#t}}cJJr!c@|j||dd|jS)N[])r^r,rbs r repr_listzRepr.repr_listms""1eS#t||DDr!c|sd|jzSd|jz}|j|||d|jS)Nz array('%s')z array('%s', []))typecoder^r-)rr:rDheaders r repr_arrayzRepr.repr_arrayps? 1::- - 1::-""1eVT4==IIr!c\|syt|}|j||dd|jS)Nzset(){})_possibly_sortedr^r/rbs rrepr_setz Repr.repr_setvs/ Q ""1eS#t{{CCr!c\|syt|}|j||dd|jS)Nz frozenset()z frozenset({z}))rpr^r0rbs rrepr_frozensetzRepr.repr_frozenset|s6 Q ""1e]D#'#4#46 6r!c@|j||dd|jS)Nzdeque([ri)r^r1rbs r repr_dequezRepr.repr_deques""1eYdmmLLr!ct|}|dk(ry|dkrd|jzdzS|dz }|j}g}tt ||j D]-}|||}||||} |j |d| /||j kDr|j |j|j||} d| dS)Nrz{}rnrorJz: )rOrr9rrpr.rUrS) rr:rDrZr\r9rPrkeyreprvalreprr[s r repr_dictzRepr.repr_dicts F 6 A:'#- -19 *1-t||rr|r}) r~r Exception __class__rr rOr4rrrs rrCzRepr.repr_instances J a A q6DMM !A a!+,AAt}}Qq()A"1&3q6!895A  J)Q[[-A-A2a5,II I JsB -B=<B=)rH)rrrr7rr9rSr^rcrgrlrqrsruryrrrCrr!rrr%sraQq1BuT&,0C( +KEJ D 6M$ r!rcN t|S#t$rt|cYSwxYwr )sortedrlist)r:s rrprps)ay Aws $$)r() r__all__r~ itertoolsr_threadrrrrpaReprrrr!rrs?M ,8OOd  zzr!