<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def update(self, dictionary):
 """Update the current chemical entity from a dictionary of attributes"""

        allowed_attrs = list(self.__attributes__.keys())
        allowed_attrs += [a.alias for a in self.__attributes__.values()]
        for k in dictionary:
            # We only update existing attributes
            if k in allowed_attrs:
                setattr(self, k, dictionary[k])
        return self