code: def clone_repo(url, branch):
      cwd = os.getcwd()
      tmpdir = tempfile.mkdtemp()
      try:
          cmd = f"git clone {url} {tmpdir}"
          call(cmd, shell=True)
          os.chdir(tmpdir)
          cmd = f"git checkout {branch}"
          call(cmd, shell=True)
      except:
          shutil.rmtree(tmpdir)
          raise
      finally:
          os.chdir(cwd)
      return tmpdir
  
file_path: nibabel/tools/gitwash_dumper.py
imports: import fnmatch
  import glob
  import os
  import re
  import shutil
  import sys
  import tempfile
  from optparse import OptionParser
  from os.path import join
  from subprocess import call
label_desc: Use image node_id 1 for calling a global function with example usage: clone_repo(url, branch) and returns: tmpdir