def _process_blocks_hooks(hive_holder, bii, hook_pattern, list_blocks):
    for block_name in list_blocks:
        try:
            block_holder = hive_holder[block_name]
        except __HOLE__:
            pass
        else:
            file_names = block_holder.cell_names
            for resource in block_holder.simple_resources:
                name = resource.name
                if fnmatch.fnmatch(name.cell_name, hook_pattern):
                    code = resource.content.load.load
                    unresolved = block_holder.unresolved()
                    hook = BiiHook(name, block_holder.block_name, False, file_names, unresolved,
                                   bii.hive_disk_image, bii.user_io.out,
                                   bii.bii_paths.user_bii_home)
                    hook.execute(code)
dataset/ETHPy150Open biicode/client/hooks.py/_process_blocks_hooks