def bind(self, name="db"):
        # This is useful for multi-threaded database connections:
        # >>>
        # >>> @app.bind("db")
        # >>> def db():
        # >>>     return Database("products.db")
        # >>>
        # >>> @app.route("/products")
        # >>> def products(id, db=None):
        # >>>     return db.execute("select * from products where id=?", (id,))
        def decorator(handler):
            return self.thread(START)(lambda: setattr(g, name, handler()))
        return decorator
The @app.bind(name) decorator binds the given function to a keyword argument
dataset/ETHPy150Open clips/pattern/pattern/server/__init__.py/Application.bind