File: //lib/python3/dist-packages/more_itertools/__pycache__/more.cpython-38.pyc
U
�A�Z�� � 1 @ s� d dl mZ d dlmZmZmZ d dlmZmZ d dl m
Z
d dlmZm
Z
mZmZmZmZmZmZmZmZ d dlmZmZmZmZ d dlmZmZ zd dlmZ W n e k
r� d dlmZ Y nX d d l!m"Z"m#Z#m$Z$ d d
l%m&Z&m'Z'm(Z(m)Z)m*Z* ddl+m,Z,m-Z-m.Z. d
ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d<d=g1Z/e0� Z1d>d� Z2e1fd?d�Z3G d@d,� d,e0�Z4dAdB� Z5dCd� Z6edDk�r�e6j7Z8ee
�Z6e8e6_7dEd� Z9dFd� Z:dGd$� Z;dHd<� Z<dxdJd*�Z=dKd� Z>dydLd"�Z?dMd:� Z@dzdNd;�ZAG dOd� de0�ZBd{dPd7�ZCdQd!� ZDdRd � ZEd|dSd�ZFd}dTd1�ZGdUd2� ZHdVd4� ZIdWd6� ZJdXd5� ZKd~dZd+�ZLd[d� ZMdd]d8�ZNd^d=� ZOd�d`d3�ZPdad� ZQe$e"ffdbd�ZRd�dcd
�ZSd�ddd�ZTded)� ZUd�dfd�ZVeWfdgd%�ZXdhd&� ZYdid-� ZZdjd9� Z[dkd#� Z\dld� Z]dmdn� fdod�Z^efdpd�Z_G dqd0� d0e�Z`G drd/� d/e0�ZaG dsd.� d.e0�ZbeWfdtd�Zcdud� Zdd�dvd'�Zed�dwd(�ZfdIS )�� )�print_function)�Counter�defaultdict�deque)�partial�wraps)�merge)
�chain�compress�count�cycle� dropwhile�groupby�islice�repeat� takewhile�tee)�
itemgetter�lt�gt�sub)�maxsize�version_info)�Sequence)�binary_type�string_types� text_type)�filter�map�range�zip�zip_longest� )�consume�flatten�take�adjacent�always_iterable�always_reversible�bucket�chunked�circular_shifts�collapse�collate�consecutive_groups�consumer�count_cycle�
difference�distinct_permutations�
distribute�divide� exactly_n�first�groupby_transform�ilen�interleave_longest�
interleave�intersperse�islice_extended�iterate�locate�lstrip�make_decorator�
map_reduce�
numeric_range�one�padded�peekable�rstrip�
run_length�seekable�SequenceView�side_effect�sliced�
sort_together�split_at�split_after�split_before�spy�stagger�strip�unique_to_each�windowed� with_iter�
zip_offsetc C s t tt|t | ��g �S )a� Break *iterable* into lists of length *n*:
>>> list(chunked([1, 2, 3, 4, 5, 6], 3))
[[1, 2, 3], [4, 5, 6]]
If the length of *iterable* is not evenly divisible by *n*, the last
returned list will be shorter:
>>> list(chunked([1, 2, 3, 4, 5, 6, 7, 8], 3))
[[1, 2, 3], [4, 5, 6], [7, 8]]
To use a fill-in value instead, see the :func:`grouper` recipe.
:func:`chunked` is useful for splitting up a computation on a large number
of keys into batches, to be pickled and sent off to worker processes. One
example is operations on rows in MySQL, which does not implement
server-side cursors properly and would otherwise load the entire dataset
into RAM on the client.
)�iterr r% )�iterable�n� rZ �5/usr/lib/python3/dist-packages/more_itertools/more.pyr* U s c C s<