<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def rst2pub(source, source_path=None, source_class=None, destination_path=None, reader=None, reader_name='standalone', parser=None, parser_name='restructuredtext', writer=None, writer_name='pseudoxml', settings=None, settings_spec=None, settings_overrides=None, config_section=None, enable_exit_status=None):
 """ Like docutils.core.publish_parts, but returns the publisher and sets some default settings, see `default_rst_opts`. Parameters: see `docutils.core` functions for explanation. Example: pub = rst2pub(rst_string) print doctree2dict(pub.document) """

    if not have_docutils:
        raise ImportError('docutils library is required to use reStructuredText conversion')

    final_settings_overrides = default_rst_opts.copy()
    if settings_overrides:
        final_settings_overrides.update(settings_overrides)

    source_class = source_class or io.StringInput

    output, pub = publish_programmatically(
        source=source, source_path=source_path, source_class=source_class,
        destination_class=io.StringOutput,
        destination=None, destination_path=destination_path,
        reader=reader, reader_name=reader_name,
        parser=parser, parser_name=parser_name,
        writer=writer, writer_name=writer_name,
        settings=settings, settings_spec=settings_spec,
        settings_overrides=final_settings_overrides,
        config_section=config_section,
        enable_exit_status=enable_exit_status)
    return pub