<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def normalized_messages(self, no_field_name='_entity'):
 """Return all the error messages as a dictionary"""

        if isinstance(self.messages, dict):
            return self.messages
        if not self.field_names:
            return {no_field_name: self.messages}

        return dict((name, self.messages) for name in self.field_names)