grthtrhthjhtyjytjytkergtrhtrjytjerhrfh4:24 29/09/2026 ”qc¾ã@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/alt/python35/lib64/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 Z predicateÚmroÚresultsÚ processedÚnamesÚbaseÚkÚvr8Úvaluer r r Ú getmemberss:          rNÚ 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Ú classmethodrTr4rOrD)rQrFZmetamroZ class_basesZ all_basesrIrJrKrLÚresultrHÚnameZhomeclsZget_objZdict_objÚexcZlast_clsZsrch_clsZsrch_objÚobjÚkindr r r Úclassify_class_attrsJs€                            racCs|jS)zHReturn tuple of base classes (including cls) in method resolution order.)Ú__mro__)rQr 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)Nrd)r)re)rcr r rfØsz!wrapper loop when unwrapping {!r})ÚidrdÚ ValueErrorÚformatrD)ÚfuncrcrfreÚmemoZid_funcr )rcr ÚunwrapÄs    rlcCs&|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 rqcCsotjj|jƒ}|dkr%dSx3|jjdƒdd…D]}t||ƒ}qBWt|ƒskdS|S)NÚ.réÿÿÿÿ)ÚsysÚmodulesÚgetÚ __module__Ú __qualname__ÚsplitrCr)rjrQr]r r r Ú _findclassês # rzc 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__rr)rrbr Ú__doc__rBrr{Ú__name__Ú__self__rCÚ __class__rrzr3rxrrTÚfgetrrrS)r_rJÚdocr]ÚselfrQrjr 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 )rn)rPršr r r rR�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®)rPÚs)r§r r ú œsz getsourcefile..rc3s|]}ˆj|ƒVqdS)N)r®)rPr°)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ŒrnÚmatchrAÚgrouprErr{rrr-r“r/r”r1rrÏ) r rÈrÊr�r]ZpatZ 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 r9r )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ú=)r6)rMr 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\)r/r8Ú formatargr r Úformatargandannotation§s  z-formatargspec..formatargandannotationNr;ríz, rîr)rnÚ enumeraterArŽ)rr r rr rr/r?Ú formatvarargsÚ formatvarkwÚ formatvalueZ formatreturnsr8r@ÚspecsZ firstdefaultr‘r>ÚspecZ kwonlyargr\r )r/r8r?r Ú formatargspec—s2       rGcCsd|S)Nr;r )r]r r r r9ÈscCsd|S)Nz**r )r]r r r r9ÉscCsdt|ƒS)Nr<)r6)rMr 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]Úlocalsr?rDr r r ÚconvertÑsz formatargvalues..convertríz, rî)rŒrnrArŽ) rr r rHr?rBrCrDrIrEr‘r r r ÚformatargvaluesÆs !!rJcsÖ‡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 )r6)rPr])r%r r rRÞs z&_missing_arguments..rrr˜z {} and {}z , {} and {}z, z*%s() missing %i required %s argument%s: %sÚ positionalz keyword-onlyrÚr°éþÿÿÿrL)rnrirŽr„)Úf_nameZargnamesÚposr%rIÚmissingr°Útailr )r%r Ú_missing_argumentsÝs     rQc 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 )rPr>)r%r r rRï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)rnr…r„) rMrZkwonlyr ZdefcountZgivenr%ZatleastZ kwonly_givenZpluralr-Z kwonly_sigÚmsgr )r%r Ú _too_manyís$ rScOsÖ|d}|dd…}t|ƒ}|\}}}}} } } |j} i} t|ƒr{|jdk r{|jf|}t|ƒ}t|ƒ}|r¥t|ƒnd}t||ƒ}x&t|ƒD]}||| ||rOÚkwargr r r Ú getcallargssd            '   rWÚ ClosureVarsz"nonlocals globals builtins unboundc CsRt|ƒr|j}t|ƒs6tdj|ƒƒ‚|j}|jdkrWi}n"dd„t|j|jƒDƒ}|j }|j dt j ƒ}t |ƒr¬|j }i}i}tƒ}x{|jD]p}|d kràqËy||||Ws z"getclosurevars..Ú __builtins__ÚNoneÚTrueÚFalse)r]r^r_)rr{rr„rirÚ __closure__ÚzipÚ co_freevarsÚ __globals__rvrÃr>r r;Úco_namesÚKeyErrorrDrX) rjÚcodeZ nonlocal_varsZ global_nsZ builtin_nsZ global_varsZ builtin_varsZ unbound_namesr]r r r ÚgetclosurevarsBs8              rgÚ 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„rir½r–rÙrÒÚmaxr‹rnrhr”Úco_name)r4ÚcontextÚlinenor§rÝr�rØÚindexr r r Ú getframeinfoys$       " rpcCs|jS)zCGet the line number from a frame object, allowing for optimization.)rj)r4r r r Ú getlineno™srqÚ FrameInfor4cCsIg}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.)rprArrÚf_back)r4rmÚ framelistÚ frameinfor r r Úgetouterframes s   rvcCsLg}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“rprArrÚtb_next)Útbrmrtrur r r Úgetinnerframes¬s   rycCs ttdƒrtjdƒSdS)z?Return the frame of the caller or None if this is not possible.Ú _getframerN)rrtrzr r r r Ú currentframe¸sr{cCsttjdƒ|ƒS)z@Return a list of records for the stack above the caller's frame.r)rvrtrz)rmr r r Ústack¼sr|cCsttjƒd|ƒS)zCReturn a list of records for the stack below the current exception.r˜)ryrtÚexc_info)rmr r r ÚtraceÀsr~cCstjdj|ƒS)Nrb)rr>r)Úklassr r r Ú_static_getmroÉsr€c CsDi}ytj|dƒ}Wntk r0YnXtj||tƒS)Nr>)r Ú__getattribute__rBÚdictrvÚ _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>re)rr„Ú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€rrerrr}rSrƒ)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>rerB)r_r„r(Zinstance_resultrrŠ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. Nrrs)Ú 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„rirCr‘r3)r“r4r 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. Nrrs)Ú 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)rCr3)rœr4r 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)rQZ 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Ú)ryrørùrïrArõÚOPÚ ERRORTOKENÚnextrÚENCODINGr¦ÚstringrŽ)Ú signatureÚself_parameterÚlast_positional_onlyr�r“Z token_streamZ delayed_commaZskip_next_commar=rDZcurrent_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 signaturerrwcSs:t|tjƒst‚|jdkr3tdƒ‚|jS)Nz'Annotations are not currently supported)rÚastr>r¦r,rh)Ú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°rM)Ú 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)Nrr) rrËrOrAr„rMÚNamerÐrgrŽÚreversed)r‚rÌÚarTrM)rÖr r Úvisit_Attribute·s  z<_signature_fromstr..RewriteSymbolics.visit_Attributecs+t|jtjƒstƒ‚ˆ|jƒS)N)rZctxrËZLoadrhrg)r‚rÌ)rÖr r Ú visit_NameÃs z7_signature_fromstr..RewriteSymbolics.visit_NameN)r}rwrxrÚ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(r,)Ú_emptyZvisitrËZ literal_evalrhrA)Z name_nodeZ default_noder(r]Úo)Ú ParameterrÜr#Úinvalidr`r$rÍr r ÚpÈs     z_signature_fromstr..pÚ fillvaluer~r`r")'Ú_parameter_clsrÊrËÚparseÚ SyntaxErrorrZModulerhriZbodyr#r rCrtrurvr>ZNodeTransformerrØrrÚ itertoolsÚ zip_longestÚPOSITIONAL_ONLYÚPOSITIONAL_OR_KEYWORDrArÅZvarargÚVAR_POSITIONALÚ KEYWORD_ONLYrar Z kw_defaultsrVÚ VAR_KEYWORDr¦r r�r7)rQr_r°rrÉrÆrÇZprogramrÊreZ module_namerárrrør‘r]r(Ú_selfZ self_isboundZ self_ismoduler ) rßrÜr#ràr`rÔ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„rirCrhrî)rQrjrr°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 functionNrr,r`r(rr"rÚ__validate_parameters__)rrµr„rirãrr rrWrr²r°r±rnrvrÝrAr'rAr rr)r*rr+)rQrjZis_duck_functionrßZ func_codeZ pos_countZ arg_namesrKZkeyword_only_countZ keyword_onlyr/rr0Zpos_default_countr$Znon_default_countr]r,Úoffsetr(ror r r Ú_signature_from_functionsj            #           rórrc!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 objectrrrrccSs t|dƒS)NÚ __signature__)r)rer 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)Nrs),r³r„rirrrr r{r®rlrôrBr!Ú_partialmethodÚ functoolsÚ partialmethodrjr¬rWr$r%r`rßrêr¦r7rrµrór¯rðr©rr¢rbrïrîrèr rörÅrhr r2)r_rrrr-rùr¨Zfirst_wrapped_paramZ sig_paramsrªZcallÚnewZinitrJZtext_sigr.rRr r r r hsè                               "   r c@seZdZdZdS)r´z1A private marker - used in Parameter & Signature.N)r}rwrxr|r r r r r´0 s r´c@seZdZdZdS)rÝz6Marker object for Signature.empty and Parameter.empty.N)r}rwrxr|r r r r rÝ4 s rÝc@s:eZdZdZdZdZdZdZdd„ZdS) Ú_ParameterKindrrr˜éécCs|jS)N)Z_name_)r‚r r r Ú__str__? sz_ParameterKind.__str__N) r}rwrxrèrérêrërìrþr r r r rû8 s rûc @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(r,cCså|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+rhrrÝrirrrr…r„Ú isidentifierrÿ)r‚r]r`r(r,rRr r r rèj s"          zParameter.__init__cCs1t|ƒ|j|jfd|jd|jifS)Nrr)rrÿrrr)r‚r r r Ú __reduce__ƒ s  zParameter.__reduce__cCs|d|_|d|_dS)Nrr)rr)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 r,• szParameter.annotationcCs|jS)N)r)r‚r r r r`™ szParameter.kindr]r`cCss|tkr|j}|tkr*|j}|tkr?|j}|tkrT|j}t|ƒ||d|d|ƒS)z+Creates a customized copy of the Parameter.r(r,)r´rÿrrrr)r‚r]r`r,r(r r r r7� s        zParameter.replacecCs™|j}|j}|jtk r<dj|t|jƒƒ}|jtk rfdj|t|jƒƒ}|tkrd|}n|t kr•d|}|S)Nz{}:{}z{}={}r;z**) r`rÿrrÝrir8rr6r)r+)r‚r`Ú formattedr r r rþ¯ s       zParameter.__str__cCsdj|jj|ƒS)Nz <{} "{}">)rirr})r‚r r r Ú__repr__ szParameter.__repr__cCs"t|j|j|j|jfƒS)N)Úhashr]r`r,r()r‚r r r Ú__hash__Å szParameter.__hash__cCsi||krdSt|tƒs#tS|j|jkoh|j|jkoh|j|jkoh|j|jkS)NT)rrßÚNotImplementedrÿrrr)r‚Úotherr r r Ú__eq__È s zParameter.__eq__N)rÿrrr)r}rwrxr|Ú __slots__r&rèr'rér)rêr*rër+rìrÝr#rèrrrTr]r(r,r`r´r7rþrr r r 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?r`r+r*r¥rer)ÚextendrArW)r‚rr«r1r>r 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|||r r r r s&  zBoundArguments.kwargsc CsÖ|j}g}x±|jjjƒD]�\}}y|j|||fƒWq"tk r¾|jtk rt|j}n3|jt krŒf}n|jt kr¤i}nw"|j||fƒYq"Xq"Wt |ƒ|_dS)zåSet default values for missing arguments. For variable-positional arguments (*args) the default is an empty tuple. For variable-keyword arguments (**kwargs) the default is an empty dict. N) r¥rr$r?rArer(rÝr`r)r+r)r‚r¥Z new_argumentsr]r1Úvalr r r Úapply_defaults# s     zBoundArguments.apply_defaultscCsE||krdSt|tƒs#tS|j|jkoD|j|jkS)NT)rrr rÅr¥)r‚r r r r r ? s  zBoundArguments.__eq__cCs|d|_|d|_dS)Nrr¥)rr¥)r‚rr r r rG s zBoundArguments.__setstate__cCsd|jd|jiS)Nrr¥)rr¥)r‚r r r Ú __getstate__K szBoundArguments.__getstate__cCs^g}x6|jjƒD]%\}}|jdj||ƒƒqWdj|jjdj|ƒƒS)Nz{}={!r}z <{} ({})>z, )r¥r?rArirr}rŽ)r‚rr>rMr r r rN szBoundArguments.__repr__N)r¥rr)r}rwrxr|rrèrTrÅrrrr rrrr 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&rAr`r]rirhr'r(rÝrÚMappingProxyTyperr) r‚r$r"rñr­Ztop_kindZ kind_defaultsÚidxr1r`r]rRr 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ó)rQrjr 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ð)rQrjr r r Ú from_builtin¯ s  zSignature.from_builtinÚfollow_wrappedcCst|d|d|ƒS)z3Constructs Signature for the given callable object.rr)r )rQr_rr 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%rr)r‚r$r"r r r r7Æ s    zSignature.replacecCsNtdd„|jjƒDƒƒ}dd„|jjƒDƒ}|||jfS)Ncss$|]}|jtkr|VqdS)N)r`r*)rPr1r r r r±Ö sz(Signature._hash_basis..cSs+i|]!}|jtkr||j“qSr )r`r*r])rPr1r r r r[Ù s z)Signature._hash_basis..)rWr$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!r r!)r‚r r 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| ƒ|| jNz$missing a required argument: {arg!r}ztoo many positional argumentsz$multiple values for argument {arg!r}z*got an unexpected keyword argument {arg!r})rrør$r%rÂÚ StopIterationr`r)r]r&rir„r+r(rÝr*rrWræÚchainr�reÚ_bound_arguments_cls)r‚rrr©r¥r$Z parameters_exZarg_valsZarg_valr1rRr%Z kwargs_paramr«r r r Ú_bindê s”                  zSignature._bindcOs|dj|dd…|ƒS)z¹Get a BoundArguments object, that maps the passed `args` and `kwargs` to the function's signature. Raises `TypeError` if the passed arguments can not be bound. rrN)r&)rrr r r Úbindm szSignature.bindcOs$|dj|dd…|ddƒS)zÂGet a BoundArguments object, that partially maps the passed `args` and `kwargs` to the function's signature. Raises `TypeError` if the passed arguments can not be bound. rrNr©T)r&)rrr r r r¤t szSignature.bind_partialcCs.t|ƒt|jjƒƒfd|jifS)Nr)rrWrr%r)r‚r r r r{ s zSignature.__reduce__cCs|d|_dS)Nr)r)r‚rr r r r€ szSignature.__setstate__cCsdj|jj|ƒS)Nz<{} {}>)rirr})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…r`r&rAr)r*rirŽr"rÝr8) r‚r\Zrender_pos_only_separatorZrender_kw_only_separatorr1rr`ZrenderedZannor r r rþ† s0         zSignature.__str__)rr)r}rwrxr|rrßrãrr%rÝr#rèr[rrrrTr$r"r´r7r!r r r&r'r¤rrrrþr r r r r!U s0  2    ƒ     r!rcCstj|d|ƒS)z/Get a signature object for the passed callable.r)r!r)r_rr 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˜rrz#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_modulerXrirr}ÚprintrtÚstderrÚexitryrCÚbuiltin_module_namesZdetailsr½Ú __cached__r6r²rr+rÙrþ)r,r«ÚparserrÚtargetZmod_nameZ has_attrsZattrsr_rÊr^rRÚpartsÚpartÚ__rnr r r Ú_main¹ sV              r<rÂ)ªr|Ú __author__rËZdisÚcollections.abcr(ZenumÚimportlib.machineryr«rær»r¤rÔrtrïrõrr�rørÃÚoperatorrrrÚglobalsZmod_dictZCOMPILER_FLAG_NAMESr?rKrLr6r rrrrrrrrr!r"r$r&r+r-r/r1r3r4r7rNrOrar:rlrqrzrƒr‡r†r–r—rªr¯r½rÁrÄrÆrºrÙrßrXràrárürýrþrÿrrr rrrrrr2r5r8r:r…rGrJrQrSrWrXrgrhrprqÚ_fieldsrrrvryr{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ÝZIntEnumrûrèr&rér'rêr)rër*rìr+rßrr!rÅr<r}r r r r ÚsP                                , t !  ;      . I -7      [        )     > 5       0      L    H� QÆ     ‰‚ÿ` :