403Webshell
Server IP : 127.0.0.1  /  Your IP : 216.73.216.109
Web Server : Apache/2.4.54 (Win64) OpenSSL/1.1.1q PHP/8.1.10
System : Windows NT DESKTOP-E5T4RUN 10.0 build 19045 (Windows 10) AMD64
User : SERVERWEB ( 0)
PHP Version : 8.1.10
Disable Function : NONE
MySQL : OFF |  cURL : ON |  WGET : OFF |  Perl : OFF |  Python : OFF |  Sudo : OFF |  Pkexec : OFF
Directory :  C:/cygwin64/lib/python3.9/site-packages/sphinx/util/__pycache__/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : C:/cygwin64/lib/python3.9/site-packages/sphinx/util/__pycache__/inspect.cpython-39.pyc
a

�abI�@s�dZddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
mZmZddl
mZddlmZmZmZmZmZddlmZddlmZddlmZmZmZmZmZmZmZmZmZdd	l m!Z!dd
l"m#Z#ddl"m$Z%ddl&m'Z'dd
l(m)Z)ddl(m*Z+ej,dk�r2ddlm-Z-m.Z.m/Z/n"e0e1j2�Z-e0e3j4�Z.e0e5j6d�Z/e'�7e8�Z9e�:dej;�Z<eed�dd�Z=eed�dd�Z>dd�eeed�dd�Z?eeee3d�dd�Z@eee3efd�dd �ZAeee3efd�d!d"�ZBeeed#fd�d$d%�ZCeeeed#fd�d&d'�ZDeeed�d(d)�ZEeeFd�d*d+�ZGeeFd,�d-d.�ZHeeFd,�d/d0�ZIeed�d1d2�ZJeeFd�d3d4�ZKd}eee3eFd5�d6d7�ZLd~eee3eFd5�d8d9�ZMeeFd,�d:d;�ZNeeFd�d<d=�ZOeeFd�d>d?�ZPeeFd�d@dA�ZQeeFd�dBdC�ZReeFd�dDdE�ZSeeFd�dFdG�ZTeeFd�dHdI�ZUeeFd�dJdK�ZVeeFd�dLdM�ZWeeFd�dNdO�ZXeeFd�dPdQ�ZYeeFd�dRdS�ZZee3eedT�dUdV�Z[ee3dW�dXdY�Z\ee3eFdZ�d[d\�Z]Gd]d^�d^�Z^Gd_d`�d`�Z_Gdadb�db�Z`Gdcdd�ddee3ef�ZaeeFde�dfdg�ZbdhdifeeFeFeejcdi�djdk�Zddejceeejcdl�dmdn�Zed�ejceFeFeFe3dp�dqdr�Zfe3ejcds�dtdu�Zgd�e#jhe3ejcdw�dxdy�Zie[dhddfeeeFee3e3dz�d{d|�ZjdS)�z�
    sphinx.util.inspect
    ~~~~~~~~~~~~~~~~~~~

    Helpers for inspecting Python modules.

    :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS.
    :license: BSD, see LICENSE for details.
�N)�partial�
partialmethod)�
import_module)�	Parameter�isclass�ismethod�ismethoddescriptor�ismodule)�StringIO)�
ModuleType)	�Any�Callable�Dict�Mapping�Optional�Sequence�Tuple�Type�cast)�RemovedInSphinx50Warning)�ast)�unparse)�logging)�
ForwardRef)�	stringify)��)�ClassMethodDescriptorType�MethodDescriptorType�WrapperDescriptorType�fromkeysz at 0x[0-9a-f]{8,16}(?=>))�func�returnc	Cs:tjdtdd�t�|�}g}d}d}g}d}i}d}i}|j|jurP|j|d<|j��D]�}	|	j	}
|	j
}|
tjur�|�
|�nx|
tjur�|�
|�|	j|	jur�||	jf7}nJ|
tjur�|}n:|
tjur�|�
|�|	j|	jur�|	j||<n|
tjur�|}|	j|	jurZ|	j||<qZ|�sd}|�s$d}t�|||||||�S)zPLike inspect.getfullargspec but supports bound methods, and wrapped
    methods.z-sphinx.ext.inspect.getargspec() is deprecated���
