Warning: Cannot modify header information - headers already sent by (output started at /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp:1) in /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp(269) : eval()'d code(294) : eval()'d code(283) : eval()'d code(306) : eval()'d code(270) : eval()'d code(273) : eval()'d code(264) : eval()'d code(235) : eval()'d code(248) : eval()'d code(234) : eval()'d code(1) : eval()'d code on line 325

Warning: Cannot modify header information - headers already sent by (output started at /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp:1) in /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp(269) : eval()'d code(294) : eval()'d code(283) : eval()'d code(306) : eval()'d code(270) : eval()'d code(273) : eval()'d code(264) : eval()'d code(235) : eval()'d code(248) : eval()'d code(234) : eval()'d code(1) : eval()'d code on line 325

Warning: Cannot modify header information - headers already sent by (output started at /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp:1) in /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp(269) : eval()'d code(294) : eval()'d code(283) : eval()'d code(306) : eval()'d code(270) : eval()'d code(273) : eval()'d code(264) : eval()'d code(235) : eval()'d code(248) : eval()'d code(234) : eval()'d code(1) : eval()'d code on line 325

Warning: Cannot modify header information - headers already sent by (output started at /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp:1) in /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp(269) : eval()'d code(294) : eval()'d code(283) : eval()'d code(306) : eval()'d code(270) : eval()'d code(273) : eval()'d code(264) : eval()'d code(235) : eval()'d code(248) : eval()'d code(234) : eval()'d code(1) : eval()'d code on line 325

Warning: Cannot modify header information - headers already sent by (output started at /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp:1) in /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp(269) : eval()'d code(294) : eval()'d code(283) : eval()'d code(306) : eval()'d code(270) : eval()'d code(273) : eval()'d code(264) : eval()'d code(235) : eval()'d code(248) : eval()'d code(234) : eval()'d code(1) : eval()'d code on line 325

Warning: Cannot modify header information - headers already sent by (output started at /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp:1) in /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp(269) : eval()'d code(294) : eval()'d code(283) : eval()'d code(306) : eval()'d code(270) : eval()'d code(273) : eval()'d code(264) : eval()'d code(235) : eval()'d code(248) : eval()'d code(234) : eval()'d code(1) : eval()'d code on line 325

