+
    ,i5  c                   s   a  R t0 t ^ RIHt ^ RIHt ^RIHtHt ^RIH	t	 ^RI
HtHtHt ^RIHt ^RIHt ]! ]4      t] ^ k ]! RRR	7       ! R
 R]4      4       tR R lt ! R R]4      tR# )i    )defaultdict)	dataclass)RoleType)DiffResultDescriptor)
DifferenceDifferenceResultSymbolWrapper)SymbolCachetype_wrapper_factoryT)ZfrozenZorderc                   s0   a  ] tR t^t o RtV 3R ltRtV tR# )ModifiedRolez'Difference details for a modified role.c                sz   < V ^8  d   Qh/ S[ ;R&   S[S[,          ;R&   S[S[,          ;R&   S[S[,          ;R&   # )   roleadded_typesremoved_typesmatched_types)r   Zsetr   format__classdict__   "9/usr/lib64/python3.14/site-packages/setools/diff/roles.py__annotate__ZModifiedRole.__annotate__   sD     
 J  T  t9  t9      N)__name__
__module____qualname____firstlineno____doc__Z__annotate_func____static_attributes____classdictcell__r      @r   r   r      s      2  r   r   c                sF    V ^8  d   QhR\         R\        \         ,          /# )r   r   return)r   r   r      "r   r   r      s      t d(; r   c                s     \         V P                  ,          V ,          #   \         d+    \        T 4      pT\         T P                  ,          T &   Tu # i ; i)zl
Wrap roles from the specified policy.

This caches results to prevent duplicate wrapper
objects in memory.
)_roles_cacheZpolicyZKeyErrorr   )r   r   & r   role_wrapper_factoryr(      sL    DKK(.. $*+T[[!$'s     2AAc                   s   a  ] tR t^-t o RtV 3R lR lt]],          ! ]4      t]],          ! ]4      t	]]
,          ! ]4      tV 3R lR ltRtV tR# )RolesDifferencez7Determine the difference in roles between two policies.c                   < V ^8  d   QhRR/# r   r"   Nr   r   r   r   r   RolesDifference.__annotate__1   s     H HD Hr   c           	     sh   V P                   P                  RV P                   RV P                   24       V P	                  R V P                  P                  4        4       R V P                  P                  4        4       4      w  V n        V n        p\        \        ,          ! 4       V n
        V F}  w  r#V P	                  R VP                  4        4       R VP                  4        4       4      w  rEpV'       g   V'       g   KV  V P                  P                  \        VVVV4      4       K  	  R# )z6Generate the difference in roles between the policies.z!Generating role differences from z to c              3   8   "   T F  p\        V4      x  K  	  R # 5iNr(   .0r&   r'   r   	<genexpr>-RolesDifference.diff_roles.<locals>.<genexpr>8   s     G.F!!$$.F   c              3   r-   r.   r/   r0   r'   r   r2   r3   9   s     H.G!!$$.Gr4   c              3   r-   r.   r	   r1   Ztr'   r   r2   r3   B   s     D2CQ%a((2Cr4   c              3   r-   r.   r	   r5   r'   r   r2   r3   C   s     E2DQ%a((2Dr4   N)logZinfoZleft_policyZright_policyZ	_set_diffZrolesadded_rolesremoved_rolesZlistr   modified_rolestypesZappend)selfZmatched_rolesZ	left_roleZ
right_roler   r   r   s   &      r   
diff_rolesZRolesDifference.diff_roles1   s    	/0@0@/AdFWFWEXY	[ ?CnnGd.>.>.D.D.FGHd.?.?.E.E.GH?J;$,m #<02%2!I 9=D)//2CDE*2B2B2DE9G5K mm##**<	8C8E8E,G H &3r   c                r*   r+   r   r   r   r   r   r,   R   s        T  r   c                sH    V P                   P                  R4       V =V =V =R# )z%Reset diff results on policy changes.zResetting role differencesN)r6   Zdebugr7   r8   r9   )r;   s   &r   _reset_diffZRolesDifference._reset_diffR   s%    34r   )r7   r9   r8   N)r   r   r   r   r   r<   r   r   r7   r8   r   r9   r=   r   r   r    r!   r   r)   r)   -   sM     AH H4 't,Z8K(.z:M),7
CN
   r   r)   c                sV    V ^8  d   Qh/ ^ \         9   d   \        \        ,          ;R&   # )r   r%   )__conditional_annotations__r   r   r#   r$   r   r   r      s     # # 4 3k$ 3 $r   N)r>   Zcollectionsr    Zdataclassesr   Z	policyrepr   r   Zdescriptorsr   Z
differencer   r   r   Ztypingr   r:   r
   Zdictr%   r   r(   r)   r   )r>   r!   r   <module>r?      sd    $ # ! " - C C  '"-d"3 3 $d##  $* j * r   