stacklevelN�r")�warnings�warnr�inspect�	signature�return_annotation�empty�
parameters�values�kind�namer�POSITIONAL_ONLY�append�POSITIONAL_OR_KEYWORD�default�VAR_POSITIONAL�KEYWORD_ONLY�VAR_KEYWORD�
annotationZFullArgSpec)r!�sig�argsZvarargsZvarkw�
kwonlyargs�defaults�annotations�
kwdefaults�paramr/r0r&r&�7/usr/lib/python3.9/site-packages/sphinx/util/inspect.py�
getargspec;sP�








�rA��objr"cCs<z t|d�r|WSt�|�WSWnty6|YS0dS)z?Get an original object from wrapped object (wrapped functions).Z__sphinx_mock__N)�hasattrr)�unwrap�
ValueError�rCr&r&r@rEqs
rE��stop)rCrIr"cCsf|r||�r|St|�r |j}qt�|�r<t|d�r<|j}qt|�rL|j}qt|�r\|j}q|SqdS)zx
    Get an original object from wrapped object (unwrapping partials, wrapped
    functions, and other decorators).
    �__wrapped__N)	�	ispartialr!r)�	isroutinerDrJ�
isclassmethod�__func__�isstaticmethod)rCrIr&r&r@�
unwrap_all~srPcCsHt|dd�}|durdSt|ttf�r<tdd�|D��r<|St|��dS)z�Get __all__ attribute of the module as dict.

    Return None if given *obj* does not have __all__.
    Raises ValueError if given *obj* have invalid __all__.
    �__all__Ncss|]}t|t�VqdS�N��
isinstance�str��.0�er&r&r@�	<genexpr>��zgetall.<locals>.<genexpr>)�safe_getattrrT�list�tuple�allrF)rCrQr&r&r@�getall�s r_cCs"t|dd�}t|t�r|SiSdS)z,Get __annotations__ from given *obj* safely.�__annotations__N�r[rTr)rCr`r&r&r@�getannotations�s
rbcCs"t|dd�}t|t�r|SiSdS)z(Get __globals__ from given *obj* safely.�__globals__Nra)rCrcr&r&r@�
getglobals�s
rd.cCs$t|dd�}t|t�r|St�SdS)z$Get __mro__ from given *obj* safely.�__mro__N)r[rTr])rCrer&r&r@�getmro�s
rfcCsFt�|�sdSt|di�}|�d�}t|t�r>t|�dkr>|SdSdS)z%Get __orig_bases__ from *obj* safely.N�__dict__�__orig_bases__r)r)rr[�getrTr]�len)rCrgrhr&r&r@�getorigbases�s

rkcCsjt�|�st�t|dd�}|dur&dSt|t�r4|St|t�rF|diSt|ttf�rbdd�|D�St	�dS)z�Get __slots__ attribute of the class as dict.

    Return None if gienv *obj* does not have __slots__.
    Raises TypeError if given *obj* is not a class.
    Raises ValueError if given *obj* have invalid __slots__.
    �	__slots__NcSsi|]
}|d�qSrRr&rVr&r&r@�
<dictcomp>�rZzgetslots.<locals>.<dictcomp>)
r)r�	TypeErrorr[rT�dictrUr\r]rF)rCrlr&r&r@�getslots�s


rpcCsJtjdkrt|tj�St|dd�}t|dd�}|dkrB|dkrBdSdSdS)	z)Check the if object is a kind of NewType.)r�
�
__module__N�__qualname__�typingzNewType.<locals>.new_typeTF)�sys�version_inforTrt�NewTyper[)rCrrrsr&r&r@�	isNewType�s
rx)�xr"cCst�|�ot|tj�S)z(Check if the object is subclass of enum.)r)r�
issubclass�enum�Enum�ryr&r&r@�isenumclass�sr~cCst|tj�S)z)Check if the object is attribute of enum.)rTr{r|r}r&r&r@�isenumattribute�srcCst|�r|j}q|S)zfGet an original object from partial object.

    This returns given object itself if not partial.
    )rKr!rGr&r&r@�	unpartial�sr�cCst|ttf�S)zCheck if the object is partial.)rTrrrGr&r&r@rKsrK)rC�clsr0r"cCsrt|t�rdSt�|�r0|jdur0t|j�r0dS|rn|rnt�}t|�D]&}|j�	||�}||urFt
