code: def do_save(self, arg):
          
          #We need to save the full paths to the staging directories for the tests that are loaded
          #so far; then when the session is restored, we can reparse the results.
          from os import path
          import json
          fullpath = path.expanduser(arg)
  
          data = {
              "tests": [path.abspath(a.stagedir) for a in list(self.tests.values())],
              "args": self.args
          }
  
          with open(fullpath, 'w') as f:
              json.dump(data, f)
          msg.okay("Saved current session to {}".format(fullpath))
docs: Saves the session variables to a file so that the same analysis can be continued later.