Ë
    èÿæiC  ã                   ód   — d Z ddlmZmZmZ ddlmZ ddlmZ ed„ «       Z	ed„ «       Z
ed„ «       Zy)	z™
This file provides internal compiler utilities that support certain special
operations with tuple and workarounds for limitations enforced in userland.
é    )ÚtypesÚtypingÚerrors)Úalloca_once)Ú	intrinsicc                 ó8   — d„ } ||||j                   «      }||fS )a  Return a copy of the tuple with item at *idx* replaced with *val*.

    Operation: ``out = tup[:idx] + (val,) + tup[idx + 1:]

    **Warning**

    - No boundchecking.
    - The dtype of the tuple cannot be changed.
      *val* is always cast to the existing dtype of the tuple.
    c                 óî   — |\  }}}t        ||j                  «      }|j                  ||«       |j                  ||j                  d«      |gd¬«      }|j                  ||«       |j	                  |«      S )Nr   T)Úinbounds)r   ÚtypeÚstoreÚgepÚload)	ÚcontextÚbuilderÚ	signatureÚargsÚtupÚidxÚvalÚstackÚoffptrs	            úo/Volumes/fast/ai/experiments/voice-extract-mac/.venv/lib/python3.12/site-packages/numba/cpython/unsafe/tuple.pyÚcodegenztuple_setitem.<locals>.codegen   si   € Ø‰ˆˆS�#Ü˜G S§X¡XÓ.ˆØ�‰�c˜5Ô!à—‘˜U S§X¡X¨a£[°#Ð$6À�ÓFˆØ�‰�c˜6Ô"Ø�|‰|˜EÓ"Ð"ó    )Údtype)Ú	typingctxr   r   r   r   Úsigs         r   Útuple_setitemr      s%   € ò#ñ ˆc�3˜Ÿ	™	Ó
"€CØ�ˆ<Ðr   c                 óü   ‡‡— t        |t        j                  «      st        j                  |«      ‚t        |j                  «      Št        j                  t        j                  ‰¬«      Š ‰|«      }ˆˆfd„}||fS )z"Creates a sz-tuple of full slices.)r   Úcountc                 óú   •— d„ }t         j                  ‰g}t        j                  ‰g|¢­Ž }| j	                  t         j                  «      }| j                  ‰«      } |‰«      |g}	| j                  ||||	«      }
|
S )Nc           	      óX   — |}t        | «      D ]  }t        ||t        d d «      «      }Œ |S )N)Úranger   Úslice)ÚlengthÚempty_tupleÚoutÚis       r   Úimplz5build_full_slice_tuple.<locals>.codegen.<locals>.impl/   s/   € ØˆCÜ˜6–]�Ü# C¨¬E°$¸Ó,=Ó>‘ð #àˆJr   )r   Úintpr   r   Úget_value_typeÚget_constant_undefÚcompile_internal)r   r   r   r   r)   Úinner_argtypesÚ	inner_sigÚll_idx_typer&   Ú
inner_argsÚresÚsizeÚ
tuple_types              €€r   r   z'build_full_slice_tuple.<locals>.codegen.   s{   ø€ ò	ô  Ÿ*™* jÐ1ˆÜ×$Ñ$ ZÐA°.ÒAˆ	Ø×,Ñ,¬U¯Z©ZÓ8ˆà×0Ñ0°Ó<ˆÙ! $Ó'¨Ð5ˆ
à×&Ñ& w°°iÀÓLˆØˆ
r   )	Ú
isinstancer   ÚIntegerLiteralr   ÚRequireLiteralValueÚintÚliteral_valueÚUniTupleÚslice2_type)ÚtyctxÚszr   r   r3   r4   s       @@r   Úbuild_full_slice_tupler>   $   sf   ù€ ô �bœ%×.Ñ.Ô/Ü×(Ñ(¨Ó,Ð,äˆr×ÑÓ €DÜ—‘¤e×&7Ñ&7¸tÔD€JÙ
�R‹.€Cõð" �ˆ<Ðr   c                 óˆ   — t        |t        j                  «      sd|› �}t        j                  |«      ‚ ||«      }d„ }||fS )aR  This exists to handle the situation y = (*x,), the interpreter injects a
    call to it in the case of a single value unpack. It's not possible at
    interpreting time to differentiate between an unpack on a variable sized
    container e.g. list and a fixed one, e.g. tuple. This function handles the
    situation should it arise.
    zBOnly tuples are supported when unpacking a single item, got type: c                 ó   — |d   S )Nr   © )r   r   r   r   s       r   r   z$unpack_single_tuple.<locals>.codegenR   s   € Ø�A‰wˆr   )r5   r   Ú	BaseTupler   ÚUnsupportedError)r<   r   Úmsgr   r   s        r   Úunpack_single_tuplerE   B   sL   € ô �cœ5Ÿ?™?Ô+ðØ˜5ð"ˆä×%Ñ% cÓ*Ð*á
ˆc‹(€Còà�ˆ<Ðr   N)Ú__doc__Ú
numba.corer   r   r   Únumba.core.cgutilsr   Únumba.core.extendingr   r   r>   rE   rA   r   r   Ú<module>rJ      sT   ðñ÷
 -Ñ ,Ý *Ý *ð ñó ðð0 ñó ðð: ñó ñr   