Hacked By AnonymousFox
�
�܋f$| � �p � d dl Z d dlZd dlZd dlZd dlZd dlZd dlZd dlZd dlmZm Z
mZ d dlm
Z
d dlZddlmZ ddlmZ d dlmZ d dlmZmZ d d lmZ d d
lmZmZ ddlmZm Z m!Z!m"Z"m#Z#m$Z$m%Z%m&Z&m'Z'm(Z(m)Z) d dl*m+Z+m,Z,m-Z-m.Z.m/Z/m0Z0 g d
�Z1 ej2 ej3 d�� � Z3 G d� d� � Z4d� Z5 G d� de
� � Z6 ed� � d?ej7 d�d�� � Z8d@d�Z9 e3e9� � dAd�� � Z:d� Z; e3e;� � d� � � Z<d� Z= e3e=� � d� � � Z>dBd �Z?d!� Z@d"eAfd#�ZBd$ZCdCd&�ZDd'� ZEd$ZCd(d)d*d+dd ddddejF d,d-�d.�ZGe ed� � eHd)ddd ddd d,df
ddd/�d0�� � � � ZI e3� � eI� � ZJ dDd1�ZK e3eK� � dEd7�� � ZL ed� � dFd8�� � ZMe ed� � eHd)dd d ddddddd5�N eOe jP � � � � d9ddd:dddddd,fd dd;�d<�� � � � ZQ e3� � eQ� � ZRd=� ZSd>� ZTdS )G� N)�
itemgetter�index�methodcaller)�Mapping� )�format)�
DataSource)� overrides)�packbits�
unpackbits)�_load_from_filelike)�set_array_function_like_doc�
set_module)�LineSplitter�
NameValidator�StringConverter�ConverterError�ConverterLockError�ConversionWarning�_is_string_like�has_nested_fields�
flatten_dtype�
easy_dtype�_decode_line)�asbytes�asstr� asunicode� os_fspath�os_PathLike�pickle)
�savetxt�loadtxt�
genfromtxt�
recfromtxt�
recfromcsv�load�save�savez�savez_compressedr r � fromregexr �numpy)�modulec �$ � e Zd ZdZd� Zd� Zd� ZdS )�BagObjam
BagObj(obj)
Convert attribute look-ups to getitems on the object passed in.
Parameters
----------
obj : class instance
Object on which attribute look-up is performed.
Examples
--------
>>> from numpy.lib.npyio import BagObj as BO
>>> class BagDemo:
... def __getitem__(self, key): # An instance of BagObj(BagDemo)
... # will call this method when any
... # attribute look-up is required
... result = "Doesn't matter what you want, "
... return result + "you're gonna get this"
...
>>> demo_obj = BagDemo()
>>> bagobj = BO(demo_obj)
>>> bagobj.hello_there
"Doesn't matter what you want, you're gonna get this"
>>> bagobj.I_can_be_anything
"Doesn't matter what you want, you're gonna get this"
c �8 � t j |� � | _ d S �N)�weakref�proxy�_obj)�self�objs �F/opt/cloudlinux/venv/lib64/python3.11/site-packages/numpy/lib/npyio.py�__init__zBagObj.__init__H s � ��M�#�&�&�� � � � c � � t � | d� � | S # t $ r t |� � d �w xY w)Nr3 )�object�__getattribute__�KeyError�AttributeError�r4 �keys r6 r; zBagObj.__getattribute__L sM � � 0��*�*�4��8�8��=�=��� 0� 0� 0� ��%�%�4�/� 0���s � # �>c �v � t t � | d� � � � � � � S )z�
Enables dir(bagobj) to list the files in an NpzFile.
This also enables tab-completion in an interpreter or IPython.
r3 )�listr: r; �keys�r4 s r6 �__dir__zBagObj.__dir__R s. � � �F�+�+�D�&�9�9�>�>�@�@�A�A�Ar8 N)�__name__�
__module__�__qualname__�__doc__r7 r; rD � r8 r6 r. r. * sP � � � � � �� �:'� '� '�0� 0� 0�B� B� B� B� Br8 r. c �t � t | d� � st | � � } ddl}d|d<