Graybyt3 Was Here
Linux cloud.locucionar.com 3.10.0-1160.81.1.el7.x86_64 #1 SMP Fri Dec 16 17:29:43 UTC 2022 x86_64
Apache
91.191.211.241
/
opt
/
imunify360
/
venv
/
lib64
/
python3.11
/
site-packages
/
defence360agent
/
utils
/
__pycache__
[ HOME ]
Exec
Submit
serialization.cpython-311.opt-1.pyc
� k�nh� � � � d dl Z d dlZd dlZd dlmZ d dlmZmZ ej e � � Z d� Zdedefd�Z dd�ded eeef fd �ZdS )� N)�iscoroutinefunction)�Union�Callablec � � t | d� � 5 }t j ||� � d d d � � d S # 1 swxY w Y d S )N�wb)�open�pickle�dump)�path�obj�ws �X/opt/imunify360/venv/lib/python3.11/site-packages/defence360agent/utils/serialization.py�_dumpr s� � � �d�D� � � �Q���C������ � � � � � � � � � � ���� � � � � � s �4�8�8r �attrc � � �� �� fd�}|S )z� Make decorator to serialize an object or object's attribute :param path: path to file to serialize into :param attr: attribute name to serialize c � �� � t j � � � �� �fd�� � }t j � � � �� �fd�� � }t � � � r|S |S )Nc � �� �| g|�R i |��}t | �� � }t � d|�� � t �|� � |S �NzWrite %r to %r��getattr�logger�debugr ��self�args�kwargs�resultr r �fr s ���r �wrapperz2serialize_attr.<locals>.decorator.<locals>.wrapper s] �� ��Q�t�-�d�-�-�-�f�-�-�F��$��%�%�C��L�L�)�3��5�5�5��$������M� c � � �K � �| g|�R i |��� d {V ��}t | �� � }t � d|�� � t �|� � |S r r r s ���r � async_wrapperz8serialize_attr.<locals>.decorator.<locals>.async_wrapper ss �� � � ��1�T�3�D�3�3�3�F�3�3�3�3�3�3�3�3�F��$��%�%�C��L�L�)�3��5�5�5��$������Mr )� functools�wrapsr )r r r"