ó 2ÄÈ[c @`sædZddlmZmZmZddlZddgZd„Zd„Zd„Z d\Z Z Z Z d „Zd„Zd„Zd„Zed„Zddded„d„d„ed„Zed„d„d„ed„ZdS(sÝSubset of inspect module from upstream python We use this instead of upstream because upstream inspect is slow to import, and significantly contributes to numpy import times. Importing this copy has almost no overhead. i(tdivisiontabsolute_importtprint_functionNt getargspect formatargspeccC`st|tjƒ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 isinstancettypest MethodType(tobject((s4/tmp/pip-build-fiC0ax/numpy/numpy/compat/_inspect.pytismethods cC`st|tjƒS(sReturn 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__) (RRt FunctionType(R((s4/tmp/pip-build-fiC0ax/numpy/numpy/compat/_inspect.pyt isfunctions cC`st|tjƒS(sƒ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 (RRtCodeType(R((s4/tmp/pip-build-fiC0ax/numpy/numpy/compat/_inspect.pytiscode+siiiicC`sÔt|ƒstdƒ‚n|j}|j}t|| ƒ}x7t|ƒD])}||d dkrJtdƒ‚qJqJWd}|jt@r¤|j|}|d}nd}|jt @rÇ|j|}n|||fS(sGet 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. sarg is not a code objectitt.s*tuple function arguments are not supported(RRN( R t TypeErrort co_argcountt co_varnamestlisttrangetNonetco_flagst CO_VARARGStCO_VARKEYWORDS(tcotnargstnamestargstitvarargstvarkw((s4/tmp/pip-build-fiC0ax/numpy/numpy/compat/_inspect.pytgetargsCs       cC`s^t|ƒr|j}nt|ƒs3tdƒ‚nt|jƒ\}}}||||jfS(smGet 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. sarg is not a Python function(R t__func__R RR t__code__t __defaults__(tfuncRRR((s4/tmp/pip-build-fiC0ax/numpy/numpy/compat/_inspect.pyRbs   cC`s+t|jƒ\}}}||||jfS(saGet 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. (R tf_codetf_locals(tframeRRR((s4/tmp/pip-build-fiC0ax/numpy/numpy/compat/_inspect.pyt getargvaluesss cC`s;t|ƒdkr"d|ddSddj|ƒdSdS(Nit(is,)s, t)(tlentjoin(tseq((s4/tmp/pip-build-fiC0ax/numpy/numpy/compat/_inspect.pytjoinseqscC`sOt|ƒttgkrA|g|D]}t|||ƒ^q"ƒS||ƒSdS(s=Recursively walk a sequence, stringifying each element. N(ttypeRttupletstrseq(RtconvertR,t_o((s4/tmp/pip-build-fiC0ax/numpy/numpy/compat/_inspect.pyR1…s)cC`sd|S(Nt*((tname((s4/tmp/pip-build-fiC0ax/numpy/numpy/compat/_inspect.pytscC`sd|S(Ns**((R5((s4/tmp/pip-build-fiC0ax/numpy/numpy/compat/_inspect.pyR6‘scC`sdt|ƒS(Nt=(trepr(tvalue((s4/tmp/pip-build-fiC0ax/numpy/numpy/compat/_inspect.pyR6’sc C`sëg} |r%t|ƒt|ƒ} nxjtt|ƒƒD]V} t|| ||ƒ} |r| | kr| ||| | ƒ} n| j| ƒq8W|dk r´| j||ƒƒn|dk rÖ| j||ƒƒnddj| ƒdS(smFormat an argument spec from the 4 values returned by getargspec. The first four arguments are (args, varargs, varkw, defaults). The other four arguments are the corresponding optional formatting functions that are called to turn names and values into strings. The ninth argument is an optional function to format the sequence of arguments. R)s, R*N(R+RR1tappendRR,( RRRtdefaultst formatargt formatvarargst formatvarkwt formatvalueR,tspecst firstdefaultRtspec((s4/tmp/pip-build-fiC0ax/numpy/numpy/compat/_inspect.pyRŽs  cC`sd|S(NR4((R5((s4/tmp/pip-build-fiC0ax/numpy/numpy/compat/_inspect.pyR6¬scC`sd|S(Ns**((R5((s4/tmp/pip-build-fiC0ax/numpy/numpy/compat/_inspect.pyR6­scC`sdt|ƒS(NR7(R8(R9((s4/tmp/pip-build-fiC0ax/numpy/numpy/compat/_inspect.pyR6®sc C`s»|||d„} g} x7tt|ƒƒD]#} | jt|| | |ƒƒq+W|r|| j||ƒ|||ƒƒn|r¦| j||ƒ|||ƒƒnddj| ƒdS(slFormat an argument spec from the 4 values returned by getargvalues. The first four arguments are (args, varargs, varkw, locals). The next four arguments are the corresponding optional formatting functions that are called to turn names and values into strings. The ninth argument is an optional function to format the sequence of arguments. cS`s||ƒ|||ƒS(N((R5tlocalsR<R?((s4/tmp/pip-build-fiC0ax/numpy/numpy/compat/_inspect.pyR2¸sR)s, R*(RR+R:R1R,( RRRRCR<R=R>R?R,R2R@R((s4/tmp/pip-build-fiC0ax/numpy/numpy/compat/_inspect.pytformatargvaluesªs!$$(iiii(t__doc__t __future__RRRRt__all__R R R t CO_OPTIMIZEDt CO_NEWLOCALSRRR RR(R.R1RtstrRRD(((s4/tmp/pip-build-fiC0ax/numpy/numpy/compat/_inspect.pyts.