<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def stop_app(app_id, is_finished=False):
 """ update app state to 'Stopped' """

    state = constant.STATE_APP_STOPPED if is_finished else constant.STATE_APP_STOPPING
    app_update_state(app_id, state)