+
    Pj                     ~   a  R	 t0 t ^ RIt^ RIt^ RIHtHtHtHtHt ^ RI	H
t
 Rt] ^ k  ! R R4      t ! R R4      tR# )
    N)ListOptionalSetTupleUnion)EinopsErroru   …c                   <   a  ] tR t^
t o RtV 3R lR ltR tRtV tR# )AnonymousAxiszHImportant thing: all instances of this class are not equal to each otherc                    < V ^8  d   QhRS[ /# )   value)str)format__classdict__s   "g/Users/ahmed/devFolder/Ultron/claude-voice/gateway/.venv/lib/python3.14/site-packages/einops/parsing.py__annotate__AnonymousAxis.__annotate__   s     c cc c    c                    \        V4      V n        V P                  ^8:  d5   V P                  ^8X  d   \        R4      h\        RV P                   24      hR# )   zENo need to create anonymous axis of length 1. Report this as an issuez0Anonymous axis should have positive length, not N)intr   r   )selfr   s   &&r   __init__AnonymousAxis.__init__   sO    Z
::?zzQ!"ijj!$TUYU_U_T`"abb	 r   c                2    \        V P                  4       R 2# )z-axis)r   r   )r   s   &r   __repr__AnonymousAxis.__repr__   s    djj/"%((r   )r   N)	__name__
__module____qualname____firstlineno____doc__r   r   __static_attributes____classdictcell__r   s   @r   r
   r
   
   s     Rc c) )r   r
   c                      a  ] tR t^t o RtRRRR/V 3R lR lltV 3R lR ltV 3R	 lR
 lt]RV 3R lR ll4       t	]V 3R lR l4       t
