+
    R<Âj¨  ã                   ó~   € ^ RI t ^ RIt^ RIt^ RIt^ RIHtHt  ! R R4      tR R lt ! R R4      t	 ! R	 R
4      t
R# )é    N)ÚAnyÚUnionc                   ó:   a € ] tR t^t o RtRtV 3R lR ltRtV tR# )Ú_Storagea>  Thread-tagged storage for a non-thread-critical ``Local``.

The data is tagged with the identity of the thread that owns it. This lets
``_CVar`` ignore data that leaked into an unrelated thread.

Python 3.14 added ``sys.flags.thread_inherit_context``, which is enabled by
default on free-threaded builds. When set, a new thread starts with a copy
of the spawning thread's context instead of an empty one, so the contextvar
backing a ``Local`` would otherwise be visible in any thread spawned from
one that had set it -- breaking the documented "thread-local in sync
threads" behaviour. asgiref re-homes the storage to the current thread at
the points where it *intentionally* moves work between threads (see
``asgiref.sync._restore_context``); data merely inherited by an unrelated
thread is never re-homed and so stays isolated.
c                ó@   <€ V ^8„  d   QhRS[ RS[S[S[3,          RR/# )é   Ú	thread_idÚdataÚreturnN)ÚintÚdictÚstrr   )ÚformatÚ__classdict__s   "€ÚM/var/www/html/data_capital/venv/lib/python3.14/site-packages/asgiref/local.pyÚ__annotate__Ú_Storage.__annotate__   s*   ø€ ÷ ñ ¡#ð ©T±#±s°(­^ð Àñ ó    c                ó   € Wn         W n        R # ©N©r	   r
   )Úselfr	   r
   s   &&&r   Ú__init__Ú_Storage.__init__   s   € Ø"ŒØŽ	r   )r
   r	   Nr   )	Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__Ú	__slots__r   Ú__static_attributes__Ú__classdictcell__)r   s   @r   r   r      s   ø‡ € ñð  &€I÷ö r   r   c                ó    € V ^8„  d   QhRRRR/# )r   Ústorager   r   © )r   s   "r   r   r       s   € ÷ 9ñ 9�Zð 9 Jñ 9r   c                óT   € \        \        P                  ! 4       V P                  4      # )z7Return a copy of *storage* owned by the current thread.)r   Ú	threadingÚ	get_identr
   )r$   s   &r   Ú_rehomer)       s   € ä”I×'Ò'Ó)¨7¯<©<Ó8Ð8r   c                   ó~   a a€ ] tR t^%t oRtV3R lR ltV3R lR ltR tV3R lV 3R lltV3R	 lR
 lt	Rt
VtV ;t# )Ú_CVarzStorage utility for Local.c                ó   <€ V ^8„  d   QhRR/# )r   r   Nr%   )r   r   s   "€r   r   Ú_CVar.__annotate__(   s   ø€ ÷ 
ñ 
˜$ñ 
r   c                ó<   € \         P                  ! R 4      V n        R# )zasgiref.localN)ÚcontextvarsÚ
ContextVarÚ_data)r   s   &r   r   Ú_CVar.__init__(   s   € Ü9D×9OÒ9OØó:
ˆŽ
r   c                ó   <€ V ^8„  d   QhRR/# )r   r   r   r%   )r   r   s   "€r   r   r-   -   s   ø€ ÷ ñ ˜*ñ r   c                óÊ   € V P                   P                  R 4      pVe%   VP                  \        P                  ! 4       8w  d    \        \        P                  ! 4       / 4      # V# r   )r1   Úgetr	   r'   r(   r   )r   r$   s   & r   Ú_storageÚ_CVar._storage-   sL   € ð —*‘*—.‘. Ó&ˆØŠ?˜g×/Ñ/´9×3FÒ3FÓ3HÔHÜœI×/Ò/Ó1°2Ó6Ð6Øˆr   c                óˆ   €  V P                  4       P                  V,          #   \         d    \        T : R T: 24      hi ; i)ú object has no attribute )r6   r
   ÚKeyErrorÚAttributeError)r   Úkeys   &&r   Ú__getattr__Ú_CVar.__getattr__6   sG   € ð	NØ—=‘=“?×'Ñ'¨Õ,Ð,øÜô 	NÜ  D¡8Ð+DÀSÁGÐ!LÓMÐMð	Nús	   ‚ # £Ac                ó*   <€ V ^8„  d   QhRS[ RS[RR/# )r   r<   Úvaluer   N)r   r   )r   r   s   "€r   r   r-   <   s"   ø€ ÷ >ñ >™sð >©3ð >°4ñ >r   c                óü   <€ VR 8X  d   \         SV `  W4      # V P                  4       P                  P	                  4       pW#V&   V P
                  P                  \        \        P                  ! 4       V4      4       R# )r1   N)
ÚsuperÚ__setattr__r6   r
   Úcopyr1   Úsetr   r'   r(   )r   r<   r@   r
   Ú	__class__s   &&& €r   rC   Ú_CVar.__setattr__<   s[   ø€ Ø�'Œ>Ü‘7Ñ& sÓ2Ð2à�}‰}‹×#Ñ#×(Ñ(Ó*ˆØˆS‰	Ø�
‰
�‰”x¤	× 3Ò 3Ó 5°tÓ<Ö=r   c                ó$   <€ V ^8„  d   QhRS[ RR/# )r   r<   r   N)r   )r   r   s   "€r   r   r-   D   s   ø€ ÷ Nñ N™sð N tñ Nr   c                óú   € V P                  4       P                  P                  4       pW9   d=   W! V P                  P	                  \        \        P                  ! 4       V4      4       R# \        V : R V: 24      h)r9   N)	r6   r
   rD   r1   rE   r   r'   r(   r;   )r   r<   r
   s   && r   Ú__delattr__Ú_CVar.__delattr__D   s]   € Ø�}‰}‹×#Ñ#×(Ñ(Ó*ˆØŒ;Ø�	Ø�J‰J�N‰Nœ8¤I×$7Ò$7Ó$9¸4Ó@ÖAä  D¡8Ð+DÀSÁGÐ!LÓMÐMr   )r1   )r   r   r   r   r   r   r6   r=   rC   rJ   r!   r"   Ú__classcell__©rF   r   s   @@r   r+   r+   %   s>   ù‡ € Ù$÷
