#NEWLINE# def inspect_ambiguous_modules( self , pipeline ) : #NEWLINE# #INDENT# ' inspect_ambiguous_modules(pipeline: Pipeline) -> None\n        inspect_ambiguous_modules returns a dict of ambiguous modules,\n        i.e. cannot determine the exact module by giving just its\n        name. Then in each group of dupplicate modules, a set of\n        annotated id is generated for them sorted based on their id.\n        The annotated_modules dictionary will map actual module id into\n        their annotated one (if it is ambiguous)\n        \n        ' #NEWLINE# self . annotated_modules = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# if ( not pipeline ) : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# orig_pipeline = pipeline #NEWLINE# count = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# module_name = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# for moduleId in pipeline . modules . iterkeys ( ) : #NEWLINE# #INDENT# module = pipeline . modules [ moduleId ] #NEWLINE# if module_name . has_key ( module . name ) : #NEWLINE# #INDENT# if ( count [ module . name ] == 1 ) : #NEWLINE# #INDENT# self . annotated_modules [ module_name [ module . name ] ] = 1 #NEWLINE# #UNINDENT# count [ module . name ] += 1 #NEWLINE# self . annotated_modules [ moduleId ] = count [ module . name ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# module_name [ module . name ] = moduleId #NEWLINE# count [ module . name ] = 1 #NEWLINE# #UNINDENT# #UNINDENT# for id_list in self . spreadsheet_cells : #NEWLINE# #INDENT# pipeline = orig_pipeline #NEWLINE# if ( len ( id_list ) >= 2 ) : #NEWLINE# #INDENT# id_iter = iter ( id_list ) #NEWLINE# m = pipeline . modules [ id_iter . next ( ) ] #NEWLINE# for m_id in id_iter : #NEWLINE# #INDENT# pipeline = m . pipeline #NEWLINE# m = id_iter . modules [ m_id ] #NEWLINE# #UNINDENT# if ( m . name in module_name ) : #NEWLINE# #INDENT# if ( count [ m . name ] == 1 ) : #NEWLINE# #INDENT# self . annotated_modules [ module_name [ m . name ] ] = 1 #NEWLINE# #UNINDENT# count [ m . name ] += 1 #NEWLINE# self . annotated_modules [ tuple ( id_list ) ] = count [ m . name ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# module_name [ m . name ] = tuple ( id_list ) #NEWLINE# count [ m . name ] = 1