code: def update_docs(
      sympy_doc_git, doc_html_zip, version, dev_version, push
  ):
      # We started with a clean tree so restore it on error
      with git_rollback_on_error(
          sympy_doc_git, branch="gh-pages"
      ) as run:
          # Delete docs for the last version
          run("git", "rm", "-rf", "latest")
  
          # Extract new docs in replacement
          extract_docs(sympy_doc_git, doc_html_zip)
  
          # Commit new docs
          run("git", "add", "latest")
          run("git", "commit", "-m", "Add sympy %s docs" % version)
  
          # Update versions.json
          with open(join(sympy_doc_git, "versions.json"), "w") as f:
              json.dump({"latest": version, "dev": dev_version}, f)
          run("git", "diff")
          run("git", "add", "versions.json")
          run("git", "commit", "-m", "Update versions.json")
  
          if push:
              run("git", "push")
          else:
              print("Results are committed but not pushed")
  
file_path: sympy/release/update_docs.py
imports: import json
  import subprocess
  import sys
  from os.path import join, splitext, basename
  from contextlib import contextmanager
  from tempfile import TemporaryDirectory
  from zipfile import ZipFile
  from shutil import copytree
label_desc: Use image node_id 2 for calling a global function with example usage: update_docs(sympy_doc_git, doc_html_zip, version, dev_version, push) without return types