parameters: (self, mode=None)
docstring: Switch to the desired mode.
  
          If mode is not specified, cycles through the available modes.
docstring_summary: Switch to the desired mode.
docstring_tokens: Switch to the desired mode .
function: def set_mode(self, mode=None):
          """Switch to the desired mode.
  
          If mode is not specified, cycles through the available modes."""
  
          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]
function_tokens: 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 ]