class_docstr: Magics that provide central IPython functionality.
  
  These are various magics that don't fit into specific categories but that
  are all part of the base 'IPython experience'.
docstr: Return docstrings from magic functions.
code: def _magic_docs(self, brief=False, rest=False):
      """Return docstrings from magic functions."""
      mman = self.shell.magics_manager
      docs = mman.lsmagic_docs(brief, missing="No documentation")
  
      if rest:
          format_string = "**%s%s**::\n\n%s\n\n"
      else:
          format_string = "%s%s:\n%s\n"
  
      return "".join(
          [
              format_string
              % (magic_escapes["line"], fname, indent(dedent(fndoc)))
              for fname, fndoc in sorted(docs["line"].items())
          ]
          + [
              format_string
              % (magic_escapes["cell"], fname, indent(dedent(fndoc)))
              for fname, fndoc in sorted(docs["cell"].items())
          ]
      )
  
imports: from __future__ import print_function
  from __future__ import absolute_import
  import argparse
  import io
  import sys
  from pprint import pformat
  from IPython.core import magic_arguments, page
  from IPython.core.error import UsageError
  from IPython.core.magic import Magics, magics_class, line_magic, magic_escapes
  from IPython.utils.text import format_screen, dedent, indent
  from IPython.testing.skipdoctest import skip_doctest
  from IPython.utils.ipstruct import Struct
  from IPython.utils.py3compat import unicode_type
  from warnings import warn
  from logging import error
label_desc: Use image node_id 3 for calling the BasicMagics obj's underlying member method code with example usage: obj._magic_docs(brief, rest) and returns: str