ð 
÷
ð òN÷>ó >÷N÷ Nð Nr   r+   c                   ó|   a a€ ] tR t^Mt oRtR	V3R lR llt]P                  R 4       tR t	V 3R lt
R tRtVtV ;t# )
ÚLocala·  Local storage for async tasks.

This is a namespace object (similar to `threading.local`) where data is
also local to the current async task (if there is one).

In async threads, local means in the same sense as the `contextvars`
module - i.e. a value set in an async frame will be visible:

- to other async code `await`-ed from this frame.
- to tasks spawned using `asyncio` utilities (`create_task`, `wait_for`,
  `gather` and probably others).
- to code scheduled in a sync thread using `sync_to_async`

In "sync" threads (a thread with no async event loop running), the
data is thread-local, but additionally shared with async code executed
via the `async_to_sync` utility, which schedules async code in a new thread
and copies context across to that thread.

If `thread_critical` is True, then the local will only be visible per-thread,
behaving exactly like `threading.local` if the thread is sync, and as
`contextvars` if the thread is async. This allows genuinely thread-sensitive
code (such as DB handles) to be kept strictly to their initial thread and
disable the sharing across `sync_to_async` and `async_to_sync` wrapped calls.

Unlike plain `contextvars` objects, this utility is threadsafe.
c                ó$   <€ V ^8„  d   QhRS[ RR/# )r   Úthread_criticalr   N)Úbool)r   r   s   "€r   r   ÚLocal.__annotate__i   s   ø€ ÷ $ñ $©ð $¸ñ $r   c                ó°   € Wn         \        P                  ! 4       V n        V  V'       d   \        P                  ! 4       V n        R # \        4       V n        R # r   )Ú_thread_criticalr'   ÚRLockÚ_thread_lockÚlocalr6   r+   )r   rQ   s   &&r   r   ÚLocal.__init__i   s6   € Ø /ÔÜ%ŸOšOÓ-ˆÔáçä%ŸOšOÓ-ˆDŽMô "›GˆDŽMr   c              #  óÔ  "  € V P                   '       d€   R p \        P                  ! 4        V'       g   V P                  x € R# \        V P                  R4      '       g   \        4       V P                  n        V P                  P                  x € R# V P                  ;_uu_ 4        V P                  x € RRR4       R#   \         d    Rp L£i ; i  + '       g   i     R# ; i5i)TFÚcvarN)	rU   ÚasyncioÚget_running_loopÚRuntimeErrorr6   Úhasattrr+   r[   rW   )r   Úis_asyncs   & r   Ú_lock_storageÚLocal._lock_storagev   s°   é € ð × × Ð ØˆHð!ô ×(Ò(Ô*÷ ð
 —m‘mÔ#ô ˜tŸ}™}¨f×5Ò5Ü).«�D—M‘MÔ&ð
 —m‘m×(Ñ(Ô(ð ×"×"Ó"Ø—m‘mÒ#÷ #Ñ"øô3  ô !Ø ’ð!ú÷2 #×"Ð"üsE   ‚C(˜C ­C(µA3C(Â(CÂ7
C(ÃCÃC(ÃCÃC(ÃC%	Ã	C(c                ó†   € V P                  4       ;_uu_ 4       p\        W!4      uuR R R 4       #   + '       g   i     R # ; ir   )ra   Úgetattr©r   r<   r$   s   && r   r=   ÚLocal.__getattr__œ   s*   € Ø×Ñ×!Ô! WÜ˜7Ó(÷ "×!×!Ó!ús	   ™/¯A 	c                ó¶   <€ VR9   d   \         SV `  W4      # V P                  4       ;_uu_ 4       p\        W1V4       RRR4       R#   + '       g   i     R# ; i)Ú_localN)rh   r6   rU   rW   )rB   rC   ra   Úsetattr)r   r<   r@   r$   rF   s   &&& €r   rC   ÚLocal.__setattr__    sF   ø€ ØÐLÔLÜ‘7Ñ& sÓ2Ð2Ø×Ñ×!Ô! WÜ�G %Ô(÷ "×!×!Ò!ús   °AÁA	c                ó†   € V P                  4       ;_uu_ 4       p\        W!4       R R R 4       R #   + '       g   i     R # ; ir   )ra   Údelattrre   s   && r   rJ   ÚLocal.__delattr__¦   s*   € Ø×Ñ×!Ô! WÜ�GÔ!÷ "×!×!Ò!ús	   ™/¯A 	)r6   rU   rW   )F)r   r   r   r   r   r   Ú
contextlibÚcontextmanagerra   r=   rC   rJ   r!   r"   rL   rM   s   @@r   rO   rO   M   sC   ù‡ € ñ÷6$ò $ð ×Ññ#$ó ð#$òJ)õ)÷"ò "r   rO   )r\   rn   r/   r'   Útypingr   r   r   r)   r+   rO   r%   r   r   Ú<module>rq      s<   ðÛ Û Û Û ß ÷ñ õ09÷
%Nñ %N÷P["ó ["r   