U vi @ sh d dl mZmZmZ d dlmZmZmZ d dlm Z edZ eeee gee f dddZdgZ dS ) )CallableOptionalTypeVar) Observableabcempty)ArgumentOutOfRangeException_T)countreturnc s. dk rt tt tt d fdd}|S )Nr )sourcer c s6 s t S dtjt ttj d fdd }t|S )aZ Returns a specified number of contiguous elements from the start of an observable sequence. >>> take(source) Keyword arguments: count -- The number of elements to return. Returns an observable sequence that contains the specified number of elements from the start of the input sequence. N)observer schedulerc s0 t d d fdd}j| j j|dS )N)valuer c s* dkr&d8 | s&