ok

Mini Shell

Direktori : /opt/cloudlinux/venv/lib64/python3.11/site-packages/ssa/modules/__pycache__/
Upload File :
Current File : //opt/cloudlinux/venv/lib64/python3.11/site-packages/ssa/modules/__pycache__/common.cpython-311.pyc

�

��f_��H�dZddlmZddlmZddlmZGd�d��ZdS)	zn
This module contains a base class including methods, common for
SSA Request Processor and SSA Decision Maker
�)�Tuple)�date���load_configurationc��eZdZdZd�Zd�Zedefd���Zede	fd���Z
dedefd�Z
edefd	���Zd
S)�Commonz
    Base SSA module class
    c�8�|���|_dS�N)�	load_conf�config��selfs �I/opt/cloudlinux/venv/lib64/python3.11/site-packages/ssa/modules/common.py�__init__zCommon.__init__s���n�n�&�&�����c�N�t|d��}|�|d��S)a
        All undefined attributes, e.g.
            - domains_number
            - urls_number
            - correlation_coefficient
            - correlation
            - request_number
            - time
        are queried in config.
        Others would be empty
        r
�)�getattr�get)r�item�confs   r�__getattr__zCommon.__getattr__s'���t�X�&�&���x�x��b�!�!�!r�returnc�
�ddhS)N�domain_total_reqs�is_a_wordpress_domain�rs r�non_url_fieldszCommon.non_url_fields)s��#�%<�=�=rc�N�|j�d��}d�|D��S)z/
        Render configured ignore list
        �,c�^�g|]*}|����|�����+Sr)�strip)�.0�is  r�
<listcomp>z-Common.configured_ignores.<locals>.<listcomp>3s-��9�9�9�a�q�w�w�y�y�9����	�	�9�9�9r)�ignore_list�split)r�elementss  r�configured_ignoreszCommon.configured_ignores-s.��
�#�)�)�#�.�.��9�9�8�9�9�9�9r�_urlc�H���fd�|jD��}t|��S)z8
        Check if given URL matches ignore list
        c3� �K�|]}|�vV��	dSrr)r$�ignr+s  �r�	<genexpr>z$Common.is_ignored.<locals>.<genexpr>9s'�����D�D�S�S�D�[�D�D�D�D�D�Dr)r*�any)rr+�	gen_checks ` r�
is_ignoredzCommon.is_ignored5s.���E�D�D�D�D�,C�D�D�D�	��9�~�~�rc��t��S)z$
        Load configuration
        rrrrrzCommon.load_conf<s��
"�#�#�#rN)�__name__�
__module__�__qualname__�__doc__rr�property�setr�listr*�str�boolr2�staticmethod�dictrrrrr	r	s���������'�'�'�
"�
"�
"��>��>�>�>��X�>��:�D�:�:�:��X�:��s��t������$�t�$�$�$��\�$�$�$rr	N)r7�typingr�datetimer�
configurationrr	rrr�<module>rBsy����������������.�.�.�.�.�.�/$�/$�/$�/$�/$�/$�/$�/$�/$�/$r

Zerion Mini Shell 1.0