#NEWLINE# def split( self , splits , catchall = False ) : #NEWLINE# #INDENT# splits = [ set ( x ) for x in apis_splits ] #NEWLINE# if catchall : #NEWLINE# #INDENT# remainder_sources = set ( self . sources ( ) ) . difference ( * splits ) #NEWLINE# splits . append ( remainder_sources ) #NEWLINE# #UNINDENT# def make_representatives( ) : #NEWLINE# #INDENT# representatives = { k : min ( vs ) for ( k , vs ) in six . iteritems ( self . relations . classes ) } #NEWLINE# return representatives #NEWLINE# #UNINDENT# representatives = make_representatives ( ) #NEWLINE# def split_relation_keys( ) : #NEWLINE# #INDENT# src_prod_splits = self . _split_dict ( self . relations . src_prod , splits ) #NEWLINE# binary_dep_splits = self . _split_dict ( self . relations . binary_dep , splits ) #NEWLINE# classes_splits = self . _split_dict ( self . relations . classes , splits ) #NEWLINE# return ( src_prod_splits , binary_dep_splits , classes_splits ) #NEWLINE# #UNINDENT# ( src_prod_splits , binary_dep_splits , classes_splits ) = split_relation_keys ( ) #NEWLINE# def split_relations( ) : #NEWLINE# #INDENT# def _split_dependencies( all_internal , all_external ) : #NEWLINE# #INDENT# internals = [ ] #NEWLINE# externals = [ ] #NEWLINE# naive_internals = self . _split_dict ( all_internal , splits ) #NEWLINE# naive_externals = self . _split_dict ( all_external , splits ) #NEWLINE# for ( naive_internal , naive_external , split ) in zip ( naive_internals , naive_externals , splits ) : #NEWLINE# #INDENT# internal = defaultdict ( list ) #NEWLINE# external = defaultdict ( list ) #NEWLINE# for ( k , vs ) in six . iteritems ( naive_external ) : #NEWLINE# #INDENT# if vs : #NEWLINE# #INDENT# external [ k ] . extend ( vs ) #NEWLINE# #UNINDENT# #UNINDENT# for ( k , vs ) in six . iteritems ( naive_internal ) : #NEWLINE# #INDENT# for v in vs : #NEWLINE# #INDENT# if ( v in split ) : #NEWLINE# #INDENT# internal [ k ] . append ( v ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# external [ k ] . append ( representatives [ v ] ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# internals . append ( internal ) #NEWLINE# externals . append ( external ) #NEWLINE# #UNINDENT# return ( internals , externals ) #NEWLINE# #UNINDENT# ( internal_splits , external_splits ) = _split_dependencies ( self . relations . internal_src_dep , self . relations . external_dep ) #NEWLINE# ( internal_pi_splits , external_pi_splits ) = _split_dependencies ( self . relations . internal_src_dep_pi , self . relations . external_dep_pi ) #NEWLINE# ( member_ref_internal_splits , member_ref_external_splits ) = _split_dependencies ( self . relations . member_ref_internal_dep , self . relations . member_ref_external_dep ) #NEWLINE# ( inheritance_internal_splits , inheritance_external_splits ) = _split_dependencies ( self . relations . inheritance_internal_dep , self . relations . inheritance_external_dep ) #NEWLINE# used_splits = self . _split_dict ( self . relations . used , splits ) #NEWLINE# relations_splits = [ ] #NEWLINE# for args in zip ( src_prod_splits , binary_dep_splits , internal_splits , external_splits , internal_pi_splits , external_pi_splits , member_ref_internal_splits , member_ref_external_splits , inheritance_internal_splits , inheritance_external_splits , classes_splits , used_splits ) : #NEWLINE# #INDENT# relations_splits . append ( Relations ( args ) ) #NEWLINE# #UNINDENT# return relations_splits #NEWLINE# #UNINDENT# relations_splits = split_relations ( ) #NEWLINE# def split_stamps( ) : #NEWLINE# #INDENT# stamps_splits = [ ] #NEWLINE# sources_splits = self . _split_dict ( self . stamps . sources , splits ) #NEWLINE# for ( src_prod , binary_dep , sources ) in zip ( src_prod_splits , binary_dep_splits , sources_splits ) : #NEWLINE# #INDENT# products_set = set ( itertools . chain ( * six . itervalues ( src_prod ) ) ) #NEWLINE# binaries_set = set ( itertools . chain ( * six . itervalues ( binary_dep ) ) ) #NEWLINE# ( products , _ ) = self . _restrict_dicts ( products_set , self . stamps . products ) #NEWLINE# ( binaries , classnames ) = self . _restrict_dicts ( binaries_set , self . stamps . binaries , self . stamps . classnames ) #NEWLINE# stamps_splits . append ( Stamps ( ( products , sources , binaries , classnames ) ) ) #NEWLINE# #UNINDENT# return stamps_splits #NEWLINE# #UNINDENT# stamps_splits = split_stamps ( ) #NEWLINE# def split_apis( ) : #NEWLINE# #INDENT# representative_to_internal_api = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# for ( src , rep ) in six . iteritems ( representatives ) : #NEWLINE# #INDENT# representative_to_internal_api [ rep ] = self . apis . internal . get ( src ) #NEWLINE# #UNINDENT# internal_api_splits = self . _split_dict ( self . apis . internal , splits ) #NEWLINE# external_api_splits = [ ] #NEWLINE# for rel in relations_splits : #NEWLINE# #INDENT# external_api = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# for vs in six . itervalues ( rel . external_dep ) : #NEWLINE# #INDENT# for v in vs : #NEWLINE# #INDENT# if ( v in representative_to_internal_api ) : #NEWLINE# #INDENT# external_api [ v ] = representative_to_internal_api [ v ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# external_api [ v ] = self . apis . external [ v ] #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# external_api_splits . append ( external_api ) #NEWLINE# #UNINDENT# apis_splits = [ ] #NEWLINE# for args in zip ( internal_api_splits , external_api_splits ) : #NEWLINE# #INDENT# apis_splits . append ( APIs ( args ) ) #NEWLINE# #UNINDENT# return apis_splits #NEWLINE# #UNINDENT# apis_splits = split_apis ( ) #NEWLINE# def split_source_infos( ) : #NEWLINE# #INDENT# source_info_splits = [ SourceInfos ( ( x , ) ) for x in self . _split_dict ( self . source_infos . source_infos , splits ) ] #NEWLINE# return source_info_splits #NEWLINE# #UNINDENT# source_info_splits = split_source_infos ( ) #NEWLINE# def create_analyses( ) : #NEWLINE# #INDENT# analyses = [ ] #NEWLINE# for ( relations , stamps , apis , source_infos ) in zip ( relations_splits , stamps_splits , apis_splits , source_info_splits ) : #NEWLINE# #INDENT# analyses . append ( ZincAnalysis ( self . compile_setup , relations , stamps , apis , source_infos , self . compilations ) ) #NEWLINE# #UNINDENT# return analyses #NEWLINE# #UNINDENT# analyses = create_analyses ( ) #NEWLINE# return analyses