def __getattribute__(self, name):
        try:
            attr = object.__getattribute__(self, name)
        except __HOLE__:
            raise AttributeError("'{}' object has no attribute '{}'".format(
                                 self.__class__.__name__, name))

        if name == 'close' or name.startswith('_') or not hasattr(
                attr, '__call__'):
            # a 'local' or internal attribute, or a non-callable
            return attr

        # it's an asynchronous callable
        # return a callable wrapper for the attribute that will
        # run in its own IOLoop
        def wrapper(clb, *args, **kwargs):
            fn = functools.partial(clb, *args, **kwargs)
            return self.io_loop.run_sync(fn)
        return functools.partial(wrapper, attr)
dataset/ETHPy150Open nephics/tornado-couchdb/couch/couch.py/BlockingCouch.__getattribute__