def reraise(clazz):
def _decorator(f):<EOL><INDENT>@functools.wraps(f)<EOL>def _wrap(*args, **kwargs):<EOL><INDENT>try:<EOL><INDENT>return f(*args, **kwargs)<EOL><DEDENT>except Exception as e:<EOL><INDENT>raise clazz(e).with_traceback(sys.exc_info()[<NUM_LIT:2>])<EOL><DEDENT><DEDENT>return _wrap<EOL><DEDENT>return _decorator<EOL>
Decorator catching every exception that might be raised by wrapped
    function and raise another exception instead.
    Exception initially raised is passed in first argument of the raised
    exception.

    :param: Exception class: clazz:
      Python exception class to raise