<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_registered(option_hooks=None, event_hooks=None, command_hooks=None, root_access=None, task_active=True):
 """ Returns a generator of registered plugins matching filters. `option_hooks` Boolean to include or exclude plugins using option hooks. `event_hooks` Boolean to include or exclude task event plugins. `command_hooks` Boolean to include or exclude command plugins. `root_access` Boolean to include or exclude root plugins. `task_active` Set to ``False`` to not filter by task-based plugins. Returns list of ``Plugin`` instances. """


    plugins = []

    for _, item in _registered:
        plugin, type_info = item

        # filter out any task-specific plugins
        if task_active:
            if type_info.get('disabled'):
                continue
        else:
            if plugin.options or plugin.task_only:
                continue

        if not option_hooks is None:
            if option_hooks != bool(type_info.get('option')):
                continue

        if not event_hooks is None:
            if event_hooks != bool(type_info.get('event')):
                continue

        if not command_hooks is None:
            if command_hooks != bool(type_info.get('command')):
                continue

        if not root_access is None:
            if root_access != plugin.needs_root:
                continue

        plugins.append(plugin)

    return plugins