before/after call will encapsulate callable object

def wrap_object(func, before, after):
    '''
    before/after call will encapsulate callable object
    '''
    def _wrapper(*args, **kwargs):
        before()
        try:
            return func(*args, **kwargs)
        except Exception as e:
            raise e
        finally:
            after()
    return _wrapper