403Webshell
Server IP : 217.160.0.135  /  Your IP : 216.73.217.85
Web Server : Apache
System : Linux www 6.18.52-i1-ampere #1203 SMP Mon Sep 14 18:29:59 CEST 2026 aarch64
User : sws1074145052 ( 1074145052)
PHP Version : 8.3.32
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /usr/lib/python3/dist-packages/numpy/testing/_private/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/python3/dist-packages/numpy/testing/_private/__pycache__/extbuild.cpython-311.pyc
�

���c���|�dZddlZddlZddlZddlZddgZddgdd�d�Zggfd�Zd	�Zd
�Z	d�Z
gggfd�Zd
�Zd�Z
dS)zb
Build a c-extension module on-the-fly in tests.
See build_and_import_extensions for usage hints

�N�build_and_import_extension�compile_extension_module�)�prologue�	build_dir�include_dirs�	more_initc��ddlm}|t||��z}d}|stjd��}|r
|dz
}||z
}|dz
}t|||��}		t
||||	��}
n!#|$r}td|�d���|�d	}~wwxYwdd	l}|j	�
||
��}
|j	�|
��}|
j�
|��|S)
a
    Build and imports a c-extension module `modname` from a list of function
    fragments `functions`.


    Parameters
    ----------
    functions : list of fragments
        Each fragment is a sequence of func_name, calling convention, snippet.
    prologue : string
        Code to precede the rest, usually extra ``#include`` or ``#define``
        macros.
    build_dir : pathlib.Path
        Where to build the module, usually a temporary directory
    include_dirs : list
        Extra directories to find include files when compiling
    more_init : string
        Code to appear in the module PyMODINIT_FUNC

    Returns
    -------
    out: module
        The module will have been loaded and is ready for use

    Examples
    --------
    >>> functions = [("test_bytes", "METH_O", """
        if ( !PyBytesCheck(args)) {
            Py_RETURN_FALSE;
        }
        Py_RETURN_TRUE;
    """)]
    >>> mod = build_and_import_extension("testme", functions)
    >>> assert not mod.test_bytes(u'abc')
    >>> assert mod.test_bytes(b'abc')
    r)�CompileErrorz8PyObject *mod = PyModule_Create(&moduledef);
           �.z.#define INITERROR return NULL
                z
return mod;zcould not compile in �:N)�distutils.errorsr�
_make_methods�pathlib�Path�_make_sourcer�RuntimeError�importlib.util�util�spec_from_file_location�module_from_spec�loader�exec_module)�modname�	functionsrrrr	r�body�init�
source_string�mod_so�e�	importlib�spec�foos               �A/usr/lib/python3/dist-packages/numpy/testing/_private/extbuild.pyrrs9��N.�-�-�-�-�-��m�I�w�7�7�7�D��D��&��L��%�%�	�����	���	����O��D� ��$��5�5�M�H�)��Y��m�=�=�����H�H�H��?�9�?�?�?�@�@�a�G�����H���������>�1�1�'�6�B�B�D�
�.�
)�
)�$�
/�
/�C��K���C� � � ��Js�A(�(B�-B�Bc���|�d��d}||z}|�d���t||��}|tjd��gz}t|||z|gg���S)aH
    Build an extension module and return the filename of the resulting
    native code file.

    Parameters
    ----------
    name : string
        name of the module, possibly including dots if it is a module inside a
        package.
    builddir : pathlib.Path
        Where to build the module, usually a temporary directory
    include_dirs : list
        Extra directories to find include files when compiling
    libraries : list
        Libraries to link into the extension module
    library_dirs: list
        Where to find the libraries, ``-L`` passed to the linker
    r���T)�exist_ok�	INCLUDEPY)�outputfilenamer�	libraries�library_dirs)�split�mkdir�_convert_str_to_file�	sysconfig�get_config_var�
_c_compile)	�name�builddirrrr*r+r�dirname�cfiles	         r$rrPs���*�j�j��o�o�b�!�G���o�G��M�M�4�M� � � � ���8�8�E��9�#;�K�#H�#H�"I�I�L��
�g��/�!�R�b�
�
�
�
�c��|dz}|�d��5}|�t|����ddd��n#1swxYwY|S)zHelper function to create a file ``source.c`` in `dirname` that contains
    the string in `source`. Returns the file name
    zsource.c�wN)�open�write�str)�sourcer4�filename�fs    r$r.r.qs�����#�H�	���s�	�	��q�	����F�������������������������Os�#A
�
A�Ac
�R�g}g}|D]b\}}}|�d|��}d|vrd}nd}|�d|�d|�d|�d���d	�|||�
��}	|�|	���cd�|��dtd�|��|�
��zz}
|
S)z� Turns the name, signature, code in functions into complete functions
    and lists them in a methods_table. Then turns the methods_table into a
    ``PyMethodDef`` structure and returns the resulting code fragment ready
    for compilation
    �_�
