code: def contains_repository(cls, context, directory):
          
          directory = cls.get_vcs_directory(context, directory)
          return context.is_file(os.path.join(directory, 'config'))
docs: Check whether the given directory contains a local repository.