shell bypass 403
�
|��g� � � � d dl Z d dlZd dlmZ d dlmZ d dlmZ g e j _ dgZ
d� Zd� Zd� Z
d � Zd
� Zd� Zd� Z G d
� de� Zy)� N)�tostring)�OrderedDict)�IntEnum�SNAPSHOTc � � t | t � r| D �cg c]
}t |� �� c}S t | t � r-| j � D ��ci c] \ }}|t |� �� c}}S dt | � � d�S c c}w c c}}w )zV
recursively traverse nested dict and add xml
CDATA element to the leaves
z <![CDATA[z]]>)�
isinstance�list� add_cdata�dict�items�str)�d�x�k�vs �9/opt/hc_python/lib/python3.12/site-packages/pyone/util.pyr
r
sw � � �!�T��'(�*�q�!��1��q�*�*� �A�t� �./�g�g�i�8�i�U�a���I�a�L��i�8�8� �3�q�6�(�#�&�&��
+�� 9s �A6�
A;c � � d� }t | t � r| j S t | t � r�t | d� r| j
} t
| � rkt | j � � d } || � r!t j t | � dd�� S d}| j � D ] \ }}|�|�d|�d�}� |S t d � �| S )
ae
This function will cast parameters to make them nebula friendly
flat dictionaries will be turned into attribute=value vectors
dictionaries with root dictionary will be serialized as XML
Structures will be turned into strings before being submitted.
:param param: the parameter to make nebula friendly
:return: casted parameter
c �R � | j � D ] }t |t � s� y y)NTF)�valuesr r )�
dictionary�vals r �is_nested_dictz cast2one.<locals>.is_nested_dict8 s'