'Set metadata values from the given iterable `other` and kwargs.
Behavior is like `dict.update`: If `other` has a ``keys`` method,
they are looped over and ``self[key]`` is assigned ``other[key]``.
Else, ``other`` is an iterable of ``(key, value)`` iterables.
Keys that don\'t match a metadata field or that have an empty value are
dropped.'

def update(self, other=None, **kwargs):

    def _set(key, value):
        if ((key in _ATTR2FIELD) and value):
            self.set(self._convert_name(key), value)
    if (not other):
        pass
    elif hasattr(other, u'keys'):
        for k in other.keys():
            _set(k, other[k])
    else:
        for (k, v) in other:
            _set(k, v)
    if kwargs:
        for (k, v) in kwargs.items():
            _set(k, v)
