+
                                ^ RI t ^ RIHtHt ^ RIHt ^ RIt^RIHtH	t	H
t
  ! R R4      t ! R R4      t]P                  ! R	]R
7      t ! R R]]P                  ],          4      t]P                  ! R]	R
7      t ! R R]],          4      tR# )    N)ABCabstractmethodIterable)PolicyObjectPolicySymbolSELinuxPolicyc                      a  ] tR t^t o RtV 3R lR lt]R 4       t]P                  R 4       t]R 4       t	]	P                  R 4       t	V 3R lR	 lt
]V 3R
 lR l4       t]RR l4       tRtV tR# )
Differencez&Base class for all policy differences.c                *   < V ^8  d   QhRS[ RS[ RR/# )   left_policyright_policyreturnN)r	   )format__classdict__s   ">/usr/lib64/python3.14/site-packages/setools/diff/difference.py__annotate__Difference.__annotate__   s#     ) )M ) )SW )    c                \    \         P                  ! \        4      V n        Wn        W n        R # N)logging	getLogger__name__logr   r   )selfr   r   s   &&&r   __init__Difference.__init__   s     $$X.&(r   c                    V P                   # r   )_left_policyr   s   &r   r   Difference.left_policy   s       r   c                n    V P                   P                  R V 24       Wn        V P                  4        R# )zPolicy diff left policy set to N)r   infor!   _reset_diffr   policys   &&r   r   r#      s,    7x@A"r   c                    V P                   # r   )_right_policyr"   s   &r   r   Difference.right_policy$   s    !!!r   c                n    V P                   P                  R V 24       Wn        V P                  4        R# )z Policy diff right policy set to N)r   r%   r*   r&   r'   s   &&r   r   r+   (   s,    8AB#r   c                   < V ^8  d   QhRR/# )r   r   N )r   r   s   "r   r   r   1   s     " "T "r   c                    \         h)z%Reset diff results on policy changes.)NotImplementedErrorr"   s   &r   r&   Difference._reset_diff1   s    !!r   c                &   < V ^8  d   QhRS[ RS[ /# )r   	rule_listr   r   )r   r   s   "r   r   r   6   s     3 3X 3 3r   c              #  b   "   V  F$  pVP                  4        F  pV! V4      x  K  	  K&  	  R# 5i)z4Generator that yields a wrapped, expanded rule list.N)expand)r3   wrapper_classunexpanded_ruleexpanded_rules   &&  r   _expand_generatorDifference._expand_generator5   s/       )O!0!7!7!9#M22 ":  )s   -/Nc                   \        V 4      p\        V4      pWT,
          pWE,
          p\        4       p\        WG,
          VR7      p	\        WV,
          VR7      p
\        V	4      \        V
4      8X  g    Q R\        V	4       R\        V
4       24       h\        W4       F*  w  rW8X  g   Q RV  RV 24       hVP	                  W34       K,  	  V'       d6   \        R V 4       4      \        R V 4       4      \        R V 4       4      3# WgV3# )az  
Standard diff of two sets.

Parameters:
left        An iterable
right       An iterable

Return:
tuple       (added, removed, matched)

added       Set of items in right but not left
removed     Set of items in left but not right
matched     Set of items in both left and right.  This is
            in the form of tuples with the matching item
            from left and right
keyz:Matched items assertion failure (this is an SETools bug), z != c              3   8   "   T F  qP                   x  K  	  R # 5ir   origin.0is   & r   	<genexpr>'Difference._set_diff.<locals>.<genexpr>q   s     5Axx   c              3   8   "   T F  qP                   x  K  	  R # 5ir   r?   rA   s   & r   rD   rE   r   s     4mHHmrF   c              3   V   "   T F  w  rVP                   VP                   3x  K!  	  R # 5ir   r?   )rB   leftrights   &  r   rD   rE   s   s     S]MTT[[%,,/]s   '))setsortedlenzipadd)rI   rJ   r=   unwrap
left_itemsright_itemsadded_itemsremoved_itemsmatched_itemsleft_matched_itemsright_matched_itemss   &&&&       r   	_set_diffDifference._set_diff?   s)   & Y
%j!."0 #Z%?cJ$k&?cJ%&#.A*BB 	GH%&'tC0C,D+EG	GB 1GKD= _LTFRVW\V]^_= tm,	 H 5554m44S]SST T }<<r   )r!   r*   r   r   r   )NT)r   
__module____qualname____firstlineno____doc__r   propertyr   setterr   r&   staticmethodr9   rX   __static_attributes____classdictcell__r   s   @r   r   r      s     0) ) ! !  
 " "  " " 3 3 5= 5=r   r   c                       ] tR t^xtRtRtR# )DifferenceResultz!Base class for difference resultsr.   N)r   rZ   r[   r\   r]   ra   r.   r   r   re   re   x   s    +r   re   T)boundc                      a  ] tR t^t o RtRtV 3R lR ltR t]R 4       t	]R 4       t
]R 4       tR tV 3R	 ltR
tV tR# )Wrapperz/Abstract base class for policy object wrappers.c                *   < V ^8  d   QhRS[ RS[RR/# )r   r@   r=   r   Nrf   int)r   r   s   "r   r   Wrapper.__annotate__   s"      q s t r   c                    Wn         W n        R # r   r@   r=   )r   r@   r=   s   &&&r   r   Wrapper.__init__   s    r   c                b    R V P                   P                   R\        V P                  4       R2# )<z
(Wrapping z)>)	__class__r   reprr@   r"   s   &r   __repr__Wrapper.__repr__   s,    4>>**+:d4;;6G5HKKr   c                    R # r   r.   r"   s   &r   __hash__Wrapper.__hash__       r   c                    R # r   r.   r   others   &&r   __eq__Wrapper.__eq__   rz   r   c                    R # r   r.   r|   s   &&r   __lt__Wrapper.__lt__   rz   r   c                    W8X  * # r   r.   r|   s   &&r   __ne__Wrapper.__ne__   s      r   c                2   < V ^8  d   Qh/ S[ ;R&   S[;R&   # )r   r@   r=   rk   )r   r   s   "r   r   rm      s      I	 
 
