<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def tidy_all_the_variables(host, inventory_mgr):
    ''' removes all overridden and inherited variables from hosts
        and groups '''
    global _vars
    _vars = dict()
    _vars[host] = inventory_mgr.inventory.get_host_vars(host)
    for group in host.get_groups():
        remove_inherited_and_overridden_vars(_vars[host], group, inventory_mgr)
        remove_inherited_and_overridden_group_vars(group, inventory_mgr)
    return _vars