def _contains(value: Any, comparer=None) -> Callable[[Observable], Observable]: comparer_ = comparer or default_comparer filtering = ops.filter(lambda v: comparer_(v, value)) something = ops.some() return pipe(filtering, something)
def _is_empty() -> Callable[[Observable], Observable]: """Determines whether an observable sequence is empty. Returns: An observable sequence containing a single element determining whether the source sequence is empty. """ return pipe(ops.some(), ops.map(lambda b: not b))
def _all(predicate: Predicate) -> Callable[[Observable], Observable]: filtering = ops.filter(lambda v: not predicate(v)) mapping = ops.map(lambda b: not b) some = ops.some() return pipe( filtering, some, mapping )
def create(): return xs.pipe(ops.some(lambda x: x > 0))
def create(): return xs.pipe(ops.some())