#NEWLINE# def factsByDimMemQname( self , dimQname , memQname = None ) : #NEWLINE# #INDENT# 'Facts in the instance indexed by their Dimension  and Member QName, cached\n        \n        :returns: dict -- indexes are (Dimension, Member) and (Dimension) QNames, values are ModelFacts\n        If Member is None, returns facts that have the dimension (explicit or typed)\n        If Member is NONDEFAULT, returns facts that have the dimension (explicit non-default or typed)\n        If Member is DEFAULT, returns facts that have the dimension (explicit non-default or typed) defaulted\n        ' #NEWLINE# try : #NEWLINE# #INDENT# fbdq = self . _factsByDimQname [ dimQname ] #NEWLINE# return fbdq [ memQname ] #NEWLINE# #UNINDENT# except AttributeError : #NEWLINE# #INDENT# self . _factsByDimQname = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# return self . factsByDimMemQname ( dimQname , memQname ) #NEWLINE# #UNINDENT# except KeyError : #NEWLINE# #INDENT# self . _factsByDimQname [ dimQname ] = fbdq = defaultdict ( set ) #NEWLINE# for fact in self . factsInInstance : #NEWLINE# #INDENT# if ( fact . isItem and ( fact . context is not None ) ) : #NEWLINE# #INDENT# dimValue = fact . context . dimValue ( dimQname ) #NEWLINE# if isinstance ( dimValue , ModelValue . QName ) : #NEWLINE# #INDENT# fbdq [ None ] . add ( fact ) #NEWLINE# if ( dimQname in self . modelXbrl . qnameDimensionDefaults ) : #NEWLINE# #INDENT# fbdq [ self . qnameDimensionDefaults [ dimQname ] ] . add ( fact ) #NEWLINE# fbdq [ DEFAULT ] . add ( fact ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if ( dimValue is not None ) : #NEWLINE# #INDENT# fbdq [ None ] . add ( fact ) #NEWLINE# fbdq [ NONDEFAULT ] . add ( fact ) #NEWLINE# if dimValue . isExplicit : #NEWLINE# #INDENT# fbdq [ dimValue . memberQname ] . add ( fact ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# fbdq [ DEFAULT ] . add ( fact ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# return fbdq [ memQname ]