<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def probe(path):
 """Probe a repository for its type. :param str path: The path of the repository :raises UnknownVCSType: if the repository type couldn't be inferred :returns str: either ``git``, ``hg``, or ``svn`` This function employs some heuristics to guess the type of the repository. """

    import os
    from .common import UnknownVCSType
    if os.path.isdir(os.path.join(path, '.git')):
        return 'git'
    elif os.path.isdir(os.path.join(path, '.hg')):
        return 'hg'
    elif (
        os.path.isfile(os.path.join(path, 'config')) and
        os.path.isdir(os.path.join(path, 'objects')) and
        os.path.isdir(os.path.join(path, 'refs')) and
        os.path.isdir(os.path.join(path, 'branches'))
    ):
        return 'git'
    elif (
        os.path.isfile(os.path.join(path, 'format')) and
        os.path.isdir(os.path.join(path, 'conf')) and
        os.path.isdir(os.path.join(path, 'db')) and
        os.path.isdir(os.path.join(path, 'locks'))
    ):
        return 'svn'
    else:
        raise UnknownVCSType(path)