https://t.me/RX1948
Server : Apache
System : Linux iad1-shared-b8-43 6.6.49-grsec-jammy+ #10 SMP Thu Sep 12 23:23:08 UTC 2024 x86_64
User : dh_edsupp ( 6597262)
PHP Version : 8.2.26
Disable Function : NONE
Directory :  /lib/python3/dist-packages/numpy/distutils/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python3/dist-packages/numpy/distutils/__pycache__/from_template.cpython-310.pyc
o

6��a��@s�dZddgZddlZddlZddlZe�dej�Ze�dej�Ze�dej�Z	dd	�Z
e�d
�Ze�d�Ze�d�Z
d
d�Zdd�Ze�d�Zdd�Zdd�Ze�d�Zdd�Zdd�Ze�dej�Zdd�Zdd�Zed�Zdd �Zed!kr|e�dSdS)"a�

process_file(filename)

  takes templated file .xxx.src and produces .xxx file where .xxx
  is .pyf .f90 or .f using the following template rules:

  '<..>' denotes a template.

  All function and subroutine blocks in a source file with names that
  contain '<..>' will be replicated according to the rules in '<..>'.

  The number of comma-separated words in '<..>' will determine the number of
  replicates.

  '<..>' may have two different forms, named and short. For example,

  named:
   <p=d,s,z,c> where anywhere inside a block '<p>' will be replaced with
   'd', 's', 'z', and 'c' for each replicate of the block.

   <_c>  is already defined: <_c=s,d,c,z>
   <_t>  is already defined: <_t=real,double precision,complex,double complex>

  short:
   <s,d,c,z>, a short form of the named, useful when no <p> appears inside
   a block.

  In general, '<..>' contains a comma separated list of arbitrary
  expressions. If these expression must contain a comma|leftarrow|rightarrow,
  then prepend the comma|leftarrow|rightarrow with a backslash.

  If an expression matches '\<index>' then it will be replaced
  by <index>-th expression.

  Note that all '<..>' forms in a block must have the same number of
  comma-separated entries.

 Predefined named template rules:
  <prefix=s,d,c,z>
  <ftype=real,double precision,complex,double complex>
  <ftypereal=real,double precision,\0,\1>
  <ctype=float,double,complex_float,complex_double>
  <ctypereal=float,double,\0,\1>

�process_str�process_file�Nz2(\n|\A)((     (\$|\*))|)\s*(subroutine|function)\bz+\n\s*end\s*(subroutine|function)\b.*(\n|\Z)z\n     (\$|\*)\s*function\bcCs�g}d}	t�||�}|dur	|S|��}t�|||���r:	|�d||�}|dkr,n|}|||d�dkr9nq |d7}t�||���}|rN|��dpQt|�}}|�	||f�q)	z� Return a list of tuples for each function or subroutine each
    tuple is the start and end of a subroutine or function to be
    expanded.
    rTN�
����z
     $�)
�routine_start_re�search�start�function_start_re�match�end�rfind�routine_end_re�len�append)�astr�spanlist�ind�mr
�ir
�r�?/usr/lib/python3/dist-packages/numpy/distutils/from_template.py�parse_structure:s,���rz<\s*(\w[\w\d]*)\s*>z<\s*(\w[\w\d]*)\s*=\s*(.*?)\s*>z<\s*((.*?))\s*>cCsPt�|�}i}|D]}|d��pt|�}|d�dd�}t|�}|||<q	|S)Nrr�\,�@comma@)�named_re�findall�strip�
unique_key�replace�conv)r�reps�names�rep�name�repl�thelistrrr�find_repl_patternsYs

