o
    Zhw                     @  s   d Z ddlmZ ddlZddlZddlZddlmZmZ ddl	m
Z
 er*ddlmZ g dZed	Ze
ejd
ddddZe
ejd
ddddZe
ejd
dddddZe
ejd
ddd ddZdS )!z
Python polyfills for builtins
    )annotationsN)TYPE_CHECKINGTypeVar   )substitute_in_graph)Iterable)allany	enumeratesum_TT)Zcan_constant_fold_throughiterableIterable[object]returnboolc                C  s   | D ]}|s	 dS qdS )NFT r   elemr   r   O/var/www/auris/lib/python3.10/site-packages/torch/_dynamo/polyfills/builtins.pyr      
   r   c                C  s   | D ]}|r	 dS qdS )NTFr   r   r   r   r   r	   &   r   r	   )Zis_embedded_typeIterable[_T]startintIterable[tuple[int, _T]]c                 c  s@    t |tstt|jd| D ]}||fV  |d7 }qd S )Nz+ object cannot be interpreted as an integer   )
isinstancer   	TypeErrortype__name__)r   r   xr   r   r   r
   .   s   


r
   c                C  s   t tj| |S )N)	functoolsreduceoperatoradd)r   r   r   r   r   r   :   s   r   )r   r   r   r   )r   )r   r   r   r   r   r   )r   r   r   r   r   r   )__doc__
__future__r   builtinsr    r"   typingr   r   Z
decoratorsr   collections.abcr   __all__r   r   r	   r
   r   r   r   r   r   <module>   s&    