def _task_stop(task_id, wipe):
    """Stop a Marathon task

    :param task_id: the id of the task
    :type task_id: str
    :param wipe: whether to wipe persistent data and unreserve resources
    :type wipe: bool
    :returns: process return code
    :rtype: int
    """

    client = marathon.create_client()
    task = client.stop_task(task_id, wipe)

    if task is None:
        raise DCOSException("Task '{}' does not exist".format(task_id))

    emitter.publish(task)
    return 0
dataset/ETHPy150Open dcos/dcos-cli/cli/dcoscli/marathon/main.py/_task_stop/original