'Determines the number of page expressions in the Mako template. Ignores
page expressions that are commented out.
Arguments:
mako_template: The contents of the Mako template.
Returns:
The number of page expressions'

def _get_page_tag_count(self, mako_template):

    count = len(re.findall('<%page    ', mako_template, re.IGNORECASE))
    count_commented = len(re.findall('##\\s+<%page    ', mako_template, re.IGNORECASE))
    return max(0, (count - count_commented))
