+
    :iY&                         R t ^ RIt^ RIt^ RIt^ RIHt ^ RIHt  ! R R4      t ! R R]P                  RR	7      t
 ! R
 R4      t ! R R]4      t ! R R4      t]! 4       t ! R R]R7      tR# )z[
This module contains utils for manipulating target configurations such as
compiler flags.
N)MappingProxyType)utilsc                   ^   a  ] tR t^t o RtRtR t]R 4       t]R 4       t	]R 4       t
RtV tR# )	Optionz.An option to be used in ``TargetConfig``.
    c               *    Wn         W n        W0n        R# )z
Parameters
----------
type :
    Type of the option value. It can be a callable.
    The setter always calls ``self._type(value)``.
default :
    The default value for the option.
doc : str
    Docstring for the option.
N_type_default_doc)selftypedefaultdocs   &&$$U/var/www/html/photoedit/myenv/lib/python3.14/site-packages/numba/core/targetconfig.py__init__Option.__init__   s     
	    c                    V P                   # N)r   r   s   &r   r   Option.type"   s    zzr   c                    V P                   # r   )r	   r   s   &r   r   Option.default&   s    }}r   c                    V P                   # r   )r
   r   s   &r   r   
Option.doc*   s    yyr   )r	   r
   r   Nr   )__name__
__module____qualname____firstlineno____doc__	__slots__r   propertyr   r   r   __static_attributes____classdictcell____classdict__s   @r   r   r      sP     +I       r   r   c                       ] tR t^/tRtR# )_FlagsStack N)r   r   r   r   r"   r(   r   r   r'   r'   /   s    r   r'   flags)
stack_namec                   L   a  ] tR t^3t o Rt]R 4       tR tR tR t	R t
RtV tR# )	ConfigStackzA stack for tracking target configurations in the compiler.

It stores the stack in a thread-local class attribute. All instances in the
same thread will see the same stack.
c                L    V ! 4       pV'       d   VP                  4       pV# RpV# )z8Get the TOS or return None if no config is set.
        N)top)clsr   r)   s   &  r   top_or_noneConfigStack.top_or_none9   s,     uHHJE  Er   c                $    \        4       V n        R # r   )r'   _stkr   s   &r   r   ConfigStack.__init__E   s    M	r   c                6    V P                   P                  4       # r   )r3   r.   r   s   &r   r.   ConfigStack.topH   s    yy}}r   c                ,    \        V P                  4      # r   )lenr3   r   s   &r   __len__ConfigStack.__len__K   s    499~r   c                8    V P                   P                  V4      # )zWReturns a contextmanager that performs ``push(flags)`` on enter and
``pop()`` on exit.
)r3   enter)r   r)   s   &&r   r<   ConfigStack.enterN   s     yyu%%r   )r3   N)r   r   r   r   r   classmethodr0   r   r.   r9   r<   r"   r#   r$   s   @r   r,   r,   3   s7     
 	 	"& &r   r,   c                   0   a  ] tR t^Ut o RtR tR tRtV tR# )_MetaTargetConfigzMetaclass for ``TargetConfig``.

When a subclass of ``TargetConfig`` is created, all ``Option`` defined
as class members will be parsed and corresponding getters, setters, and
delters will be inserted.
c           	     4   / p\        V4       F  pVP                  VP                  4       K   	  VP                  V P                  V4      4       \	        V4      V n        R pV P                  P                  4        F  w  r\        WV! W4      4       K  	  R# )zInvoked when subclass is created.

Insert properties for each ``Option`` that are class members.
All the options will be grouped inside the ``.options`` class
attribute.
c                 \   a a V V3R  lpV V3R lpV 3R lp\        W#VSP                  4      # )c                 P   < V P                   P                  SSP                  4      # r   )_valuesgetr   )r   nameoptions   &r   getter=_MetaTargetConfig.__init__.<locals>.make_prop.<locals>.gettero   s    ||''fnn==r   c                 D   < SP                  V4      V P                  S&   R # r   )r   rD   )r   valrF   rG   s   &&r   setter=_MetaTargetConfig.__init__.<locals>.make_prop.<locals>.setterr   s    %+[[%5T"r   c                 "   < V P                   S R # r   rD   r   rF   s   &r   delter=_MetaTargetConfig.__init__.<locals>.make_prop.<locals>.delteru   s    LL&r   )r!   r   )rF   rG   rH   rL   rQ   s   ff   r   	make_prop-_MetaTargetConfig.__init__.<locals>.make_propn   s'    >6' FFFJJ??r   N)reversedupdateoptionsfind_optionsr   itemssetattr)r/   rF   basesdctoptsbase_clsrS   rG   s   &&&&    r   r   _MetaTargetConfig.__init__\   s~      !HKK(() (C$$S)*&t,
	@  KK--/LDCy67 0r   c                    VP                  4        UUu/ uF  w  r#\        V\        4      '       g   K  W#bK!  	  upp# u uppi )zKReturns a new dict with all the items that are a mapping to an