H r   )r=   r@   Nro   )r   rZ   r[   r\   r]   	__slots__r   ru   r   rx   r~   r   r   __annotate_func__ra   rb   rc   s   @r   ri   ri      sg     9
 "I L      !;  r   ri   Sc                   d   a a ] tR t^t oRtRtV3R lV 3R lltR tR tR t	V3R lt
RtVtV ;t# )	SymbolWrapperzx
General wrapper for policy symbols, e.g. types, roles
to provide a diff-specific equality operation based
on its name.
c                $   < V ^8  d   QhRS[ RR/# )r   symbolr   N)r   )r   r   s   "r   r   SymbolWrapper.__annotate__   s        q  T  r   c                p   < \         SV `  V\        VP                  4      4       VP                  V n        R # r   )superr   hashname)r   r   rs   s   &&r   r   SymbolWrapper.__init__   s&    fkk!23KK	r   c                    V P                   # r   r<   r"   s   &r   rx   SymbolWrapper.__hash__   s    xxr   c                4    V P                   VP                   8  # r   r   r|   s   &&r   r   SymbolWrapper.__lt__   s    yy5::%%r   c                4    V P                   VP                   8H  # r   r   r|   s   &&r   r~   SymbolWrapper.__eq__   s    yyEJJ&&r   c                &   < V ^8  d   Qh/ S[ ;R&   # )r   r   )str)r   r   s   "r   r   r      s      I r   r   )r   rZ   r[   r\   r]   r   r   rx   r   r~   r   ra   rb   __classcell__)rs   r   s   @@r   r   r      s1      I   &'-  r   r   )r   abcr   r   collections.abcr   typing	policyrepr   r   r	   r   re   TypeVarrf   Genericri   r   r   r.   r   r   <module>r      s|     # $  A Ag= g=T	 	 NN3l+!c6>>!$ !B NN3l+'GAJ 'r   