def METHOD_NAME(extension):
    event_hooks = []
    for hook_script in extension.get_hooks():
        if is_valid_hook_script(hook_script):
            name, target = _get_hook_parts(extension, hook_script)
            if name:
                event_hooks.append(
                    ExtensionEventHook(
                        id=_create_hook_id(extension, hook_script),
                        name=name,
                        target=target,
                        script=hook_script,
                        syspaths=extension.module_paths,
                        extension_name=extension.name,
                    )
                )
    return event_hooks