def reset_epoch(func):
@wraps(func)<EOL>def wrapped_func(*args, **kwargs):  <EOL><INDENT>connection = kwargs.get('<STR_LIT>', None)<EOL>epoch = connection.current_epoch() if connection else None<EOL>try:<EOL><INDENT>return func(*args, **kwargs)<EOL><DEDENT>finally:<EOL><INDENT>if epoch is not None:<EOL><INDENT>connection.set_epoch(epoch.gps_start, epoch.gps_stop)<EOL><DEDENT><DEDENT><DEDENT>return wrapped_func<EOL>
Wrap a function to reset the epoch when finished

    This is useful for functions that wish to use `connection.set_epoch`.