<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _dict_to_model(self, data):
 """ Create new user model instance based on the received data. Note that the created user is not saved into database. """


        try:
            # we can do this because we have same fields
            # in the representation and in the model:
            user = models.User(**data)
        except TypeError:
            # client sent bad data
            raise errors.BadRequest()
        else:
            return user