code: def call_cur(f):
    "decorator for opening a connection and passing a cursor to the function"
    @functools.wraps(f)
    def f2(self, *args, **kwargs):
      with self.withcur() as cur:
        return f(self, cur, *args, **kwargs)
    return ff call_cur(f):
    "decorator for opening a connection and passing a cursor to the function"
    @functools.wraps(f)
    def f2(self, *args, **kwargs):
      with self.withcur() as cur:
        return f(self, cur, *args, **kwargs)
    return f2
docs: decorator for opening a connection and passing a cursor to the function