@extensionclassmethod(Observable)
def from_callback(cls, func, selector=None):

    def function(*args):
        arguments = list(args)
        def subscribe(observer):
            def handler(*args):
                results = list(args)
                if selector:
                    try:
                        results = selector(args)
                    except Exception as err:
                        observer.on_error(err)
                        return

                    observer.on_next(results)
                else:
                    if isinstance(results, list) and len(results) <= 1:
                        observer.on_next(*results)
                    else:
                        observer.on_next(results)

                    observer.on_completed()

            arguments.append(handler)
            func(*arguments)

        return AnonymousObservable(subscribe)
    return function
This method extracts a bag of features histogram for the input image using
dataset/ETHPy150Open ReactiveX/RxPY/rx/linq/observable/fromcallback.py/from_callback--crossover with--dataset/ETHPy150Open sightmachine/SimpleCV/SimpleCV/Features/BOFFeatureExtractor.py/BOFFeatureExtractor.extract