code: def save(self):
          "Saves the state to the state file"
          with open(self.state_file, "w") as fh:
              json.dump({
                  "hosts": self.hosts,
                  "stats": self.stats,
              }, fhf save(self):
          "Saves the state to the state file"
          with open(self.state_file, "w") as fh:
              json.dump({
                  "hosts": self.hosts,
                  "stats": self.stats,
              }, fh)
docs: Saves the state to the state file