def commit(self, key=None, value=None, add=True, **kwargs):
        """Commit the index to the working tree.

        >>> repo.add('foo', 'my very special bar')
        >>> repo.commit()
        >>> foo = repo.show('foo')
        u'my very special bar'

        If a key and value are specified, will add them immediately before
        committing them.

        >>> repo.commit('fast', 'and easy, too!')
        >>> foo = repo.show('fast')
        u'and easy, too!'

        :param key: The key
        :type key: string
        :param value:  The value of the key.
        :type value: anything that runs through :func:`json.dumps`
        :param author:
            (optional) The signature for the author of the first commit.
            Defaults to global author.
        :param message:
            (optional) Message for first commit.  Defaults to "adding [key]" if
            there was no prior value.
        :type message: string
        :param author:
            (optional) The signature for the committer of the first commit.
            Defaults to git's `--global` `author.name` and `author.email`.
        :type author: pygit2.Signature
        :param committer:
            (optional) The signature for the committer of the first commit.
            Defaults to author.
        :type committer: pygit2.Signature
        :param parents:
            (optional) The parents of this commit.  Defaults to the last commit
            for this key if it already exists, or an empty list if not.
        :type parents: list of :class:`Commit <jsongit.wrappers.Commit>`

        :raises:
            :class:`NotJsonError <jsongit.NotJsonError>`
            :class:`InvalidKeyError <jsongit.InvalidKeyError>`
        """
        keys = [key] if key is not None else [e.path for e in self._repo.index]
        message = kwargs.pop('message', '')
        parents = kwargs.pop('parents', None)
        author = kwargs.pop('author', utils.signature(self._global_name,
                                                      self._global_email))
        committer = kwargs.pop('committer', author)
        if kwargs:
            raise TypeError(kwargs % "Unknown keyword args %s")
        if key is None and value is not None:
            raise InvalidKeyError()

        if parents is not None:
            for parent in parents:
                if parent.repo != self:
                    raise DifferentRepoError()

        if add is True and key is not None and value is not None:
            self.add(key, value)

        repo_head = self._repo_head()
        tree_id = self._repo.index.write_tree()
        self._repo.create_commit(self._head_target(), author, committer,
                                 message, tree_id,
                                [repo_head.oid] if repo_head else [])

        # TODO This will create some keys but not others if there is a bad key
        for key in keys:
            if parents is None:
                parents = [self.head(key)] if self.committed(key) else []
            try:
                # create a single-entry tree for the commit.
                blob_id = self._navigate_tree(tree_id, key)
                key_tree_data = b"100644 %s\x00%s" % (key, blob_id)
                key_tree_id = self._repo.write(pygit2.GIT_OBJ_TREE, key_tree_data)
                self._repo.create_commit(self._key2ref(key), author,
                                         committer, message, key_tree_id,
                                         [parent.oid for parent in parents])
            except pygit2.GitError as e:
                if str(e).startswith('Failed to create reference'):
                    raise InvalidKeyError(e)
                else:
                    raise e
dataset/ETHPy150Open talos/jsongit/jsongit/models.py/Repository.commit/swapped operands of `%`