add-determinism 0.7.3

RPM buildroot helper to strip nondeterministic bits in files
Documentation
a

Z��^s��@s�gd�ZddlmZddlmZddlmZddlmZddl	m
Z
dZdZeefd	d
�Z
eefdd�Zefd
d�Zefdd�Zefdd�Zefdd�Zefdd�Zefdd�Zefdd�Zefdd�Zefdd�Zefdd �Zefd!d"�Zefd#d$�Zd%efd&efd'efgd'efd(efd%efgd(efd'efd&efgd&efd%efd(efgd)�Zd*d+�Zd,d-�Zzdd.lmZWne �y�Yn0e!�Z"e"fd/d0�Z#zdd1lm#Z#Wne �y�Yn0Gd2d3�d3�Z$zdd4lm$Z$Wne �y�Yn0Gd5d6�d6e!�Z%d7d8�Z&ed9gd:��Z'Gd;d<�d<e(�Z)e!�fe*e+he,e-e.fd=d>�Z/dWdAdB�Z0dCdD�Z1zddElm1Z1Wne �yxYn0dFdG�Z2dHdI�Z3dXdKdL�Z4dMdN�Z5dOdP�Z6dQdR�Z7GdSdT�dT�Z8e!�Z9GdUdV�dV�Z:dJS)Y)�update_wrapper�wraps�WRAPPER_ASSIGNMENTS�WRAPPER_UPDATES�total_ordering�cache�
cmp_to_key�	lru_cache�reduce�partial�
partialmethod�singledispatch�singledispatchmethod�cached_property�)�get_cache_token)�
namedtuple)�recursive_repr)�RLock)�GenericAlias)�
__module__�__name__�__qualname__�__doc__�__annotations__)�__dict__c	Csd|D]2}zt||�}Wnty(Yq0t|||�q|D]}t||��t||i��q<||_|S�N)�getattr�AttributeError�setattr�update�__wrapped__)�wrapper�wrapped�assigned�updated�attr�value�r'�!/usr/lib64/python3.9/functools.pyr#srcCstt|||d�S)N�r"r#r$)r
rr)r'r'r(rAs�rcCs$|�|�}||ur|S|o"||kSr��__lt__��self�other�NotImplemented�	op_resultr'r'r(�_gt_from_ltYs
r1cCs"|�|�}||ur|S|p ||kSrr*r,r'r'r(�_le_from_lt`s
r2cCs|�|�}||ur|S|Srr*r,r'r'r(�_ge_from_ltgs
r3cCs$|�|�}||ur|S|p"||kSr��__le__r,r'r'r(�_ge_from_lens
r6cCs"|�|�}||ur|S|o ||kSrr4r,r'r'r(�_lt_from_leus
r7cCs|�|�}||ur|S|Srr4r,r'r'r(�_gt_from_le|s
r8cCs$|�|�}||ur|S|o"||kSr��__gt__r,r'r'r(�_lt_from_gt�s
r;cCs"|�|�}||ur|S|p ||kSrr9r,r'r'r(�_ge_from_gt�s
r<cCs|�|�}||ur|S|Srr9r,r'r'r(�_le_from_gt�s
r=cCs$|�|�}||ur|S|p"||kSr��__ge__r,r'r'r(�_le_from_ge�s
r@cCs"|�|�}||ur|S|o ||kSrr>r,r'r'r(�_gt_from_ge�s
rAcCs|�|�}||ur|S|Srr>r,r'r'r(�_lt_from_ge�s
rBr:r5r?r+)r+r5r:r?csV�fdd�tD�}|std��t|�}t|D]"\}}||vr.||_t�||�q.�S)Ncs(h|] }t�|d�tt|d�ur|�qSr)r�object)�.0�op��clsr'r(�	<setcomp>��z!total_ordering.<locals>.<setcomp>z6must define at least one ordering operation: < > <= >=)�_convert�
ValueError�maxrr)rG�roots�root�opname�opfuncr'rFr(r�srcsG�fdd�dt�}|S)NcsZeZdZdgZdd�Z�fdd�Z�fdd�Z�fdd	�Z�fd
d�Z�fdd
�Z	dZ
dS)zcmp_to_key.<locals>.K�objcSs
||_dSr�rQ)r-rQr'r'r(�__init__�szcmp_to_key.<locals>.K.__init__cs�|j|j�dkS�NrrR�r-r.��mycmpr'r(r+�szcmp_to_key.<locals>.K.__lt__cs�|j|j�dkSrTrRrUrVr'r(r:�szcmp_to_key.<locals>.K.__gt__cs�|j|j�dkSrTrRrUrVr'r(�__eq__�szcmp_to_key.<locals>.K.__eq__cs�|j|j�dkSrTrRrUrVr'r(r5�szcmp_to_key.<locals>.K.__le__cs�|j|j�dkSrTrRrUrVr'r(r?�szcmp_to_key.<locals>.K.__ge__N)rrr�	__slots__rSr+r:rXr5r?�__hash__r'rVr'r(�K�sr[)rC)rWr[r'rVr(r�sr)rcCsXt|�}|tur<zt|�}Wq@ty8td�d�Yq@0n|}|D]}|||�}qD|S)Nz0reduce() of empty sequence with no initial value)�iter�_initial_missing�next�
StopIteration�	TypeError)�functionZsequence�initial�itr&�elementr'r'r(r	�sr	)r	csFeZdZdZ�fdd�Zdd�Ze�dd��Zdd	�Zd
d�Z	�Z
S)r
)�func�args�keywordsr�__weakref__cs^t|�std��t|d�r8|j|}i|j�|�}|j}tt|��|�}||_||_||_|S)Nz#the first argument must be callablere)	�callabler`�hasattrrfrgre�superr
�__new__)rGrerfrgr-��	__class__r'r(rls

