def capture(context, callable_, *args, **kwargs):

    if not compat.callable(callable_):
        raise exceptions.RuntimeException(
                           "capture() function expects a callable as "
                           "its argument (i.e. capture(func, *args, **kwargs))"
                        )
    context._push_buffer()
    try:
        callable_(*args, **kwargs)
    finally:
        buf = context._pop_buffer()
    return buf.getvalue()
Execute the given template def, capturing the output into
dataset/ETHPy150Open cloudera/hue/desktop/core/ext-py/Mako-0.8.1/mako/runtime.py/capture