code: def get_repo_checkout(node: Dict) -> str:
      try:
          branch = node["branch"]
          repo_path = f"/tmp/{branch}/PySyft"
          if not os.path.exists(repo_path):
              os.makedirs(repo_path, exist_ok=True)
              repo = git.Repo.clone_from(
                  "https://github.com/OpenMined/pysyft",
                  repo_path,
                  single_branch=True,
                  b=branch,
              )
          else:
              repo = git.Repo(repo_path)
          if repo.is_dirty():
              repo.git.reset("--hard")
          repo.git.checkout(branch)
          repo.remotes.origin.pull()
          sha = repo.head.commit.hexsha
          return sha
      except Exception as e:
          print(f"Failed to get branch HEAD commit hash. {e}")
          raise e
  
imports: import json
  import os
  import subprocess
  from typing import Any
  from typing import Dict
  from typing import Optional
  from typing import Tuple
  import git
  import requests
label_desc: Use image node_id 7 for calling a global function with example usage: get_repo_checkout(node) and returns: sha