code: def do_save(self, fp=None):
          
          if fp is None:
              fp = sys.stdout
          data = {
              'settings': self.settings,
              'nodes': self.nodes,
              'backward': self.backward
          }
          json.dump(data, fp, ensure_ascii=False)
docs: Save to file.
  
          Parameters
          ----------
          fp : `file` or `str`, optional
              Output file (default: stdout).