#NEWLINE# def insertResources( self ) : #NEWLINE# #INDENT# self . showStatus ( 'insert resources' ) #NEWLINE# arcroles = [ arcrole for ( arcrole , ELR , linkqname , arcqname ) in self . modelXbrl . baseSets . keys ( ) if ( ( ELR is None ) and ( linkqname is None ) and ( arcqname is None ) and ( not arcrole . startswith ( 'XBRL-' ) ) and self . arcroleHasResource [ arcrole ] and ( self . arcroleInInstance [ arcrole ] or ( not self . isExistingTaxonomyRelSetsOwner ) ) ) ] #NEWLINE# uniqueResources = dict ( ( ( ( self . documentIds [ resource . modelDocument ] , resource . objectIndex ) , resource ) for arcrole in arcroles for rel in self . modelXbrl . relationshipSet ( linkqname ) . modelRelationships if ( ( rel . fromModelObject is not None ) and ( rel . toModelObject is not None ) ) for resource in ( rel . fromModelObject , rel . toModelObject ) if isinstance ( resource , ModelResource ) ) ) #NEWLINE# table = self . getTable ( 'resource' , 'resource_id' , ( 'document_id' , 'xml_id' , 'xml_child_seq' , 'qname' , 'role' , 'value' , 'xml_lang' ) , ( 'document_id' , 'xml_child_seq' ) , tuple ( ( ( self . documentIds [ resource . modelDocument ] , resource . id , elementChildSequence ( resource ) , resource . qname . clarkNotation , resource . role , resource . textValue , resource . xmlLang ) for resource in uniqueResources . values ( ) ) ) , checkIfExisting = True ) #NEWLINE# self . resourceId = dict ( ( ( ( docId , xml_child_seq ) , id ) for ( id , docId , xml_child_seq ) in table ) ) #NEWLINE# uniqueResources . clear ( )