U
vi
@ s d dl Z d dlmZmZmZmZ d dlmZmZ d dl m
Z
mZ d dlm
Z
mZ d dlmZ e dZedZdeee eee geee f d d
dZdgZdS )
N)CallableListOptionalTypeVar)
Observableabc)RefCountDisposableSingleAssignmentDisposable)ArgumentOutOfRangeExceptionadd_ref)SubjectZRx_T)countskipreturnc sR dkrt |dk r|n dkr,t tt ttt d fdd}|S )a Projects each element of an observable sequence into zero or more
windows which are produced based on element count information.
Examples:
>>> window_with_count(10)
>>> window_with_count(10, 1)
Args:
count: Length of each window.
skip: [Optional] Number of elements to skip between creation of
consecutive windows. If not specified, defaults to the
count.
Returns:
An observable sequence of windows.
r N)sourcer c s2 dt jtt tt j d fdd
}t|S )N)observer schedulerc s t }t|dgg fdd td d fdd}td dfdd }d d
fdd}j||||d
|_S )Nr c s$ t } | t| d S )N)r appendon_nextr )s)r qrefCountDisposable U/opt/alt/python38/lib/python3.8/site-packages/reactivex/operators/_windowwithcount.py
create_window4 s
zWwindow_with_count_.