Ë
    øÿæi4  ã                   óþ   — d dl Z d dlZd dlZd dlmZ d dlmZmZ d dlm	Z	 d dl
mZ 	 ddededz  deee   eedz  f   fd	„Zd
ee   dee   fd„Z G d„ de«      Zej&                  d„ «       Zd„ Z G d„ de«      Zd„ Zy)é    N)Údedent)ÚAnyÚ
NamedTuple)ÚErrorReport)ÚSourceRangeFactoryÚobjÚ	error_msgÚreturnc                 óÆ   — d}	 t        j                  | «      }t        j                  | «      \  }}|||fS # t        $ r!}d| › d�}|r|d|z   z  }t        |«      |‚d}~ww xY w)z{
    Wrapper around inspect.getsourcelines and inspect.getsourcefile.

    Returns: (sourcelines, file_lino, filename)
    NzCan't get source for zs. TorchScript requires source access in order to carry out compilation, make sure original .py files are available.Ú
)ÚinspectÚgetsourcefileÚgetsourcelinesÚOSError)r   r	   ÚfilenameÚsourcelinesÚfile_linenoÚeÚmsgs          úc/Volumes/fast/ai/experiments/voice-extract-mac/.venv/lib/python3.12/site-packages/torch/_sources.pyÚget_source_lines_and_filer      sŠ   € ð €Hð"Ü×(Ñ(¨Ó-ˆÜ#*×#9Ñ#9¸#Ó#>Ñ ˆ�[ð ˜ XÐ-Ð-øô ò "à# C 5ð )ð ð 	ñ
 Ø�4˜)Ñ#Ñ#ˆCÜ�c‹l Ð!ûð"ús   „-6 ¶	A ¿AÁA r   c                 óh  — d„ }d}t        | «      D ](  \  }}|j                  «       j                  d«      sŒ&|} n |€| S | |   }|j                  d«      d   }| d| D �cg c]  }| |||«      z   ‘Œ }}| |dz   d D �cg c]  }| |||«      z   ‘Œ }	}|j	                  |«       ||	z   S c c}w c c}w )a   
    This helper function accepts a list of source lines. It finds the
    indentation level of the function definition (`def`), then it indents
    all lines in the function body to a point at or greater than that
    level. This allows for comments and continued string literals that
    are at a lower indentation than the rest of the code.
    Args:
        sourcelines: function source code, separated into lines by
                        the '
' character
    Returns:
        A list of source lines that have been correctly aligned
    c                 óD   — | | j                  |«      xr t        |«      d  S ©N)Ú
startswithÚlen)ÚtextÚprefixs     r   Úremove_prefixz-normalize_source_lines.<locals>.remove_prefix4   s"   € Ø�D—O‘O FÓ+Ò;´°F³Ð=Ð>Ð>ó    NÚdefr   é   )Ú	enumerateÚlstripr   ÚsplitÚappend)
r   r   ÚidxÚiÚlÚfn_defÚ
whitespaceÚsÚaligned_prefixÚaligned_suffixs
             r   Únormalize_source_linesr/   &   sø   € ò?ð €CÜ˜+Ö&‰ˆˆ1Ø�8‰8‹:× Ñ  Õ'ØˆCÙð 'ð €{ØÐð ˜Ñ€FØ—‘˜eÓ$ QÑ'€Jð <GÀtÈÑ;LóÙ;L°aˆ
‘] 1 jÓ1Ó1Ð;Lð ð ð <GÀsÈQÁwÀyÑ;QóÙ;Q°aˆ
‘] 1 jÓ1Ó1Ð;Qð ð ð
 ×Ñ˜&Ô!Ø˜NÑ*Ð*ùòùòs   Á B*Á?B/c                   ó$   ‡ — e Zd Z	 	 dˆ fd„	Zˆ xZS )ÚSourceContextc                 óT   •— t         ‰| �  ||||«       || _        || _        || _        y r   )ÚsuperÚ__init__Úuses_true_divisionr   Úfuncname)ÚselfÚsourcer   r   Úleading_whitespace_lenr5   r6   Ú	__class__s          €r   r4   zSourceContext.__init__X   s/   ø€ ô 	‰Ñ˜ ¨;Ð8NÔOØ"4ˆÔØ ˆŒØ ˆ�r    )TN)Ú__name__Ú
__module__Ú__qualname__r4   Ú__classcell__)r:   s   @r   r1   r1   W   s   ø„ ð  Ø÷!ñ !r    r1   c                  ó   — t        | Ž S r   )r1   )Úargss    r   Úmake_source_contextrA   g   s   € ä˜$ÐÐr    c                  ó>   — t        dd dd«      j                  dd«      S )NÚ r   r"   )r1   Úmake_raw_range© r    r   Ú
fake_rangerF   l   s    € Ü˜˜T 1 aÓ(×7Ñ7¸¸1Ó=Ð=r    c                   óZ   — e Zd ZU ej                  ed<   eed<   eed<   edz  ed<   eed<   y)Ú	ParsedDefÚastÚctxr8   Nr   r   )	r;   r<   r=   rI   ÚModuleÚ__annotations__r1   ÚstrÚintrE   r    r   rH   rH   p   s&   … Ø	�‰ƒOØ	ÓØƒKØ�D‰jÓØÔr    rH   c                 ó*  — t        | t        j                  «       «      \  }}}t        |«      }dj	                  |«      }t        |«      }t        j                  |«      }t        |j                  «      dk7  s't        |j                  d   t        j                  «      st        d|› d|› �«      ‚t        |j                  dd«      d   «      t        |j                  dd«      d   «      z
  }t        ||||d| j                  «      }t!        |||||«      S )NrC   r"   r   z&Expected a single top-level function: Ú:r   T)r   r   Ú
call_stackr/   Újoinr   rI   Úparser   ÚbodyÚ
isinstanceÚFunctionDefÚRuntimeErrorr%   rA   r;   rH   )	Úfnr   r   r   r8   Ú
dedent_srcÚpy_astr9   rJ   s	            r   Ú	parse_defr[   x   s  € Ü)BØ
ŒK×"Ñ"Ó$ó*Ñ&€K�˜hô )¨Ó5€KØ�W‰W�[Ó!€FÜ˜“€JÜ�Y‰Y�zÓ"€FÜ
ˆ6�;‰;Ó˜1Ò¤J¨v¯{©{¸1©~¼s¿¹Ô$OÜØ4°X°J¸aÀ¸}ÐMó
ð 	
ô ! §¡¨d°AÓ!6°qÑ!9Ó:¼SØ×Ñ˜˜qÓ! !Ñ$ó>ñ Ðô Ø�˜+Ð'=¸tÀRÇ[Á[ó€Cô �V˜S &¨(°KÓ@Ð@r    r   )rI   Ú	functoolsr   Útextwrapr   Útypingr   r   Útorch._Cr   Útorch._C._jit_tree_viewsr   rM   ÚtupleÚlistrN   r   r/   r1   ÚcacherA   rF   rH   r[   rE   r    r   Ú<module>rd      s®   ðã 
Û Û Ý ß "å  Ý 7ð
 !ñ.Ø	ð.à�T‰zð.ð ˆ4�‰9�c˜3 ™:Ð%Ñ&ó.ð4,+¨¨S©	ð ,+°d¸3±ió ,+ôb!Ð&ô !ð  ‡�ñ ó ð ò>ô�
ô óAr    