#NEWLINE# @ cached_property #NEWLINE# def num_pages( self ) : #NEWLINE# #INDENT# '\n        Returns the total number of pages.\n        ' #NEWLINE# if ( ( hits . count == 0 ) and ( not self . allow_empty_first_page ) ) : #NEWLINE# #INDENT# return 0 #NEWLINE# #UNINDENT# hits = max ( 1 , ( self . count - self . orphans ) ) #NEWLINE# return int ( ceil ( ( hits / float ( self . per_page ) ) ) )