U vi@sNddlmZddlmZmZmZmZmZmZddl m Z m Z m Z ddl m ZddlmZddlmZmZedZedZde eeeeefeeeefe ed d d Zdeeee efee ege efd ddZdeeee ege efdddZeeee edffee ege efd ddZdddgZd S))Future)AnyCallableOptionalTypeVarUnioncast) Observablefrom_ from_future) operators)identity)Mapper MapperIndexed_T1_T2N)sourcemappermapper_indexedreturncs2ttttdfdd }|t|tS)N)xircsTr |nr||nt}t|tr8ttd|}nt|trH|}nt|}|S)Nz Future[Any])r isinstancerr rr r )rrZ mapper_resultresultrrM/opt/alt/python38/lib/python3.8/site-packages/reactivex/operators/_flatmap.py projections   z&_flat_map_internal..projection)rintr rpipeopsZ map_indexedZ merge_all)rrrrrrr_flat_map_internal s r!)rrcs ttttdfdd }|S)Nrrcs.trt|d}nt|fddd}|S)aOOne of the Following: Projects each element of an observable sequence to an observable sequence and merges the resulting observable sequences into one observable sequence. Example: >>> flat_map(source) Args: source: Source observable to flat map. Returns: An operator function that takes a source observable and returns an observable sequence whose elements are the result of invoking the one-to-many transform function on each element of the input sequence . rcsSNr_r#rr?z-flat_map_..flat_map..callabler!rretr#rrflat_map)szflat_map_..flat_mapr rr)rr-rr#r flat_map_&sr/)rrcs ttttdfdd }|S)Nr"cs.trt|d}nt|fddd}|S)a One of the Following: Projects each element of an observable sequence to an observable sequence and merges the resulting observable sequences into one observable sequence. Example: >>> flat_map_indexed(source) Args: source: Source observable to flat map. Returns: An observable sequence whose elements are the result of invoking the one-to-many transform function on each element of the input sequence. rcsSr$rr%r0rrr'^r(z=flat_map_indexed_..flat_map_indexed..r#r)r+r0rrflat_map_indexedIsz+flat_map_indexed_..flat_map_indexed)r r)rr1rr0rflat_map_indexed_Fsr2z Future[_T2]cs ttttdfdd }|S)Nr"cs|ttS)aProjects each element of an observable sequence into a new sequence of observable sequences by incorporating the element's index and then transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence. Args: source: Source observable to flat map latest. Returns: An observable sequence whose elements are the result of invoking the transform function on each element of source producing an observable of Observable sequences and that at any point in time produces the elements of the most recent inner observable sequence that has been received. )rr mapZ switch_latest)rr#rrflat_map_latestgsz)flat_map_latest_..flat_map_latestr.)rr4rr#rflat_map_latest_dsr5)NN)N)N)asynciortypingrrrrrrZ reactivexr r r r r Zreactivex.internal.basicr Zreactivex.typingrrrrr!r/r2r5__all__rrrrs:      !