code: def handle_dump(args):
      
      session_file = get_db_name(args['<session-file>'])
  
      with use_db(session_file, WorkDB.Mode.open) as database:
          for work_item, result in database.completed_work_items:
              print(json.dumps((work_item, result), cls=WorkItemJsonEncoder))
          for work_item in database.pending_work_items:
              print(json.dumps((work_item, None), cls=WorkItemJsonEncoder))
  
      return ExitCode.OK
docs: usage: cosmic-ray dump <session-file>
  
      JSON dump of session data. This output is typically run through other
      programs to produce reports.
  
      Each line of output is a list with two elements: a WorkItem and a
      WorkResult, both JSON-serialized. The WorkResult can be null, indicating a
      WorkItem with no results.