def map_indexed_( mapper_indexed: Optional[MapperIndexed[_T1, _T2]] = None ) -> Callable[[Observable[_T1]], Observable[_T2]]: def _identity(value: _T1, _: int) -> _T2: return cast(_T2, value) _mapper_indexed = mapper_indexed or cast(typing.MapperIndexed[_T1, _T2], _identity) return compose( ops.zip_with_iterable(infinite()), ops.starmap_indexed(_mapper_indexed), )
def create(): return n1.pipe(ops.zip_with_iterable(n2), ops.map(sum))