<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _setup_options(plugin):
 """ Handles setup or teardown of option hook registration for the provided plugin. `plugin` ``Plugin`` class. """


    options = plugin.options

    if options and isinstance(options, (list, tuple)):
        for props in options:
            if isinstance(props, dict):
                if 'block' in props and 'options' in props:  # block
                    block = props['block']
                    option_list = props['options']

                    # options for this block
                    for props in option_list:
                        if isinstance(props, dict):
                            name = props.pop('name', None)

                            if name:
                                key = "{0}_{1}".format(block, name)
                                register('option', key, plugin, props)

                else:  # non-block option
                    name = props.pop('name', None)

                    if name:
                        register('option', name, plugin, props)