Ë
    üÇ:j�
  ã                   óx   — d Z ddlmZmZ ddlmZ ddlmZ ddlm	Z	 ddl
mZmZ ddlmZ ed„ «       Zed	„ «       Zy
)zd
This file provides internal compiler utilities that support certain special
operations with numpy.
é    )ÚtypesÚtyping)Úunpack_tuple)Ú	intrinsic)Úimpl_ret_new_ref)ÚRequireLiteralValueÚTypingError)Útuple_setitemc                 ó”   ‡— ddl mŠ ˆfd„}t        |«      }t        j                  |dt        j
                  ¬«      } ||«      }||fS )z×A version of numpy.empty whose dtype is inferred by the type system.

    Expects `shape` to be a int-tuple.

    There is special logic in the type-inferencer to handle the "refine"-ing
    of undefined dtype.
    r   )Ú_empty_nd_implc                 ó¬   •— |j                   }|j                  «       sJ ‚t        ||d   «      } ‰| |||«      }t        | |||j	                  «       «      S )Nr   )Úreturn_typeÚ
is_preciser   r   Ú	_getvalue)ÚcontextÚbuilderÚ	signatureÚargsÚarrtyÚshapesÚresr   s          €úl/home/mcse/projects/srt_converter/srt-converter-venv/lib/python3.12/site-packages/numba/np/unsafe/ndarray.pyÚcodegenzempty_inferred.<locals>.codegen   sW   ø€ à×%Ñ%ˆØ×ÑÔ!Ð!Ð!Ü˜g t¨A¡wÓ/ˆá˜W g¨u°fÓ=ˆÜ ¨°%¸¿¹»ÓIÐIó    ÚC)ÚndimÚlayoutÚdtype)Únumba.np.arrayobjr   Úlenr   ÚArrayÚ	undefined)Ú	typingctxÚshaper   ÚndÚarray_tyÚsigr   s         @r   Úempty_inferredr(      sB   ø€ õ 1ôJô 
ˆU‹€BÜ�{‰{ ¨3´e·o±oÔF€HÙ
�5‹/€CØ�ˆ<Ðr   c                 óH  ‡‡— t        |t        j                  «      st        d«      ‚|j                  dk7  r$t        dj                  |j                  «      «      ‚t        |j                  «      Št        j                  |j                  ‰¬«      Š ‰||«      }ˆˆfd„}||fS )zÑConvert *array* into a tuple of *length*

    Returns ``UniTuple(array.dtype, length)``

    ** Warning **
    - No boundchecking.
      If *length* is longer than *array.size*, the behavior is undefined.
    z$*length* argument must be a constanté   zNot supported on array.ndim={})r   Úcountc                 ó  •— d„ }|j                   d   t        j                  ‰g}t        j                  ‰g|¢­Ž }| j                  t        j                  «      }| j                  ‰«      }|d    |‰«      |g}	| j                  ||||	«      }
|
S )Nc                 óJ   — |}t        |«      D ]  }t        ||| |   «      }Œ |S )N)Úranger
   )ÚarrayÚlengthÚempty_tupleÚoutÚis        r   Úimplz-to_fixed_tuple.<locals>.codegen.<locals>.impl?   s1   € ØˆCÜ˜6“]ò 6�Ü# C¨¨E°!©HÓ5‘ð6àˆJr   r   )r   r   Úintpr   r   Úget_value_typeÚget_constant_undefÚcompile_internal)r   r   r   r   r4   Úinner_argtypesÚ	inner_sigÚll_idx_typer1   Ú
inner_argsr   Ú
tuple_sizeÚ
tuple_types              €€r   r   zto_fixed_tuple.<locals>.codegen>   sŒ   ø€ ò	ð $Ÿ.™.¨Ñ+¬U¯Z©Z¸ÐDˆÜ×$Ñ$ ZÐA°.ÒAˆ	Ø×,Ñ,¬U¯Z©ZÓ8ˆà×0Ñ0°Ó<ˆØ˜1‘g™{¨:Ó6¸ÐDˆ
à×&Ñ& w°°iÀÓLˆØˆ
r   )Ú
isinstancer   ÚIntegerLiteralr   r   r	   ÚformatÚintÚliteral_valueÚUniTupler   )r#   r/   r0   r'   r   r=   r>   s        @@r   Úto_fixed_tuplerE   )   sŠ   ù€ ô �fœe×2Ñ2Ô3Ü!Ð"HÓIÐIà‡z�z�Q‚ÜÐ:×AÑAÀ%Ç*Á*ÓMÓNÐNô �V×)Ñ)Ó*€JÜ—‘ e§k¡k¸ÔD€JÙ
�U˜FÓ
#€Cõð" �ˆ<Ðr   N)Ú__doc__Ú
numba.corer   r   Únumba.core.cgutilsr   Únumba.core.extendingr   Únumba.core.imputilsr   Únumba.core.errorsr   r	   Únumba.cpython.unsafe.tupler
   r(   rE   © r   r   ú<module>rN      sF   ðñ÷ %Ý +Ý *Ý 0ß >å 4ð ñó ðð4 ñ%ó ñ%r   