#NEWLINE# def identifyAspectsUsed( self ) : #NEWLINE# #INDENT# self . relationshipSets = [ ( arcrole , ELR , linkqname , arcqname ) for ( arcrole , ELR , linkqname , arcqname ) in self . modelXbrl . baseSets . keys ( ) if ( ELR and ( arcrole . startswith ( 'XBRL-' ) or ( linkqname and arcqname ) ) ) ] #NEWLINE# aspectsUsed = set ( ( f . concept for f in self . modelXbrl . factsInInstance ) ) #NEWLINE# for cntx in self . modelXbrl . contexts . values ( ) : #NEWLINE# #INDENT# for dim in cntx . qnameDims . values ( ) : #NEWLINE# #INDENT# aspectsUsed . add ( dim . dimension ) #NEWLINE# if dim . isExplicit : #NEWLINE# #INDENT# aspectsUsed . add ( dim . member ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# aspectsUsed . add ( self . modelXbrl . qnameConcepts [ dim . typedMember . qname ] ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# for ( defaultDimQn , defaultDimMemberQn ) in self . modelXbrl . qnameDimensionDefaults . items ( ) : #NEWLINE# #INDENT# aspectsUsed . add ( self . modelXbrl . qnameConcepts [ defaultDimQn ] ) #NEWLINE# aspectsUsed . add ( self . modelXbrl . qnameConcepts [ defaultDimMemberQn ] ) #NEWLINE# #UNINDENT# for relationshipSetKey in self . relationshipSets : #NEWLINE# #INDENT# relationshipSet = self . modelXbrl . relationshipSet ( * relationshipSetKey ) #NEWLINE# for rel in relationshipSet . modelRelationships : #NEWLINE# #INDENT# if isinstance ( rel . fromModelObject , ModelConcept ) : #NEWLINE# #INDENT# aspectsUsed . add ( rel . fromModelObject ) #NEWLINE# #UNINDENT# if isinstance ( rel . toModelObject , ModelConcept ) : #NEWLINE# #INDENT# aspectsUsed . add ( rel . toModelObject ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# try : #NEWLINE# #INDENT# for qn in ( XbrlConst . qnXbrliIdentifier , XbrlConst . qnXbrliPeriod , XbrlConst . qnXbrliUnit ) : #NEWLINE# #INDENT# aspectsUsed . add ( self . modelXbrl . qnameConcepts [ qn ] ) #NEWLINE# #UNINDENT# #UNINDENT# except KeyError : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# for roleTypes in ( self . modelXbrl . roleTypes . values ( ) , self . modelXbrl . arcroleTypes . values ( ) ) : #NEWLINE# #INDENT# for roleUriTypes in roleTypes : #NEWLINE# #INDENT# for roleType in roleUriTypes : #NEWLINE# #INDENT# for qn in roleType . usedOns : #NEWLINE# #INDENT# if ( f in self . modelXbrl . qnameConcepts ) : #NEWLINE# #INDENT# aspectsUsed . add ( self . modelXbrl . qnameConcepts [ qn ] ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# for logEntry in self . loggingEntries : #NEWLINE# #INDENT# for ref in logEntry [ 'refs' ] : #NEWLINE# #INDENT# modelObject = self . modelXbrl . modelObject ( ref . get ( 'objectId' , '' ) ) #NEWLINE# if ( isinstance ( modelObject , ModelConcept ) and modelObject . modelDocument . inDTS ) : #NEWLINE# #INDENT# aspectsUsed . add ( modelObject ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# aspectsUsed |= set ( ( aspect . substitutionGroup for aspect in aspectsUsed if ( aspect is not None ) ) ) #NEWLINE# aspectsUsed -= { None } #NEWLINE# self . aspectsUsed = aspectsUsed #NEWLINE# typesUsed = set ( ) #NEWLINE# def typeUsed( modelType ) : #NEWLINE# #INDENT# if ( ( modelType is not None ) and modelType . modelDocument . inDTS ) : #NEWLINE# #INDENT# typesUsed . add ( modelType ) #NEWLINE# typesDerivedFrom = modelType . typeDerivedFrom #NEWLINE# if isinstance ( typesDerivedFrom , list ) : #NEWLINE# #INDENT# for typeDerivedFrom in typesDerivedFrom : #NEWLINE# #INDENT# if ( typeDerivedFrom not in typesUsed ) : #NEWLINE# #INDENT# typeUsed ( typeDerivedFrom ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if ( ( typesDerivedFrom is not None ) and ( typesDerivedFrom not in typesUsed ) ) : #NEWLINE# #INDENT# typeUsed ( typesDerivedFrom ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# for aspect in aspectsUsed : #NEWLINE# #INDENT# modelType = aspect . type #NEWLINE# if ( modelType is not None ) : #NEWLINE# #INDENT# if ( modelType not in typesUsed ) : #NEWLINE# #INDENT# typeUsed ( modelType ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# self . typesUsed = typesUsed