zpartial.__new__cOs*i|j�|�}|jg|j�|�Ri|��Sr�rgrerf)r-rfrgr'r'r(�__call__*szpartial.__call__cCs�t|�j}t|j�g}|�dd�|jD��|�dd�|j��D��t|�jdkrld|�dd�	|��d�S|�dd�	|��d�S)	Ncss|]}t|�VqdSr)�repr)rD�xr'r'r(�	<genexpr>2rIz#partial.__repr__.<locals>.<genexpr>css |]\}}|�d|��VqdS)�=Nr'�rD�k�vr'r'r(rs3rI�	functoolsz
functools.�(�, �))
�typerrqre�extendrfrg�itemsr�join)r-�qualnamerfr'r'r(�__repr__.s
zpartial.__repr__cCs*t|�|jf|j|j|jpd|jp$dffSr)r|rerfrgr�r-r'r'r(�
__reduce__8s�zpartial.__reduce__cCs�t|t�std��t|�dkr0tdt|�����|\}}}}t|�rrt|t�rr|dur`t|t�rr|durzt|t�sztd��t|�}|dur�i}nt|�tur�t|�}|dur�i}||_||_||_	||_
dS)Nz(argument to __setstate__ must be a tuple�zexpected 4 items in state, got zinvalid partial state)�
isinstance�tupler`�lenri�dictr|rrerfrg)r-�statererf�kwds�	namespacer'r'r(�__setstate__<s4
����zpartial.__setstate__)rrrrYrlrprr�r�r��
__classcell__r'r'rmr(r
s
	r
)r
c@sBeZdZdd�Zdd�Zdd�Zddd	�Zed
d��Ze	e
�ZdS)
rcOsft|�s t|d�s td�|���t|t�rP|j|_|j||_i|j�|�|_n||_||_||_dS)N�__get__z${!r} is not callable or a descriptor)	rirjr`�formatr�rrerfrg)r-rerfrgr'r'r(rSbs�
zpartialmethod.__init__cCsNd�tt|j��}d�dd�|j��D��}d}|j|jj|jj	|j
||d�S)Nrzcss|]\}}d�||�VqdS)z{}={!r}N)r�rur'r'r(rsws�z)partialmethod.__repr__.<locals>.<genexpr>z*{module}.{cls}({func}, {args}, {keywords}))�modulerGrerfrg)r�maprqrfrgr~r�rnrrre)r-rfrg�
format_stringr'r'r(r�us
�
�zpartialmethod.__repr__cs�fdd�}�j|_�|_|S)Ncs,i�j�|�}�j|g�j�|�Ri|��Srro)�cls_or_selfrfrgr�r'r(�_method�sz3partialmethod._make_unbound_method.<locals>._method)�__isabstractmethod__�_partialmethod)r-r�r'r�r(�_make_unbound_method�sz"partialmethod._make_unbound_methodNcCs�t|jdd�}d}|durh|||�}||jurht|g|j�Ri|j��}z|j|_WntyfYn0|dur�|���||�}|S)Nr�)	rrer
rfrg�__self__rr�r�)r-rQrG�get�result�new_funcr'r'r(r��s

zpartialmethod.__get__cCst|jdd�S�Nr�F�rrer�r'r'r(r��sz"partialmethod.__isabstractmethod__)N)rrrrSr�r�r��propertyr��classmethodr�__class_getitem__r'r'r'r(rZs

rcCst|t�r|j}q|Sr)r�r
re�rer'r'r(�_unwrap_partial�s
r��	CacheInfo)�hits�misses�maxsize�currsizec@s$eZdZdZefdd�Zdd�ZdS)�
_HashedSeq�	hashvaluecCs||dd�<||�|_dSr�r�)r-�tup�hashr'r'r(rS�sz_HashedSeq.__init__cCs|jSrr�r�r'r'r(rZ�sz_HashedSeq.__hash__N)rrrrYr�rSrZr'r'r'r(r��sr�c
s�|}|r&||7}|��D]}	||	7}q|rh||�fdd�|D��7}|r�||�fdd�|��D��7}n$||�dkr��|d�|vr�|dSt|�S)Nc3s|]}�|�VqdSrr'�rDrw�r|r'r(rs�rIz_make_key.<locals>.<genexpr>c3s|]}�|�VqdSrr'r�r�r'r(rs�rI�r)r~�valuesr�)
rfr��typed�kwd_mark�	fasttypesr�r|r��key�itemr'r�r(�	_make_key�s
 r��Fcs~t�t�r�dkrld�nTt��r\t�t�r\�d}�t|��t�}��fdd�|_t||�S�durltd����fdd�}|S)Nrr�cs
��d�S�N�r�r�r'r'r�r'r(�<lambda>�rIzlru_cache.<locals>.<lambda>z=Expected first argument to be an integer, a callable, or Nonecs(t|��t�}��fdd�|_t||�S)Ncs
��d�Sr�r'r'r�r'r(r�rIz8lru_cache.<locals>.decorating_function.<locals>.<lambda>)�_lru_cache_wrapper�
_CacheInfo�cache_parametersr)�
user_functionr!r�r'r(�decorating_functionsz&lru_cache.<locals>.decorating_function)	r��intri�boolr�r�r�rr`)r�r�r�r!r�r'r�r(r�s


