
    1;ji                     T    d Z ddlZddlZddlZ G d dej                  Zd Zd ZdS )zR
This module provides helper functions to find the first line of a function
body.
    Nc                   >     e Zd ZdZd Z fdZdej        fdZ xZ	S )FindDefFirstLinez
    Attributes
    ----------
    first_stmt_line : int or None
        This stores the first statement line number if the definition is found.
        Or, ``None`` if the definition is not found.
    c                 0    || _         || _        d| _        dS )zf
        Parameters
        ----------
        code :
            The function's code object.
        N)_co_name_co_firstlinenofirst_stmt_line)selfnamefirstlinenos      T/root/voice-cloning/.venv/lib/python3.11/site-packages/numba/misc/firstlinefinder.py__init__zFindDefFirstLine.__init__   s!     *#    c                 x    t          j        |          D ]#}t                                          |           $d S )N)astiter_child_nodessupervisit)r	   nodechild	__class__s      r   _visit_childrenz FindDefFirstLine._visit_children   s@    )$// 	! 	!EGGMM%    	! 	!r   r   c                 f   |j         | j        k    rt          |j        g          }|j        r'|j        d         }|                    |j                   | j        |v r?|j        r7|j        d         }t          |          r|j        d         }|j        | _	        d S 	 | 
                    |           d S )Nr      )r
   r   setlinenodecorator_listaddr   body_is_docstringr   r   )r	   r   possible_start_linesfirst_decor
first_stmts        r   visit_FunctionDefz"FindDefFirstLine.visit_FunctionDef#   s    9%% $'}#5#5 " = #1!4$(();<<<#';;; 9 !%1J$Z00 2%)Yq\
+5+<D(F
 T"""""r   )
__name__
__module____qualname____doc__r   r   r   FunctionDefr#   __classcell__)r   s   @r   r   r      sn         	$ 	$ 	$! ! ! ! !#co # # # # # # # #r   r   c                     t          | t          j                  r@t          | j        t          j                  r!t          | j        j        t
                    rdS dS )NTF)
isinstancer   ExprvalueConstantstr)r   s    r   r   r   A   sM    $!! tz3<00 	tz/55	45r   c                 4   | j         }	 t          |j                  5 }|                                }d}ddd           n# 1 swxY w Y   nc# t          t
          f$ rO 	 t          j        |           \  }}d                    |          }|dz
  }n# t
          t          f$ r Y Y dS w xY wY nw xY wt          j        t          j        |                    }t          |j        |j        |z
            }|                    |           |j        r
|j        |z   S dS )a  
    Look up the first line of function body using the file in
    ``pyfunc.__code__.co_filename``.

    Returns
    -------
    lineno : int; or None
        The first line number of the function body; or ``None`` if the first
        line cannot be determined.
    r   N r   )__code__openco_filenamereadFileNotFoundErrorOSErrorinspectgetsourcelinesjoin	TypeErrorr   parsetextwrapdedentr   co_nameco_firstlinenor   r   )pyfunccofinsourceoffsetlinestreefinders           r   get_func_body_first_linenorI   I   sp    
B
".!! 	SXXZZFF	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 w'   	#26::ME6WWU^^FaZFF# 	 	 	444	 F	 9X_V,,--Dbj"*;f*DEEF
LL %.. tsW   A A A  AA AA B,1BB,B&!B,%B&&B,+B,)r'   r   r8   r=   NodeVisitorr   r   rI    r   r   <module>rL      s    
 


  3# 3# 3# 3# 3#s 3# 3# 3#l      r   