#NEWLINE# def evaluateAtomicValue( self , exprStack , type , contextItem = None ) : #NEWLINE# #INDENT# if ( exprStack and ( len ( exprStack ) > 0 ) and isinstance ( exprStack [ 0 ] , ProgHeader ) ) : #NEWLINE# #INDENT# progHeader = exprStack [ 0 ] #NEWLINE# result = self . atomize ( progHeader , self . evaluate ( exprStack , contextItem = contextItem ) ) #NEWLINE# if ( isinstance ( type , QName ) and ( type . namespaceURI == XbrlConst . xsd ) ) : #NEWLINE# #INDENT# type = ( 'xs:' + type . localName ) #NEWLINE# #UNINDENT# if isinstance ( type , str ) : #NEWLINE# #INDENT# ( prefix , sep , localName ) = type . rpartition ( ':' ) #NEWLINE# if ( prefix == 'xs' ) : #NEWLINE# #INDENT# if localName . endswith ( '*' ) : #NEWLINE# #INDENT# localName = localName [ : ( - 1 ) ] #NEWLINE# #UNINDENT# if isinstance ( result , ( tuple , list , set ) ) : #NEWLINE# #INDENT# from arelle import FunctionXs #NEWLINE# if type . endswith ( '*' ) : #NEWLINE# #INDENT# return [ FunctionXs . call ( self , progHeader , localName , ( r , ) ) for r in result ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( len ( result ) > 0 ) : #NEWLINE# #INDENT# return FunctionXs . call ( self , progHeader , localName , ( result [ 0 ] , ) ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if localName . startswith ( 'item()' ) : #NEWLINE# #INDENT# return result #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if ( len ( result ) == 0 ) : #NEWLINE# #INDENT# return None #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( len ( result ) == 1 ) : #NEWLINE# #INDENT# return result [ 0 ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return result #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# return None