403Webshell
Server IP : 35.80.110.71  /  Your IP : 216.73.216.221
Web Server : Apache/2.4.58 (Ubuntu)
System : Linux ip-172-31-21-44 6.17.0-1019-aws #19~24.04.1-Ubuntu SMP Tue Jun 23 18:53:06 UTC 2026 x86_64
User : ubuntu ( 1000)
PHP Version : 8.3.31
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /lib/python3/dist-packages/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3/dist-packages/__pycache__/cycler.cpython-312.pyc
�

�k{a�8��l�dZddlZddlmZddlmZmZddlmZm	Z	dZ
d�Zd�ZGd	�d
�Z
d�Zd�Zy)
a�
Cycler
======

Cycling through combinations of values, producing dictionaries.

You can add cyclers::

    from cycler import cycler
    cc = (cycler(color=list('rgb')) +
          cycler(linestyle=['-', '--', '-.']))
    for d in cc:
        print(d)

Results in::

    {'color': 'r', 'linestyle': '-'}
    {'color': 'g', 'linestyle': '--'}
    {'color': 'b', 'linestyle': '-.'}


You can multiply cyclers::

    from cycler import cycler
    cc = (cycler(color=list('rgb')) *
          cycler(linestyle=['-', '--', '-.']))
    for d in cc:
        print(d)

Results in::

    {'color': 'r', 'linestyle': '-'}
    {'color': 'r', 'linestyle': '--'}
    {'color': 'r', 'linestyle': '-.'}
    {'color': 'g', 'linestyle': '-'}
    {'color': 'g', 'linestyle': '--'}
    {'color': 'g', 'linestyle': '-.'}
    {'color': 'b', 'linestyle': '-'}
    {'color': 'b', 'linestyle': '--'}
    {'color': 'b', 'linestyle': '-.'}
�N)�reduce)�product�cycle)�mul�addz0.10.0c���|�tt|��ni}|�tt|��ni}t|j��}t|j��}||zrt	d��||zS)a
    Helper function to compose cycler keys.

    Parameters
    ----------
    left, right : iterable of dictionaries or None
        The cyclers to be composed.

    Returns
    -------
    keys : set
        The keys in the composition of the two cyclers.
    z"Can not compose overlapping cycles)�next�iter�set�keys�
ValueError)�left�right�l_peek�r_peek�l_key�r_keys      �(/usr/lib/python3/dist-packages/cycler.py�
_process_keysr4sk��"&�!1�T�$�t�*�
�r�F�"'�"3�T�$�u�+�
��F�����
��E�����
��E��u�}��=�>�>��5�=��c�T���|j|jk7rJtdj|j|jz|j|jz����|j��|j��t	t
��fd�|jD��S)aS
    Concatenate `Cycler`\s, as if chained using `itertools.chain`.

    The keys must match exactly.

    Examples
    --------
    >>> num = cycler('a', range(3))
    >>> let = cycler('a', 'abc')
    >>> num.concat(let)
    cycler('a', [0, 1, 2, 'a', 'b', 'c'])

    Returns
    -------
    `Cycler`
        The concatenated cycler.
    zBKeys do not match:
	Intersection: {both!r}
	Disjoint: {just_one!r})�both�just_onec3�H�K�|]}t|�|�|z����y�w�N��_cycler)�.0�k�_l�_rs  ��r�	<genexpr>zconcat.<locals>.<genexpr>es$�����E�a���2�a�5�2�a�5�=�1�E�s�")rr
�format�by_keyrr)rrr r!s  @@r�concatr%Ks����$�y�y�E�J�J���4�4:�F�"&�)�)�e�j�j�"8�&*�i�i�%�*�*�&<�5;�5>�?�	?�

����B�	����B��#�E�4�9�9�E�F�Frc��eZdZdZd�Zdd�Zd�Zed��Zd�Z	e
d��Zd	�Zd
�Z
d�Zd�Zd
�Zd�Zd�Zd�Zd�Zd�ZdZd�Zd�Zd�ZeZd�ZeZy)�Cyclera�
    Composable cycles.

    This class has compositions methods:

    ``+``
      for 'inner' products (zip)

    ``+=``
      in-place ``+``

    ``*``
      for outer products (`itertools.product`) and integer multiplication

    ``*=``
      in-place ``*``

    and supports basic slicing via ``[]``.

    Parameters
    ----------
    left, right : Cycler or None
        The 'left' and 'right' cyclers.
    op : func or None
        Function which composes the 'left' and 'right' cyclers.
    c��t|�Sr)r��selfs r�__call__zCycler.__call__�s���T�{�rNc�<�t|t�r1t|j|j|j�|_n2|�)|D�cgc]}tj
