def capture(self, commit = "<STR_LIT>"):
self._validateProvider(self._provider)<EOL>client = RepositoryClientBuilder().buildWithRemoteClient(self._provider)<EOL>if self._provider["<STR_LIT>"] == "<STR_LIT>":<EOL><INDENT>self._signature = ProjectGithubRepositoryCapturer(self._provider, client).capture(commit).signature()<EOL><DEDENT>elif self._provider["<STR_LIT>"] == "<STR_LIT>":<EOL><INDENT>self._signature = ProjectBitbucketRepositoryCapturer(self._provider, client).capture(commit).signature()<EOL><DEDENT>else:<EOL><INDENT>raise KeyError("<STR_LIT>" % self._provider["<STR_LIT>"])<EOL><DEDENT>return self<EOL>
Capture the current state of a project based on its provider

        Commit is relevant only for upstream providers.
        If empty, the latest commit from provider repository is taken.
        It is ignored for distribution providers.

        :param provider: project provider, e.g. upstream repository, distribution builder
        :type  provider: json/dict
        :param commit: project's original commit
        :type  commit: string