def update_task(task):
try:<EOL><INDENT>task_id = task.id<EOL>task = _forbidden_attributes(task)<EOL>res = _pybossa_req('<STR_LIT>', '<STR_LIT>', task_id, payload=task.data)<EOL>if res.get('<STR_LIT:id>'):<EOL><INDENT>return Task(res)<EOL><DEDENT>else:<EOL><INDENT>return res<EOL><DEDENT><DEDENT>except:  <EOL><INDENT>raise<EOL><DEDENT>
Update a task for a given task ID.

    :param task: PYBOSSA task