code: def json_pretty_dump(obj, filename):
      
      with open(filename, "wt") as fh:
          json.dump(obj, fh, indent=4, sort_keys=4)
docs: Serialize obj as a JSON formatted stream to the given filename (
      pretty printing version)