def create(): pfh = self.test_obs.pipe(pairwise_buffer, ops.map(lambda x: x[0])) w = pfh.pipe( ops.window( self.test_obs.pipe(pairwise_buffer, ops.filter(lambda x: x[0] != x[1])))) return w.pipe(ops.flat_map(lambda x: x.pipe(ops.to_list())))
def create(): def mapper(w, i): return w.pipe(ops.map(lambda x: str(i) + ' ' + str(x))) return xs.pipe( ops.window(ys), ops.map_indexed(mapper), ops.merge_all(), )
def create(): def mapper(w, i): return w.pipe(ops.map(lambda x: str(i) + ' ' + str(x))) return xs.pipe( ops.window(ys), ops.map_indexed(mapper), ops.merge_all(), )
def create(): def closing(x): raise Exception(ex) def mapper(w, i): return w.pipe(ops.map(lambda x: str(i) + ' ' + str(x))) return xs.pipe( ops.window(ys, closing), ops.map_indexed(mapper), ops.merge_all(), )
def create(): def closing(): return rx.throw(ex) def mapper(w, i): return w.pipe(ops.map(lambda x: str(i) + ' ' + str(x))) return xs.pipe( ops.window(closing), ops.map_indexed(mapper), ops.merge_all(), )
def create(): def closing(x): raise Exception(ex) def mapper(w, i): return w.pipe(ops.map(lambda x: str(i) + ' ' + str(x))) return xs.pipe( ops.window(ys, closing), ops.map_indexed(mapper), ops.merge_all(), )
def create(): def closing(): return rx.throw(ex) def mapper(w, i): return w.pipe(ops.map(lambda x: str(i) + ' ' + str(x))) return xs.pipe( ops.window(closing), ops.map_indexed(mapper), ops.merge_all(), )
def create(): def closing(): curr = window[0] window[0] += 1 return rx.timer(curr * 100) def mapper(w, i): return w.pipe(ops.map(lambda x: str(i) + ' ' + str(x))) return xs.pipe( ops.window(closing), ops.map_indexed(mapper), ops.merge_all(), )
def create(): def closings(): w = window[0] window[0] += 1 return rx.timer(w * 100) def mapper(w, i): return w.pipe(ops.map(lambda x: str(i) + ' ' + str(x))) return xs.pipe( ops.window(window_closing_mapper=closings), ops.map_indexed(mapper), ops.merge_all(), )
def create(): def closing(): curr = window[0] window[0] += 1 return rx.timer(curr * 100) def mapper(w, i): return w.pipe(ops.map(lambda x: str(i) + ' ' + str(x))) return xs.pipe( ops.window(closing), ops.map_indexed(mapper), ops.merge_all(), )
def create(): def closings(): w = window[0] window[0] += 1 return rx.timer(w * 100) def mapper(w, i): return w.pipe(ops.map(lambda x: str(i) + ' ' + str(x))) return xs.pipe( ops.window(window_closing_mapper=closings), ops.map_indexed(mapper), ops.merge_all(), )
def _buffer(buffer_openings=None, buffer_closing_mapper=None) -> Callable[[Observable], Observable]: """Projects each element of an observable sequence into zero or more buffers. Args: buffer_openings -- Observable sequence whose elements denote the creation of windows. buffer_closing_mapper -- [optional] A function invoked to define the closing of each produced window. If a closing mapper function is specified for the first parameter, this parameter is ignored. Returns: A function that takes an observable source and retuerns an observable sequence of windows. """ return pipe(ops.window(buffer_openings, buffer_closing_mapper), ops.flat_map(pipe(ops.to_iterable(), ops.map(list))))
def _buffer(buffer_openings=None, buffer_closing_mapper=None) -> Callable[[Observable], Observable]: """Projects each element of an observable sequence into zero or more buffers. Args: buffer_openings -- Observable sequence whose elements denote the creation of windows. buffer_closing_mapper -- [optional] A function invoked to define the closing of each produced window. If a closing mapper function is specified for the first parameter, this parameter is ignored. Returns: A function that takes an observable source and retuerns an observable sequence of windows. """ return pipe( ops.window(buffer_openings, buffer_closing_mapper), ops.flat_map(pipe(ops.to_iterable(), ops.map(list))) )
def _buffer(boundaries: Observable) -> Callable[[Observable], Observable]: return pipe(ops.window(boundaries), ops.flat_map(pipe(ops.to_iterable(), ops.map(list))))