

def __init__(self, app, modules=[], injector=None, request_scope_class=RequestScope, use_annotations=None):
    'Initializes Injector for the application.\n\n        .. note::\n\n            Needs to be called *after* all views, signal handlers, template globals\n            and context processors are registered.\n\n        :param app: Application to configure\n        :param modules: Configuration for newly created :class:`injector.Injector`\n        :param injector: Injector to initialize app with, if not provided\n            a new instance will be created.\n        :type app: :class:`flask.Flask`\n        :type modules: Iterable of configuration modules\n        :param use_annotations: Enables Python 3 annotation support, see Injector\n                                documentation for details.\n        :type use_annotations: bool\n        :rtype: :class:`injector.Injector`\n        '
    if (injector and (app is not None)):
        raise AssertionError('You cannot set use_annotations and pass Injector instance at the same time')
    if (not injector):
        kwargs = {
            
        }
        if (use_annotations is not None):
            kwargs['use_annotations'] = use_annotations
        injector = Injector(**kwargs)
    for module in ([FlaskModule(app=app, request_scope_class=request_scope_class)] + list(modules)):
        injector.binder.install(module)
    for container in (app.view_functions, app.before_request_funcs, app.after_request_funcs, app.teardown_request_funcs, app.template_context_processors, app.jinja_env.globals):
        process_dict(container, injector)
    process_error_handler_spec(app.error_handler_spec, injector)

    def reset_request_scope_before(*args, **kwargs):
        injector.get(request_scope_class).prepare()

    def reset_request_scope_after(*args, **kwargs):
        injector.get(request_scope_class).cleanup()
    app.before_request_funcs.setdefault(None, []).insert(0, reset_request_scope_before)
    app.teardown_request(reset_request_scope_after)
    self.injector = injector
    self.app = app

dataset/ETHPy150Open alecthomas/flask_injector/flask_injector.py FlaskInjector.__init__/VarMisuse@36/290 `use_annotations`->`app`