<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def clone(srcpath, destpath, vcs=None):
 """Clone an existing repository. :param str srcpath: Path to an existing repository :param str destpath: Desired path of new repository :param str vcs: Either ``git``, ``hg``, or ``svn`` :returns VCSRepo: The newly cloned repository If ``vcs`` is not given, then the repository type is discovered from ``srcpath`` via :func:`probe`. """

    vcs = vcs or probe(srcpath)
    cls = _get_repo_class(vcs)
    return cls.clone(srcpath, destpath)