def restore(self, name=None, keep=False, last=True, global_register=True, pixel_register=True):
if name is None:<EOL><INDENT>if keep:<EOL><INDENT>name = next(reversed(self.config_state)) if last else next(iter(self.config_state))<EOL>value = self.config_state[name]<EOL><DEDENT>else:<EOL><INDENT>name, value = self.config_state.popitem(last=last)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>value = self.config_state[name]<EOL>if not keep:<EOL><INDENT>value = copy.deepcopy(value)  <EOL>del self.config_state[name]<EOL><DEDENT><DEDENT>if global_register:<EOL><INDENT>self.global_registers = copy.deepcopy(value[<NUM_LIT:0>])<EOL><DEDENT>if pixel_register:<EOL><INDENT>self.pixel_registers = copy.deepcopy(value[<NUM_LIT:1>])<EOL><DEDENT>
Restoring a configuration restore point.

        Parameters
        ----------
        name : str
            Name of the restore point. If not given, a md5 hash will be generated.
        keep : bool
            Keeping restore point for later use.
        last : bool
            If name is not given, the latest restore point will be taken.
        global_register : bool
            Restore global register.
        pixel_register : bool
            Restore pixel register.