docstr: The main implementation of the %lsmagic
code: def _lsmagic(self):
      """The main implementation of the %lsmagic"""
      mesc = magic_escapes["line"]
      cesc = magic_escapes["cell"]
      mman = self.magics_manager
      magics = mman.lsmagic()
      out = [
          "Available line magics:",
          mesc + ("  " + mesc).join(sorted(magics["line"])),
          "",
          "Available cell magics:",
          cesc + ("  " + cesc).join(sorted(magics["cell"])),
          "",
          mman.auto_status(),
      ]
      return "\n".join(out)
  
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 2 for calling the MagicsDisplay obj's underlying member method code with example usage: obj._lsmagic() and returns: str