'Searches for Mako python blocks and checks if they contain
violations.
Arguments:
mako_template: The contents of the Mako template.
has_page_default: True if the page is marked as default, False
otherwise.
results: A list of results into which violations will be added.'

def _check_mako_python_blocks(self, mako_template, has_page_default, results):

    python_block_regex = re.compile('<%\\s(?P<code>.*?)%>', re.DOTALL)
    for python_block_match in python_block_regex.finditer(mako_template):
        self._check_expression_python(python_code=python_block_match.group('code'), start_offset=(python_block_match.start() + len('<%    ')), has_page_default=has_page_default, results=results)
