def check_open_close_on_mako_nodes(self, children):
        open_mako_context = None
        for child in children:
            child_type = type(child)

            # Check child nodes for open/close semantics
            if child_type is MakoNode and open_mako_context is None:
                open_mako_context = child
            if child_type is MakoEndTag:
                if open_mako_context is None:
                    # Closer w/o an open context
                    raise NemoException('\nEnd tag without open context\n' + \
                                        'at:\n\t%s\n' % child + \
                                        'within:\n\t%s\n' % self )
                # Close context
                open_mako_context = None

            yield child

        if open_mako_context is not None:
            # Open context without a closer
            raise NemoException('\nOpen tag without a closer found:\n' + \
                                'at:\n\t%s\n' % open_mako_context + \
                                'within:\n\t%s\n' % self )
dataset/ETHPy150Open KaySackey/Nemo/nemo/nodes.py/NemoNode.check_open_close_on_mako_nodes/original