def maybe_render_markdown(string: str) -> Any:
    """Render a string as Markdown only if in an IPython interpreter."""
    if is_ipython_interpreter():  # pragma: no cover
        from IPython.display import Markdown  # type: ignore # noqa: E501

        return Markdown(string)
    else:
        return string
def maybe_render_markdown ( string : str ) -> Any : if is_ipython_interpreter ( ) : from IPython . display import Markdown return Markdown ( string ) else : return string
Render a string as Markdown only if in an IPython interpreter.