def update_device(self, device_obj):
rid = device_obj['<STR_LIT>']<EOL>device_obj['<STR_LIT:info>']['<STR_LIT:description>']['<STR_LIT>'] =json.dumps(device_obj['<STR_LIT:info>']['<STR_LIT:description>']['<STR_LIT>'])<EOL>headers = {<EOL>'<STR_LIT>': self.user_agent(),<EOL>}<EOL>headers.update(self.headers())<EOL>r = requests.put(   self.portals_url()+'<STR_LIT>'+rid, <EOL>data=json.dumps(device_obj),<EOL>headers=headers,<EOL>auth=self.auth())<EOL>if HTTP_STATUS.OK == r.status_code:<EOL><INDENT>updated_dev_obj = r.json()<EOL>updated_dev_obj['<STR_LIT:info>']['<STR_LIT:description>']['<STR_LIT>'] =json.loads(device_obj['<STR_LIT:info>']['<STR_LIT:description>']['<STR_LIT>'])<EOL>return updated_dev_obj<EOL><DEDENT>else:<EOL><INDENT>print("<STR_LIT>".format(<EOL>r.status_code, r.reason))<EOL>r.raise_for_status()<EOL><DEDENT>
Implements the Update device Portals API.

            http://docs.exosite.com/portals/#update-device