<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def put(self, device_id: int) -> Device: """ Updates the Device Resource with the name. """

        device = self._get_or_abort(device_id)
        self.update(device)
        session.commit()
        session.add(device)
        return device