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

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 .