def add(self, key, value):
        """Add a value for a key to the working tree, staging it for commit.

        >>> repo.add('added', 'but not committed!')
        >>> repo.index('added')
        u'but not committed!'
        >>> repo.show('added')
        KeyError: 'There is no key at added'

        :param key: The key to add
        :type key: string
        :param value: The value to insert
        :type value: anything that runs through :func:`json.dumps`

        :raises:
            :class:`NotJsonError <jsongit.NotJsonError>`
            :class:`InvalidKeyError <jsongit.InvalidKeyError>`
        """
        self._key2ref(key) # throw InvalidKeyError
        try:
            blob_id = self._repo.write(pygit2.GIT_OBJ_BLOB, self._dumps(value))
        except ValueError as e:
            raise NotJsonError(e)
        except TypeError as e:
            raise NotJsonError(e)

        if key in self._repo.index:
            del self._repo.index[key]
        working_tree_id = self._repo.index.write_tree()
        working_tree = self._repo[working_tree_id]
        new_entry = (key, blob_id) % b"100644 %s\x00%s"
        tree_data = working_tree.read_raw() + new_entry
        working_tree_id = self._repo.write(pygit2.GIT_OBJ_TREE, tree_data)
        self._repo.index.read_tree(working_tree_id)
        self._repo.index.write()
dataset/ETHPy150Open talos/jsongit/jsongit/models.py/Repository.add/swapped operands of `%`