�rcs�t��t�d\����i�d�	�
d��j��j�t��
g���ddg�dd�<�dkrh�
�fdd�}nN�dur����	��
���fdd�}n*���������	�
���
���fdd�}���	�
��
fdd	�}���	�
�
�fd
d�}||_||_|S)N)rr���rFcs�d7��|i|��}|S�Nr�r')rfr�r�)r�r�r'r(r!sz#_lru_cache_wrapper.<locals>.wrappercsL�||��}�|��}|�ur*�d7�|S�d7��|i|��}|�|<|Sr�r')rfr�r�r�)r�	cache_getr��make_keyr��sentinelr�r�r'r(r!&s
csp�
||��}�	���|�}|dur�|\}}}}||�<||�<�
�}||�<�
�<||�<�
|�<�d7�|Wd�S�d7�Wd�n1s�0Y�|i|��}�	��|�vr�n���r�
}	||	�<||	�<|	��
�
�}
�
�}d�
�<�
�<�|
=|	�|<n6�
�}|�
||g}||�<�
�<�|<���k�Wd�n1�sb0Y|Sr�r')rfr�r��linkZ	link_prevZ	link_next�_keyr�ZlastZoldrootZoldkeyZ	oldresult)�KEY�NEXT�PREV�RESULTrr��	cache_len�fullr��lockr�r�r�rNr�r�r'r(r!5sB&
*cs8�� �������Wd�S1s*0YdSrr'r')r�r�r�r�r�r�r'r(�
cache_infonsz&_lru_cache_wrapper.<locals>.cache_infocsP��8�����ddg�dd�<d��d�Wd�n1sB0YdS)NrF)�clearr')rr�r�r�r�rNr'r(�cache_clearss
z'_lru_cache_wrapper.<locals>.cache_clear)rCr�r��__len__rr�r�)r�r�r�r�r!r�r�r')r�r�r�r�r�rr�r�r�r�r�r�r�r�rNr�r�r�r(r�s**9	r�)r�cCstdd�|�S)N)r�)r)r�r'r'r(r�srcCs�g}dd�|D�}|s|S|D]2}|d}|D]}||dd�vr.d}qq.qRq|durbtd��|�|�|D]}|d|krp|d=qpqdS)NcSsg|]}|r|�qSr'r'�rD�sr'r'r(�
<listcomp>�rIz_c3_merge.<locals>.<listcomp>rr�zInconsistent hierarchy)�RuntimeError�append)�	sequencesr��s1�	candidate�s2�seqr'r'r(�	_c3_merge�s"
r�Nc
stt|j��D]$\}�t�d�rt|j�|}q8qd}�rDt��ng�t|jd|��}g}t|j|d��}�D]0�t|��rtt�fdd�|jD��st|���qt|D]���	��q��fdd�|D�}�fdd�|D�}�fdd�|D�}	t
|gg|||	|g|g|g�S)	N�__abstractmethods__rc3s|]}t|��VqdSr)�
issubclass)rD�b)�baser'r(rs�sz_c3_mro.<locals>.<genexpr>csg|]}t|�d��qS���abcs��_c3_mro�rDr�r�r'r(r��rIz_c3_mro.<locals>.<listcomp>csg|]}t|�d��qSr�r�r�r�r'r(r��rIcsg|]}t|�d��qSr�r�r�r�r'r(r��rI)�	enumerate�reversed�	__bases__rjr��listr��anyr��remover�)
rGr��i�boundary�explicit_bases�abstract_bases�other_bases�explicit_c3_mros�abstract_c3_mros�
other_c3_mrosr')r�r�r(r��sD
��������r�cs�t�j����fdd���fdd��D���fdd���fdd��D��t���g}�D]�}g}|��D]0}|�vrht�|�rh|��fdd�|jD��qh|s�|�|�qX|jtd	d
�|D] }|D]}||vr�|�|�q�q�qXt�|d�S)Ncs|�vot|d�ot�|�S)N�__mro__)rjr�)�typ)�basesrGr'r(�
is_related�s�z _compose_mro.<locals>.is_relatedcsg|]}�|�r|�qSr'r'�rD�n)r�r'r(r��rIz _compose_mro.<locals>.<listcomp>cs&�D]}||kr||jvrdSqdS)NTF)r�)r�r.)�typesr'r(�is_strict_base�sz$_compose_mro.<locals>.is_strict_basecsg|]}�|�s|�qSr'r'r�)r�r'r(r��rIcsg|]}|�vr|�qSr'r'r�)�type_setr'r(r��rIT)r��reverser�)�setr��__subclasses__r�r��sortr�r�)rGr��mror��found�sub�subclsr')r�rGr�r�rr�r(�_compose_mro�s*

