def restore_grid(func):
@wraps(func)<EOL>def wrapped_func(self, *args, **kwargs):<EOL><INDENT>grid = (self.xaxis._gridOnMinor, self.xaxis._gridOnMajor,<EOL>self.yaxis._gridOnMinor, self.yaxis._gridOnMajor)<EOL>try:<EOL><INDENT>return func(self, *args, **kwargs)<EOL><DEDENT>finally:<EOL><INDENT>self.xaxis.grid(grid[<NUM_LIT:0>], which="<STR_LIT>")<EOL>self.xaxis.grid(grid[<NUM_LIT:1>], which="<STR_LIT>")<EOL>self.yaxis.grid(grid[<NUM_LIT:2>], which="<STR_LIT>")<EOL>self.yaxis.grid(grid[<NUM_LIT:3>], which="<STR_LIT>")<EOL><DEDENT><DEDENT>return wrapped_func<EOL>
Wrap ``func`` to preserve the Axes current grid settings.