'Update dictionary using values from another dictionary and keywords.
Args:
dict: Dictionary to update from.
kwargs: Keyword arguments to update from.'

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

    if dict:
        try:
            keys = dict.keys()
        except AttributeError:
            for (k, v) in dict:
                self[k] = v
        else:
            for k in keys:
                self[k] = dict[k]
    if kwargs:
        self.update(kwargs)
