403Webshell
Server IP : 192.158.238.246  /  Your IP : 18.189.30.7
Web Server : LiteSpeed
System : Linux uniform.iwebfusion.net 4.18.0-553.27.1.lve.1.el8.x86_64 #1 SMP Wed Nov 20 15:58:00 UTC 2024 x86_64
User : jenniferflocom ( 1321)
PHP Version : 8.1.32
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /usr/lib/python3.6/site-packages/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/python3.6/site-packages/__pycache__/jsonpointer.cpython-36.opt-1.pyc
3

�1V�$�@sddlmZyddlmZmZWn$ek
rDddlmZmZYnXdZdZdZ	dZ
y ddlmZddl
mZeZWn$ek
r�ddlmZeZYnXdd	l
mZdd
lZdd
lZejd�ZGdd
�d
e�ZGdd�de�Ze�Zefdd�Zddd�ZGdd�de�Zdd�Z d
S)�)�unicode_literals)�Mapping�Sequenceu Stefan Kögl <stefan@skoegl.net>z1.10z2https://github.com/stefankoegl/python-json-pointerzModified BSD License)�unquote)�izip)�teeNz0|[1-9][0-9]*$c@seZdZdS)�JsonPointerExceptionN)�__name__�
__module__�__qualname__�rr�!/usr/lib/python3.6/jsonpointer.pyrBsrc@s eZdZdZdd�Zdd�ZdS)�	EndOfListz+ Result of accessing element "-" of a list cCs
||_dS)N)�list_)�selfrrrr
�__init__IszEndOfList.__init__cCsdj|jjt|j�d�S)Nz{cls}({lst}))�clsZlst)�format�	__class__r	�reprr)rrrr
�__repr__Ms
zEndOfList.__repr__N)r	r
r�__doc__rrrrrr
rFsrcCst|�}|j||�S)an
    Resolves pointer against doc and returns the referenced object

    >>> obj = {"foo": {"anArray": [ {"prop": 44}], "another prop": {"baz": "A string" }}}

    >>> resolve_pointer(obj, '') == obj
    True

    >>> resolve_pointer(obj, '/foo') == obj['foo']
    True

    >>> resolve_pointer(obj, '/foo/another%20prop') == obj['foo']['another prop']
    True

    >>> resolve_pointer(obj, '/foo/another%20prop/baz') == obj['foo']['another prop']['baz']
    True

    >>> resolve_pointer(obj, '/foo/anArray/0') == obj['foo']['anArray'][0]
    True

    >>> resolve_pointer(obj, '/some/path', None) == None
    True

    )�JsonPointer�resolve)�doc�pointer�defaultrrr
�resolve_pointerUsrTcCst|�}|j|||�S)aV
    Resolves pointer against doc and sets the value of the target within doc.

    With inplace set to true, doc is modified as long as pointer is not the
    root.

    >>> obj = {"foo": {"anArray": [ {"prop": 44}], "another prop": {"baz": "A string" }}}

    >>> set_pointer(obj, '/foo/anArray/0/prop', 55) ==     {'foo': {'another prop': {'baz': 'A string'}, 'anArray': [{'prop': 55}]}}
    True

    >>> set_pointer(obj, '/foo/yet%20another%20prop', 'added prop') ==     {'foo': {'another prop': {'baz': 'A string'}, 'yet another prop': 'added prop', 'anArray': [{'prop': 55}]}}
    True

    )r�set)rr�value�inplacerrr
�set_pointerrsr!c@s�eZdZdZdd�Zdd�Zefdd�ZeZdd	d
�Z	dd�Z
d
d�Zdd�Zdd�Z
edd��Zdd�Zdd�Zedd��ZdS)rz= A JSON Pointer that can reference parts of an JSON document cCsP|jd�}|jd�dkr td��tt|�}dd�|D�}dd�|D�}||_dS)N�/r�zlocation must starts with /cSsg|]}|jdd��qS)z~1r")�replace)�.0�partrrr
�
<listcomp>�sz(JsonPointer.__init__.<locals>.<listcomp>cSsg|]}|jdd��qS)z~0�~)r$)r%r&rrr
r'�s)�split�popr�mapr�parts)rrr,rrr
r�s

