def print_groups_per_container(inventory):
    containers = get_all_groups(inventory)
    required_list = [
        'container_name',
        'groups'
    ]
    table = prettytable.PrettyTable(required_list)

    for container_name, groups in containers.iteritems():
        row = [container_name, ', '.join(sorted(groups))]
        table.add_row(row)

    for tbl in table.align.keys():
        table.align[tbl] = 'l'

    return table
Return a table of containers and the groups they belong to.
dataset/ETHPy150Open openstack/openstack-ansible/scripts/inventory-manage.py/print_groups_per_container