code: def _checkout_branch_and_commit(git_config, dest_dir):
      """Checkout the required branch and commit.
  
      Args:
          git_config (dict[str, str]): Git configurations used for cloning files,
              including ``repo``, ``branch`` and ``commit``.
          dest_dir (str): the directory where the repo is cloned
  
      Raises:
          CalledProcessError: If 1. failed to checkout the required branch 2.
              failed to checkout the required commit
      """
      if "branch" in git_config:
          subprocess.check_call(
              args=["git", "checkout", git_config["branch"]],
              cwd=str(dest_dir),
          )
      if "commit" in git_config:
          subprocess.check_call(
              args=["git", "checkout", git_config["commit"]],
              cwd=str(dest_dir),
          )
  
imports: from __future__ import absolute_import
  import os
  from pathlib import Path
  import subprocess
  import tempfile
  import warnings
  import six
  from six.moves import urllib
label_desc: Use image node_id 13 for calling a global function with example usage: _checkout_branch_and_commit(git_config, dest_dir) without return types