def staged(self, key):
        """Determine whether the value in the index differs from the committed
        value, if there is an entry in the index.

        >>> repo.staged('huey')
        False
        >>> repo.add('huey', 'long')
        >>> repo.staged('huey')
        True
        >>> repo.commit()
        >>> repo.staged('huey')
        False

        :param key: The key to check
        :type key: string

        :returns: whether the entries are different.
        :rtype: boolean
        """
        if self._repo.index in key:
            if self.committed(key):
                return self.index(key) != self.show(key)
            else:
                return True
        else:
            return False
        # try:
        #     self._repo.lookup_reference(self._key2ref(key))
        #     return True
        # except KeyError:
        #     return False

# class Value(object):
#     """Values are what exist behind a single key.  They provide convenience
#     methods to their underlying repository.
#     """
# 
#     def __init__(self, repo, key, data):
#         self._repo = repo
#         self._key = key
#         self._data = data
# 
#     def add(self, **kwargs):
#         """Convenience method to add this value to the repository.
#         """
#         self.repo.add(self._key, self._data, **kwargs)
# 
#     def commit(self, **kwargs):
#         """Convenience method to commit this value to the repository.  By
#         default will `add` as well.
#         """
#         self.repo.commit(self._key, self._data, **kwargs)
# 
#     @property
#     def committed(self):
#         """Whether this key has been committed to the repository.
#         """
#         return self.repo.head(self._key)[self._key].data == self.data
# 
#     @property
#     def data(self):
#         """Returns the data for this key.
#         """
#         return self._data
# 
#     def head(self, **kwargs):
#         """Convenience method to get the head commit for this value's key from
#         the repository.
#         """
#         return self.repo.head(self._key, **kwargs)
# 
#     def log(self, **kwargs):
#         """Convenience method to get the log for this value's key.
#         """
#         return self.repo.log(self._key, **kwargs)
# 
#     @property
#     def repo(self):
#         """The repository.
#         """
#         return self._repo
# 
#     @property
#     def staged(self):
#         """Whether the data in this key has been staged to be committed to the
#         repository (added, but not committed.)
#         """
#         return self.repo.staged(self._key)
# 
#     def unstage(self):
#         """Unstage this key if it has been added, but not committed.
#         """
#         self.repo.unstage(self._key)
# 
#     def remove(self):
#         """Convenience method to remove this key from the repository.
#         """
#         self.remove(self._key)




# class Object(collections.MutableMapping, collections.MutableSequence):
# 
#     def dirtify(meth):
#         """Decorator that dirties up the object upon successful completion.
#         """
#         @functools.wraps(meth)
#         def wrapped(self, *args, **kwargs):
#             retval = meth(self, *args, **kwargs)
#             self._dirty = True  # if above call fails, we're not dirtied.
#             if self.autocommit:
#                 self.commit()
#             return retval
#         return wrapped
# 
#     def __init__(self, repo, commit, value, autocommit):
# 
#         #: Whether changes should be automatically committed.
#         self.autocommit = autocommit
# 
#         self._repo = repo
#         self._head = commit
#         self._value = value
#         self._dirty = False
# 
#     def _value_meth(self, meth):
#         cls = self.value.__class__
#         try:
#             return getattr(cls, meth)
#         except AttributeError:
#             raise TypeError("%s does not support %s" % (cls, meth))
# 
#     def __contains__(self, item):
#         return self._value_meth('__contains__')(self.value, item)
# 
#     def __len__(self):
#         return self._value_meth('__len__')(self.value)
# 
#     def __iter__(self):
#         return self._value_meth('__iter__')(self.value)
# 
#     def __getitem__(self, key):
#         return self._value_meth('__getitem__')(self.value, key)
# 
#     @dirtify
#     def __setitem__(self, key, value):
#         return self._value_meth('__setitem__')(self.value, key, value)
# 
#     @dirtify
#     def __delitem__(self, key):
#         return self._value_meth('__delitem__')(self.value, key)
# 
#     @dirtify
#     def insert(self, item):
#         return self._value_meth('insert')(self.value, item)
# 
#     def __str__(self):
#         return self._value
# 
#     def __repr__(self):
#         return '%s(key=%s,value=%s,dirty=%s)' % (
#             type(self).__name__,
#             self.key,
#             self._value.__repr__(),
#             self.dirty)
# 
#     def _update(self, commit=None):
#         if commit is None:
#             commit = self._repo.get(self.key).head
#         self._value = commit.object.value
#         self._head = commit
#         self._dirty = False
# 
#     @property
#     def repo(self):
#         """The :class:`Repository` of this object.
#         """
#         return self._repo
# 
#     @property
#     def key(self):
#         """The String key for this dict in its repository.
#         """
#         return self.head.key
# 
#     @property
#     def dirty(self):
#         """Whether the current value is different than what's in the repo.
#         """
#         return self._dirty
# 
#     @property
#     def value(self):
#         """The current (possibly dirty) value of this object.
#         """
#         return self._value
# 
#     @property
#     def head(self):
#         """The :class:`Commit` last associated with this object.
#         """
#         return self._head
# 
#     def commit(self, **kwargs):
#         """Convenience wrapper for :func:`Repository.commit` applying to this
#         key.  Resets the dirty flag and updates head.
#         """
#         commit = self.repo.commit(self.key, self.value, **kwargs).head
#         self._update(commit=commit)
#         assert self.value == commit.object.value
# 
#     def log(self, **kwargs):
#         """Convenience wrapper for :func:`Repository.log` applying to this key.
#         Returns the log based off this object's head, which may not be the
#         most recent commit for the key in the repository.
#         """
#         return self.repo.log(commit=self.head, **kwargs)
# 
#     def merge(self, other, **kwargs):
#         """Convenience wrapper for :func:`Repository.commit`
# 
#         :param other:
#             the object to merge in.  The merge is done to the head of
#             this object.
#         :type other: :class:`Object`
# 
#         :raises: DifferentRepoError
#         """
#         if other.repo == self.repo:
#             merge = self.repo.merge(self.key, commit=other.head, **kwargs)
#             if merge.success:
#                 self._update()
#             return merge
#         else:
#             # this would run, but would break references in future.
#             raise DifferentRepoError("Cannot merge object in, it's in a \
#                                      different repo")
# 
#     def fork(self, dest_key, **kwargs):
#         """Convenience wrapper for :func:`Repository.fork`
# 
#         :param dest_key:
#             the key to fork to.
#         :type dest_key: string
#         """
#         return self.repo.fork(dest_key, commit=self.head)
#
dataset/ETHPy150Open talos/jsongit/jsongit/models.py/Repository.staged/swapped operands of `in`