code: def main():
      parser = argparse.ArgumentParser(
          description="Update arrow dep versions."
      )
      sub_parsers = parser.add_subparsers(help="sub-command help")
  
      parser_version = sub_parsers.add_parser(
          "version", help="update arrow version"
      )
      parser_version.add_argument(
          "new_version", type=str, help="new arrow version"
      )
      parser_version.set_defaults(which="version")
  
      parser_commit = sub_parsers.add_parser(
          "commit", help="update arrow commit"
      )
      parser_commit.set_defaults(which="commit")
  
      args = parser.parse_args()
  
      repo_root = Path(__file__).parent.parent.absolute()
  
      if args.which == "version":
          for cargo_toml in repo_root.rglob("Cargo.toml"):
              update_version_cargo_toml(cargo_toml, args.new_version)
      elif args.which == "commit":
          new_sha = get_arrow_sha()
          print(
              "Updating files in {} to use sha {}".format(
                  repo_root, new_sha
              )
          )
          for cargo_toml in repo_root.rglob("Cargo.toml"):
              update_commit_cargo_toml(cargo_toml, new_sha)
  
file_path: arrow-datafusion/dev/update_arrow_deps.py
imports: import argparse
  from pathlib import Path
  import tomlkit
  import requests
label_desc: Use image node_id 5 for calling a global function with example usage: main() without return types