def save(self):
        tmp_path = self.path + '.tmp'
        with open(tmp_path, 'w') as f:
            f.write(json.dumps(self.body_labels.items()))
        os.rename(tmp_path, self.path)
def main():
    parser = argparse.ArgumentParser()
    parser.add_argument("day", help="The day of the results, with format yyyymmdd")
    args = parser.parse_args()
    install_autopkgtest_results_formatter()
    with tempfile.TemporaryDirectory(dir=os.environ.get("HOME")) as temp_dir:
        clone_results_repo(temp_dir)
        format_results(temp_dir, ACTIVE_DISTROS, args.day)
        commit_and_push(temp_dir, args.day)