HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //usr/local/lib/python3.10/dist-packages/numpy/distutils/__pycache__/_shell_utils.cpython-310.pyc
o

���g5
�@s�dZddlZddlZddlZzddlmZWney%ddlmZYnwgd�ZGdd�d�ZGdd�d�Z	Gd	d
�d
�Z
ejdkrHe	ZdSejdkrQe
ZdSdS)
zq
Helper functions for interacting with the shell, and consuming shell-style
parameters provided in config files.
�N��quote)�
WindowsParser�PosixParser�NativeParserc@�(eZdZdZedd��Zedd��ZdS)�CommandLineParsera

    An object that knows how to split and join command-line arguments.

    It must be true that ``argv == split(join(argv))`` for all ``argv``.
    The reverse neednt be true - `join(split(cmd))` may result in the addition
    or removal of unnecessary escaping.
    cC�t�)z5 Join a list of arguments into a command line string ��NotImplementedError��argv�r�G/usr/local/lib/python3.10/dist-packages/numpy/distutils/_shell_utils.py�join�zCommandLineParser.joincCr	)z6 Split a command line string into a list of arguments r
��cmdrrr�splitrzCommandLineParser.splitN��__name__�
__module__�__qualname__�__doc__�staticmethodrrrrrrrs
rc@r)rz�
    The parsing behavior used by `subprocess.call("string")` on Windows, which
    matches the Microsoft C/C++ runtime.

    Note that this is _not_ the behavior of cmd.
    cCs
t�|�S�N)�
subprocess�list2cmdlinerrrrr*s
zWindowsParser.joincs�ddl}z|jWn	tyt�w|sgSd|}|jjj}|�|j�|_|j|�|j	�f|_
|�	�}|||�|����fdd�t|j
�D�}|jj���rRJ�|ddksZJ�|dd�S)Nrzdummy csg|]}�|�qSrr)�.0�i��lpargsrr�
<listcomp>Csz'WindowsParser.split.<locals>.<listcomp>�dummy�)�ctypes�windll�AttributeErrorr�shell32�CommandLineToArgvW�POINTER�	c_wchar_p�restype�c_int�argtypes�byref�range�value�kernel32�	LocalFree)rr%r)�nargs�argsrr rr/s$
�
zWindowsParser.splitNrrrrrr#s
rc@r)rzX
    The parsing behavior used by `subprocess.call("string", shell=True)` on Posix.
    cCsd�dd�|D��S)N� css�|]}t|�VqdSrr)r�argrrr�	<genexpr>Qs�z#PosixParser.join.<locals>.<genexpr>)rrrrrrOszPosixParser.joincCstj|dd�S)NT)�posix)�shlexrrrrrrSszPosixParser.splitNrrrrrrKs
r�ntr9)
r�osr:rr�ImportError�pipes�__all__rrr�namerrrrr�<module>s$�(


