o
    Gƒáe  ã                   @   sH   d Z ddlZejdkZerdpdZerdpdZdddd	d
œZdd„ ZdS )zø Byteorder utilities for system - numpy byteorder encoding

Converts a variety of string codes for little endian, big endian,
native byte order and swapped byte order to explicit NumPy endian
codes - one of '<' (little endian) or '>' (big endian)

é    NÚlittleú<ú>)r   r   ÚlÚle)Úbigr   ÚbÚbe)Únativeú=)ÚswappedÚS)r   r   r
   r   c                 C   s`   |   ¡ } | du r
tS | td v rdS | td v rdS | td v r"tS | td v r*tS td|  ƒ‚)	a5  
    Convert various order codings to NumPy format.

    Parameters
    ----------
    code : str
        The code to convert. It is converted to lower case before parsing.
        Legal values are:
        'little', 'big', 'l', 'b', 'le', 'be', '<', '>', 'native', '=',
        'swapped', 's'.

    Returns
    -------
    out_code : {'<', '>'}
        Here '<' is the numpy dtype code for little endian,
        and '>' is the code for big endian.

    Examples
    --------
    >>> import sys
    >>> sys_is_le == (sys.byteorder == 'little')
    True
    >>> to_numpy_code('big')
    '>'
    >>> to_numpy_code('little')
    '<'
    >>> nc = to_numpy_code('native')
    >>> nc == '<' if sys_is_le else nc == '>'
    True
    >>> sc = to_numpy_code('swapped')
    >>> sc == '>' if sys_is_le else sc == '<'
    True

    Nr   r   r   r   r
   r   zWe cannot handle byte order %s)ÚlowerÚnative_codeÚaliasesÚswapped_codeÚ
ValueError)Úcode© r   úh/var/www/html/SPIRAL.web.tool/spiral_venv/lib/python3.10/site-packages/scipy/io/matlab/byteordercodes.pyÚto_numpy_code   s   #ÿr   )Ú__doc__ÚsysÚ	byteorderÚ	sys_is_ler   r   r   r   r   r   r   r   Ú<module>   s    
ý