r(cCs"t|�}t�td|�d}||fS)N�r)r(�re�subnr)rr#rrr�find_and_remove_repl_patternscsr,z\A\\(?P<index>\d+)\ZcCs`|�d�}dd�|D�}tt|��D]}t�||�}|r*t|�d��}||||<qd�|�S)N�,cSsg|]}|���qSr)r)�.0�xrrr�
<listcomp>kszconv.<locals>.<listcomp>�index)�split�ranger�item_rer�int�group�join)r�b�lrr�jrrrr!is
�
r!cCs>t|���}d}d}|sd|}||vr|d7}nd}|r|S)z( Obtain a unique key given a dictionary.Frz__l%sT)�list�keys)�adict�allkeys�done�n�newkeyrrrrss
�rz\A\s*(\w[\w\d]*)\s*\Zcsh|�dd�}|�dd�}t|��t�d|�}�fdd�}t�||�}d}d}i�t�|�D]Z}|�vr���||�|d��}|durGtd|��||vrT|�	d	�sT|||<d
d�|�
d�D�}t|�}|duro|}|�|<|}q-||krx|�|<q-td
|d�
�|�||f�q-�s�|S��fdd�}	d}
t|�D]�|
t�|	|�d7}
q�|
�dd�}
|
�dd�}
|
S)Nz\>z@rightarrow@z\<z@leftarrow@z<\1>csjt|�d��dd��}t�|�rd|Sd}���D]
}�||kr$|}q|dur1t��}|�|<d|S)Nrrrz<%s>)r!r6r �template_name_rerr<r)�mobjr'r%�key)�lnamesrr�listrepl�s
�zexpand_sub.<locals>.listreplzNo replicates found for <%s>�_cSsg|]}|�dd��qS)rr-)r )r.rrrrr0�szexpand_sub.<locals>.<listcomp>r-zHMismatch in number of replacements (base <%s=%s>) for <%s=%s>. Ignoring.cs$|�d�}��|�d|g��S)Nr)r6�get)rCr%)�k�rulesrr�namerepl�s
zexpand_sub.<locals>.namereplr)z

�>�<)r r(r�sub�list_re�template_rerrH�
ValueError�
startswithr2r�printr7r3)�substrr#rF�numsubs�	base_rule�rr'�rule�numrK�newstrr)rIrErJr�
expand_sub�sJ

��r[c	Cs�|}d}t|�}d}i}|�t�|D]*}t|||d��\}}||7}|�|�|t||d|d�|�7}|d}q|||d�7}|S)Nr)rr)r�update�_special_namesr,r[)	�allstrrZ�writestr�struct�oldendr#rN�
cleanedstr�defsrrrr�s


z8(\n|\A)\s*include\s*['\"](?P<name>[\w\d./\\]+\.src)['\"]cCs�tj�|�}t|��B}g}|D]4}t�|�}|r>|�d�}tj�|�s*tj�||�}tj�	|�r8|�
t|��q|�|�q|�|�qWd�|S1sOwY|S)Nr%)
�os�path�dirname�open�include_src_rerr6�isabsr7�isfile�extend�resolve_includesr)�source�d�fid�lines�liner�fnrrrrl�s$


�
��rlcCst|�}td�|��S)Nr))rlrr7)rmrprrrr�sz�
<_c=s,d,c,z>
<_t=real,double precision,complex,double complex>
<prefix=s,d,c,z>
<ftype=real,double precision,complex,double complex>
<ctype=float,double,complex_float,complex_double>
<ftypereal=real,double precision,\0,\1>
<ctypereal=float,double,\0,\1>
cCstztjd}Wntytj}tj}Ynwt|d�}tj�|�\}}|}t|d�}|�	�}t
|�}|�|�dS)NrrW�w)�sys�argv�
IndexError�stdin�stdoutrgrdre�splitext�readr�write)�filero�outfile�base�ext�newnamer^r_rrr�main�s
�

r��__main__)�__doc__�__all__rdrtr*�compile�IrrrrrPrrOr(r,r4r!rrBr[rrhrlrr]r��__name__rrrr�<module>s8.






<

�

https://t.me/RX1948 - 2025