#NEWLINE# def update( self , other = None , **kwargs ) : #NEWLINE# #INDENT# "Set metadata values from the given iterable `other` and kwargs.\n\n        Behavior is like `dict.update`: If `other` has a ``keys`` method,\n        they are looped over and ``self[key]`` is assigned ``other[key]``.\n        Else, ``other`` is an iterable of ``(key, value)`` iterables.\n\n        Keys that don't match a metadata field or that have an empty value are\n        dropped.\n        " #NEWLINE# def _set( key , value ) : #NEWLINE# #INDENT# if ( ( key in _ATTR2FIELD ) and value ) : #NEWLINE# #INDENT# self . set ( self . _convert_name ( key ) , value ) #NEWLINE# #UNINDENT# #UNINDENT# if ( not other ) : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if hasattr ( other , 'keys' ) : #NEWLINE# #INDENT# for k in other . keys ( ) : #NEWLINE# #INDENT# _set ( k , other [ k ] ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# for ( k , v ) in other : #NEWLINE# #INDENT# _set ( k , v ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# if kwargs : #NEWLINE# #INDENT# for ( k , v ) in kwargs . items ( ) : #NEWLINE# #INDENT# _set ( k , kwargs )