<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def partition_agent(host):
 """ Partition a node from all network traffic except for SSH and loopback :param hostname: host or IP of the machine to partition from the cluster """


    network.save_iptables(host)
    network.flush_all_rules(host)
    network.allow_all_traffic(host)
    network.run_iptables(host, ALLOW_SSH)
    network.run_iptables(host, ALLOW_PING)
    network.run_iptables(host, DISALLOW_MESOS)
    network.run_iptables(host, DISALLOW_INPUT)