zJsonPointer.__init__cCsH|js|dfSx"|jdd�D]}|j||�}qW||j||jd�fS)z@ Resolves ptr until the last step, returns (sub-doc, last-step) N����r.)r,�walk�get_part)rrr&rrr
�to_last�s
zJsonPointer.to_lastcCsJxD|jD]:}y|j||�}Wqtk
r@|tkr8�n|SYqXqW|S)zBResolves the pointer against doc and returns the referenced object)r,r/r�_nothing)rrrr&rrr
r�szJsonPointer.resolveTcCsFt|j�dkr|rtd��|S|s,tj|�}|j|�\}}|||<|S)zH Resolve the pointer against the doc and replace the target with value. rzcannot set root in place)�lenr,r�copy�deepcopyr1)rrrr �parentr&rrr
r�s
zJsonPointer.setcCsjt|t�r|St|t�rH|dkr$|Stjt|��s@td|f��t|�St|d�rV|Stdt	|���dS)z+ Returns the next step in the correct type �-z'%s' is not a valid list index�__getitem__zQDocument '%s' does not support indexing, must be dict/list or support __getitem__N)
�
isinstancerr�RE_ARRAY_INDEX�match�strr�int�hasattr�type)rrr&rrr
r0�s


zJsonPointer.get_partcCs�|j||�}t|t�rFy||Stk
rBtd||f��Yq�XnPt|t�r�|dkr`t|�Sy||Stk
r�td|f��Yq�Xn||SdS)z7 Walks one step in doc and returns the referenced part zmember '%s' not found in %sr7zindex '%s' is out of boundsN)r0r9r�KeyErrorrrr�
IndexError)rrr&rrr
r/�s

zJsonPointer.walkcCs|jdt|j��|jkS)z+Returns True if self contains the given ptrN)r,r3)r�ptrrrr
�contains�szJsonPointer.containscCs
|j|�S)z+Returns True if self contains the given ptr)rC)r�itemrrr
�__contains__�szJsonPointer.__contains__cCs2dd�|jD�}dd�|D�}djdd�|D��S)zx Returns the string representation of the pointer

        >>> ptr = JsonPointer('/~0/0/~1').path == '/~0/0/~1'
        cSsg|]}|jdd��qS)r(z~0)r$)r%r&rrr
r'	sz$JsonPointer.path.<locals>.<listcomp>cSsg|]}|jdd��qS)r"z~1)r$)r%r&rrr
r'
sr#css|]}d|VqdS)r"Nr)r%r&rrr
�	<genexpr>sz#JsonPointer.path.<locals>.<genexpr>)r,�join)rr,rrr
�pathszJsonPointer.pathcCst|t�sdS|j|jkS)z� compares a pointer to another object

        Pointers can be compared by comparing their strings (or splitted
        strings), because no two different parts can point to the same
        structure in an object (eg no different number representations) F)r9rr,)r�otherrrr
�__eq__
s
zJsonPointer.__eq__cCstt|j��S)N)�hash�tupler,)rrrr
�__hash__szJsonPointer.__hash__cCsFdd�|D�}dd�|D�}dd�|D�}|djdd�|D���}|S)z� Constructs a JsonPointer from a list of (unescaped) paths

        >>> JsonPointer.from_parts(['a', '~', '/', 0]).path == '/a/~0/~1/0'
        True
        cSsg|]}t|��qSr)r<)r%r&rrr
r'$sz*JsonPointer.from_parts.<locals>.<listcomp>cSsg|]}|jdd��qS)r(z~0)r$)r%r&rrr
r'%scSsg|]}|jdd��qS)r"z~1)r$)r%r&rrr
r'&sr#css|]}d|VqdS)r"Nr)r%r&rrr
rF'sz)JsonPointer.from_parts.<locals>.<genexpr>)rG)rr,rBrrr
�
from_partss
zJsonPointer.from_partsN)T)r	r
rrrr1r2r�getrr0r/rCrE�propertyrHrJrM�classmethodrNrrrr
r�s


rcCs&t|�\}}x|D]}PqWt||�S)z� s -> (s0,s1), (s1,s2), (s2, s3), ...

    >>> list(pairwise([]))
    []

    >>> list(pairwise([1]))
    []

    >>> list(pairwise([1, 2, 3, 4]))
    [(1, 2), (2, 3), (3, 4)]
    )rr)�iterable�a�b�_rrr
�pairwise,s
rV)T)!Z
__future__r�collections.abcrr�ImportError�collections�
__author__�__version__Z__website__Z__license__Zurllibr�	itertoolsrZunicoder<Zurllib.parse�zipr�rer4�compiler:�	Exceptionr�objectrr2rr!rrVrrrr
�<module>!s6


$

Youez - 2016 - github.com/yon3zu
LinuXploit