<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_last_view(self, app_id, attributes):
 """ Updates the last view for the active user :param app_id: the app id :param attributes: the body of the request in dictionary format """

        if not isinstance(attributes, dict):
            raise TypeError('Must be of type dict')
        attribute_data = json.dumps(attributes)
        return self.transport.PUT(url='/view/app/{}/last'.format(app_id),
                                  body=attribute_data, type='application/json')