code: def do_mode(self, arg):
          
          restart_server = False
          if self.server.is_server_running() == 'yes' or self.server.is_server_running() == 'maybe':
              r = raw_input("Switching modes requires the server to restart. Really "
                            "switch modes? y or n: ")
              if r != 'y':
                  return
              restart_server = True
          if arg['<which>'] is None:
              if self.sandbox:
                  arg['<which>'] = 'live'
              else:
                  arg['<which>'] = 'sandbox'
          if arg['<which>'] == 'live':
              self.set_sandbox(False)
              self.update_hit_tally()
              print 'Entered %s mode' % colorize('live', 'bold')
          else:
              self.set_sandbox(True)
              self.update_hit_tally()
              print 'Entered %s mode' % colorize('sandbox', 'bold')
          if restart_server:
              self.server_restart()
docs: Usage: mode
                 mode <which>