def wrap_fun(fun, injector):
    if isinstance(fun, LocalProxy):
        return fun

    # Important: this block needs to stay here so it's executed *before* the
    # hasattr(fun, '__call__') block below - otherwise things may crash.
    if hasattr(fun, '__bindings__'):
        return wrap_function(fun, injector)

    if hasattr(fun, '__call__') or not isinstance(fun, type):
        bindings_from_annotations = injector._infer_injected_bindings(fun)
        if bindings_from_annotations:
            return wrap_fun(inject(**bindings_from_annotations)(fun), injector)

    if hasattr(fun, 'view_class'):
        return wrap_class_based_view(fun, injector)

    return fun
dataset/ETHPy150Open alecthomas/flask_injector/flask_injector.py/wrap_fun/operator `and` -> `or`