# Buggy code
def legend(
    self,
    show: Optional[bool] = True,
    show_size_legend: Optional[bool] = True,
    show_colorbar: Optional[bool] = True,
    size_title: Optional[str] = DEFAULT_SIZE_LEGEND_TITLE,
    colorbar_title: Optional[str] = DEFAULT_COLOR_LEGEND_TITLE,
    width: Optional[float] = DEFAULT_LEGENDS_WIDTH,
):
    """
    Configure legend parameters.

    Parameters
    ----------
    show
        Set to `False` to hide the default plot of the legends.
    show_size_legend
        Set to `False` to hide the the size legend
    show_colorbar
        Set to `False` to hide the the colorbar
    size_title
        Title for the dot size legend. Use "\n" to add line breaks.
    colorbar_title
        Title for the color bar. Use "\n" to add line breaks.
    width
        Width of the legends.

    Returns
    -------
    DotPlot

    Examples
    --------
    >>> adata = sc.datasets.pbmc68k_reduced()
    >>> markers = {{'T-cell': 'CD3D', 'B-cell': 'CD79A', 'myeloid': 'CST3'}}
    >>> dp = sc.pl.DotPlot(adata, markers, groupby='bulk_labels')
    >>> dp.legend(colorbar_title='log(UMI counts + 1)').show()
    """

    if not show:
        # turn of legends by setting width to 0
        self.legends_width = 0
    else:
        self.color_legend_title = colorbar_title
        self.size_title = size_title
        self.legends_width = width
        self.show_size_legend = show_size_legend
        self.show_colorbar = show_colorbar

    return self


# Traceback (sphinx.errors.SphinxWarning)
/home/docs/checkouts/readthedocs.org/user_builds/icb-scanpy/envs/1204/lib/python3.6/site-packages/setuptools_scm/git.py:68: UserWarning: "/home/docs/checkouts/readthedocs.org/user_builds/icb-scanpy/checkouts/1204" is shallow and may cause errors
warnings.warn('"{}" is shallow and may cause errors'.format(wd.path))
/home/docs/checkouts/readthedocs.org/user_builds/icb-scanpy/checkouts/1204/docs/conf.py:112: RemovedInSphinx40Warning: The app.add_stylesheet() is deprecated. Please use app.add_css_file() instead.
app.add_stylesheet('css/custom.css')

Traceback (most recent call last):
File "/home/docs/checkouts/readthedocs.org/user_builds/icb-scanpy/envs/1204/lib/python3.6/site-packages/sphinx/cmd/build.py", line 280, in build_main
app.build(args.force_all, filenames)
File "/home/docs/checkouts/readthedocs.org/user_builds/icb-scanpy/envs/1204/lib/python3.6/site-packages/sphinx/application.py", line 348, in build
self.builder.build_update()
File "/home/docs/checkouts/readthedocs.org/user_builds/icb-scanpy/envs/1204/lib/python3.6/site-packages/sphinx/builders/__init__.py", line 299, in build_update
len(to_build))
File "/home/docs/checkouts/readthedocs.org/user_builds/icb-scanpy/envs/1204/lib/python3.6/site-packages/sphinx/builders/__init__.py", line 311, in build
updated_docnames = set(self.read())
File "/home/docs/.pyenv/versions/3.6.8/lib/python3.6/contextlib.py", line 88, in __exit__
next(self.gen)
File "/home/docs/checkouts/readthedocs.org/user_builds/icb-scanpy/envs/1204/lib/python3.6/site-packages/sphinx/util/logging.py", line 213, in pending_warnings
memhandler.flushTo(logger)
File "/home/docs/checkouts/readthedocs.org/user_builds/icb-scanpy/envs/1204/lib/python3.6/site-packages/sphinx/util/logging.py", line 178, in flushTo
logger.handle(record)
File "/home/docs/.pyenv/versions/3.6.8/lib/python3.6/logging/__init__.py", line 1454, in handle
self.callHandlers(record)
File "/home/docs/.pyenv/versions/3.6.8/lib/python3.6/logging/__init__.py", line 1516, in callHandlers
hdlr.handle(record)
File "/home/docs/.pyenv/versions/3.6.8/lib/python3.6/logging/__init__.py", line 861, in handle
rv = self.filter(record)
File "/home/docs/.pyenv/versions/3.6.8/lib/python3.6/logging/__init__.py", line 720, in filter
result = f.filter(record)
File "/home/docs/checkouts/readthedocs.org/user_builds/icb-scanpy/envs/1204/lib/python3.6/site-packages/sphinx/util/logging.py", line 415, in filter
raise SphinxWarning(location + ":" + str(message))
sphinx.errors.SphinxWarning: /home/docs/checkouts/readthedocs.org/user_builds/icb-scanpy/checkouts/1204/scanpy/plotting/_dotplot.py:docstring of scanpy.pl.dotplot:122:Inline strong start-string without end-string.

Warning, treated as error:
/home/docs/checkouts/readthedocs.org/user_builds/icb-scanpy/checkouts/1204/scanpy/plotting/_dotplot.py:docstring of scanpy.pl.dotplot:122:Inline strong start-string without end-string.

# Fixed code
def legend(
    self,
    show: Optional[bool] = True,
    show_size_legend: Optional[bool] = True,
    show_colorbar: Optional[bool] = True,
    size_title: Optional[str] = DEFAULT_SIZE_LEGEND_TITLE,
    colorbar_title: Optional[str] = DEFAULT_COLOR_LEGEND_TITLE,
    width: Optional[float] = DEFAULT_LEGENDS_WIDTH,
):
    """\
        Configures dot size and the colorbar legends

        Parameters
        ----------
        show
            Set to `False` to hide the default plot of the legends. This sets the
            legend width to zero, which will result in a wider main plot.
        show_size_legend
            Set to `False` to hide the dot size legend
        show_colorbar
            Set to `False` to hide the colorbar legend
        size_title
            Title for the dot size legend. Use '\\n' to add line breaks. Appears on top
            of dot sizes
        colorbar_title
            Title for the color bar. Use '\\n' to add line breaks. Appears on top of the
            color bar
        width
            Width of the legends area. The value is a proportion with respect
            to the figure width. E.g. 0.5 means the legend width is 50% of the figure

        Returns
        -------
        :class:`~scanpy.pl.DotPlot`

        Examples
        --------

        Set color bar title:

        >>> adata = sc.datasets.pbmc68k_reduced()
        >>> markers = {{'T-cell': 'CD3D', 'B-cell': 'CD79A', 'myeloid': 'CST3'}}
        >>> dp = sc.pl.DotPlot(adata, markers, groupby='bulk_labels')
        >>> dp.legend(colorbar_title='log(UMI counts + 1)').show()
        """

    if not show:
        # turn of legends by setting width to 0
        self.legends_width = 0
    else:
        self.color_legend_title = colorbar_title
        self.size_title = size_title
        self.legends_width = width
        self.show_size_legend = show_size_legend
        self.show_colorbar = show_colorbar

    return self