def set_mode(self,mode=None):

        if not mode:
            new_idx = ( self.valid_modes.index(self.mode) + 1 ) % \
                      len(self.valid_modes)
            self.mode = self.valid_modes[new_idx]
        elif mode not in self.valid_modes:
            raise ValueError('Unrecognized mode in FormattedTB: <'+mode+'>\n'\
                  'Valid modes: '+str(self.valid_modes))
        else:
            self.mode = mode
        # include variable details only in 'Verbose' mode
        self.include_vars = (self.mode == self.valid_modes[2])
        # Set the join character for generating text tracebacks
        self.tb_join_char = self._join_chars[self.mode]

    # some convenient shorcuts
Return a serializable form of the config instance
dataset/ETHPy150Open ipython/ipython-py3k/IPython/core/ultratb.py/FormattedTB.set_mode--crossover with--dataset/ETHPy150Open saltstack/salt/salt/utils/schema.py/SchemaItem.serialize