🔐 Sid Gifari File Manager Pro
v8.0.5 | 2026-06-24 02:08:58 | PHP 8.2.31
📂
/ (Root)
/
opt
/
imunify360
/
venv
/
lib
/
python3.11
/
site-packages
/
defence360agent
/
utils
/
__pycache__
📍 /opt/imunify360/venv/lib/python3.11/site-packages/defence360agent/utils/__pycache__
🔄 Refresh
✏️
Editing: serialization.cpython-311.pyc
Read Only
� 2F���]�� � � d Z ddlZddlZddlZddlZddlZddlmZ ddlm Z m Z mZ ej e � � Zde de fd�Zd� Zd ed efd�Zdd�d ed ee ef fd�ZdS )zLJSON persistence helpers for small agent state files (no pickle at runtime).� N)�iscoroutinefunction)�Any�Callable�Union�obj�returnc � � t | t j � � rd� | D � � S t | t � � rd� | � � � D � � S t | t t f� � rd� | D � � S | S )Nc �, � g | ]}t |� � ��S � ��_to_jsonable��.0�items �X/opt/imunify360/venv/lib/python3.11/site-packages/defence360agent/utils/serialization.py� <listcomp>z _to_jsonable.<locals>.<listcomp> � � �3�3�3�t��T�"�"�3�3�3� c �4 � i | ]\ }}|t |� � ��S r r )r �k�vs r � <dictcomp>z _to_jsonable.<locals>.<dictcomp> s$ � �;�;�;�t�q�!��<��?�?�;�;�;r c �, � g | ]}t |� � ��S r r r s r r z _to_jsonable.<locals>.<listcomp> r r )� isinstance�collections�deque�dict�items�list�tuple)r s r r r s� � ��#�{�(�)�)� 4�3�3�s�3�3�3�3��#�t��� <�;�;�s�y�y�{�{�;�;�;�;��#��e�}�%�%� 4�3�3�s�3�3�3�3��Jr c � � t j t |� � � � }d� | � � }t |dd�� � 5 }|� |� � ddd� � n# 1 swxY w Y t j || � � dS )z-Atomically write ``obj`` to ``path`` as JSON.z{}.tmp�w�utf-8��encodingN)�json�dumpsr �format�open�write�os�replace)�pathr �payload�tmpr"