| 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 : |
�
�k{a�8 � �l � d Z ddlZddlmZ ddlmZmZ ddlmZm Z dZ
d� Zd� Z G d � 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 �� � | �t t | � � ni }|�t t |� � ni }t |j � � }t |j � � }||z rt d� �||z S )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_keysr 4 sk � � "&�!1�T�$�t�*�
�r�F�"'�"3�T�$�u�+�
��F�����
��E�����
��E��u�}��=�>�>��5�=�� c �T ��� | j |j k7 rJt dj | j |j z | j |j z �� � �| j � �|j � �t t
��fd�| j D � � 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_onec 3 �H �K � | ] }t |�| �| z � �� � y �w�N��_cycler)�.0�k�_l�_rs ��r � <genexpr>zconcat.<locals>.<genexpr>e s$ �� �� �E�a���2�a�5�2�a�5�=�1�E�s �")r r
�format�by_keyr r )r r r r! s @@r �concatr% K s� �� �$ �y�y�E�J�J��� 4�4:�F�"&�)�)�e�j�j�"8�&*�i�i�%�*�*�&<� 5;� 5>�?� ?�
����B� ����B��#�E�4�9�9�E�F�Fr c � � e Zd ZdZd� Zdd�Zd� Zed� � Zd� Z e
d� � Zd � Zd
� 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 | � S r )r ��selfs r �__call__zCycler.__call__� s � ��T�{�r Nc �< � t |t � r1t |j |j |j � | _ n2|�)|D �cg c] }t j
|� �� c}| _ nd| _ t |t � r1t |j |j |j � | _ n2|�)|D �cg c] }t j
|� �� c}| _ nd| _ t
| j | j � | _ || _ yc c}w c c}w )zf
Semi-private init.
Do not use this directly, use `cycler` function instead.
N)�
isinstancer'