code: def probe(path):
      
      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)
docs: 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.