r	cCstt||���}d}|D]R}|dur\||vrX||jvrX||jvrXt||�sXtd�||���qj||vr|}q|�|�S)NzAmbiguous dispatch: {} or {})r	�keysr�r�r�r�r�)rG�registryr�match�tr'r'r(�
_find_impls 
���rcs�ddl}ddl}i�|���d����fdd��d
����fdd�	���fdd�}t|dd	��|�t<�|_�|_|���|_�j	|_
t||�|S)Nrcsx�dur"t�}�|kr"���|�z�|}WnDtyrz�|}Wntydt|��}Yn0|�|<Yn0|Sr)rr��KeyErrorr)rG�
current_token�impl)�cache_token�dispatch_cacherr'r(�dispatch0sz singledispatch.<locals>.dispatchcs�|dur�t�t�r ��fdd�St�di�}|s@td��d����}ddlm}tt||�����\}�t�t�s�td|�d	��d
���|��<�dur�t	�d�r�t
�����|S)Ncs
��|�Srr')�f)rG�registerr'r(r�PrIz2singledispatch.<locals>.register.<locals>.<lambda>rz(Invalid first argument to `register()`: zS. Use either `@register(some_class)` or plain `@register` on an annotated function.r)�get_type_hintszInvalid annotation for z. z is not a class.r�)r�r|rr`�typingrr^r\r~rjrr�)rGre�annr�argname)rrrrrFr(rGs4
��
���z singledispatch.<locals>.registercs*|st��d����|dj�|i|��S)Nz( requires at least 1 positional argumentr)r`rn)rf�kw)r�funcnamer'r(r!hs
�
zsingledispatch.<locals>.wrapperrzsingledispatch function)N)r��weakref�WeakKeyDictionaryrrCrr�MappingProxyTyperr��_clear_cacher)rer�rr!r')rrrrrrr(rs!
rc@s4eZdZdd�Zd
dd�Zddd�Zedd	��ZdS)r
cCs4t|�s t|d�s t|�d���t|�|_||_dS)Nr�z  is not callable or a descriptor)rirjr`r�
dispatcherre�r-rer'r'r(rS�s
zsingledispatchmethod.__init__NcCs|jj||d�S)Nr�)r!r)r-rG�methodr'r'r(r�szsingledispatchmethod.registercs0���fdd�}�j|_�j|_t|�j�|S)Ncs(�j�|dj�}|����|i|��SrT)r!rrnr�)rf�kwargsr#�rGrQr-r'r(r��sz-singledispatchmethod.__get__.<locals>._method)r�rrre)r-rQrGr�r'r%r(r��s
zsingledispatchmethod.__get__cCst|jdd�Sr�r�r�r'r'r(r��sz)singledispatchmethod.__isabstractmethod__)N)N)rrrrSrr�r�r�r'r'r'r(r
zs



r
c@s.eZdZdd�Zdd�Zddd�Zee�ZdS)	rcCs ||_d|_|j|_t�|_dSr)re�attrnamerrr�r"r'r'r(rS�szcached_property.__init__cCs8|jdur||_n"||jkr4td|j�d|�d���dS)Nz?Cannot assign the same cached_property to two different names (z and z).)r&r`)r-�owner�namer'r'r(�__set_name__�s

���zcached_property.__set_name__Nc	Cs|dur|S|jdurtd��z
|j}Wn6ty^dt|�j�d|j�d�}t|�d�Yn0|�|jt�}|tu�r|j�v|�|jt�}|tur�|�	|�}z|||j<Wn6ty�dt|�j�d|j�d�}t|�d�Yn0Wd�n1s�0Y|S)NzGCannot use cached_property instance without calling __set_name__ on it.zNo '__dict__' attribute on z instance to cache z
 property.zThe '__dict__' attribute on z7 instance does not support item assignment for caching )
r&r`rrr|rr��
_NOT_FOUNDr�re)r-�instancer'r�msg�valr'r'r(r��sB
�
���

���.zcached_property.__get__)N)	rrrrSr)r�r�rr�r'r'r'r(r�s	
r)r�F)N);�__all__�abcr�collectionsr�reprlibr�_threadrr�rrrrrr/r1r2r3r6r7r8r;r<r=r@rArBrJrr�
_functools�ImportErrorrCr]r	r
rr�r�r�r�r��strr�r|r�r�rr�rr�r�r	rrr
r*rr'r'r'r(�<module>s�
�
�
�����AJ	�

.t	
-)\(