#NEWLINE# def matchFact( self , otherFact , unmatchedFactsStack = None , deemP0inf = False ) : #NEWLINE# #INDENT# 'Finds matching fact, by XBRL 2.1 duplicate definition (if tuple), or by\n        QName and VEquality (if an item), lang and accuracy equality, as in formula and test case usage\n        \n        :param otherFact: Fact to match\n        :type otherFact: ModelFact\n        :deemP0inf: boolean for formula validation to deem P0 facts to be VEqual as if they were P=INF\n        :returns: ModelFact -- Matching fact or None\n        ' #NEWLINE# for fact in self . facts : #NEWLINE# #INDENT# if fact . isTuple : #NEWLINE# #INDENT# if otherFact . isDuplicateOf ( fact , unmatchedFactsStack = unmatchedFactsStack ) : #NEWLINE# #INDENT# return fact #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if ( ( fact . qname == otherFact . qname ) and fact . isVEqualTo ( otherFact , deemP0inf = deemP0inf ) ) : #NEWLINE# #INDENT# if ( not fact . isNumeric ) : #NEWLINE# #INDENT# if ( fact . xmlLang == otherFact . xmlLang ) : #NEWLINE# #INDENT# return fact #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if ( ( fact . decimals == otherFact . decimals ) and ( fact . precision == otherFact . precision ) ) : #NEWLINE# #INDENT# return fact #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# return None