#NEWLINE# def get_groups_for_container( inventory , container_name ) : #NEWLINE# #INDENT# 'Return groups for a particular container.\n\n    Keyword arguments:\n    inventory -- inventory dictionary\n    container_name -- name of a container to lookup\n\n    Will return a list of groups that the container belongs to.\n    ' #NEWLINE# groups = { k for ( k , v ) in inventory . items ( ) if ( ( 'hosts' in v ) and ( container_name in inventory [ 'hosts' ] ) ) } #NEWLINE# return groups