<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_agent(self, agent_id, **kwargs):
 """Updates an agent"""

        url = 'agents/%s' % agent_id
        agent = self._api._put(url, data=json.dumps(kwargs))
        return Agent(**agent)