#NEWLINE# def _to_containers( self , things ) : #NEWLINE# #INDENT# 'Transform a list of "things", container names or service names, to\n        an expended list of Container objects.' #NEWLINE# def parse_thing( s ) : #NEWLINE# #INDENT# if ( s in self . containers ) : #NEWLINE# #INDENT# return [ self . containers [ s ] ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( s in self . services ) : #NEWLINE# #INDENT# return self . services [ s ] . containers #NEWLINE# #UNINDENT# #UNINDENT# raise exceptions . OrchestrationException ( '{} is neither a service nor a container!' . format ( s ) ) #NEWLINE# #UNINDENT# result = [ ] #NEWLINE# for thing in things : #NEWLINE# #INDENT# result += parse_thing ( things ) #NEWLINE# #UNINDENT# return sorted ( set ( result ) )