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