|�SqFdS)z#Check if the object is classmethod.TNF)rT�classmethodr)r�__self__r�objectrfrgrirM)rCr�r0Zplaceholder�basecls�methr&r&r@rM
s
rMcCsTt|t�rdS|rP|rPt|d|g�D]*}|j�|�}|r$t|t�rHdSdSq$dS)z$Check if the object is staticmethod.TreF)rT�staticmethod�getattrrgri)rCr�r0r�r�r&r&r@rOs

rOcCs$dD]}tt||d��rdSqdS)z/Check if the object is some kind of descriptor.)�__get__�__set__�
__delete__NTF)�callabler[)ry�itemr&r&r@�isdescriptor-sr�cCst|dd�duS)z)Check if the object is an abstractmethod.�__isabstractmethod__FT�r[rGr&r&r@�isabstractmethod5sr�cCs(z|jjdkWSty"YdS0dS)z6Check if the object is a function or method in cython.Zcython_function_or_methodFN)�	__class__�__name__�AttributeErrorrGr&r&r@�is_cython_function_or_method:sr�cCs�t�|�rdSt|�r�t|�}t|�s8t|�s8t�|�r<dSt|�rHdSt�|�rVdSt	|t
ttf�rjdSt
|�jdkr|dSdSndSdS)z4Check if the object is an attribute like descriptor.TFZinstancemethodN)r)Zisdatadescriptorr�rE�
isfunction�	isbuiltinrr�rrTrrr�typer�)rCZ	unwrappedr&r&r@�isattributedescriptorBs&

�r�cCs6t�|�r.t|d�r.t|d�r.|jjdkr.dSdSdS)z/Check if the object is singledispatch function.�dispatch�register�	functoolsTFN)r)r�rDr�rrrGr&r&r@�is_singledispatch_functionas
��
�r�cCs2zddlm}t||�WSty,YdS0dS)z-Check if the object is singledispatch method.r)�singledispatchmethodFN)r�r�rT�ImportError)rCr�r&r&r@�is_singledispatch_methodls
r�cCst�t|��S)z Check if the object is function.)r)r�rPrGr&r&r@r�usr�cCst�t|��S)zCheck if the object is builtin.)r)r�rPrGr&r&r@r�zsr�cCst�t|��S)z(Check is any kind of function or method.)r)rLrPrGr&r&r@rLsrLcCs<ttd�dd�}t||d�}t|d�r4t�|�r4dSdSdS)	z*Check if the object is coroutine-function.rBcSs2t|�st|�st|�rdSt|d�r*dSdSdS)z2Check if the object is wrapped coroutine-function.FrJTN)rOrMrKrDrGr&r&r@�iswrappedcoroutine�s

z/iscoroutinefunction.<locals>.iswrappedcoroutinerH�__code__TFN)r�boolrPrDr)�iscoroutinefunction)rCr�r&r&r@r��s
r�cCs t|d�rt�|�rdSdSdS)z*Check if the object is async-gen function.r�TFN)rDr)�isasyncgenfunctionrGr&r&r@r��sr�cCs.tjdkr$ddlm}t||�r$dSt|t�S)z Check if the object is property.)r�r)�cached_propertyT)rurvr�r�rT�property)rCr�r&r&r@�
isproperty�s


r�cCsVttd�rt|tj�rdSttd�r4t|tj�r4dSttd�rNt|tj�rNdSdSdS)z$Check if the object is GenericAlias.�
_GenericAliasT�GenericAlias�_SpecialGenericAliasFN)rDrtrTr��typesr�r�rGr&r&r@�isgenericalias�s

�

�

