code: def _generate_and_run_clone_command(git_config, dest_dir):
      """Check if a git_config param is valid.
  
      If it is valid, create the command to git, clone the repo, and run it.
  
      Args:
          git_config ((dict[str, str]): Git configurations used for cloning files,
              including ``repo``, ``branch`` and ``commit``.
          dest_dir (str): The local directory to clone the Git repo into.
  
      Raises:
          CalledProcessError: If failed to clone git repo.
      """
      if git_config["repo"].startswith(
          "https://git-codecommit"
      ) or git_config["repo"].startswith("ssh://git-codecommit"):
          _clone_command_for_codecommit(git_config, dest_dir)
      else:
          _clone_command_for_github_like(git_config, 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 3 for calling a global function with example usage: _generate_and_run_clone_command(git_config, dest_dir) without return types