%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3.9/site-packages/ansible/module_utils/common/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3.9/site-packages/ansible/module_utils/common/__pycache__/collections.cpython-39.pyc

a

�)g�@s~dZddlmZmZmZeZddlmZm	Z	ddl
mZmZm
Z
mZGdd�dee�Zdd�Zdd
d�Zddd
�Zdd�ZdS)z*Collection of low-level utility functions.�)�absolute_import�division�print_function)�binary_type�	text_type)�Hashable�Mapping�MutableMapping�Sequencec@sXeZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�ZdS)�
ImmutableDictz!Dictionary that cannot be updatedcOst|i|��|_dS�N)�dict�_store)�self�args�kwargs�r�K/usr/lib/python3.9/site-packages/ansible/module_utils/common/collections.py�__init__szImmutableDict.__init__cCs
|j|Sr�r)r�keyrrr�__getitem__szImmutableDict.__getitem__cCs
|j��Sr)r�__iter__�rrrrrszImmutableDict.__iter__cCs
|j��Sr)r�__len__rrrrrszImmutableDict.__len__cCstt|����Sr)�hash�	frozenset�itemsrrrr�__hash__szImmutableDict.__hash__cCs2z|��t|�krWdSWnty,Yn0dS)NTF)rr�	TypeError)r�otherrrr�__eq__s
zImmutableDict.__eq__cCsd�t|j��S)NzImmutableDict({0}))�format�reprrrrrr�__repr__(szImmutableDict.__repr__cCst|jfi|��S)a�
        Create an ImmutableDict as a combination of the original and overriding_mapping

        :arg overriding_mapping: A Mapping of replacement and additional items
        :return: A copy of the ImmutableDict with key-value pairs from the overriding_mapping added

        If any of the keys in overriding_mapping are already present in the original ImmutableDict,
        the overriding_mapping item replaces the one in the original ImmutableDict.
        )rr)rZoverriding_mappingrrr�union+s
zImmutableDict.unioncs6t|���fdd��j��D�}t�fdd�|D��S)aK
        Create an ImmutableDict as a combination of the original minus keys in subtractive_iterable

        :arg subtractive_iterable: Any iterable containing keys that should not be present in the
            new ImmutableDict
        :return: A copy of the ImmutableDict with keys from the subtractive_iterable removed
        c3s|]}|�vr|VqdSrr��.0�k)�remove_keysrr�	<genexpr>@�z+ImmutableDict.difference.<locals>.<genexpr>c3s|]}|�j|fVqdSrrr&rrrr*Ar+)rr�keysr)rZsubtractive_iterabler,r)r)rr�
difference7szImmutableDict.differenceN)
�__name__�
__module__�__qualname__�__doc__rrrrrr!r$r%r-rrrrrs	rcCst|ttf�pt|dd�S)zCIdentify whether the input has a string-like type (inclding bytes).Z
__ENCRYPTED__F)�
isinstancerr�getattr)�seqrrr�	is_stringDsr5FcCs8|st|�rdSzt|�WdSty2YdS0dS)z*Identify whether the input is an iterable.FTN)r5�iterr�r4Zinclude_stringsrrr�is_iterableJsr8cCs|st|�rdSt|t�S)z�Identify whether the input is a sequence.

    Strings and bytes are not sequences here,
    unless ``include_string`` is ``True``.

    Non-indexable things are never of a sequence type.
    F)r5r2r
r7rrr�is_sequenceVsr9cCs8t|�std��t�}|D]}|�|d�d||<q|S)aTReturns a dictionary with the number of appearances of each element of the iterable.

    Resembles the collections.Counter class functionality. It is meant to be used when the
    code is run on Python 2.6.* where collections.Counter is not available. It should be
    deprecated and replaced when support for Python < 2.7 is dropped.
    z%Argument provided  is not an iterabler�)r8�	Exceptionr
�get)r4Zcounters�elemrrr�countdsr>N)F)F)r1Z
__future__rrr�typeZ
__metaclass__Zansible.module_utils.sixrrZ/ansible.module_utils.common._collections_compatrrr	r
rr5r8r9r>rrrr�<module>s6



Zerion Mini Shell 1.0