RtV tR# )ParsedExpressionz
non-mutable structure that contains information about one side of expression (e.g. 'b c (h w)')
and keeps some information important for downstream
allow_underscoreFallow_duplicatesc                ,   < V ^8  d   QhRS[ RS[RS[/# )r   
expressionr(   r)   r   bool)r   r   s   "r   r   ParsedExpression.__annotate__   s(     P. P.3 P.T P.]a P.r   c                 a aaa R S n         RS n        \        4       S n        R S n        . S n        RV9   dq   RV9  d   \        R4      h\        P                  VR4      ^8w  g   \        P                  VR4      ^8w  d   \        R4      hVP                  R\        4      pRS n         RoVVVV 3R lpRpV F  pVR9   d`   Ve	   V! V4       RpVR	8X  d   Se   \        R
4      h. oK2  VR8X  d/   Sf   \        R4      hS P
                  P                  S4       RoKg  Ki  \        P                  V4      '       g   VR\        39   d   Vf   TpK  WV,          pK  \        RV R24      h	  Se   \        RV R24      hVe   V! V4       R# R# )FN.z...z6Expression may contain dots only inside ellipsis (...)zUExpression may contain dots only inside ellipsis (...); only one ellipsis for tensor Tc                 L  < V SP                   9   d'   S'       d   V R 8X  g   S'       g   \        RV  R24      hV \        8X  dj   SP                   P                  \        4       Sf)   SP                  P                  \        4       RSn        R# SP                  \        4       RSn        R# \        P                  V 4      pV'       d5   \        V 4      ^8X  d%   Sf   SP                  P                  . 4       R#  R# SP                  V SR7      w  r#V'       g   V'       g   \        RV  RV 24      hV'       d   \        V 4      p SP                   P                  V 4       V'       d   RSn        Sf   SP                  P                  V .4       R# SP                  V 4       R# )	_z2Indexing expression contains duplicate dimension ""NFT)r(   zInvalid axis identifier: 
)identifiersr   	_ellipsisaddcompositionappendhas_ellipsis_parenthesizedr   	isdecimalr   check_axis_name_return_reasonr
   has_non_unitary_anonymous_axes)x	is_numberis_axis_namereasonr)   r(   bracket_groupr   s   &   r   add_axis_name0ParsedExpression.__init__.<locals>.add_axis_name3   sW   D$$$(Q#X?O%(Z[\Z]]^&_``I~  $$Y/ ($$++I66;D3!((36:D3MM!,	Q1$,((//3  '+'I'I!^n'I'o$!\%(A!Bvh&OPP%a(A  $$Q':>D7 ($$++QC0!((+r   z() (zDAxis composition is one-level (brackets inside brackets not allowed))zBrackets are not balancedr2   zUnknown character ''z'Imbalanced parentheses in expression: "r3   )has_ellipsisr:   setr5   r=   r8   r   r   countreplacer6   r9   isalnum)r   r+   r(   r)   rC   current_identifiercharrB   s   f&dd   @r   r   ParsedExpression.__init__   s   "':>'%(U49+8:*J&!"Z[[yyU+q0CIIj#4NRS4S!k  $++E9=J $D-1 	,  	,D "Du}%1!"45%)"3;$0)*pqq$&MS[$,)*EFF$$++M:$(M	 !
 T""dsI.>&>%-)-&&.&!$7vQ"?@@) , $ G
|STUVV),- *r   c                    < V ^8  d   QhRS[ /# r   return)r   )r   r   s   "r   r   r.   q   s       r   c                    . pV P                    F:  p\        V\        4      '       g   Q R 4       hV F  pVP                  V4       K  	  K<  	  V# )zdoes not work with ellipsis)r8   
isinstancelistr9   )r   resultcomposed_axisaxiss   &   r   flat_axes_order ParsedExpression.flat_axes_orderq   sM    !--MmT22Q4QQ2%d# & . r   c                    < V ^8  d   QhRS[ /# rQ   )r-   )r   r   s   "r   r   r.   y   s      4 r   c                    V P                    F.  p\        V\        4      '       g   K  \        V4      ^8  g   K-   R# 	  R# )r   TF)r8   rT   rU   len)r   axess   & r   has_composed_axes"ParsedExpression.has_composed_axesy   s1    $$D$%%#d)a- % r   c                B   < V ^8  d   QhRS[ RS[RS[S[S[ 3,          /# )r   namer(   rR   )r   r-   r   )r   r   s   "r   r   r.      s/      C 4 TYZ^`cZcTd r   c                ^   \         P                  V 4      '       g   R# V ^ ,          R8X  g   V R,          R8X  d   V R8X  d   V'       d   R# R# \        P                  ! V 4      '       d!   \        P
                  ! RV  2\        ^R7       V R	9   d   \        P
                  ! R\        ^R7       R# )
Fr2   z7It is discouraged to use axes names that are keywords: )
stacklevelzQIt is discouraged to use 'axis' as an axis name and will raise an error in future)Fznot a valid python identifier)T )Fz8axis name should should not start or end with underscore)rX   )r   isidentifierkeyword	iskeywordwarningswarnRuntimeWarningFutureWarning)rb   r(   s   &&r   r<   .ParsedExpression.check_axis_name_return_reason   s    %%99!W^tBx3s{/TT  &&MdVT" 
 xg! 
 Or   c                &   < V ^8  d   QhRS[ RS[/# )r   rb   rR   r,   )r   r   s   "r   r   r.      s      c d r   c                4    \         P                  V 4      w  rV# )zs
Valid axes names are python identifiers except keywords,
and additionally should not start or end with underscore
)r'   r<   )rb   is_valid_reasons   &  r   check_axis_name ParsedExpression.check_axis_name   s     -JJ4Pr   )r8   rH   r:   r=   r5   N)F)r   r   r    r!   r"   r   rY   r_   staticmethodr<   rs   r#   r$   r%   s   @r   r'   r'      si     
P.E P.di P. P.d     ,  r   r'   c                @    V ^8  d   Qh/ ^ \         9   d
   \        ;R&   # )r   r6   )__conditional_annotations__r   )r   s   "r   r   r      s      3  r   )rw   rh   rj   typingr   r   r   r   r   einopsr   r6   r
   r'   r   )rw   s   @r   <module>rz      s5      4 4 	 ) )E Er   