code: def save_to_file(cn_topo, filename):
      '''
      Save a topology to a file.
      '''
      jstr = cn_topo.serialize()
      with open(filename, 'w') as outfile:
          outfile.write(jstrf save_to_file(cn_topo, filename):
      '''
      Save a topology to a file.
      '''
      jstr = cn_topo.serialize()
      with open(filename, 'w') as outfile:
          outfile.write(jstr)
docs: Save a topology to a file.