Your IP : 3.145.81.47


Current Path : /opt/imunify360/venv/lib64/python3.11/site-packages/attr/__pycache__/
Upload File :
Current File : //opt/imunify360/venv/lib64/python3.11/site-packages/attr/__pycache__/_funcs.cpython-311.pyc

�

Q�DgZA���ddlZddlmZmZddlmZmZmZddlm	Z	dde
ddfd�Zd	�Zdde
dfd
�Zd�Zd�Zd
�Z	dd�ZdS)�N�)�PY_3_9_PLUS�get_generic_base)�NOTHING�_obj_setattr�fields)�AttrsAttributeNotFoundErrorTFc	�������t|j��}���}|D�],}t||j��}	��
�||	��s�'��
�|||	��}	|dur�t	|	j��rt|	d�������||j<�lt
|	ttttf��r5�dur|	jnt}
|
����fd�|	D����||j<��t
|	t��r8�������fd�|	���D����||j<��|	||j<��"|	||j<��.|S)a]
    Return the *attrs* attribute values of *inst* as a dict.

    Optionally recurse into other *attrs*-decorated classes.

    :param inst: Instance of an *attrs*-decorated class.
    :param bool recurse: Recurse into classes that are also
        *attrs*-decorated.
    :param callable filter: A callable whose return code determines whether an
        attribute or element is included (``True``) or dropped (``False``).  Is
        called with the `attrs.Attribute` as the first argument and the
        value as the second argument.
    :param callable dict_factory: A callable to produce dictionaries from.  For
        example, to produce ordered dictionaries instead of normal Python
        dictionaries, pass in ``collections.OrderedDict``.
    :param bool retain_collection_types: Do not convert to ``list`` when
        encountering an attribute whose type is ``tuple`` or ``set``.  Only
        meaningful if ``recurse`` is ``True``.
    :param Optional[callable] value_serializer: A hook that is called for every
        attribute or dict key/value.  It receives the current instance, field
        and value and must return the (updated) value.  The hook is run *after*
        the optional *filter* has been applied.

    :rtype: return type of *dict_factory*

    :raise attrs.exceptions.NotAnAttrsClassError: If *cls* is not an *attrs*
        class.

    ..  versionadded:: 16.0.0 *dict_factory*
    ..  versionadded:: 16.1.0 *retain_collection_types*
    ..  versionadded:: 20.3.0 *value_serializer*
    ..  versionadded:: 21.3.0 If a dict has a collection for a key, it is
        serialized as a tuple.
    NT��recurse�filter�dict_factory�retain_collection_types�value_serializerc
�:��g|]}t|d���������S�F��is_keyr
rrr��_asdict_anything��.0�irr
rrs  �����k/builddir/build/BUILD/imunify360-venv-2.4.0/opt/imunify360/venv/lib/python3.11/site-packages/attr/_funcs.py�
<listcomp>zasdict.<locals>.<listcomp>LsL���
�
�
��)��#(�#)�)5�4K�-=�
���
�
�
�c
3�r�K�|]1\}}t|d�������t|d�������fV��2dS�TrFNr�r�kk�vv�dfr
rrs   ����r�	<genexpr>zasdict.<locals>.<genexpr>Zs������ � �&��B�#)��#'�#)�)+�4K�-=�
���)��#(�#)�)+�4K�-=�
���� � � � � � r)
r�	__class__�getattr�name�has�asdict�
isinstance�tuple�list�set�	frozenset�dict�items)�instrr
rrr�attrs�rv�a�v�cfr"s  ````     @rr(r(s��������T
�4�>�"�"�E�	����B�
�;�;���D�!�&�!�!����f�f�Q��l�l����'� � ��q�!�,�,�A��d�?�?��1�;���0
�#�� �!�!-�,C�%5�
����1�6�
�
��A��t�S�)�<�=�=�'
�$;�t�$C�$C�Q�[�[����R�
�
�
�
�
�
�
�"#�
�
�
����1�6�
�
��A�t�$�$�
�!���R� � � � � � � �&#$�'�'�)�)�' � � ����1�6�
�
�,��1�6�
�
��B�q�v�J�J�
�Irc��������t|jdd���t|d�������}n�t|tt
ttf��r8�dur|j}n|rt}nt
}|����fd�|D����}nUt|t��r/�������fd�|�	��D����}n|}��
�dd|��}|S)zK
    ``asdict`` only works on attrs instances, this works on anything.
    �__attrs_attrs__NTrc
�:��g|]}t|d���������Srrrs  ����rrz$_asdict_anything.<locals>.<listcomp>�sL���

�

�

��!�� �!�!-�,C�%5�
���

�

�

rc
3�r�K�|]1\}}t|d�������t|d�������fV��2dSrrrs   ����rr#z#_asdict_anything.<locals>.<genexpr>�s������
�
�&��B�#!���!�!#�,C�%5�
���!�� �!�!#�,C�%5�
���
�
�
�
�
�
�
r)
r%r$r(r)r*r+r,r-r.r/)	�valrr
rrrr2r5r"s	  ````  @rrrvsf��������s�}�/��6�6�B�
����%�$;�-�

�
�
���
�C�%��s�I�6�	7�	7�/2�"�d�*�*���B�B�
�	��B�B��B�
�R�

�

�

�

�

�

�

��

�

�

�
�
���
�C��	�	�2�
��
�R�
�
�
�
�
�
�
�&�)�)�+�+�'
�
�
�
�
���,���'�!�!�$��b�1�1�B�
�Irc
�.����t|j��}g}|�|D�]a}t||j��}��
�||��s�'|du�r t	|j��r(|�t
|d���������ht|ttttf��r?�dur|jnt}	|�|	���fd�|D��������t|t��rQ�dur|jnt}
|�|
��fd�|�
��D��������5|�|����L|�|����c�tur|n
�|��S)a)
    Return the *attrs* attribute values of *inst* as a tuple.

    Optionally recurse into other *attrs*-decorated classes.

    :param inst: Instance of an *attrs*-decorated class.
    :param bool recurse: Recurse into classes that are also
        *attrs*-decorated.
    :param callable filter: A callable whose return code determines whether an
        attribute or element is included (``True``) or dropped (``False``).  Is
        called with the `attrs.Attribute` as the first argument and the
        value as the second argument.
    :param callable tuple_factory: A callable to produce tuples from.  For
        example, to produce lists instead of tuples.
    :param bool retain_collection_types: Do not convert to ``list``
        or ``dict`` when encountering an attribute which type is
        ``tuple``, ``dict`` or ``set``.  Only meaningful if ``recurse`` is
        ``True``.

    :rtype: return type of *tuple_factory*

    :raise attrs.exceptions.NotAnAttrsClassError: If *cls* is not an *attrs*
        class.

    ..  versionadded:: 16.2.0
    NT�rr
�
tuple_factoryrc	�d��g|],}t|j��rt|d������n|��-S)Tr<�r'r$�astuple)r�jr
�retainr=s  ���rrzastuple.<locals>.<listcomp>�sd������!"� #�1�;�/�/�#�G� !�(,�'-�.;�8>�����"#���rc3��K�|]W\}}t|j��rt|�����n|t|j��rt|�����n|fV��XdS))r=rNr?)rr r!rBr=s   ��rr#zastuple.<locals>.<genexpr>s��������"#�B�� #�2�<�0�0�$�G� "�.;�8>�����"$� #�2�<�0�0�$�G� "�.;�8>�����"$�������r)rr$r%r&r'�appendr@r)r*r+r,r-r.r/)r0rr
r=rr1r2r3r4r5r"rBs  ``       @rr@r@�s�����B
�4�>�"�"�E�	�B�
$�F�
�;�;���D�!�&�!�!����f�f�Q��l�l����d�?�?��1�;���4
��	�	��� $�%�&3�06���������A��t�S�)�<�=�=�*
�$*�d�N�N�Q�[�[����	�	��B�������&'����
�
����� �A�t�$�$�
�$*�d�N�N�Q�[�[����	�	��B������"'(�g�g�i�i�#���������,�	�	�!������I�I�a�L�L�L�L��$�&�&�2�2�M�M�"�,=�,=�=rc��t|dd��}|�dSt|��}|�t|dd��}|�||_|duSdS)z�
    Check whether *cls* is a class with *attrs* attributes.

    :param type cls: Class to introspect.
    :raise TypeError: If *cls* is not a class.

    :rtype: bool
    r7NTF)r%rr7)�clsr1�generic_base�
generic_attrss    rr'r'#sf��
�C�*�D�1�1�E����t�$�C�(�(�L�����.?��F�F�
��$�"/�C���D�(�(��5rc��tj|��}t|j��}|���D]O\}}t	||t
��}|t
urt
|�d|j�d����t|||���P|S)a�
    Copy *inst* and apply *changes*.

    This is different from `evolve` that applies the changes to the arguments
    that create the new instance.

    `evolve`'s behavior is preferable, but there are `edge cases`_ where it
    doesn't work. Therefore `assoc` is deprecated, but will not be removed.

    .. _`edge cases`: https://github.com/python-attrs/attrs/issues/251

    :param inst: Instance of a class with *attrs* attributes.
    :param changes: Keyword changes in the new copy.

    :return: A copy of inst with *changes* incorporated.

    :raise attrs.exceptions.AttrsAttributeNotFoundError: If *attr_name*
        couldn't be found on *cls*.
    :raise attrs.exceptions.NotAnAttrsClassError: If *cls* is not an *attrs*
        class.

    ..  deprecated:: 17.1.0
        Use `attrs.evolve` instead if you can.
        This function will not be removed du to the slightly different approach
        compared to `attrs.evolve`.
    z is not an attrs attribute on �.)�copyrr$r/r%rr	r)r0�changes�newr1�kr4r3s       r�assocrO;s���6�)�D�/�/�C��4�>�"�"�E��
�
��� � ���1��E�1�g�&�&����<�<�-��D�D�C�M�D�D�D���
�	�S�!�Q������Jrc��|r5	|\}n�#t$r"tdt|���d���d�wxYw	|�d��}n#t$rtd��d�wxYwddl}|�dtd�	��|j}t|��}|D]/}|j
s�
|j}|j}||vrt||��||<�0|d
i|��S)a�
    Create a new instance, based on the first positional argument with
    *changes* applied.

    :param inst: Instance of a class with *attrs* attributes.
    :param changes: Keyword changes in the new copy.

    :return: A copy of inst with *changes* incorporated.

    :raise TypeError: If *attr_name* couldn't be found in the class
        ``__init__``.
    :raise attrs.exceptions.NotAnAttrsClassError: If *cls* is not an *attrs*
        class.

    .. versionadded:: 17.1.0
    .. deprecated:: 23.1.0
       It is now deprecated to pass the instance using the keyword argument
       *inst*. It will raise a warning until at least April 2024, after which
       it will become an error. Always pass the instance as a positional
       argument.
    z*evolve() takes 1 positional argument, but z were givenNr0z7evolve() missing 1 required positional argument: 'inst'rzgPassing the instance per keyword argument is deprecated and will stop working in, or after, April 2024.�)�
stacklevel�)�
ValueError�	TypeError�len�pop�KeyError�warnings�warn�DeprecationWarningr$r�initr&�aliasr%)	�argsrLr0rYrFr1r3�	attr_name�	init_names	         r�evolverabsT��0�
�	��G�T�T���	�	�	���S��Y�Y�������
�	����	��;�;�v�&�&�D�D���	�	�	��I����
�	����
	�����
�
�
:���		�	
�	
�	
��.�C��3�K�K�E�
�:�:���v�	���F�	��G�	��G�#�#�!(��y�!9�!9�G�I����3�>�>��>�>�s�	�,5�A�A*c��t|dd��|kreddl}||d�}tr||d<|j|fi|��}|�t	|��n|D]'}|j|vrt
|d||j���(||_|S)aA
    Resolve any strings and forward annotations in type annotations.

    This is only required if you need concrete types in `Attribute`'s *type*
    field. In other words, you don't need to resolve your types if you only
    use them for static type checking.

    With no arguments, names will be looked up in the module in which the class
    was created. If this is not what you want, e.g. if the name only exists
    inside a method, you may pass *globalns* or *localns* to specify other
    dictionaries in which to look up these names. See the docs of
    `typing.get_type_hints` for more details.

    :param type cls: Class to resolve.
    :param Optional[dict] globalns: Dictionary containing global variables.
    :param Optional[dict] localns: Dictionary containing local variables.
    :param Optional[list] attribs: List of attribs for the given class.
        This is necessary when calling from inside a ``field_transformer``
        since *cls* is not an *attrs* class yet.
    :param bool include_extras: Resolve more accurately, if possible.
        Pass ``include_extras`` to ``typing.get_hints``, if supported by the
        typing module. On supported Python versions (3.9+), this resolves the
        types more accurately.

    :raise TypeError: If *cls* is not a class.
    :raise attrs.exceptions.NotAnAttrsClassError: If *cls* is not an *attrs*
        class and you didn't pass any attribs.
    :raise NameError: If types cannot be resolved because of missing variables.

    :returns: *cls* so you can use this function also as a class decorator.
        Please note that you have to apply it **after** `attrs.define`. That
        means the decorator has to come in the line **before** `attrs.define`.

    ..  versionadded:: 20.1.0
    ..  versionadded:: 21.1.0 *attribs*
    ..  versionadded:: 23.1.0 *include_extras*

    �__attrs_types_resolved__Nr)�globalns�localns�include_extras�type)r%�typingr�get_type_hintsrr&rrc)	rFrdre�attribsrfrh�kwargs�hints�fields	         r�
resolve_typesrn�s���V�s�.��5�5��<�<��
�
�
�&�7�;�;���	6�'5�F�#�$�%��%�c�4�4�V�4�4��$+�O�V�C�[�[�[��	?�	?�E��z�U�"�"��U�F�E�%�*�,=�>�>�>��(+��$��Jr)NNNT)rK�_compatrr�_makerrr�
exceptionsr	r.r(rr*r@r'rOrarnrSrr�<module>rrs������2�2�2�2�2�2�2�2�0�0�0�0�0�0�0�0�0�0�3�3�3�3�3�3�

���!��
h�h�h�h�VF�F�F�V
���!�a>�a>�a>�a>�H���0$�$�$�N;�;�;�~DH�=�=�=�=�=�=r

?>