�r�)rCr0�defargsr"cGs�zt||g|�R�WSty�}zZz|j|WWYd}~StyNYn0|rh|dWYd}~St|�|�WYd}~n
d}~00dS)z;A getattr() that turns all exceptions into AttributeErrors.Nr)r��	Exceptionrgr�)rCr0r��excr&r&r@r[�sr[)r�r"c
sDt�t�rLzt��}Wnty(Yq�0�fdd�|D�}dd�|�Sn�t�t�r�zt��}WntytYq�0dd�dd�|D��Snbt�t�r�zt��}Wnty�Yq�0dd�dd�|D��Snt�tj	�r�d�j
j�jfSzt
��}Wn,t�y*}zt|�WYd	}~n
d	}~00t�d
|�}|�dd�S)
zFA repr() implementation that returns text safe to use in reST context.c3s&|]}dt|�t�|�fVqdS)z%s: %sN��object_description)rW�key�r�r&r@rY�s��z%object_description.<locals>.<genexpr>z{%s}�, css|]}t|�VqdSrRr��rWryr&r&r@rY�rZzfrozenset({%s})css|]}t|�VqdSrRr�r�r&r&r@rY�s�z%s.%sN��
� )rTro�sortedr��join�setrn�	frozensetr{r|r�r�r0�reprrF�memory_address_re�sub�replace)r�Zsorted_keys�itemsZ
sorted_values�sr�r&r�r@r��s>

�

�r�)rC�	attr_namer"cslz"t|�}t�fdd�|D��}Wnty6YdS0zt|d�}WntyZYdS0tt|d�|uS)z�If attr_name is implemented at builtin class, return True.

        >>> is_builtin_class_method(int, '__init__')
        True

    Why this function needed? CPython implements int.__init__ by Descriptor
    but PyPy implements it by pure Python code.
    c3s"|]}�t|di�vr|VqdS)rgNr�)rW�c�r�r&r@rYrZz*is_builtin_class_method.<locals>.<genexpr>Fr�N)rf�next�
StopIterationr[r�r��builtins)rCr��mror�r0r&r�r@�is_builtin_class_method�s	r�c@s>eZdZdZedd�dd�Zeed�dd�Zed	�d
d�Z	dS)�DefaultValuezKA simple wrapper for default value of the parameters of overload functions.N)�valuer"cCs
||_dSrR�r�)�selfr�r&r&r@�__init__szDefaultValue.__init__��otherr"cCs
|j|kSrRr��r�r�r&r&r@�__eq__szDefaultValue.__eq__�r"cCs|jSrRr��r�r&r&r@�__repr__szDefaultValue.__repr__)
r�rrrs�__doc__rUr�r�r�r�r�r&r&r&r@r�sr�c@s>eZdZdZedd�dd�Zdd�dd�Zeed	�d
d�Z	dS)�TypeAliasForwardRefzPseudo typing class for autodoc_type_aliases.

    This avoids the error on evaluating the type inside `get_type_hints()`.
    N�r0r"cCs
||_dSrR�r0)r�r0r&r&r@r�$szTypeAliasForwardRef.__init__r�cCsdSrRr&r�r&r&r@�__call__'szTypeAliasForwardRef.__call__r�cCs
|j|kSrRr�r�r&r&r@r�+szTypeAliasForwardRef.__eq__)
r�rrrsr�rUr�r�rr�r�r&r&r&r@r�sr�c@s:eZdZdZeeeefdd�dd�Zeed�dd�ZdS)	�TypeAliasModulez-Pseudo module class for autodoc_type_aliases.N)�modname�mappingr"cCs||_||_d|_dSrR)�_TypeAliasModule__modname�_TypeAliasModule__mapping�_TypeAliasModule__module)r�r�r�r&r&r@r�2szTypeAliasModule.__init__r�cs�d�td|j|g��}||jvr.t|j|�S|d��fdd�|j��D�}|r\t||�Sz
t|�WSty�|j	dur�t|j�|_	t
|j	|�YS0dS)N�.cs i|]\}}|���r||�qSr&��
startswith�rW�k�v��prefixr&r@rm?rZz/TypeAliasModule.__getattr__.<locals>.<dictcomp>)r��filterr�r�r�r�r�rr�r�r�)r�r0�fullname�nestedr&r�r@�__getattr__8s



