def _process_deps_hooks(closure, bii, hook_pattern, list_blocks):
    if closure is not None:
        files = compute_deps_files(closure)
        block_files = defaultdict(list)
        for bcn in files:
            block_files[bcn.block_name].append(bcn.cell_name)

        for block_name in list_blocks:
            try:
                bfiles = block_files[block_name]
            except __HOLE__:
                pass
            else:
                for name in bfiles:
                    if fnmatch.fnmatch(name, hook_pattern):
                        code = files[block_name + name]
                        unresolved = []  # FIXME, need to correctly compute unresolved here
                        hook = BiiHook(name, block_name, True, bfiles, 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_deps_hooks