``Option``.
)rY   
isinstancer   )r/   r\   kvs   &&  r   rX   _MetaTargetConfig.find_options}   s1     "%F
1f0EFFFs   ==r(   N)	r   r   r   r   r   r   rX   r"   r#   r$   s   @r   r@   r@   U   s     8BG Gr   r@   c                   &   a  ] tR t^t o R tRtV tR# )_NotSetTypec                    R # )z<NotSet>r(   r   s   &r   __repr___NotSetType.__repr__   s    r   r(   N)r   r   r   r   rh   r"   r#   r$   s   @r   rf   rf      s      r   rf   c                      a  ] tR t^t o RtR.tRR/tRR ltR tR t	R t
R	 tR
 tR t]3R ltR tV 3R lR ltR tR t]V 3R lR l4       tV 3R lR lt]V 3R lR l4       tRtV tR# )TargetConfiga  Base class for ``TargetConfig``.

Subclass should fill class members with ``Option``. For example:

>>> class MyTargetConfig(TargetConfig):
>>>     a_bool_option = Option(type=bool, default=False, doc="a bool")
>>>     an_int_option = Option(type=int, default=0, doc="an int")

The metaclass will insert properties for each ``Option``. For example:

>>> tc = MyTargetConfig()
>>> tc.a_bool_option = True  # invokes the setter
>>> print(tc.an_int_option)  # print the default
rD   wbitsNc                    / V n         Ve@   \        V\        4      '       g   Q hV P                   P                  VP                   4       R# R# )z
Parameters
----------
copy_from : TargetConfig or None
    if None, creates an empty ``TargetConfig``.
    Otherwise, creates a copy.
N)rD   ra   rk   rV   )r   	copy_froms   &&r   r   TargetConfig.__init__   sA      i6666LL	 1 12 !r   c                D   . p. pV P                    FN  pV R \        W4       2pV P                  V4      '       g   VP                  V4       K=  VP                  V4       KP  	  V P                  P
                  pV RRP                  V4       RRP                  V4       R2# )=(, z, [z]))rW   getattris_setappend	__class__r   join)r   argsdefsrb   msgclsnames   &     r   rh   TargetConfig.__repr__   s     ACq)*+C;;q>>C C   ..))!DIIdO,C		$/@CCr   c                X    \        \        \        V P                  4       4      4      4      # r   )hashtuplesortedvaluesr   s   &r   __hash__TargetConfig.__hash__   s    E&/011r   c                |    \        V\        4      '       d"   V P                  4       VP                  4       8H  # \        # r   )ra   rk   r   NotImplemented)r   others   &&r   __eq__TargetConfig.__eq__   s,    e\**;;=ELLN22!!r   c                V    V P                    Uu/ uF  q\        W4      bK  	  up# u upi )z)Returns a dict of all the values
        )rW   rt   )r   rb   s   & r   r   TargetConfig.values   s(     .2\\:\74##\:::s   &c                @    V P                  V4       WP                  9   # )zIs the option set?
        )_guard_optionrD   rP   s   &&r   ru   TargetConfig.is_set   s     	4 ||##r   c                `    V P                  V4       V P                  P                  VR4       R# )ztRemove the option by name if it is defined.

