o b¦æc“ã@s\dZgd¢ZddlZddlmZddlmZd dd„ZGd d „d ƒZd d „Z eƒZ e j Z dS)zGRedo the builtin repr() (representation) but with limits on most sizes.)ÚReprÚreprÚrecursive_repréN)Úislice)Ú get_identú...cs‡fdd„}|S)zGDecorator to make a repr function return fillvalue for a recursive callcsXtƒ‰‡‡‡fdd„}tˆdƒ|_tˆdƒ|_tˆdƒ|_tˆdƒ|_tˆdiƒ|_|S)Nc sJt|ƒtƒf}|ˆvr ˆSˆ |¡z ˆ|ƒ}Wˆ |¡|Sˆ |¡w©N)ÚidrÚaddÚdiscard)ÚselfÚkeyÚresult)Ú fillvalueÚ repr_runningÚ user_function©úh/home/lily/lilypond-2.24.1/release/binaries/dependencies/install/Python-3.10.8/lib/python3.10/reprlib.pyÚwrappers    ÿz.decorating_function..wrapperÚ __module__Ú__doc__Ú__name__Ú __qualname__Ú__annotations__)ÚsetÚgetattrrrrrr)rr©r)rrrÚdecorating_function s   z+recursive_repr..decorating_functionr)rrrrrr s rc@s~eZdZdd„Zdd„Zdd„Zddd „Zd d „Zd d „Zdd„Z dd„Z dd„Z dd„Z dd„Z dd„Zdd„Zdd„ZdS) rcCsFd|_d|_d|_d|_d|_d|_d|_d|_d|_d|_ d|_ dS)Nééééé() ÚmaxlevelÚmaxtupleÚmaxlistÚmaxarrayÚmaxdictÚmaxsetÚ maxfrozensetÚmaxdequeÚ maxstringÚmaxlongÚmaxother)r rrrÚ__init__&s z Repr.__init__cCs| ||j¡Sr)Úrepr1r#)r Úxrrrr3sz Repr.reprcCsRt|ƒj}d|vr| ¡}d |¡}t|d|ƒr#t|d|ƒ||ƒS| ||¡S)Nú Ú_Zrepr_)ÚtyperÚsplitÚjoinÚhasattrrÚ repr_instance)r r0ÚlevelÚtypenameÚpartsrrrr/6s   z Repr.repr1Úc s€t|ƒ}|dkr |r d}n,|d‰|j‰‡‡fdd„t||ƒDƒ} ||kr*|  d¡d | ¡}|dkr9|r9||}d|||fS)Nrrécsg|]}ˆ|ˆƒ‘qSrr)Ú.0Úelem©Únewlevelr/rrÚ Gsz'Repr._repr_iterable..ú, z%s%s%s)Úlenr/rÚappendr5) r r0r8ÚleftÚrightZmaxiterZtrailÚnÚsÚpiecesrr?rÚ_repr_iterable@s  zRepr._repr_iterablecCs| ||dd|jd¡S)Nú(ú)ú,)rJr$©r r0r8rrrÚ repr_tupleMszRepr.repr_tuplecCó| ||dd|j¡S)Nú[ú])rJr%rNrrrÚ repr_listPózRepr.repr_listcCs,|sd|jSd|j}| |||d|j¡S)Nz array('%s')z array('%s', [ú]))ZtypecoderJr&)r r0r8ZheaderrrrÚ repr_arraySs  zRepr.repr_arraycCó$|sdSt|ƒ}| ||dd|j¡S)Nzset()ú{ú})Ú_possibly_sortedrJr(rNrrrÚrepr_setYsz Repr.repr_setcCrW)Nz frozenset()z frozenset({z}))rZrJr)rNrrrÚrepr_frozenset_s  ÿzRepr.repr_frozensetcCrP)Nzdeque([rU)rJr*rNrrrÚ repr_dequefrTzRepr.repr_dequec Csšt|ƒ}|dkr dS|dkrdS|d}|j}g}tt|ƒ|jƒD]}|||ƒ}||||ƒ} | d|| f¡q!||jkrC| d¡d |¡} d| fS) Nrz{}z{...}r<z%s: %srrBz{%s})rCr/rrZr'rDr5) r r0r8rGr@r/rIr ZkeyreprZvalreprrHrrrÚ repr_dictis     zRepr.repr_dictcCs˜t |d|j…¡}t|ƒ|jkrJtd|jddƒ}td|jd|ƒ}t |d|…|t|ƒ|d…¡}|d|…d|t|ƒ|d…}|S©Nréér)Úbuiltinsrr+rCÚmax©r r0r8rHÚiÚjrrrÚrepr_strxs&$z Repr.repr_strcCsht |¡}t|ƒ|jkr2td|jddƒ}td|jd|ƒ}|d|…d|t|ƒ|d…}|Sr_)rbrrCr,rcrdrrrÚrepr_ints $z Repr.repr_intcCs”zt |¡}Wntyd|jjt|ƒfYSwt|ƒ|jkrHtd|jddƒ}td|jd|ƒ}|d|…d|t|ƒ|d…}|S)Nz<%s instance at %#x>rr`rar) rbrÚ ExceptionÚ __class__rr rCr-rcrdrrrr7‰s ÿ$zRepr.repr_instanceN)r;)rrrr.rr/rJrOrSrVr[r\r]r^rgrhr7rrrrr$s    rcCs&zt|ƒWStyt|ƒYSwr)ÚsortedriÚlist)r0rrrrZ—s    ÿrZ)r) rÚ__all__rbÚ itertoolsrÚ_threadrrrrZZaReprrrrrrÚs   s