METH_KEYWORDSz2(PyObject *self, PyObject *args, PyObject *kwargs)z (PyObject *self, PyObject *args)z{"z", (PyCFunction)z, z},z^
        static PyObject* {cfuncname}{signature}
        {{
        {code}
        }}
        )�	cfuncname�	signature�code�
a6
    static PyMethodDef methods[] = {
    %(methods)s
    { NULL }
    };
    static struct PyModuleDef moduledef = {
        PyModuleDef_HEAD_INIT,
        "%(modname)s",  /* m_name */
        NULL,           /* m_doc */
        -1,             /* m_size */
        methods,        /* m_methods */
    };
    )�methodsr)�append�format�join�dict)rr�
methods_table�codes�funcname�flagsrDrBrC�	func_coders           r$rr{s����M��E�!*� � ���%��&�w�w���1�	��e�#�#�L�I�I�:�I�����08���)�)�)�U�U�U�K�	M�	M�	M��

�F�Y�)�$�F�G�G�	�	���Y������9�9�U�����t�y�y��/�/��
A�
A�
A�B�B�D��Kr6c�0�dt|||���z}|S)zG Combines the code fragments into source code ready to be compiled
    zn
    #include <Python.h>

    %(body)s

    PyMODINIT_FUNC
    PyInit_%(name)s(void) {
    %(init)s
    }
    )r2rr)rJ)r2rrrDs    r$rr�s0��	��
��4�����D��Kr6c	� �tjdkr2dg}dtj�tjd��zg}n+tj�d��rgd�}d}ndx}}	tjdkr|dgz}tjdkr�d	D]�}|d
z|vr:tj�|d
z��r|�|d
z��|dz|vr:tj�|dz��r|�|dz����|�	t����}tj���}	t|||||||��|���D]7\}	}
tj�|	��|
kr|
tj|	<�8nQ#|���D]7\}	}
tj�|	��|
kr|
tj|	<�8wxYw|S)N�win32z/we4013z	/LIBPATH:�libs�linux)z-O0z-gz%-Werror=implicit-function-declarationz-fPICz/DEBUG�darwin)z/sw/z/opt/local/�include�lib)�sys�platform�os�pathrI�base_prefix�
startswith�existsrG�with_suffix�
get_so_suffix�environ�copy�build�items�get)r5r)rr*r+�
compile_extra�
link_extra�s�
saved_environ�key�values           r$r1r1�s��
�|�w���"��
�!�B�G�L�L���&�$I�$I�I�J�
�
�	��	 �	 ��	)�	)�
�K�K�K�
��
�
�%)�)�
�
��
�|�w����8�*�,�
�
�|�x���(�	/�	/�A��I�
�\�1�1�����q�9�}�5�5�2��#�#�A�	�M�2�2�2��5�y��,�,������E�	�1J�1J�,��#�#�A��I�.�.�.��#�/�/�
���@�@�N��J�O�O�%�%�M�
(�
��>��:��)�\�	3�	3�	3�(�-�-�/�/�	(�	(�J�C���z�~�~�c�"�"�e�+�+�"'��
�3���	(��-�-�-�/�/�	(�	(�J�C���z�~�~�c�"�"�e�+�+�"'��
�3���	(�����s
�F=�=AHc����ddlm}|dd���}|�d��g}	tj��}
tj�j��	|�t�j	��g||���}|	�fd�|D��z
}	tj|
��n#tj|
��wxYw|�
|	t|��|||�	��d
S)z@cd into the directory where the cfile is, use distutils to buildr)�new_compiler��)�force�verboser)r�
extra_preargsc�>��g|]}t�j|z����S�)r;�parent)�.0�rr5s  �r$�
<listcomp>zbuild.<locals>.<listcomp>�s(���7�7�7�a�C���q�(�)�)�7�7�7r6)r*rrr+N)�numpy.distutils.ccompilerrm�	customizerZ�getcwd�chdirru�compiler;r2�link_shared_object)r5r)rfrgrr*r+rm�compiler�objects�old�ress`           r$rcrc�s���7�6�6�6�6�6��|�!�Q�/�/�/�H����r�����G�
�)�+�+�C��H�U�\��������
���_�_��%�'�����
	�7�7�7�7�3�7�7�7�7��
���
�
�
�
�����
�
�
�
���������^�$�$�� �!�	 �#�#�#�#�#s�<B*�*Cc�6�tjd��}|sJ�|S)N�
EXT_SUFFIX)r/r0)�rets r$r`r`�s ��
�
"�<�
0�
0�C��J�J�J��Jr6)�__doc__rZrrXr/�__all__rrr.rrr1rcr`rtr6r$�<module>r�s�����
�	�	�	�����
�
�
�
�����'�)C�
D��)+�d��2�>�>�>�>�>�F"$�"�
�
�
�
�B���%�%�%�P���$46���$�$�$�$�N#�#�#�8����r6

Youez - 2016 - github.com/yon3zu
LinuXploit