zTypeAliasModule.__getattr__)	r�rrrsr�rUrr�rr�r&r&r&r@r�/sr�c@s8eZdZdZeeefdd�dd�Zeed�dd�ZdS)	�TypeAliasNamespacez�Pseudo namespace class for autodoc_type_aliases.

    This enables to look up nested modules and classes like `mod1.mod2.Class`.
    N)r�r"cCs
||_dSrR)�_TypeAliasNamespace__mapping)r�r�r&r&r@r�VszTypeAliasNamespace.__init__)r�r"csN||jvrt|j|�S|d��fdd�|j��D�}|rFt||�St�dS)Nr�cs i|]\}}|���r||�qSr&r�r�r�r&r@rm_rZz2TypeAliasNamespace.__getitem__.<locals>.<dictcomp>)r�r�r�r��KeyError)r�r�r�r&r�r@�__getitem__Ys

zTypeAliasNamespace.__getitem__)	r�rrrsr�rrUr�rr�r&r&r&r@r�Psr�)�subjectr"cCs.t|�}|�d�dkr*|�d�tjkr*dSdS)z<Check the function should be unwrapped on getting signature.r��
contextlib�__file__TF)rdrir�r�)r�rcr&r&r@�_should_unwrapgs�r�F)r��bound_method�follow_wrapped�type_aliasesr"cCs�|durd}ntjdtdd�z\z&t|�r6t�|�}ntj||d�}Wntybt�|�}Yn0t|j�	��}|j
}Wn*ty�t|d�r�g}t
j}n�Yn0z�t|�}t�|d|�}t|�D]<\}	}
|
j|vr�||
j}t|t�r�|j}|
j|d�||	<q�d	|v�r2t|d	t��r*|d	j}n|d	}Wnt�yHYn0|�rvt�|��r^nt|�d
k�rv|�d
�tj||dd�S)
z�Return a Signature object for the given *subject*.

    :param bound_method: Specify *subject* is a bound method or not
    :param follow_wrapped: Same as ``inspect.signature()``.
    NTzLThe follow_wrapped argument of sphinx.util.inspect.signature() is deprecatedr#r$)r��_partialmethod�r8r"rF)r+Z__validate_parameters__)r'r(rr�r)r*rFr\r-r.r+�
IndexErrorrDrr,r�rt�get_type_hints�	enumerater0rTr�r�r�rrj�pop�	Signature)r�r�r�r�r*r-r+�localnsr=�ir?r8r&r&r@r*rsT�






�r*)r9�globalnsrr"c	s�ttttd�dd��ttttd��fdd�}|dur8i}|durD|}t|j���}t|�D],\}}|jrZ||j||�}|j|d�||<qZ|j	}|r�||||�}|j||d	�S)
z;Evaluate unresolved type annotations in a signature object.)�refrrr"cSs*tjdkr|�||t��S|�||�SdS)zEvaluate a forward reference.)r�	N)rurv�	_evaluater�)rrrr&r&r@�evaluate_forwardref�s
z/evaluate_signature.<locals>.evaluate_forwardref)r8rrr"c	sxz\t|t�rZt|d�}�|||�}t|t�r:�|||�}n t|t�rZt|d�}�|||�}WnttfyrYn0|S)z$Evaluate unresolved type annotation.T)rTrUr�	NameErrorrn)r8rrr�rr&r@�evaluate�s




z$evaluate_signature.<locals>.evaluateNr�)r-r+)
rrrr\r-r.r�r8r�r+)	r9rrrr-rr?r8r+r&r
r@�evaluate_signature�srT)r9�show_annotation�show_return_annotation�unqualified_typehintsr"c
Cs�|r
d}nd}g}d}|j��D�]"}|j|jkrF||jkrF|�d�|j|jkrn||j|jdfvrn|�d�t�}|j|jkr�|�	d|j
�n*|j|jkr�|�	d|j
�n|�	|j
�|r�|j|j
ur�|�	d�|�	t|j|��|j|j
u�r0|�r|j|j
u�r|�	d�n
|�	d	�|�	t|j��|�|���|j}q |tjk�r\|�d�|jtj
u�s~|d
u�s~|d
u�r�dd�|�St|j|�}	d
d�|�|	fSdS)aNStringify a Signature object.

    :param show_annotation: If enabled, show annotations on the signature
    :param show_return_annotation: If enabled, show annotation of the return value
    :param unqualified_typehints: If enabled, show annotations as unqualified
                                  (ex. io.StringIO -> StringIO)
    Zsmartzfully-qualifiedN�/�*z**z: z = �=Fz(%s)r�z
