

def replace_blocks_in_extends(self, extends_text, blocks):

    def replace(match):
        name = match.group('name')
        old_code = match.group('code')
        code = (blocks.get(name) or old_code)
        return self.re_block_super.sub(old_code, code)
    return self.re_block.sub(replace, extends_text)

dataset/ETHPy150Open mozillazg/bustard/bustard/template.py Template.replace_blocks_in_extends/original