|���c}|_nd|_t|t�r1t|j|j|j�|_n2|�)|D�cgc]}tj
|���c}|_nd|_t
|j|j�|_||_ycc}wcc}w)zf
        Semi-private init.

        Do not use this directly, use `cycler` function instead.
        N)�
isinstancer'�_left�_right�_op�copyr�_keys)r*rr�op�vs     r�__init__zCycler.__init__�s����d�F�#���
�
�D�K�K����B�D�J�
�
�15�5�1�$�)�)�A�,�5�D�J��D�J��e�V�$� ����e�l�l�E�I�I�F�D�K�
�
�27�7�A�4�9�9�Q�<�7�D�K��D�K�"�4�:�:�t�{�{�;��
�����6��8s�D�;Dc��||jvSr)r2)r*rs  r�__contains__zCycler.__contains__�s���D�J�J��rc�,�t|j�S)z!The keys this Cycler knows about.)rr2r)s rrzCycler.keys�s���4�:�:��rc�f�||k(ry||jvrtdj||����||jvrtdj||����|jj	|�|jj|�|j�5||jjvr|jj||�yt|jt�r|jj||�y|jD�cgc]	}|||i��c}|_
ycc}w)a
        Change a key in this cycler to a new name.
        Modification is performed in-place.

        Does nothing if the old key is the same as the new key.
        Raises a ValueError if the new key is already a key.
        Raises a KeyError if the old key isn't a key.
        Nz6Can't replace {old} with {new}, {new} is already a key)�old�newz2Can't replace {old} with {new}, {old} is not a key)r2r
r#�KeyError�removerr/r�
change_keyr-r.r')r*r:r;�entrys    rr>zCycler.change_key�s����#�:���$�*�*���H���C�S��)��
��d�j�j� ��O�"�F�s��F�4�6�
6�	
�
�
���#���
�
���s���;�;�"�s�d�k�k�.>�.>�'>��K�K�"�"�3��,���
�
�F�
+��J�J�!�!�#�s�+�
:>���D��3��c�
�+�D�D�J��Ds�D.c�Z��|d�}t�fd�|D��|_�h|_|S)a�
        Class method to create 'base' Cycler objects
        that do not have a 'right' or 'op' and for which
        the 'left' object is not another Cycler.

        Parameters
        ----------
        label : str
            The property key.

        itr : iterable
            Finite length iterable of the property values.

        Returns
        -------
        `Cycler`
            New 'base' cycler.
        Nc3�&�K�|]}�|i���
y�wr�)rr4�labels  �rr"z$Cycler._from_iter.<locals>.<genexpr>�s�����1��%���1�s�)�listr.r2)�clsrC�itr�rets `  r�
_from_iterzCycler._from_iter�s.���(�$�i���1�S�1�1��	��G��	��
rc���t�t�r7|j�}tt�fd�|j�D��St
d��)Nc3�B�K�|]\}}t||�����y�wrr)rrr4�keys   �rr"z%Cycler.__getitem__.<locals>.<genexpr>�s �����M�t�q�!���1�S�6� 2�M���z+Can only use slices with Cycler.__getitem__)r-�slicer$rr�itemsr
)r*rK�transs ` r�__getitem__zCycler.__getitem__�s=����c�5�!��K�K�M�E��#�M�u�{�{�}�M�N�N��J�K�Krc#�K�|j�|jD]}t|����y|j|j|j�D]-\}}i}|j	|�|j	|�|���/y�wr)r/r.�dictr0�update)r*r�a�b�outs     r�__iter__zCycler.__iter__�su�����;�;���
�
�
!���4�j� �
!�������T�[�[�9�
���1����
�
�1�
��
�
�1�
��	�	
�s�BBc��t|�t|�k7r#tdt|��dt|�����t||t�S)z�
        Pair-wise combine two equal length cyclers (zip).

        Parameters
        ----------
        other : Cycler
        z&Can only add equal length cycles, not z and )�lenr
r'�zip�r*�others  r�__add__zCycler.__add__�sP���t�9��E�
�"��$�$'��I�;�e�C��J�<�A�B�
B��d�E�3�'�'rc����t�t�rt|�t�St�t�r7|j	�}tt�fd�|j�D��StS)z�
        Outer product of two cyclers (`itertools.product`) or integer
        multiplication.

        Parameters
        ----------
        other : Cycler or int
        c3�B�K�|]\}}t||�z����y�wrr)rrr4r\s   �rr"z!Cycler.__mul__.<locals>.<genexpr>s �����N���1���1�U�7� 3�N�rL)	r-r'r�intr$rrrN�NotImplemented)r*r\rOs ` r�__mul__zCycler.__mul__sR����e�V�$��$��w�/�/�
��s�
#��K�K�M�E��#�N����
�N�O�O�!�!rc��||zSrrBr[s  r�__rmul__zCycler.__rmul__s���e�|�rc���tttti}|j�t|j�St|j�}t|j�}||j||�Sr)rZ�minrrr/rYr.r0)r*�op_dict�l_len�r_lens    r�__len__zCycler.__len__s[����W�c�*���;�;���t�z�z�?�"��D�J�J����D�K�K� �� �w�t�x�x� ���.�.rc��t|t�std��tj|�}t	||�|_||_t|_t|j|j|j�|_	|S)z�
        In-place pair-wise combine two equal length cyclers (zip).

        Parameters
        ----------
        other : Cycler
        z"Cannot += with a non-Cycler object)
r-r'�	TypeErrorr1rr2r.rZr0r/�r*r\�old_selfs   r�__iadd__zCycler.__iadd__#sd���%��(��@�A�A��9�9�T�?��"�8�U�3��
���
�����U�[�[�%�,�,��	�	�B����rc��t|t�std��tj|�}t	||�|_||_t|_t|j|j|j�|_	|S)z�
        In-place outer product of two cyclers (`itertools.product`).

        Parameters
        ----------
        other : Cycler
        z"Cannot *= with a non-Cycler object)
r-r'rlr1rr2r.rr0r/rms   r�__imul__zCycler.__imul__5sd���%��(��@�A�A��9�9�T�?��"�8�U�3��
���
�����U�[�[�%�,�,��	�	�B����rc��t|�t|�k7ry|j|jzrytd�t||�D��S)NFc3�,K�|]\}}||k(���y�wrrB)rrTrUs   rr"z Cycler.__eq__.<locals>.<genexpr>Ls����7�d�a��1��6�7�s�)rYr�allrZr[s  r�__eq__z
Cycler.__eq__Gs@���t�9��E�
�"���9�9�u�z�z�!���7�c�$��&6�7�7�7rc��||k(SrrBr[s  r�__ne__z
Cycler.__ne__Ns���E�M�"�"rc�2��tdtdi}|j�7|jj	��t�fd�|D��}d��d|�d�S|j
|jd�}d}|j|j||j�	�S)
N�+�*c3�(�K�|]	}|����y�wrrB�rr4�labs  �rr"z"Cycler.__repr__.<locals>.<genexpr>Ws�����,�!�q��v�,���zcycler(z, �)�?z({left!r} {op} {right!r}))rr3r)
rZrr/r�poprD�getr0r#r.)r*�op_maprFr3�msgr}s     @r�__repr__zCycler.__repr__Ss�����s�G�S�)���;�;���)�)�-�-�/�C��,�t�,�,�C��S�G�2�c�W�A�.�.����D�H�H�c�*�B�-�C��:�:�4�:�:�"�D�K�K�:�H�Hrc���d}t|jt��}|D]}|d|�d�z
}�
t|�D]}|dz
}|D]}|d||�d�z
}�|dz
}�!|d	z
}|S)
Nz<table>)rKz<th>z</th>z<tr>z<td>z</td>z</tr>z</table>)�sortedr�reprr
)r*�output�sorted_keysrK�drs      r�_repr_html_zCycler._repr_html_^s������T�Y�Y�D�1���	*�C���S�G�5�)�)�F�	*��d��	�A��f��F� �
/���D��1����.�.��
/��g��F�		�
	�*����
