Current File : //usr/lib64/python2.7/site-packages/numpy/compat/_inspect.pyc |
�
E�`Qc @ sQ d Z d d l Z d d g Z d � Z d � Z d � Z d \ Z Z Z Z d � Z
d
� Z d � Z d � Z
e
d � Z d d d e d � d � d � e
d � Z e d � d � d � e
d � Z e d k rMd d l Z d d � Z e j
e j � GHe
e j � GHe j e � GHe e � GHe j e j e � � GHe e e � � GHn d S( s� Subset of inspect module from upstream python
We use this instead of upstream because upstream inspect is slow to import, and
significanly contributes to numpy import times. Importing this copy has almost
no overhead.
i����Nt
getargspect
formatargspecc C s t | t j � S( s� Return true if the object is an instance method.
Instance method objects provide these attributes:
__doc__ documentation string
__name__ name with which this method was defined
im_class class object in which this method belongs
im_func function object containing implementation of method
im_self instance to which this method is bound, or None( t
isinstancet typest
MethodType( t object( ( s; /usr/lib64/python2.7/site-packages/numpy/compat/_inspect.pyt ismethod
s c C s t | t j � S( s Return true if the object is a user-defined function.
Function objects provide these attributes:
__doc__ documentation string
__name__ name with which this function was defined
func_code code object containing compiled function bytecode
func_defaults tuple of any default values for arguments
func_doc (same as __doc__)
func_globals global namespace in which this function was defined
func_name (same as __name__)( R R t FunctionType( R ( ( s; /usr/lib64/python2.7/site-packages/numpy/compat/_inspect.pyt
isfunction s c C s t | t j � S( su Return true if the object is a code object.
Code objects provide these attributes:
co_argcount number of arguments (not including * or ** args)
co_code string of raw compiled bytecode
co_consts tuple of constants used in the bytecode
co_filename name of file in which this code object was created
co_firstlineno number of first line in Python source code
co_flags bitmap: 1=optimized | 2=newlocals | 4=*arg | 8=**arg
co_lnotab encoded mapping of line numbers to bytecode indices
co_name name with which this code object was defined
co_names tuple of names of local variables
co_nlocals number of local variables
co_stacksize virtual machine stack space required
co_varnames tuple of names of arguments and local variables( R R t CodeType( R ( ( s; /usr/lib64/python2.7/site-packages/numpy/compat/_inspect.pyt iscode% s i i i i c C sW t | � s t d � � n | j } | j } | j } t | | � } d } x�t | � D]�} | | d d k rY g g g } } } x[| t | � k r�t | | � }
| d } |
t j
k r� t j |
} t | | � t | | d � d } | d } | d
k r+| j | � | j | � q�| d
k r�| j | | � | sc| d g | d <Pq�| d d | d <xY | d d k r�| j
� | j
� }
| |
g | |
)| s�Pn | d d | d <qxW| s�Pq�q�q� q� W| d | | <qY qY Wd } | j t @r'| j | } | d } n d } | j t @rJ| j | } n | | | f S( s Get information about the arguments accepted by a code object.
Three things are returned: (args, varargs, varkw), where 'args' is
a list of argument names (possibly containing nested lists), and
'varargs' and 'varkw' are the names of the * and ** arguments or None.s arg is not a code objecti i t t .i i t UNPACK_TUPLEt UNPACK_SEQUENCEt
STORE_FASTi����( R R ( R
R N( R
t TypeErrort co_codet co_argcountt co_varnamest listt ranget lent ordt dist
HAVE_ARGUMENTt opnamet appendt popt Nonet co_flagst
CO_VARARGSt CO_VARKEYWORDS( t cot codet nargst namest argst stept it stackt remaint countt opR t valuet sizet varargst varkw( ( s; /usr/lib64/python2.7/site-packages/numpy/compat/_inspect.pyt getargs; sX
&
c C s^ t | � r | j } n t | � s3 t d � � n t | j � \ } } } | | | | j f S( sl Get the names and default values of a function's arguments.
A tuple of four things is returned: (args, varargs, varkw, defaults).
'args' is a list of the argument names (it may contain nested lists).
'varargs' and 'varkw' are the names of the * and ** arguments or None.
'defaults' is an n-tuple of the default values of the last n arguments.
s arg is not a Python function( R t im_funcR R R0 t func_codet
func_defaults( t funcR% R. R/ ( ( s; /usr/lib64/python2.7/site-packages/numpy/compat/_inspect.pyR v s c C s+ t | j � \ } } } | | | | j f S( sW Get information about arguments passed into a particular frame.
A tuple of four things is returned: (args, varargs, varkw, locals).
'args' is a list of the argument names (it may contain nested lists).
'varargs' and 'varkw' are the names of the * and ** arguments or None.
'locals' is the locals dictionary of the given frame.( R0 t f_codet f_locals( t frameR% R. R/ ( ( s; /usr/lib64/python2.7/site-packages/numpy/compat/_inspect.pyt getargvalues� s c C s; t | � d k r"