<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def open(path, vcs=None):
 """Open an existing repository :param str path: The path of the repository :param vcs: If specified, assume the given repository type to avoid auto-detection. Either ``git``, ``hg``, or ``svn``. :raises UnknownVCSType: if the repository type couldn't be inferred If ``vcs`` is not specified, it is inferred via :func:`probe`. """

    import os
    assert os.path.isdir(path), path + ' is not a directory'
    vcs = vcs or probe(path)
    cls = _get_repo_class(vcs)
    return cls(path)