rc��|j}|D�cic]
}|t���}}|D] }|D]}||j||���"|Scc}w)a�
        Values by key.

        This returns the transposed values of the cycler.  Iterating
        over a `Cycler` yields dicts with a single value for each key,
        this method returns a `dict` of `list` which are the values
        for the given key.

        The returned value can be used to create an equivalent `Cycler`
        using only `+`.

        Returns
        -------
        transpose : dict
            dict of lists of the values for each key.
        )rrD�append)r*rrrVr�s     rr$z
Cycler.by_keylsd��*�y�y��"&�'�Q�q�$�&�y�'��'��	$�A��
$���A��
�
�a��d�#�
$�	$��
��(s�Ac�l�|j�}ttd�|j�D��S)z�
        Simplify the cycler into a sum (but no products) of cyclers.

        Returns
        -------
        simple : Cycler
        c3�:K�|]\}}t||����y�wrr�rrr4s   rr"z"Cycler.simplify.<locals>.<genexpr>�s����D�d�a��G�A�q�M�D���)r$rrrN)r*rOs  r�simplifyzCycler.simplify�s(�����
���c�D�e�k�k�m�D�E�Er)NN)�__name__�
__module__�__qualname__�__doc__r+r5r7�propertyrr>�classmethodrHrPrWr]rbrdrjrorqrurw�__hash__r�r�r$�
_transposer�r%rBrrr'r'hs����6��6�����"E�H����0L�	�(�"�"�/��$�$8�#��H�	I���<�J�F� �Frr'c�V�|r
|rtd��t|�dk(r,t|dt�std��t|d�St|�dk(rt	|�St|�dkDrtd��|r%ttd�|j�D��Std��)	a�
    Create a new `Cycler` object from a single positional argument,
    a pair of positional arguments, or the combination of keyword arguments.

    cycler(arg)
    cycler(label1=itr1[, label2=iter2[, ...]])
    cycler(label, itr)

    Form 1 simply copies a given `Cycler` object.

    Form 2 composes a `Cycler` as an inner product of the
    pairs of keyword arguments. In other words, all of the
    iterables are cycled simultaneously, as if through zip().

    Form 3 creates a `Cycler` from a label and an iterable.
    This is useful for when the label cannot be a keyword argument
    (e.g., an integer or a name that has a space in it).

    Parameters
    ----------
    arg : Cycler
        Copy constructor for Cycler (does a shallow copy of iterables).
    label : name
        The property key. In the 2-arg form of the function,
        the label can be any hashable object. In the keyword argument
        form of the function, it must be a valid python identifier.
    itr : iterable
        Finite length iterable of the property values.
        Can be a single-property `Cycler` that would
        be like a key change, but as a shallow copy.

    Returns
    -------
    cycler : Cycler
        New `Cycler` for the given property

    zBcyl() can only accept positional OR keyword arguments -- not both.�rzDIf only one positional argument given, it must be a Cycler instance.�zdOnly a single Cycler can be accepted as the lone positional argument. Use keyword arguments instead.c3�:K�|]\}}t||����y�wrrr�s   rr"zcycler.<locals>.<genexpr>�s����E�d�a��G�A�q�M�E�r�z4Must have at least a positional OR keyword arguments)rlrYr-r'rrrrN)�args�kwargss  r�cyclerr��s���L���1�2�	2��4�y�A�~��$�q�'�6�*��4�5�
5��d�1�g���	�T��a����~��	�T��Q���N�O�	O���c�E�f�l�l�n�E�F�F�
�J�
K�Krc����t|t�rB|j}t|�dk7r
d}t	|��|j���fd�|D�}tj
||�S)aD
    Create a new `Cycler` object from a property name and iterable of values.

    Parameters
    ----------
    label : hashable
        The property key.
    itr : iterable
        Finite length iterable of the property values.

    Returns
    -------
    cycler : Cycler
        New `Cycler` for the given property
    r�z2Can not create Cycler from a multi-property Cyclerc3�(�K�|]	}|����y�wrrBr|s  �rr"z_cycler.<locals>.<genexpr>�s�����#�!�q��v�#�r~)r-r'rrYr
r�rH)rCrFrr�r}s    @rrr�s\��� �#�v���x�x���t�9��>�F�C��S�/�!��h�h�j��$�s�#�����U�C�(�(r)r�r1�	functoolsr�	itertoolsrr�operatorrr�__version__rr%r'r�rrBrr�<module>r�sB��(�V��$�����.G�:t�t�n	8L�v)r

Youez - 2016 - github.com/yon3zu
LinuXploit