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/__pycache__/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : C:/cygwin64/lib/python3.9/site-packages/sphinx/__pycache__/versioning.cpython-39.opt-1.pyc
a

�ab=�@s*dZddlZddlmZmZddlmZddlmZddl	m
Z
mZmZm
Z
ddlmZddlmZdd	lmZe
r�dd
lmZzddlZdZWney�dZYn0d
Zeee
ed�dd�Zeeee
ed�dd�Zeeed�dd�Zeeed�dd�Z Gdd�de�Z!deeefd�dd�Z"dS) z�
    sphinx.versioning
    ~~~~~~~~~~~~~~~~~

    Implements the low-level algorithms Sphinx uses for the versioning of
    doctrees.

    :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS.
    :license: BSD, see LICENSE for details.
�N)�product�zip_longest)�
itemgetter)�path)�
TYPE_CHECKING�Any�Dict�Iterator)�uuid4)�Node)�SphinxTransform)�SphinxTF�A)�doctree�	condition�returnccs$|�|�D]}t�j|_|Vq
dS)aAdd a unique id to every node in the `doctree` which matches the
    condition and yield the nodes.

    :param doctree:
        A :class:`docutils.nodes.document` instance.

    :param condition:
        A callable which returns either ``True`` or ``False`` for a given node.
    N)�findallr
�hex�uid)rrZnode�r�5/usr/lib/python3.9/site-packages/sphinx/versioning.py�add_uids#s

r)�old�newrrccs�|�|�}|�|�}g}g}i}t�}t||�D]�\}	}
|	durL|�|
�q0t|	dd�sbt�j|	_|
durv|�|	�q0t|	j	|
j	�}|dkr�|	j|
_|�
|
�q0|||	|
f<|�|	�|�|
�q0t||�D]V\}	}
|
|vs�|	|
f|vr�q�t|	j	|
j	�}|dk�r|	j|
_|�
|
�q�|||	|
f<q�t|�
�td�d�}|D]L\\}	}
}|
|v�rX�q<n
|�
|
�|tk�rv|	j|
_nt�j|
_|
V�q<t|�|D]}
t�j|
_|
V�q�dS)a1Merge the `old` doctree with the `new` one while looking at nodes
    matching the `condition`.

    Each node which replaces another one or has been added to the `new` doctree
    will be yielded.

    :param condition:
        A callable which returns either ``True`` or ``False`` for a given node.
    Nrr�)�key)r�setr�append�getattrr
rr�	get_ratioZ	rawsource�addr�sorted�itemsr�VERSIONING_RATIO)rrrZold_iterZnew_iterZ	old_nodesZ	new_nodesZratios�seenZold_nodeZnew_nodeZratiorrr�merge_doctrees2sT














r%)rrrcCsFt||g�stStr,t�||�t|�dSt||�t|�dSdS)z�Return a "similarity ratio" (in percent) representing the similarity
    between the two strings where 0 is equal and anything above less than equal.
    gY@N)�allr#�
IS_SPEEDUP�LevenshteinZdistance�len�levenshtein_distance)rrrrrrus
r)�a�brcCs�||krdSt|�t|�kr&||}}|s2t|�Sttt|�d��}t|�D]f\}}|dg}t|�D]F\}}||dd}||d}	||||k}
|�t||	|
��qh|}qN|dS)zEReturn the Levenshtein edit distance between two strings *a* and *b*.rr���)r)�list�range�	enumerater�min)r+r,Zprevious_row�iZcolumn1Zcurrent_row�jZcolumn2Z
insertionsZ	deletionsZ
substitutionsrrrr*�s 

r*c@s$eZdZdZdZedd�dd�ZdS)�UIDTransformz#Add UIDs to doctree for versioning.ipN)�kwargsrcKs�|j}d}|jsdS|jrzzLt�|j|jd�}t|d��}t�	|�}Wd�n1sZ0YWnt
yxYn0|jr�|dur�tt|j
|j��ntt||j
|j��dS)Nz.doctree�rb)�envZversioning_conditionZversioning_comparer�joinZ
doctreedirZdocname�open�pickle�load�OSErrorr.rZdocumentr%)�selfr5r7Zold_doctree�filename�frrr�apply�s,zUIDTransform.apply)�__name__�
__module__�__qualname__�__doc__Zdefault_priorityrr@rrrrr4�sr4r
)�apprcCs|�t�dddd�S)NZbuiltinT)�versionZparallel_read_safeZparallel_write_safe)Z
add_transformr4)rErrr�setup�s

�rG)#rDr:�	itertoolsrr�operatorr�osr�typingrrrr	Zuuidr
Zdocutils.nodesrZsphinx.transformsrZsphinx.applicationr
r(r'�ImportErrorr#rr%�str�floatr�intr*r4rGrrrr�<module>s,

C


Youez - 2016 - github.com/yon3zu
LinuXploit