404

[ Avaa Bypassed ]




Upload:

Command:

elspacio@3.128.205.187: ~ $
3

\�me#)�@s�ddlmZddlmZddlmZmZmZmZddl	Z	e	j
Z
Gdd�d�ZGdd�de	j�Z
d	d
�Zeed�dd
�Zeeeeed�dd�ZGdd�de	j�Ze
jde
j�Gdd�de	jj�Zeeeeeffd�dd�Zdd�Zddd�ZdS) �)�defaultdict)�chain)�Any�Dict�List�TupleNc@s2eZdZeejejd�dd�Zdd�Zdd�ZdS)	�SchemaPathMarks)�path�
start_mark�end_markcCs||_||_||_dS)N)r	r
r)�selfr	r
r�r
�/usr/lib/python3.6/safeyaml.py�__init__szSchemaPathMarks.__init__cCsp|jj|jjks |jj|jjkr$dS|jj|jjkrH|jj|jjkrHdS|jj|jjkrl|jj|jjkrldSdS)z;Return whether other start/end marks are within self marks.FT)r
�liner�column)r�otherr
r
r�__contains__szSchemaPathMarks.__contains__cCs@|jj|jjko>|jj|jjko>|jj|jjko>|jj|jjkS)N)r
rrr)rrr
r
r�__eq__+szSchemaPathMarks.__eq__N)	�__name__�
__module__�__qualname__�str�yamlZMarkrrrr
r
r
rrsrcseZdZ�fdd�Z�ZS)�_CustomSafeLoadercst�j|�S)N)�superZconstruct_scalar)r�node)�	__class__r
r�construct_python_unicode5sz*_CustomSafeLoader.construct_python_unicode)rrrr�
__classcell__r
r
)rrr4srcCs2x,|ddd�D]}||kr||kr|SqWdS)N����r
)Z
child_mark�marks�markr
r
r�_find_closest_parent9sr$)�
line_markscCsbx\|D]T}t||�}|r|jjdd�\}}|j|jksF|jj|j�r|jj||jd�|_qWdS)zP
    Update any SchemaPathMarks.path for items not under the proper parent.
    �.r N)r$r	�rsplit�
startswith�replace)r%r#�parentZpath_prefixZ	_path_idxr
r
r�_reparent_schema_mark_children@s


r+)�new_markr"�returncCsfg}d}x@|D]8}||kr&|j|�q||kr<d}|j|�|j|�qW|rXt|�n
|j|�|S)a=Insert new_mark into marks, ordering ancestors first.

    Reparent existing SchemaPathMarks.path when new_mark is a parent of
    an existing mark item.

    Because schema processing is depth first, leaf/child mappings and
    sequences may be processed for SchemaPathMarks before their parents.
    This leads to SchemaPathMarks.path of 'grandchildren' being incorrectly
    parented by the root dictionary instead of an intermediary parents below
    root.

    Walk through the list of existing marks and reparent marks that are
    contained within the new_mark.
    FT)�appendr+)r,r"�	new_marksZreparent_pathsr#r
r
r�_add_mark_and_reparent_marksOs




r0csNeZdZdZ�fdd�Zdd�Z�fdd�Zd
�fd	d
�	Z�fdd�Z�Z	S)�_CustomSafeLoaderWithMarksa�A loader which provides line and column start and end marks for YAML.

    If the YAML loaded represents a dictionary, get_single_data will inject
    a top-level "schemamarks" key in that dictionary which can be used at
    call-sites to process YAML paths schemamark metadata when annotating
    YAML files for errors.

    The schemamarks key is dictionary where each key is a dot-delimited path
    into the YAML object. Each dot represents an element that is nested under
    a parent and list items are represented with the format
    `<parent>.<list-index>`.

    The values in schemamarks will be the line number in the original content
    where YAML element begins to aid in annotation when encountering schema
    errors.

    The example YAML shows expected schemamarks for both dicts and lists:

      one: val1
      two:
        subtwo: val2
      three: [val3, val4]

    schemamarks == {
        "one": 1, "two": 2, "two.subtwo": 3, "three": 4, "three.0": 4,
        "three.1": 4
    }
    cst�j|�tt�|_dS)N)rrr�list�schemamarks_by_line)r�stream)rr
