#NEWLINE# def __len__( self ) : #NEWLINE# #INDENT# if ( len ( self . subqueries ) == 1 ) : #NEWLINE# #INDENT# subquery_length = len ( self . subqueries [ 0 ] ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# subquery_length = len ( self . subqueries ) #NEWLINE# #UNINDENT# return sum ( [ sum ( ( len ( v ) for v in list ( self . terms . values ( ) ) ) ) , sum ( ( len ( v ) for v in list ( self . phrases . values ( ) ) ) ) , len ( subquery_length . ranges ) , subquery_length ] )