| Server IP : 209.209.40.120 / Your IP : 216.73.217.112 Web Server : Microsoft-IIS/10.0 System : Windows NT NEWWWW 10.0 build 17763 (Windows Server 2019) i586 User : NEWWWW$ ( 0) PHP Version : 8.3.30 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /Python312/Lib/site-packages/numpy/lib/__pycache__/ |
Upload File : |
�
�g`| � �� � d Z dZddlZddlmc mZ ddlm Z m
Z
dd�Zd� Zd� Z
d� Zdd �Z G d
� d� Z G d� d
� Zd� Z G d� de� Z G d� de� Z G d� de� Z G d� d� Zdd�Zy)zBA collection of functions designed to help I/O with ascii files.
zrestructuredtext en� N)�asbytes� asunicodec �R � t | � t u r|�d}| j |� } | S )ak Decode bytes from binary input streams.
Defaults to decoding from 'latin1'. That differs from the behavior of
np.compat.asunicode that decodes from 'ascii'.
Parameters
----------
line : str or bytes
Line to be decoded.
encoding : str
Encoding used to decode `line`.
Returns
-------
decoded_line : str
�latin1)�type�bytes�decode)�line�encodings �4C:\Python312\Lib\site-packages\numpy/lib/_iotools.py�_decode_liner
s. � �$ �D�z�U�����H��{�{�8�$���K� c �: � | dz y# t t f$ r Y yw xY w)z2
Check whether obj behaves like a string.
� FT�� TypeError�
ValueError��objs r �_is_string_liker % s, � ���b�� ��
�z�"� ���� � ��c �: � | dz y# t t f$ r Y yw xY w)z8
Check whether obj behaves like a bytes object.
r FTr r s r �_is_bytes_liker 0 s, � ���c� � ��
�z�"� ���r c �H � � t � fd�� j xs dD � � S )a�
Returns whether one or several fields of a dtype are nested.
Parameters
----------
ndtype : dtype
Data-type of a structured array.
Raises
------
AttributeError
If `ndtype` does not have a `names` attribute.
Examples
--------
>>> import numpy as np
>>> dt = np.dtype([('name', 'S4'), ('x', float), ('y', float)])
>>> np.lib._iotools.has_nested_fields(dt)
False
c 3 �@ �K � | ] }�| j d u�� � y �w�N)�names)�.0�name�ndtypes �r � <genexpr>z$has_nested_fields.<locals>.<genexpr>Q s �� �� �M�$�v�d�|�!�!��-�M�s �� )�anyr )r s `r �has_nested_fieldsr$ ; s �� �, �M�&�,�,�:L�"�M�M�Mr c � � | j }|�E|r6| j gt t j | j
� � z S | j gS g }|D ]1 }| j | }t |d |� }|j |� �3 |S )as
Unpack a structured data-type by collapsing nested fields and/or fields
with a shape.
Note that the field names are lost.
Parameters
----------
ndtype : dtype
The datatype to collapse
flatten_base : bool, optional
If True, transform a field with a shape into several fields. Default is
False.
Examples
--------
>>> import numpy as np
>>> dt = np.dtype([('name', 'S4'), ('x', float), ('y', float),
... ('block', int, (2, 3))])
>>> np.lib._iotools.flatten_dtype(dt)
[dtype('S4'), dtype('float64'), dtype('float64'), dtype('int64')]
>>> np.lib._iotools.flatten_dtype(dt, flatten_base=True)
[dtype('S4'),
dtype('float64'),
dtype('float64'),
dtype('int64'),
dtype('int64'),
dtype('int64'),
dtype('int64'),
dtype('int64'),
dtype('int64')]
r ) r �base�int�np�prod�shape�fields�
flatten_dtype�extend)r �flatten_baser �types�field�info�flat_dts r r, r, T s� � �D
�L�L�E��}���K�K�=�3�r�w�w�v�|�|�'<�#=�=�=����}����� "�E��=�=��'�D�#�D��G�\�:�G��L�L��!� "� �r c �: � e Zd ZdZd� Z d d�Zd� Zd� Zd� Zd� Z y)
�LineSplittera�
Object to split a string at a given delimiter or at given places.
Parameters
----------
delimiter : str, int, or sequence of ints, optional
If a string, character used to delimit consecutive fields.
If an integer or a sequence of integers, width(s) of each field.
comments : str, optional
Character used to mark the beginning of a comment. Default is '#'.
autostrip : bool, optional
Whether to strip each individual field. Default is True.
c � �� �fd�S )a�
Wrapper to strip each member of the output of `method`.
Parameters
----------
method : function
Function that takes a single argument and returns a sequence of
strings.
Returns
-------
wrapped : function
The result of wrapping `method`. `wrapped` takes a single input
argument and returns a list of strings that are stripped of
white-space.
c �V �� �| � D �cg c] }|j � �� c}S c c}w r )�strip)�input�_�methods �r �<lambda>z(LineSplitter.autostrip.<locals>.<lambda>� s �� ����?�A�a�g�g�i�?� ��?s �&r"