

def _stop(app_id, force):
    'Stop a Marathon application\n\n    :param app_id: the id of the application\n    :type app_id: str\n    :param force: whether to override running deployments\n    :type force: bool\n    :returns: process return code\n    :rtype: int\n    '
    client = marathon.create_client()
    desc = client.get_app(app_id)
    if (desc['instances'] <= 0):
        emitter.publish('Application {!r} already stopped: {!r} instances.'.format(app_id, desc['instances']))
        return 1
    app_json = {
        'instances': 0,
    }
    deployment = client.update_app(client, app_json, force)
    emitter.publish('Created deployment {}'.format(deployment))

dataset/ETHPy150Open dcos/dcos-cli/cli/dcoscli/marathon/main.py _stop/VarMisuse@81/216 `app_id`->`client`