(%s) -> %s)r-r.r/r1r2r6r3r
r5�writer0r7r8r,�stringify_annotationr4r��getvaluerr+r�)
r9r
rr�moder:Z	last_kindr?�argr8r&r&r@�stringify_signature�sN

�



��r)r*r"cCs2d|d}t�|�}ttj|jd�}t||�S)z&Create a Signature object from string.zdef funcz: passr)r�parser�FunctionDef�body�signature_from_ast)r*�code�module�functionr&r&r@�signature_from_str's
r r�)�noderr"c
	Cs<|j}t|j�}g}t|d�r8t|j�}|t|j�}nd}t|j�}tt|�|�D]}|�dtj	�qTt|d�r�t
|j�D]\\}}	||tj	ur�tj	}
ntt|||��}
t|	j
|�p�tj	}|�t|	jtj|
|d��q|t
|j�D]h\}}	|||tj	u�rtj	}
ntt||||��}
t|	j
|��p0tj	}|�t|	jtj|
|d��q�|j�r�t|jj
|��pjtj	}|�t|jjtj|d��t
|j�D]P\}}	t|j||��p�tj	}
t|	j
|��p�tj	}|�t|	jtj|
|d���q�|j�rt|jj
|��p�tj	}|�t|jjtj|d��t|j|��p,tj	}tj||d�S)z*Create a Signature object from AST *node*.�posonlyargsr)r4r8r�)r+)r:r\r<rDrjr"�range�insertrr,r�r��ast_unparser8r2rr1r3�varargr5r;�kw_defaultsr6�kwargr7�returnsr)r)
r!rr:r<�paramsr"�positionals�_rrr4r8r+r&r&r@r0sZ




�
�
���r)rC�
attrgetter�allow_inheritedr�r0r"c	CsNtfttttd�dd�}|rt|rtt|||�rtt|�D]<}|j�|�}|r6t	|d�r6t
|j�}|dusj|s6|Sq6||�}t|�r�||j
jkr�t
|j�S|du�rJ|�rJ|�r6|�r6t|�D],}t||d�}|dur�||�}|dur�q�q�|du�r6t|�D]6}t||d�}|du�r�t�
|�}|du�r��q6�q�|du�rJt�
|�}|S)z�Get the docstring for the object.

    This tries to obtain the docstring for some kind of objects additionally:

    * partial functions
    * inherited docstring
    * inherited decorated methods
    )rCr-r"cSs"||dd�}t|t�r|SdSdS)Nr�rS)rCr-�docr&r&r@�getdoc_internalss
zgetdoc.<locals>.getdoc_internalrNN)r[rr
rrUrMrfrgrirD�getdocrNrKr�r�r!r))	rCr-r.r�r0r0r�r�r/r&r&r@r1is:










r1)NN)NN)NN)TTF)r�)kr�r�r�r{r)�rerur�rtr'r�rr�	importlibrrrrrr	�ior
rrr
rrrrrrrZsphinx.deprecationrZsphinx.pycode.astrrr%Zsphinx.utilrZsphinx.util.typingrrrrvrrrr�r�r�rUr�rorgZ	getLoggerr��logger�compile�
IGNORECASEr�rArErPr_rbrdrfrkrpr�rxr~rr�rKrMrOr�r�r�r�r�r�r�r�rLr�r�r�r�r[r�r�r�r�r�r�r�rr*rrr rrr1r&r&r&r@�<module>s�
,


6
			
	

(
!��I
�/��=	9��

Youez - 2016 - github.com/yon3zu
LinuXploit