@extensionmethod(Observable, alias="tap")
def do_action(self, on_next=None, on_error=None, on_completed=None,
              observer=None):

    source = self

    if isinstance(observer, AbstractObserver):
        on_next = observer.on_next
        on_error = observer.on_error
        on_completed = observer.on_completed
    elif isinstance(on_next, AbstractObserver):
        on_error = on_next.on_error
        on_completed = on_next.on_completed
        on_next = on_next.on_next

    def subscribe(observer):
        def _on_next(x):
            try:
                on_next(x)
            except Exception as e:
                observer.on_error(e)

            observer.on_next(x)

        def _on_error(exception):
            if not on_error:
                observer.on_error(exception)
            else:
                try:
                    on_error(exception)
                except Exception as e:
                    observer.on_error(e)

                observer.on_error(exception)

        def _on_completed():
            if not on_completed:
                observer.on_completed()
            else:
                try:
                    on_completed()
                except Exception as e:
                    observer.on_error(e)

                observer.on_completed()
        return source.subscribe(_on_next, _on_error, _on_completed)
    return AnonymousObservable(subscribe)
Performs weight input validation and standardization
dataset/ETHPy150Open ReactiveX/RxPY/rx/linq/observable/doaction.py/do_action--crossover with--dataset/ETHPy150Open fchollet/keras/keras/engine/training.py/standardize_weights