rr�sz#_CustomSafeLoaderWithMarks.__init__cCs�|jj|jkrf|j|jjd}x2|j|jjdd�D]}||kr8||kr8|}q8W||krf|jdSxJt|jj�dd�D]4\}}x*|ddd�D]}||kr�|j�d�Sq�WqzWdS)Nrr r&T)�reverse�r!)r
rr3r	�sorted�items)rrZmost_specific_markZ	path_markZ	_line_num�schema_marksr#r
r
r�_get_nested_path_prefix�s 
z2_CustomSafeLoaderWithMarks._get_nested_path_prefixcsrt�j|�}|j|�}xV|jD]L\}}|�|j��}|jj}t||j|j�}|j|}	t	||	�}
|
|j|<qW|S)N)
r�construct_mappingr:�valuer
rrrr3r0)rr�mapping�nested_path_prefixZkey_nodeZ
value_node�
node_key_path�line_numr,r9r/)rr
rr;�s


z,_CustomSafeLoaderWithMarks.construct_mappingFc
	st�j|dd�}|j|�}x�t|j�D]�\}}|jj}|�|��}t||j|j�}	||j	krj|	g|j	|<q&||jjkr�|j	|}
t
|	|
�}||j	|<q&xvt||jj�D]d}||j	kr�|j	|}
t
|	|
�}||ko�|
dj|k�r|j
dt||
dj|
dj��||j	|<q�Wq&W|S)NT)�deeprr r!)r�construct_sequencer:�	enumerater<r
rrrr3r0�ranger	�insert)
rrrAZsequencer>�indexZ
sequence_itemr@r?r,r9r/Z
inner_line)rr
rrB�s<




z-_CustomSafeLoaderWithMarks.construct_sequencecs8t�j�}t|t�r4tdd�t|jj��D��|d<|S)NcSsg|]}|j|jjdf�qS)r )r	r
r)�.0�vr
r
r�
<listcomp>�sz>_CustomSafeLoaderWithMarks.get_single_data.<locals>.<listcomp>�schemamarks)r�get_single_data�
isinstance�dictrr3�values)r�data)rr
rrK�s

z*_CustomSafeLoaderWithMarks.get_single_data)F)
rrr�__doc__rr:r;rBrKrr
r
)rrr1rs*r1z tag:yaml.org,2002:python/unicodec@seZdZdZdd�ZdS)�NoAliasSafeDumperz>A class which avoids constructing anchors/aliases on yaml dumpcCsdS)NTr
)rrOr
r
r�ignore_aliases�sz NoAliasSafeDumper.ignore_aliasesN)rrrrPrRr
r
r
rrQ�srQ)r-cCs0tj|td�}t|t�si}n
|jd�}||fS)a�Perform YAML SafeLoad and track start and end marks during parse.

    JSON schema errors come with an encoded object path such as:
        <key1>.<key2>.<list_item_index>

    YAML loader needs to preserve a mapping of schema path to line and column
    marks to annotate original content with JSON schema error marks for the
    command:
        cloud-init devel schema --annotate


    )�LoaderrJ)r�loadr1rLrM�pop)�blob�resultrJr
r
r�load_with_marks�s



