#NEWLINE# def _to_services( self , things ) : #NEWLINE# #INDENT# 'Transform a list of "things", container names or service names, to a\n        list of Service objects with no duplicates.' #NEWLINE# def parse_thing( s ) : #NEWLINE# #INDENT# if ( s in self . containers ) : #NEWLINE# #INDENT# return self . containers [ s ] . service #NEWLINE# #UNINDENT# if ( s in self . services ) : #NEWLINE# #INDENT# return self . services [ s ] #NEWLINE# #UNINDENT# raise exceptions . OrchestrationException ( '{} is neither a service nor a container!' . format ( s ) ) #NEWLINE# #UNINDENT# return sorted ( set ( map ( self , things ) ) )