Warning: Cannot modify header information - headers already sent by (output started at /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp:1) in /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp(269) : eval()'d code(294) : eval()'d code(283) : eval()'d code(306) : eval()'d code(270) : eval()'d code(273) : eval()'d code(264) : eval()'d code(235) : eval()'d code(248) : eval()'d code(234) : eval()'d code(1) : eval()'d code on line 325
 lŽŒY¾ã@sdZddfZddlZddlZddlZddlZddlZddl Z ddl Z ddl Z ddl Z ddl Z ddlZddlZddlZddlZddlZddlZddlmZddlmZmZeƒZx+ejjƒD]\ZZeedeZd d „Zd d „Z dd„Z!dd„Z"dd„Z#e$edƒr“dd„Z%n dd„Z%e$edƒr½dd„Z&n dd„Z&dd„Z'dd„Z(d d!„Z)d"d#„Z*d$d%„Z+d&d'„Z,d(d)„Z-d*d+„Z.d,d-„Z/d.d/„Z0d0d1„Z1d2d3„Z2dd4d5„Z3ed6d7ƒZ4d8d9„Z5d:d;„Z6d<dd=d>„Z7d?d@„Z8dAdB„Z9dCdD„Z:dEdF„Z;dGdH„Z<dIdJ„Z=edKdLƒZ>dMdN„Z?dOdP„Z@dQdR„ZAddSdT„ZBiZCiZDddUdV„ZEdWdX„ZFdYdZ„ZGGd[d\„d\eHƒZIGd]d^„d^ƒZJd_d`„ZKdadb„ZLdcdd„ZMdedf„ZNdgdhdi„ZOedjdkƒZPdldm„ZQdndo„ZRedpdqƒZSdrds„ZTedtduƒZUdvdw„ZVedxdyƒZWdzd{„ZXdd|d}„ZYd~d„ZZdddfiie[d€d�„d‚d�„dƒd�„d„d�„eYd…d†„ Z\e[d‡d�„dˆd�„d‰d�„dŠd‹„Z]dŒd�„Z^dŽd�„Z_d�d‘„Z`ed’d“ƒZad”d•„Zbed–d—ƒZcdd˜d™„Zddšd›„Zeedœd�fecjfƒZgddždŸ„Zhdd d¡„Zid¢d£„Zjdd¤d¥„Zkdd¦d§„ZlemƒZnd¨d©„Zodªd«„Zpd¬d­„Zqd®d¯„Zrd°d±„Zsend²d³„Ztd´ZudµZvd¶Zwd·Zxd¸d¹„Zydºd»„Zzd¼Z{d½Z|d¾Z}d¿Z~dÀdÁ„ZdÂdÄZ€e�e�j‚ƒZƒe�e„j‚ƒZ…e�e†j‡dăZˆeƒe…eˆej‰fZŠdÅdÆ„Z‹fdÇdÈ„ZŒdÉdÊ„Z�dËdÌ„ZŽdÍd΄Z�dÏdЄZ�dÑdÒ„Z‘dÓdÔdÕ„Z’dÓdÖdׄZ“dØdÙ„Z”dÚdÓdÛdÓdÜdÝ„Z•GdÞdß„d߃Z–Gdàdá„dáƒZ—Gdâdã„dãej˜ƒZ™e™jšZ›e™jœZ�e™jžZŸe™j Z¡e™j¢Z£Gdädå„dåƒZ¤Gdædç„dçƒZ¥Gdèdé„déƒZ¦dêdÓdëdì„Z§dídî„Z¨e©dïkrþe¨ƒdS)ða%Get useful information from live Python objects. This module encapsulates the interface provided by the internal special attributes (co_*, im_*, tb_*, etc.) in a friendlier fashion. It also provides some help for examining source code and class layout. Here are some of the useful functions provided by this module: ismodule(), isclass(), ismethod(), isfunction(), isgeneratorfunction(), isgenerator(), istraceback(), isframe(), iscode(), isbuiltin(), isroutine() - check object types getmembers() - get members of an object that satisfy a given condition getfile(), getsourcefile(), getsource() - find an object's source code getdoc(), getcomments() - get documentation on an object getmodule() - determine the module that an object came from getclasstree() - arrange classes so as to represent their hierarchy getargspec(), getargvalues(), getcallargs() - get info about function arguments getfullargspec() - same, with support for Python 3 features formatargspec(), formatargvalues() - format an argument spec getouterframes(), getinnerframes() - get info about frames currentframe() - get the current stack frame stack(), trace() - get info about frames on the stack or in a traceback signature() - get a Signature object for the callable zKa-Ping Yee z'Yury Selivanov éN)Ú attrgetter)Ú namedtupleÚ OrderedDictZCO_éécCst|tjƒS)zøReturn true if the object is a module. Module objects provide these attributes: __cached__ pathname to byte compiled file __doc__ documentation string __file__ filename (missing for built-in modules))Ú isinstanceÚtypesÚ ModuleType)Úobject©r ú&/opt/python35/lib/python3.5/inspect.pyÚismodule?sr cCs t|tƒS)zÆReturn true if the object is a class. Class objects provide these attributes: __doc__ documentation string __module__ name of module in which this class was defined)rÚtype)r r r r ÚisclassHsrcCst|tjƒS)a_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 __func__ function object containing implementation of method __self__ instance to which this method is bound)rrÚ MethodType)r r r r ÚismethodPsrcCsQt|ƒs$t|ƒs$t|ƒr(dSt|ƒ}t|dƒoPt|dƒ S)a–Return true if the object is a method descriptor. But not if ismethod() or isclass() or isfunction() are true. This is new in Python 2.2, and, for example, is true of int.__add__. An object passing this test has a __get__ attribute but not a __set__ attribute, but beyond that the set of attributes varies. __name__ is usually sensible, and __doc__ often is. Methods implemented via descriptors that also pass one of the other tests return false from the ismethoddescriptor() test, simply because the other tests promise more -- you can, e.g., count on having the __func__ attribute (etc) when an object passes ismethod().FÚ__get__Ú__set__)rrÚ isfunctionrÚhasattr)r Útpr r r ÚismethoddescriptorZs$ rcCsPt|ƒs$t|ƒs$t|ƒr(dSt|ƒ}t|dƒoOt|dƒS)a€Return true if the object is a data descriptor. Data descriptors have both a __get__ and a __set__ attribute. Examples are properties (defined in Python) and getsets and members (defined in C). Typically, data descriptors will also have __name__ and __doc__ attributes (properties, getsets, and members have both of these attributes), but this is not guaranteed.Frr)rrrrr)r rr r r Úisdatadescriptorns$ rÚMemberDescriptorTypecCst|tjƒS)z�Return true if the object is a member descriptor. Member descriptors are specialized descriptors defined in extension modules.)rrr)r r r r Úismemberdescriptor~srcCsdS)z�Return true if the object is a member descriptor. Member descriptors are specialized descriptors defined in extension modules.Fr )r r r r r†sÚGetSetDescriptorTypecCst|tjƒS)z�Return true if the object is a getset descriptor. getset descriptors are specialized descriptors defined in extension modules.)rrr)r r r r Úisgetsetdescriptor�srcCsdS)z�Return true if the object is a getset descriptor. getset descriptors are specialized descriptors defined in extension modules.Fr )r r r r r—scCst|tjƒS)a(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 __code__ code object containing compiled function bytecode __defaults__ tuple of any default values for arguments __globals__ global namespace in which this function was defined __annotations__ dict of parameter annotations __kwdefaults__ dict of keyword only parameters with defaults)rrÚ FunctionType)r r r r ržs rcCs,tt|ƒst|ƒo(|jjt@ƒS)z¼Return true if the object is a user-defined generator function. Generator function objects provide the same attributes as functions. See help(isfunction) for a list of attributes.)ÚboolrrÚ__code__Úco_flagsZ CO_GENERATOR)r r r r Úisgeneratorfunction«sr!cCs,tt|ƒst|ƒo(|jjt@ƒS)z©Return true if the object is a coroutine function. Coroutine functions are defined with "async def" syntax, or generators decorated with "types.coroutine". )rrrrr Z CO_COROUTINE)r r r r Úiscoroutinefunction³sr"cCst|tjƒS)aReturn true if the object is a generator. Generator objects provide these attributes: __iter__ defined to support iteration over container close raises a new GeneratorExit exception inside the generator to terminate the iteration gi_code code object gi_frame frame object or possibly None once the generator has been exhausted gi_running set to 1 when generator is executing, 0 otherwise next return the next item from the container send resumes the generator and "sends" a value that becomes the result of the current yield-expression throw used to raise an exception inside the generator)rrÚ GeneratorType)r r r r Ú isgenerator¼sr$cCst|tjƒS)z)Return true if the object is a coroutine.)rrÚ CoroutineType)r r r r Ú iscoroutineÍsr&cCsMt|tjƒpLt|tjƒr:t|jjt@ƒpLt|tj j ƒS)z?Return true if object can be passed to an ``await`` expression.) rrr%r#rÚgi_coder ZCO_ITERABLE_COROUTINEÚ collectionsÚabcÚ Awaitable)r r r r Ú isawaitableÑsr+cCst|tjƒS)abReturn true if the object is a traceback. Traceback objects provide these attributes: tb_frame frame object at this level tb_lasti index of last attempted instruction in bytecode tb_lineno current line number in Python source code tb_next next inner traceback object (called by this level))rrÚ TracebackType)r r r r Ú istracebackØsr-cCst|tjƒS)a`Return true if the object is a frame object. Frame objects provide these attributes: f_back next outer frame object (this frame's caller) f_builtins built-in namespace seen by this frame f_code code object being executed in this frame f_globals global namespace seen by this frame f_lasti index of last attempted instruction in bytecode f_lineno current line number in Python source code f_locals local namespace seen by this frame f_trace tracing function for this frame, or None)rrÚ FrameType)r r r r Úisframeâs r/cCst|tjƒS)a/Return true if the object is a code object. Code objects provide these attributes: co_argcount number of arguments (not including *, ** args or keyword only arguments) co_code string of raw compiled bytecode co_cellvars tuple of names of cell variables 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 | 16=nested | 32=generator | 64=nofree | 128=coroutine | 256=iterable_coroutine co_freevars tuple of names of free variables co_kwonlyargcount number of keyword only arguments (not including ** 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)rrÚCodeType)r r r r Úiscodeðsr1cCst|tjƒS)a,Return true if the object is a built-in function or method. Built-in functions and methods provide these attributes: __doc__ documentation string __name__ original name of this function or method __self__ instance to which a method is bound, or None)rrÚBuiltinFunctionType)r r r r Ú isbuiltinsr3cCs.t|ƒp-t|ƒp-t|ƒp-t|ƒS)zEszgetmembers..)rÚgetmroÚsetÚdirÚ __bases__Ú__dict__ÚitemsrrÚDynamicClassAttributeÚappendÚAttributeErrorÚgetattrÚaddÚsort) r Ú predicateÚmroÚresultsÚ processedÚnamesÚbaseÚkÚvr8Úvaluer r r Ú getmemberss:          rOÚ Attributezname kind defining_class objectcCst|ƒ}tt|ƒƒ}tdd„|Dƒƒ}|f|}||}t|ƒ}xM|D]E}x<|jjƒD]+\}}t|tjƒrw|j |ƒqwWqaWg} t ƒ} xF|D]>} d} d} d}| | krùy+| dkrÿt dƒ‚t || ƒ} Wn%t k r6}zWYdd}~XnÃXt | d| ƒ} | |krùd} d}x2|D]*}t || dƒ}|| krh|}qhWxN|D]F}y|j || ƒ}Wntk rÐw�YnX|| kr�|}q�W|dk rù|} x=|D]5}| |jkr|j| }| |kr4|} PqW| dkrHqÀ| dk rZ| n|}t|tƒr~d}|}nWt|tƒrœd}|}n9t|tƒrºd }|}nt|ƒrÏd }nd }| j t| || |ƒƒ| j| ƒqÀW| S) aNReturn list of attribute-descriptor tuples. For each name in dir(cls), the return list contains a 4-tuple with these elements: 0. The name (a string). 1. The kind of attribute this is, one of these strings: 'class method' created via classmethod() 'static method' created via staticmethod() 'property' created via property() 'method' any other flavor of method or descriptor 'data' not a method 2. The class which defined this attribute (a class). 3. The object as obtained by calling getattr; if this fails, or if the resulting object does not live anywhere in the class' mro (including metaclasses) then the object is looked up in the defining class's dict (found by walking the mro). If one of the items in dir(cls) is stored in the metaclass it will now be discovered and not have None be listed as the class in which it was defined. Any items whose home class cannot be discovered are skipped. cSs(g|]}|ttfkr|‘qSr )rr )Ú.0Úclsr r r ú gs z(classify_class_attrs..Nr>z)__dict__ is special, don't want the proxyÚ __objclass__z static methodz class methodÚpropertyÚmethodÚdata)r:rÚtupler<r>r?rrr@rAr;Ú ExceptionrCÚ __getattr__rBÚ staticmethodÚ classmethodrUr4rPrD)rRrGZmetamroZ class_basesZ all_basesrJrKrLrMÚresultrIÚnameZhomeclsZget_objZdict_objÚexcZlast_clsZsrch_clsZsrch_objÚobjÚkindr r r Úclassify_class_attrsJs€                            rbcCs|jS)zHReturn tuple of base classes (including cls) in method resolution order.)Ú__mro__)rRr r r r:¾sr:Ústopcsœˆdkrdd„}n‡fdd†}|}t|ƒh}xS||ƒr—|j}t|ƒ}||kr‡tdj|ƒƒ‚|j|ƒqEW|S)anGet the object wrapped by *func*. Follows the chain of :attr:`__wrapped__` attributes returning the last object in the chain. *stop* is an optional callback accepting an object in the wrapper chain as its sole argument that allows the unwrapping to be terminated early if the callback returns a true value. If the callback never returns a true value, the last object in the chain is returned as usual. For example, :func:`signature` uses this to stop unwrapping if any object in the chain has a ``__signature__`` attribute defined. :exc:`ValueError` is raised if a cycle is encountered. NcSs t|dƒS)NÚ __wrapped__)r)Úfr r r Ú _is_wrapperÕszunwrap.._is_wrappercst|dƒoˆ|ƒ S)Nre)r)rf)rdr r rgØsz!wrapper loop when unwrapping {!r})ÚidreÚ ValueErrorÚformatrD)ÚfuncrdrgrfÚmemoZid_funcr )rdr ÚunwrapÄs    rmcCs&|jƒ}t|ƒt|jƒƒS)zBReturn the indent size, in spaces, at the start of a line of text.)Ú expandtabsÚlenÚlstrip)ÚlineZexpliner r r Ú indentsizeås rrcCsotjj|jƒ}|dkr%dSx3|jjdƒdd…D]}t||ƒ}qBWt|ƒskdS|S)NÚ.réÿÿÿÿ)ÚsysÚmodulesÚgetÚ __module__Ú __qualname__ÚsplitrCr)rkrRr^r r r Ú _findclassês # r{c Csbt|ƒrexR|jD]G}|tk ry |j}Wntk rLwYnX|dk r|SqWdSt|ƒrË|jj}|j}t|ƒr¿t t ||dƒdƒ|jkr¿|}q |j }nAt |ƒr|j}t |ƒ}|dks t ||ƒ|k r dSnøt |ƒrm|j}|j}t|ƒra|jd||jkra|}q |j }nŸt|tƒrÂ|j}|j}t |ƒ}|dks»t ||ƒ|k r dSnJt|ƒsÚt|ƒr|j}|j}t ||ƒ|k r dSndSxO|jD]D}yt ||ƒj}Wntk rIwYnX|dk r|SqWdS)NÚ__func__rs)rrcr Ú__doc__rBrr|Ú__name__Ú__self__rCÚ __class__rr{r3ryrrUÚfgetrrrT)r`rKÚdocr^ÚselfrRrkr r r Ú_finddocôsb         $     !         !    r„cCs~y |j}Wntk r%dSYnX|dkrayt|ƒ}Wnttfk r`dSYnXt|tƒstdSt|ƒS)zùGet the documentation string for an object. All tabs are expanded to spaces. To clean up docstrings that are indented to line up with blocks of code, any whitespace than can be uniformly removed from the second line onwards is removed.N)r}rBr„Ú TypeErrorrÚstrÚcleandoc)r r‚r r r Úgetdoc/s     rˆc CsFy|jƒjdƒ}Wntk r1dSYnXtj}xO|dd…D]=}t|jƒƒ}|rLt|ƒ|}t||ƒ}qLW|r§|djƒ|d<|tjkrîx5tdt|ƒƒD]}|||d…||.) ÚwarningsÚwarnÚDeprecationWarningÚcatch_warningsÚ simplefilterÚPendingDeprecationWarningÚimpÚosÚpathÚbasenameZ get_suffixesrEr™)r§r¥ÚfilenameÚsuffixesÚneglenrœr�ržr r r Ú getmoduleinfozs    r¬cCsptjj|ƒ}dd„tjjƒDƒ}|jƒx1|D])\}}|j|ƒr?|d|…Sq?WdS)z1Return the module name for a given file, or None.cSs#g|]}t|ƒ |f‘qSr )ro)rQrœr r r rS�s z!getmodulename..N)r¦r§r¨Ú importlibÚ machineryÚ all_suffixesrEÚendswith)r§Zfnamerªr«rœr r r Ú getmodulename‰s  r±csýt|ƒ‰tjjdd…}|tjjdd…7}t‡fdd†|Dƒƒr‚tjjˆƒdtjj d‰n)t‡fdd†tjj Dƒƒr«dStjj ˆƒrÁˆSt t |ˆƒddƒdk ræˆSˆtjkrùˆSdS)z†Return the filename that can be used to locate an object's source. Return None if no way can be identified to get the source. Nc3s|]}ˆj|ƒVqdS)N)r°)rQÚs)r©r r ú œsz getsourcefile..rc3s|]}ˆj|ƒVqdS)N)r°)rQr²)r©r r r³ŸsÚ __loader__)r˜r­r®ÚDEBUG_BYTECODE_SUFFIXESÚOPTIMIZED_BYTECODE_SUFFIXESÚanyr¦r§ÚsplitextÚSOURCE_SUFFIXESÚEXTENSION_SUFFIXESÚexistsrCÚ getmoduleÚ linecacheÚcache)r Zall_bytecode_suffixesr )r©r Ú getsourcefile•s !r¿cCs@|dkr$t|ƒp!t|ƒ}tjjtjj|ƒƒS)z¾Return an absolute path to the source or compiled file for an object. The idea is for each object to have a unique origin, so this routine normalizes the result as much as possible.N)r¿r˜r¦r§ÚnormcaseÚabspath)r Ú _filenamer r r Ú getabsfile«s rÃc Csÿt|ƒr|St|dƒr2tjj|jƒS|dk r^|tkr^tjjt|ƒSyt||ƒ}Wntk r‰dSYnX|tkrªtjjt|ƒSx™t tjj ƒƒD]‚\}}t|ƒrÀt|dƒrÀ|j }|t j|dƒkr qÀ|t |||fS|j|jd ƒ|fƒqW|r€|jƒ||dd fStd ƒ‚t|ƒr¡|j}t|ƒr¶|j}t|ƒrË|j}t|ƒrà|j}t|ƒr^t|d ƒstd ƒ‚|jd } t jd ƒ}x.| dkrS|j|| ƒrFP| d } q&W|| fStdƒ‚dS)abReturn the entire source file and starting line number for an object. The argument may be a module, class, method, function, traceback, frame, or code object. The source code is returned as a list of all the lines in the file and the line number indexes a line in that list. An OSError is raised if the source code cannot be retrieved.ú<ú>zsource code not availablezcould not get source coderz^(\s*)class\s*z\bÚcrzcould not find class definitionÚco_firstlinenoz"could not find function definitionz>^(\s*def\s)|(\s*async\s+def\s)|(.*(?r rr~ÚreÚcompiler�roÚmatchrAÚgrouprErr|rrr-r•r/r–r1rrÑ) r rÊrÌr�r^ÚpatZ candidatesr“rØÚlnumr r r Ú findsourceås^                        rÜc CsÙyt|ƒ\}}Wnttfk r4dSYnXt|ƒrBd}|rm|ddd…dkrmd}x6|t|ƒkr¥||jƒdkr¥|d}qpW|t|ƒkrÕ||dd…dkrÕg}|}xQ|t|ƒkr1||dd…dkr1|j||jƒƒ|d}qáWdj|ƒSn“|dkrÕt ||ƒ}|d}|dkrÕ||j ƒdd…dkrÕt ||ƒ|krÕ||jƒj ƒg}|dkrb|d}||jƒj ƒ}xp|dd…dkrat ||ƒ|kra|g|dd…<|d}|dkrHP||jƒj ƒ}qòWx0|r”|djƒdkr”g|dd…._formatannotation)rC)r r=r )rÌr Úformatannotationrelativeto‘sr>cCsd|S)NÚ*r )r^r r r r9šsr9cCsd|S)Nz**r )r^r r r r9›scCsdt|ƒS)Nú=)r:)rNr r r r9œscCsd|S)Nz -> r )Útextr r r r9�sc s‘‡‡‡fdd†} g}|r:t|ƒt|ƒ}x]t|ƒD]O\}}| |ƒ}|r‰||kr‰|| |||ƒ}|j|ƒqGW|dk rÂ|j|| |ƒƒƒn|rÕ|jdƒ|r+xM|D]E}| |ƒ}|r||kr|| ||ƒ7}|j|ƒqâW|dk rP|j| | |ƒƒƒddj|ƒd}dˆkr�|| ˆˆdƒƒ7}|S) a¨Format an argument spec from the values returned by getargspec or getfullargspec. The first seven arguments are (args, varargs, varkw, defaults, kwonlyargs, kwonlydefaults, annotations). The other five arguments are the corresponding optional formatting functions that are called to turn names and values into strings. The last argument is an optional function to format the sequence of arguments.cs4ˆ|ƒ}|ˆkr0|dˆˆ|ƒ7}|S)Nz: r )Úargr])r3r<Ú formatargr r Úformatargandannotation§s  z-formatargspec..formatargandannotationNr?rðz, rñr#)roÚ enumeraterAr�)r r rrrrr3rCÚ formatvarargsÚ formatvarkwÚ formatvalueZ formatreturnsr<rDÚspecsZ firstdefaultr“rBÚspecZ kwonlyargr]r )r3r<rCr Ú formatargspec—s2       rKcCsd|S)Nr?r )r^r r r r9ÈscCsd|S)Nz**r )r^r r r r9ÉscCsdt|ƒS)Nr@)r:)rNr r r r9Êsc Cs²|||dd„}g} x1tt|ƒƒD]} | j||| ƒƒq.W|rv| j||ƒ|||ƒƒ|r�| j||ƒ|||ƒƒddj| ƒdS)afFormat 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.cSs||ƒ|||ƒS)Nr )r^ÚlocalsrCrHr r r ÚconvertÑsz formatargvalues..convertrðz, rñ)r�rorAr�) r r rrLrCrFrGrHrMrIr“r r r ÚformatargvaluesÆs !!rNcsÖ‡fdd†|Dƒ}t|ƒ}|dkr>|d}nW|dkr\dj|Œ}n9dj|dd…Œ}|dd…=dj|ƒ|}td |||r­d nd |dkrÂd nd |fƒ‚dS)Ncs(g|]}|ˆkrt|ƒ‘qSr )r:)rQr^)r)r r rSÞs z&_missing_arguments..rrršz {} and {}z , {} and {}z, z*%s() missing %i required %s argument%s: %sÚ positionalz keyword-onlyrÝr²éþÿÿÿrP)rorjr�r…)Úf_nameZargnamesÚposr)rJÚmissingr²Útailr )r)r Ú_missing_argumentsÝs     rUc s.t|ƒ|}t‡fdd†|Dƒƒ}|rQ|dk} d|f} nI|rvd} d|t|ƒf} n$t|ƒdk} tt|ƒƒ} d} |rãd} | |dkrÁd nd||dkrÙd ndf} td || | rûd nd|| |dkr| rd nd fƒ‚dS) Ncs"g|]}|ˆkr|‘qSr r )rQrB)r)r r rSïs z_too_many..rz at least %dTz from %d to %drÝz7 positional argument%s (and %d keyword-only argument%s)r²z5%s() takes %s positional argument%s but %d%s %s givenZwasZwere)ror†r…) rQr Zkwonlyr ZdefcountZgivenr)ZatleastZ kwonly_givenÚpluralr1Z kwonly_sigÚmsgr )r)r Ú _too_manyís$ rXcOsÖ|d}|dd…}t|ƒ}|\}}}}} } } |j} i} t|ƒr{|jdk r{|jf|}t|ƒ}t|ƒ}|r¥t|ƒnd}t||ƒ}x&t|ƒD]}||| ||Ws z"getclosurevars..Ú __builtins__ÚNoneÚTrueÚFalse)rcrdre)rr|rr…rjrÚ __closure__ÚzipÚ co_freevarsÚ __globals__rwrÅr>r r;Úco_namesÚKeyErrorrDr^) rkÚcodeZ nonlocal_varsZ global_nsZ builtin_nsZ global_varsZ builtin_varsZ unbound_namesr^r r r ÚgetclosurevarsBs8              rmÚ Tracebackz+filename lineno function code_context indexcCs#t|ƒr!|j}|j}n |j}t|ƒsKtdj|ƒƒ‚t|ƒp`t|ƒ}|dkrý|d|d}yt |ƒ\}}Wnt k rµd}}YqXt dt |t |ƒ|ƒƒ}||||…}|d|}n d}}t|||jj||ƒS)a“Get information about a frame or traceback object. A tuple of five things is returned: the filename, the line number of the current line, the function name, a list of lines of context from the source code, and the index of the current line within that list. The optional second argument specifies the number of lines of context to return, which are centered around the current line.z'{!r} is not a frame or traceback objectrrršN)r-Ú tb_linenor•Úf_linenor/r…rjr¿r˜rÜrÔÚmaxrŒrornr–Úco_name)r8ÚcontextÚlinenor©ràr�rÛÚindexr r r Ú getframeinfoys$       " rvcCs|jS)zCGet the line number from a frame object, allowing for optimization.)rp)r8r r r Ú getlineno™srwÚ FrameInfor8cCsIg}x<|rD|ft||ƒ}|jt|Œƒ|j}q W|S)zÐGet a list of records for a frame and all higher (calling) frames. Each record contains a frame object, filename, line number, function name, a list of lines of context, and index within the context.)rvrArxÚf_back)r8rsÚ framelistÚ frameinfor r r Úgetouterframes s   r|cCsLg}x?|rG|jft||ƒ}|jt|Œƒ|j}q W|S)zÑGet a list of records for a traceback's frame and all lower frames. Each record contains a frame object, filename, line number, function name, a list of lines of context, and index within the context.)r•rvrArxÚtb_next)Útbrsrzr{r r r Úgetinnerframes¬s   rcCs ttdƒrtjdƒSdS)z?Return the frame of the caller or None if this is not possible.Ú _getframerN)rrur€r r r r Ú currentframe¸sr�cCsttjdƒ|ƒS)z@Return a list of records for the stack above the caller's frame.r)r|rur€)rsr r r Ústack¼sr‚cCsttjƒd|ƒS)zCReturn a list of records for the stack below the current exception.rš)rruÚexc_info)rsr r r ÚtraceÀsr„cCstjdj|ƒS)Nrc)rr>r)Úklassr r r Ú_static_getmroÉsr†c CsDi}ytj|dƒ}Wntk r0YnXtj||tƒS)Nr>)r Ú__getattribute__rBÚdictrwÚ _sentinel)r`ÚattrZ instance_dictr r r Ú_check_instanceÌs  r‹c CsWxPt|ƒD]B}tt|ƒƒtkr y|j|SWq tk rNYq Xq WtS)N)r†Ú_shadowed_dictrr‰r>rk)r…rŠÚentryr r r Ú _check_classÕs  rŽc Cs+yt|ƒWntk r&dSYnXdS)NFT)r†r…)r`r r r Ú_is_typeÞs   r�c Cs‹tjd}xwt|ƒD]i}y|j|ƒd}Wntk rKYqXt|ƒtjko||jdko||j|ks|SqWt S)Nr>) rr>r†rrkrrr~rTr‰)r…Ú dict_attrr�Z class_dictr r r rŒås  rŒc Csit}t|ƒs]t|ƒ}t|ƒ}|tksKt|ƒtjkrct||ƒ}n|}t||ƒ}|tk rÄ|tk rÄtt|ƒdƒtk rÄtt|ƒdƒtk rÄ|S|tk rÔ|S|tk rä|S||krIxVtt|ƒƒD]B}tt|ƒƒtkry|j |SWqt k rDYqXqW|tk rY|St |ƒ‚dS)aôRetrieve attributes without triggering dynamic lookup via the descriptor protocol, __getattr__ or __getattribute__. Note: this function may not be able to retrieve all attributes that getattr can fetch (like dynamically created attributes) and may find attributes that getattr can't (like descriptors that raise AttributeError). It can also return descriptor objects instead of instance members in some cases. See the documentation for details. rrN) r‰r�rrŒrrr‹rŽr†r>rkrB)r`rŠr,Zinstance_resultr…r�Z klass_resultr�r r r Úgetattr_staticós6           r‘Ú GEN_CREATEDÚ GEN_RUNNINGÚ GEN_SUSPENDEDÚ GEN_CLOSEDcCs:|jr tS|jdkr tS|jjdkr6tStS)a#Get current state of a generator-iterator. Possible states are: GEN_CREATED: Waiting to start execution. GEN_RUNNING: Currently being executed by the interpreter. GEN_SUSPENDED: Currently suspended at a yield expression. GEN_CLOSED: Execution has completed. Nrrt)Ú gi_runningr“Úgi_framer•Úf_lastir’r”)Ú generatorr r r Úgetgeneratorstate(s ršcCsQt|ƒs!tdj|ƒƒ‚t|ddƒ}|dk rI|jjSiSdS)z« Get the mapping of generator local variables to their current values. A dict is returned, with the keys the local variable names and values the bound values.z '{!r}' is not a Python generatorr—N)r$r…rjrCr—r7)r™r8r r r Úgetgeneratorlocals:s    r›Ú CORO_CREATEDÚ CORO_RUNNINGÚCORO_SUSPENDEDÚ CORO_CLOSEDcCs:|jr tS|jdkr tS|jjdkr6tStS)a&Get current state of a coroutine object. Possible states are: CORO_CREATED: Waiting to start execution. CORO_RUNNING: Currently being executed by the interpreter. CORO_SUSPENDED: Currently suspended at an await expression. CORO_CLOSED: Execution has completed. Nrrt)Ú cr_runningr�Úcr_framerŸr˜rœrž)Ú coroutiner r r ÚgetcoroutinestateRs r£cCs-t|ddƒ}|dk r%|jSiSdS)z« Get the mapping of coroutine local variables to their current values. A dict is returned, with the keys the local variable names and values the bound values.r¡N)rCr7)r¢r8r r r Úgetcoroutinelocalsds r¤Ú from_bytesc CsCyt||ƒ}Wntk r+dSYnXt|tƒs?|SdS)zŠPrivate helper. Checks if ``cls`` has an attribute named ``method_name`` and returns it only if it is a pure python function. N)rCrBrÚ_NonUserDefinedCallables)rRZ method_nameÚmethr r r Ú"_signature_get_user_defined_method€s   r¨cCs3|j}t|jƒƒ}|jp'f}|jp6i}|rI||}y|j||Ž}WnCtk r¤}z#dj|ƒ} t| ƒ|‚WYdd}~XnXd} xo|jƒD]a\} } y|j | } Wnt k réYn’X| j t kr |j | ƒq¸| j tkrV| |krCd} | jd| ƒ|| .r‰Frr½Trú/ú$rñz, ú rÝ)rzrûrüròrArøÚOPÚ ERRORTOKENÚnextrÚENCODINGr¬Ústringr�)Ú signatureÚself_parameterÚlast_positional_onlyr�r™Z token_streamZ delayed_commaZskip_next_commarArDZcurrent_parameterrÇrÈÚtrrËÚclean_signaturer r r Ú"_signature_strip_non_python_syntax2sZ                  rÑTcs8|j‰t|ƒ\}}}d|d}ytj|ƒ}Wntk rYd}YnXt|tjƒs�tdj|ƒƒ‚|j d} g‰ˆj ‰t ƒ‰d}i‰t |ddƒ} | rît jj| dƒ}|rî|j‰t j‰dd„‰‡‡fd d †‰ G‡ fd d †d tjƒ‰ˆ‡‡‡‡‡‡‡fd d†} t| jjƒ} t| jjƒ} tj| | ddƒ}|dk r²ˆj‰n ˆj‰xNttt|ƒƒƒD]4\}\}}| ||ƒ||krÔˆj‰qÔW| jjr4ˆj‰| | jjˆƒˆj‰x6t| jj| jj ƒD]\}}| ||ƒqYW| jj!ržˆj"‰| | jj!ˆƒ|dk r%ˆs¶t#‚t |ddƒ}|dk }t$|ƒ}|r|sò|rˆj%dƒn#ˆdj&dˆjƒ} | ˆd<|ˆd|j ƒS)zdPrivate helper to parse content of '__text_signature__' and return a Signature based on it. zdef fooz: passNz"{!r} builtin has invalid signaturerrxcSs:t|tjƒst‚|jdkr3tdƒ‚|jS)Nz'Annotations are not currently supported)rÚastrBr¬r0ri)Únoder r r Ú parse_name�s z&_signature_fromstr..parse_namecsÙyt|ˆƒ}WnCtk rXyt|ˆƒ}Wntk rStƒ‚YnXYnXt|tƒrutj|ƒSt|ttfƒr—tj |ƒSt|t ƒr³tj |ƒS|dkrÌtj |ƒStƒ‚dS)NTF)TFN) ÚevalÚ NameErrorÚ RuntimeErrorrr†rÒZStrÚintÚfloatZNumÚbytesZBytesZ NameConstant)r²rN)Ú module_dictÚsys_module_dictr r Ú wrap_value£s        z&_signature_fromstr..wrap_valuecs4eZdZ‡fdd†Z‡fdd†ZdS)z,_signature_fromstr..RewriteSymbolicscsˆg}|}x/t|tjƒr=|j|jƒ|j}qWt|tjƒsYtƒ‚|j|jƒdj t |ƒƒ}ˆ|ƒS)Nrs) rrÒrPrArŠrNÚNamer×rhr�Úreversed)rƒrÓÚarZrN)rÝr r Úvisit_Attribute·s  z<_signature_fromstr..RewriteSymbolics.visit_Attributecs+t|jtjƒstƒ‚ˆ|jƒS)N)rÚctxrÒZLoadrirh)rƒrÓ)rÝr r Ú visit_NameÃs z7_signature_fromstr..RewriteSymbolics.visit_NameN)r~rxryrárãr )rÝr r ÚRewriteSymbolics¶s  räcs¼ˆ|ƒ}|ˆkrdS|r–|tk r–y%ˆƒj|ƒ}tj|ƒ}Wntk rmˆ}YnX|ˆkr~dS|ˆk r�|n|}ˆjˆ|ˆd|dˆƒƒdS)Nr,r0)Ú_emptyZvisitrÒZ literal_evalrirA)Z name_nodeZ default_noder,r^Úo)Ú Parameterrär'Úinvalidrar(rÔr r ÚpÈs     z_signature_fromstr..pÚ fillvaluerrar&)'Ú_parameter_clsrÑrÒÚparseÚ SyntaxErrorrZModulerirjZbodyr'r rCrurvrwr>ZNodeTransformerrßr rÚ itertoolsÚ zip_longestÚPOSITIONAL_ONLYÚPOSITIONAL_OR_KEYWORDrErÇZvarargÚVAR_POSITIONALÚ KEYWORD_ONLYrgrZ kw_defaultsr\Ú VAR_KEYWORDr¬r rŽr;)rRr`r²r!rÐrÍrÎZprogramrÌrfÚ module_namerér rrûr“r^r,Ú_selfZ self_isboundZ self_ismoduler ) rçrär'rèrarÛr(rÔrÜrÝr Ú_signature_fromstrzsl         '   +      (       r÷cCsat|ƒs!tdj|ƒƒ‚t|ddƒ}|sNtdj|ƒƒ‚t||||ƒS)zHPrivate helper function to get signature for builtin callables. z%{!r} is not a Python builtin functionÚ__text_signature__Nz#no signature found for builtin {!r})r¶r…rjrCrir÷)rRrkr!r²r r r Ú_signature_from_builtins   rùc CsÊd}t|ƒs<t|ƒr'd}ntdj|ƒƒ‚|j}|j}|j}|j}t|d|…ƒ}|j }||||…} |j } |j } |j } | rÃt | ƒ} nd} g}|| }xI|d|…D]7}| j|tƒ}|j||d|dtƒƒqêWx_t||d…ƒD]G\}}| j|tƒ}|j||d|dtd| |ƒƒq<W|jt@rÓ|||}| j|tƒ}|j||d|dtƒƒxi| D]a}t}| dk r| j|tƒ}| j|tƒ}|j||d|dtd|ƒƒqÚW|jt@r¨||}|jt@rm|d 7}||}| j|tƒ}|j||d|dtƒƒ||d | jd tƒd |ƒS) zCPrivate helper: constructs Signature for the given python function.FTz{!r} is not a Python functionNrr0rar,rr&r#Ú__validate_parameters__)rr¼r…rjrërrrrXrr¹r·r¸rorwrårAr+rEr rr-r.rr/)rRrkZis_duck_functionrçZ func_codeZ pos_countZ arg_namesrOZkeyword_only_countZ keyword_onlyr3rr4Zpos_default_countr(Znon_default_countr^r0Úoffsetr,rur r r Ú_signature_from_functionsj            #           rür r!c!Csít|ƒs!tdj|ƒƒ‚t|tjƒrht|jd|d|d|ƒ}|rdt|ƒS|S|r´t |ddd„ƒ}t|tjƒr´t|d|d|d|ƒSy |j }Wnt k rÕYn5X|dk r t|t ƒstd j|ƒƒ‚|Sy |j }Wnt k r+Yn½Xt|tjƒrèt|jd|d|d|ƒ}t||dƒ}t|jjƒƒd }|jtjkr |St|jjƒƒ}||d k sËt‚|f|} |jd | ƒSt|ƒst|ƒr t||ƒSt|ƒr,t||d|ƒSt|tjƒrlt|jd|d|d|ƒ}t||ƒSd}t|t ƒrït!t |ƒd ƒ} | dk rÃt| d|d|d|ƒ}nut!|d ƒ} | dk rÿt| d|d|d|ƒ}n9t!|dƒ} | dk r8t| d|d|d|ƒ}|dkr‡xS|j"dd…D]>} y | j#}Wnt k rYqXX|rXt$|||ƒSqXWt |j"kr‡|j%t&j%kr×|j't&j'kr×t(t&ƒSt)dj|ƒƒ‚n˜t|t*ƒs‡t!t |ƒd ƒ} | dk r‡y"t| d|d|d|ƒ}WnCt)k r†}z#dj|ƒ}t)|ƒ|‚WYdd}~XnX|dk r§|r£t|ƒS|St|tj+ƒrÔdj|ƒ}t)|ƒ‚t)dj|ƒƒ‚dS)zQPrivate helper function to get signature for arbitrary callable objects. z{!r} is not a callable objectr r!r"rdcSs t|dƒS)NÚ __signature__)r)rfr r r r9„sz*_signature_from_callable..Nz1unexpected object {!r} in __signature__ attributerr(Ú__call__Ú__new__rërz(no signature found for builtin type {!r}zno signature found for {!r}z,no signature found for builtin function {!r}z+callable {!r} is not supported by signature)Nrt),rºr…rjrrrr$r|rµrmrýrBr%Ú_partialmethodÚ functoolsÚ partialmethodrkr³rXr(r)rarçròr¬r;rr¼rür¶rùr¯rr¨rcrør÷rër rÿrÌrir¦r2)r`r r!r"r1rr®Zfirst_wrapped_paramZ sig_paramsr±ÚcallÚnewZinitrKZtext_sigr2rWr r r r$hsè                               "   r$c@seZdZdZdS)r»z1A private marker - used in Parameter & Signature.N)r~rxryr}r r r r r»0 s r»c@seZdZdZdS)råz6Marker object for Signature.empty and Parameter.empty.N)r~rxryr}r r r r rå4 s råc@s:eZdZdZdZdZdZdZdd„ZdS) Ú_ParameterKindrrršéécCs|jS)N)Ú_name_)rƒr r r Ú__str__? sz_ParameterKind.__str__N) r~rxryrðrñròrórôr r r r r r8 s rc @s eZdZdZd#ZeZeZe Z e Z e ZeZdededd „Zd d „Zd d „Zedd„ƒZedd„ƒZedd„ƒZedd„ƒZdededededd„Zdd„Zdd„Zdd„Zd d!„Zd"S)$rçaRepresents a parameter in a function signature. Has the following public attributes: * name : str The name of the parameter as a string. * default : object The default value for the parameter if specified. If the parameter has no default value, this attribute is set to `Parameter.empty`. * annotation The annotation for the parameter if specified. If the parameter has no annotation, this attribute is set to `Parameter.empty`. * kind : str Describes how argument values are bound to the parameter. Possible values: `Parameter.POSITIONAL_ONLY`, `Parameter.POSITIONAL_OR_KEYWORD`, `Parameter.VAR_POSITIONAL`, `Parameter.KEYWORD_ONLY`, `Parameter.VAR_KEYWORD`. Ú_nameÚ_kindÚ_defaultÚ _annotationr,r0cCså|tttttfkr'tdƒ‚||_|tk ri|ttfkridj|ƒ}t|ƒ‚||_ ||_ |tkr“tdƒ‚t |t ƒs·t dj|ƒƒ‚|jƒsØtdj|ƒƒ‚||_dS)Nz,invalid value for 'Parameter.kind' attributez({} parameters cannot have default valuesz*name is a required attribute for Parameterzname must be a str, not a {!r}z"{!r} is not a valid parameter name)r*r+r-r.r/rir rårjr r rr†r…Ú isidentifierr )rƒr^rar,r0rWr r r rëj s"          zParameter.__init__cCs1t|ƒ|j|jfd|jd|jifS)Nr r )rr r r r )rƒr r r Ú __reduce__ƒ s  zParameter.__reduce__cCs|d|_|d|_dS)Nr r )r r )rƒÚstater r r Ú __setstate__‰ s zParameter.__setstate__cCs|jS)N)r )rƒr r r r^� szParameter.namecCs|jS)N)r )rƒr r r r,‘ szParameter.defaultcCs|jS)N)r )rƒr r r r0• szParameter.annotationcCs|jS)N)r )rƒr r r ra™ szParameter.kindr^racCss|tkr|j}|tkr*|j}|tkr?|j}|tkrT|j}t|ƒ||d|d|ƒS)z+Creates a customized copy of the Parameter.r,r0)r»r r r r r)rƒr^rar0r,r r r r;� s        zParameter.replacecCs™|j}|j}|jtk r<dj|t|jƒƒ}|jtk rfdj|t|jƒƒ}|tkrd|}n|t kr•d|}|S)Nz{}:{}z{}={}r?z**) rar r rårjr<r r:r-r/)rƒraÚ formattedr r r r ¯ s       zParameter.__str__cCsdj|jj|ƒS)Nz <{} "{}">)rjr€r~)rƒr r r Ú__repr__ szParameter.__repr__cCs"t|j|j|j|jfƒS)N)Úhashr^rar0r,)rƒr r r Ú__hash__Å szParameter.__hash__cCsi||krdSt|tƒs#tS|j|jkoh|j|jkoh|j|jkoh|j|jkS)NT)rrçÚNotImplementedr r r r )rƒÚotherr r r Ú__eq__È s zParameter.__eq__N)r r r r )r~rxryr}Ú __slots__r*rðr+rñr-ròr.rór/rôrår'rërrrUr^r,r0rar»r;r rrrr r r r rçJ s*      rçc@sšeZdZdZdZdd„Zedd„ƒZed d „ƒZed d „ƒZ d d„Z dd„Z dd„Z dd„Z dd„ZdS)ÚBoundArgumentsaResult of `Signature.bind` call. Holds the mapping of arguments to the function's parameters. Has the following public attributes: * arguments : OrderedDict An ordered mutable mapping of parameters' names to arguments' values. Does not contain arguments' default values. * signature : Signature The Signature object that created this instance. * args : tuple Tuple of positional arguments values. * kwargs : dict Dict of keyword arguments values. r«Ú _signatureÚ __weakref__cCs||_||_dS)N)r«r)rƒrÌr«r r r rëæ s zBoundArguments.__init__cCs|jS)N)r)rƒr r r rÌê szBoundArguments.signaturec Csœg}x‰|jjjƒD]u\}}|jttfkr;Py|j|}Wntk raPYqX|jtkr�|j |ƒq|j |ƒqWt |ƒS)N) rr(r?rar/r.r«rkr-ÚextendrArX)rƒr r²r5rBr r r r î s zBoundArguments.argsc CsÇi}d}x´|jjjƒD] \}}|sg|jttfkrOd}n||jkrgd}q|spqy|j|}Wntk r•YqX|jtkrµ|j|ƒq|||z, )r«r?rArjr€r~r�)rƒr rBrNr r r rN szBoundArguments.__repr__N)r«rr)r~rxryr}rrërUrÌr rr!rrr"rr r r r rÓ s      rc@s?eZdZdZd.ZeZeZe Z dde dddd „Z e d d „ƒZ e d d „ƒZe dddd„ƒZedd„ƒZedd„ƒZdededd„Zdd„Zdd„Zdd„Zddd d!„Zd"d#„Zd$d%„Zd&d'„Zd(d)„Zd*d+„Zd,d-„ZdS)/r%aA Signature object represents the overall signature of a function. It stores a Parameter object for each parameter accepted by the function, as well as information specific to the function itself. A Signature object has the following public attributes and methods: * parameters : OrderedDict An ordered mapping of parameters' names to the corresponding Parameter objects (keyword-only arguments are in the same order as listed in `code.co_varnames`). * return_annotation : object The annotation for the return type of the function if specified. If the function has no annotation for its return type, this attribute is set to `Signature.empty`. * bind(*args, **kwargs) -> BoundArguments Creates a mapping from positional and keyword arguments to parameters. * bind_partial(*args, **kwargs) -> BoundArguments Creates a partial mapping from positional and keyword arguments to parameters (simulating 'functools.partial' behavior.) Ú_return_annotationÚ _parametersNr&rúTc Cs[|dkrtƒ}n$|r#tƒ}t}d}xt|ƒD]Ü\}}|j} |j} | |kr‘d} | j|| ƒ} t| ƒ‚n| |kr©d}| }| ttfkrë|jt krå|rëd} t| ƒ‚nd}| |krdj| ƒ} t| ƒ‚||| .)rr*rErar^rjrir+r,rårÚMappingProxyTyper$r#) rƒr(r&rúr´Ztop_kindZ kind_defaultsÚidxr5rar^rWr r r rës s<           zSignature.__init__cCs#tjdtddƒt||ƒS)z3Constructs Signature for the given python function.zNinspect.Signature.from_function() is deprecated, use Signature.from_callable()rrš)rŸr r¡rü)rRrkr r r Ú from_function¦ s  zSignature.from_functioncCs#tjdtddƒt||ƒS)z4Constructs Signature for the given builtin function.zMinspect.Signature.from_builtin() is deprecated, use Signature.from_callable()rrš)rŸr r¡rù)rRrkr r r Ú from_builtin¯ s  zSignature.from_builtinÚfollow_wrappedcCst|d|d|ƒS)z3Constructs Signature for the given callable object.r"r )r$)rRr`r)r r r Ú from_callable¸ szSignature.from_callablecCs|jS)N)r$)rƒr r r r(¾ szSignature.parameterscCs|jS)N)r#)rƒr r r r& szSignature.return_annotationr(cCsF|tkr|jjƒ}|tkr0|j}t|ƒ|d|ƒS)z�Creates a customized copy of the Signature. Pass 'parameters' and/or 'return_annotation' arguments to override them in the new copy. r&)r»r(r)r#r)rƒr(r&r r r r;Æ s    zSignature.replacecCsNtdd„|jjƒDƒƒ}dd„|jjƒDƒ}|||jfS)Ncss$|]}|jtkr|VqdS)N)rar.)rQr5r r r r³Ö sz(Signature._hash_basis..cSs+i|]!}|jtkr||j“qSr )rar.r^)rQr5r r r raÙ s z)Signature._hash_basis..)rXr(r)r&)rƒr´Ú kwo_paramsr r r Ú _hash_basisÕ s"zSignature._hash_basiscCs:|jƒ\}}}t|jƒƒ}t|||fƒS)N)r,Ú frozensetr)r)rƒr´r+r&r r r rÞ szSignature.__hash__cCs9||krdSt|tƒs#tS|jƒ|jƒkS)NT)rr%rr,)rƒrr r r rã s  zSignature.__eq__r¯FcCsetƒ}t|jjƒƒ}f}t|ƒ}xêyt|ƒ}Wntk rMyt|ƒ} Wntk rxPYnÑX| jtkrŒPn½| j|krá| jt krÔd} | j d| jƒ} t | ƒd‚| f}Pnh| jt ksÿ| j tk r | f}Pn=|r| f}Pn*d} | j d| jƒ} t | ƒd‚Yq3Xyt|ƒ} Wn!tk r�t dƒd‚Yq3X| jt tfkr¦t dƒd‚| jtkrß|g} | j|ƒt| ƒ|| j)rjr€r~)rƒr r r rƒ szSignature.__repr__c Csg}d}d}x¡|jjƒD]�}t|ƒ}|j}|tkrRd}n|rk|jdƒd}|tkr€d}n%|tkr¥|r¥|jdƒd}|j|ƒq"W|rÉ|jdƒdjdj |ƒƒ}|j t k rt |j ƒ}|dj|ƒ7}|S)NFTrÄr?z({})z, z -> {}) r(r)r†rar*rAr-r.rjr�r&rår<) rƒr]Zrender_pos_only_separatorZrender_kw_only_separatorr5rraZrenderedZannor r r r † s0         zSignature.__str__)r#r$)r~rxryr}rrçrërr0rår'rër\r'r(r*rUr(r&r»r;r,rrr1r2rªrrrr r r r r r%U s0  2    ƒ     r%r)cCstj|d|ƒS)z/Get a signature object for the passed callable.r))r%r*)r`r)r r r rÌ´ srÌcCs^ddl}ddl}|jƒ}|jdddƒ|jdddd dd ƒ|jƒ}|j}|jd ƒ\}}}y|j|ƒ}} Wn`tk rù} z@d j |t | ƒj | ƒ} t | d t jƒtdƒWYdd} ~ XnX|r5|jdƒ} | }x| D]} t|| ƒ}qW| j t jkrdt dd t jƒtdƒ|jrJt dj |ƒƒt dj t| ƒƒƒt dj | jƒƒ|| krÿt dj t| jƒƒƒt| dƒr=t dj | jƒƒn>yt|ƒ\}}Wntk r)YnXt dj |ƒƒt dƒnt t|ƒƒdS)z6 Logic for inspecting an object given at command line rNr ÚhelpzCThe object to be analysed. It supports the 'module:qualname' syntaxz-dz --detailsÚactionÚ store_truez9Display info about the module rather than its source coder¾zFailed to import {} ({}: {})rÊršrsz#Can't get info for builtin modules.rz Target: {}z Origin: {}z Cached: {}z Loader: {}Ú__path__zSubmodule search path: {}zLine: {}r‰)Úargparser­ÚArgumentParserÚ add_argumentÚ parse_argsr Ú partitionÚ import_modulerYrjrr~ÚprintruÚstderrÚexitrzrCÚbuiltin_module_namesZdetailsr¿Ú __cached__r:r´rr6rÜr)r7r­Úparserr ÚtargetZmod_nameZ has_attrsZattrsr`rÌr_rWÚpartsÚpartÚ__rtr r r Ú_main¹ sV              rGrÄ)ªr}Ú __author__rÒZdisÚcollections.abcr(ÚenumZimportlib.machineryr­rîr½r¦rÖruròrørrŸrrÅÚoperatorrrrÚglobalsZmod_dictZCOMPILER_FLAG_NAMESr?rLrMr6r rrrrrrrrr!r"r$r&r+r-r/r1r3r4r7rOrPrbr:rmrrr{r„rˆr‡r˜r™r¬r±r¿rÃrÆrÈr¼rÜrârYrãrärÿrrrrr rr rrrrr6r9r<r>r†rKrNrUrXr]r^rmrnrvrwÚ_fieldsrxr|rr�r‚r„r r‰r†r‹rŽr�rŒr‘r’r“r”r•ršr›rœr�ržrŸr£r¤rrþZ_WrapperDescriptorÚallZ_MethodWrapperrØr>Z_ClassMethodWrapperr2r¦r¨r³rµr¶r¼rÀrÑr÷rùrür$r»råÚIntEnumrrðr*rñr+ròr-rór.rôr/rçrr%rÌrGr~r r r r ÚsP                                , t !  ;      . I -7      [        )     > 5       0      L    H� QÆ     ‰‚ÿ` :