rXcCstj|td�S)N)rS)rrTr)rVr
r
rrTsrTTFc	Cs$tj|dd||d|rtntjjd�S)z%Return data in nicely formatted yaml.�
�F)Z
line_break�indent�explicit_start�explicit_endZdefault_flow_styleZDumper)r�dumprQ�dumper�
SafeDumper)�objr\r]Znoaliasr
r
r�dumpssrb)TTF)�collectionsr�	itertoolsrZtypingrrrrrZ	YAMLErrorrZ
SafeLoaderrr$r+r0r1Zadd_constructorrr_r`rQr�intrXrTrbr
r
r
r�<module>s$"!}

Filemanager

Name Type Size Permission Actions
__init__.cpython-36.opt-1.pyc File 113 B 0644
__init__.cpython-36.pyc File 113 B 0644
apport.cpython-36.opt-1.pyc File 5.92 KB 0644
apport.cpython-36.pyc File 5.96 KB 0644
atomic_helper.cpython-36.opt-1.pyc File 2.05 KB 0644
atomic_helper.cpython-36.pyc File 2.05 KB 0644
cloud.cpython-36.opt-1.pyc File 3.08 KB 0644
cloud.cpython-36.pyc File 3.08 KB 0644
dmi.cpython-36.opt-1.pyc File 5.32 KB 0644
dmi.cpython-36.pyc File 5.32 KB 0644
event.cpython-36.opt-1.pyc File 1.97 KB 0644
event.cpython-36.pyc File 1.97 KB 0644
features.cpython-36.opt-1.pyc File 1.47 KB 0644
features.cpython-36.pyc File 1.47 KB 0644
gpg.cpython-36.opt-1.pyc File 3.76 KB 0644
gpg.cpython-36.pyc File 3.76 KB 0644
helpers.cpython-36.opt-1.pyc File 13.31 KB 0644
helpers.cpython-36.pyc File 13.31 KB 0644
importer.cpython-36.opt-1.pyc File 1.68 KB 0644
importer.cpython-36.pyc File 1.68 KB 0644
log.cpython-36.opt-1.pyc File 4.61 KB 0644
log.cpython-36.pyc File 4.61 KB 0644
netinfo.cpython-36.opt-1.pyc File 12.67 KB 0644
netinfo.cpython-36.pyc File 12.67 KB 0644
persistence.cpython-36.opt-1.pyc File 2.82 KB 0644
persistence.cpython-36.pyc File 2.82 KB 0644
registry.cpython-36.opt-1.pyc File 1.38 KB 0644
registry.cpython-36.pyc File 1.38 KB 0644
safeyaml.cpython-36.opt-1.pyc File 8 KB 0644
safeyaml.cpython-36.pyc File 8 KB 0644
settings.cpython-36.opt-1.pyc File 1.14 KB 0644
settings.cpython-36.pyc File 1.14 KB 0644
signal_handler.cpython-36.opt-1.pyc File 1.58 KB 0644
signal_handler.cpython-36.pyc File 1.58 KB 0644
simpletable.cpython-36.opt-1.pyc File 2.53 KB 0644
simpletable.cpython-36.pyc File 2.53 KB 0644
ssh_util.cpython-36.opt-1.pyc File 15.36 KB 0644
ssh_util.cpython-36.pyc File 15.36 KB 0644
stages.cpython-36.opt-1.pyc File 25.15 KB 0644
stages.cpython-36.pyc File 25.15 KB 0644
subp.cpython-36.opt-1.pyc File 9.97 KB 0644
subp.cpython-36.pyc File 9.97 KB 0644
temp_utils.cpython-36.opt-1.pyc File 2.81 KB 0644
temp_utils.cpython-36.pyc File 2.81 KB 0644
templater.cpython-36.opt-1.pyc File 4.55 KB 0644
templater.cpython-36.pyc File 4.55 KB 0644
type_utils.cpython-36.opt-1.pyc File 437 B 0644
type_utils.cpython-36.pyc File 437 B 0644
url_helper.cpython-36.opt-1.pyc File 21.03 KB 0644
url_helper.cpython-36.pyc File 21.03 KB 0644
user_data.cpython-36.opt-1.pyc File 8.25 KB 0644
user_data.cpython-36.pyc File 8.25 KB 0644
util.cpython-36.opt-1.pyc File 73.64 KB 0644
util.cpython-36.pyc File 73.64 KB 0644
version.cpython-36.opt-1.pyc File 429 B 0644
version.cpython-36.pyc File 429 B 0644
warnings.cpython-36.opt-1.pyc File 3.25 KB 0644
warnings.cpython-36.pyc File 3.25 KB 0644