After this, the value for the option will be set to its default value.
N)r   rD   poprP   s   &&r   discardTargetConfig.discard   s&    
 	4 t$r   c                    V P                  V4       V P                  V4      '       gT   \        4       pV'       d(   VP                  4       p\	        W\        WA4      4       R# V\        Jd   \	        WV4       R# R# R# )a  Inherit flag from ``ConfigStack``.

Parameters
----------
name : str
    Option name.
default : optional
    When given, it overrides the default value.
    It is only used when the flag is not defined locally and there is
    no entry in the ``ConfigStack``.
N)r   ru   r,   r.   rZ   rt   _NotSet)r   rF   r   cstkr.   s   &&&  r   inherit_if_not_setTargetConfig.inherit_if_not_set   sa     	4 {{4  =DhhjGC$67'G, ( !r   c                $    \        V 4      ! V 4      # )zClone this instance.
        )r   r   s   &r   copyTargetConfig.copy   s     Dz$r   c                    < V ^8  d   QhRS[ /#    returnstr)formatr%   s   "r   __annotate__TargetConfig.__annotate__   s     / / /r   c                    V P                  4        UUu. uF  w  rV RV 2NK  	  pppV P                  P                  pV RRP                  V4       R2# u uppi )zReturns a ``str`` that summarizes this instance.

In contrast to ``__repr__``, only options that are explicitly set will
be shown.
rq   rr   rs   ))_summary_argsrw   r   rx   )r   rb   rc   ry   r|   s   &    r   summaryTargetConfig.summary   s_     (,'9'9';<';tq1#Qqc
';<..))!DIIdO,A.. =s   Ac                ^    WP                   9  d   V: R \        V 4       2p\        V4      hR# )z is not a valid option for N)rW   r   
ValueError)r   rF   r{   s   && r   r   TargetConfig._guard_option   s0    ||#H7T
|DCS/! $r   c                    . p\        V P                  4       Fa  pV P                  V,          pV P                  V4      '       g   K/  \        W4      pVP                  V8w  g   KM  W$3pVP                  V4       Kc  	  V# )zreturns a sorted sequence of 2-tuple containing the
``(flag_name, flag_value)`` for flag that are set with a non-default
value.
)r   rW   ru   rt   r   rv   )r   ry   rb   optflagvalrc   s   &     r   r   TargetConfig._summary_args  se    
 %A,,q/C{{1~~!$*;;')AKKN & r   c                    < V ^8  d   QhRS[ /# r   )bytes)r   r%   s   "r   r   r     s     % %U %r   c                   . pVP                  R4       VP                  V P                  P                  4       VP                  RR.4       V P                  P                  4        F:  w  r#VP                  V4       VP                  \        VP                  4      4       K<  	  RP                  V4      P                  4       # )zMReturns a ``bytes`` object suitable for use as a dictionary for
compression.
numbaTrueFalse )
rv   rw   r   extendrW   rY   r   r   rx   encode)r/   bufrb   r   s   &   r   _make_compression_dictionary)TargetConfig._make_compression_dictionary  s    
 

7

3==))*

FG$%kk'')FAJJqMJJs3;;'( * wws|""$$r   c                    < V ^8  d   QhRS[ /# r   r   )r   r%   s   "r   r   r   #  s     8 83 8r   c                   V P                  4       p\        P                  ! RRVR\        P                  /V P                  B pVP                  V P                  4       P                  4       4      .pVP                  VP                  4       4       \        P                  ! RP                  V4      4      P                  4       # )z6Return a string suitable for symbol mangling.
        zdictlevelr   r(   )r   zlibcompressobjZ_BEST_COMPRESSION_ZLIB_CONFIGcompressr   r   rv   flushbase64	b64encoderx   decode)r   r   compr   s   &   r   get_mangle_stringTargetConfig.get_mangle_string#  s     113 5e 543J3J 5"&"3"35 }}T\\^22456

4::< .5577r   c                &   < V ^8  d   QhRS[ RS[ /# )r   mangledr   r   )r   r%   s   "r   r   r   1  s     & &s &s &r   c                   R p\         P                  ! RW!4      p\        P                  ! V4      pV P	                  4       p\
        P                  ! RRV/V P                  B p. pV'       d/   VP                  VP                  V4      4       VP                  pK6  VP                  VP                  4       4       RP                  V4      P                  4       # )zCReturns the demangled result from ``.get_mangle_string()``
        c                 f    \        \        R V P                  ^ 4      R,          ,           ^4      4      # )0x:   NN)chrintgroup)xs   &r   repl#TargetConfig.demangle.<locals>.repl5  s%    s4!''!*R.0"566r   z_[a-zA-Z0-9][a-zA-Z0-9]r   r   r(   )resubr   	b64decoder   r   decompressobjr   rv   
decompressunconsumed_tailr   rx   r   )r/   r   r   	unescapedrawr   dcr   s   &&      r   demangleTargetConfig.demangle0  s    
	7FF5tE	y)002@e@s/?/?@JJr}}S)*$$C

288:xx}##%%r   rO   ir   )r   r   r   r   r   r    r   r   rh   r   r   r   ru   r   r   r   r   r   r   r   r>   r   r   r   r"   r#   r$   s   @r   rk   rk      s      I S>L3D2";
$% 07 -, 
/ /"
 % %"8 8 & &r   rk   )	metaclass)r   r   r   r   typesr   
numba.corer   r   ThreadLocalStackr'   r,   r   r@   rf   r   rk   r(   r   r   <module>r      sv    
   "  D	%((W 	& &D,G ,G^ 
 -v&. v&r   