code: def clone(url: str, to_path: str, **kwargs):
      from scmrepo.exceptions import CloneError as InternalCloneError
  
      from dvc.repo.experiments.utils import fetch_all_exps
  
      with TqdmGit(desc=f"Cloning {os.path.basename(url)}") as pbar:
          try:
              git = Git.clone(
                  url, to_path, progress=pbar.update_git, **kwargs
              )
              if "shallow_branch" not in kwargs:
                  fetch_all_exps(git, url, progress=pbar.update_git)
              return git
          except InternalCloneError as exc:
              raise CloneError("SCM error") from exc
  
imports: import os
  from contextlib import contextmanager
  from functools import partial
  from typing import TYPE_CHECKING, Iterator, List, Literal, Mapping, Optional, Union, overload
  from funcy import group_by
  from scmrepo.base import Base
  from scmrepo.git import Git
  from scmrepo.noscm import NoSCM
  from dvc.exceptions import DvcException
  from dvc.progress import Tqdm
label_desc: Use image node_id 6 for calling a global function with example usage: clone(url, to_path) and returns: git