File: //opt/alt/python37/lib64/python3.7/site-packages/numpy/lib/__pycache__/npyio.cpython-37.pyc
B
<�FdA' � @ s d dl mZmZmZ d dlZd dlZd dlZd dlZd dlZd dl Z d dl
mZmZ
d dlZddlmZ ddlmZ d dlmZmZ ddlmZmZmZmZmZmZmZmZm Z m!Z!m"Z" d d l#m$Z$m%Z%m&Z&m'Z'm(Z(m)Z)m*Z* ej+d d
kr�d dl,Z,nd dl-Z,d dl.m/Z/ e,j0Z0dd
ddddddddddddddgZ1G dd� de2�Z3dd� Z4G d d!� d!e2�Z5d=d$d�Z6d>d%d�Z7d&d� Z8d'd� Z9d?d(d)�Z:d*d+� Z;e<d,ddd dd-d fd.d
�Z=d@d4d�Z>d5d� Z?e<d,dd d dddddddd6d-d"d7dd-d"d"dfd8d�Z@d9d� ZAd:d� ZBd;d� ZCd<d� ZDdS )A� )�division�absolute_import�print_functionN)�
itemgetter�index� )�format)�
DataSource)�packbits�
unpackbits)�LineSplitter�
NameValidator�StringConverter�ConverterError�ConverterLockError�ConversionWarning�_is_string_like�has_nested_fields�
flatten_dtype�
easy_dtype�_bytes_to_name)�asbytes�asstr�asbytes_nested�bytes�
basestring�unicode�is_pathlib_path� )�map�savetxt�loadtxt�
genfromtxt� ndfromtxt� mafromtxt�
recfromtxt�
recfromcsv�load�loads�save�savez�savez_compressedr
r � fromregexr c @ s( e Zd ZdZdd� Zdd� Zdd� ZdS ) �BagObjau
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(object):
... 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 C s t �|�| _d S )N)�weakref�proxy�_obj)�self�obj� r3 �B/opt/alt/python37/lib64/python3.7/site-packages/numpy/lib/npyio.py�__init__F s zBagObj.__init__c C s2 yt �| d�| S tk
r, t|��Y nX d S )Nr0 )�object�__getattribute__�KeyError�AttributeError)r1 �keyr3 r3 r4 r7 J s zBagObj.__getattribute__c C s t �| d��� S )z�
Enables dir(bagobj) to list the files in an NpzFile.
This also enables tab-completion in an interpreter or IPython.
r0 )r6 r7 �keys)r1 r3 r3 r4 �__dir__P s zBagObj.__dir__N)�__name__�
__module__�__qualname__�__doc__r5 r7 r<