docstr: Print the docstring for any object.
  
  Optional:
  -formatter: a function to run the docstring through for specially
  formatted docstrings.
  
  Examples
  --------
  In [1]: class NoInit:
     ...:     pass
  
  In [2]: class NoDoc:
     ...:     def __init__(self):
     ...:         pass
  
  In [3]: %pdoc NoDoc
  No documentation found for NoDoc
  
  In [4]: %pdoc NoInit
  No documentation found for NoInit
  
  In [5]: obj = NoInit()
  
  In [6]: %pdoc obj
  No documentation found for obj
  
  In [5]: obj2 = NoDoc()
  
  In [6]: %pdoc obj2
  No documentation found for obj2
docstr_tok: ["Print","the","docstring","for","any","object",".","Optional",":","-formatter",":","a","function","to","run","the","docstring","through","for","specially","formatted","docstrings",".","Examples","--","--","--","--","In","[","1","]",":","class","NoInit",":","...",":","pass","In","[","2","]",":","class","NoDoc",":","...",":","def","__init__","(","self",")",":","...",":","pass","In","[","3","]",":","%","pdoc","NoDoc","No","documentation","found","for","NoDoc","In","[","4","]",":","%","pdoc","NoInit","No","documentation","found","for","NoInit","In","[","5","]",":","obj","=","NoInit","(",")","In","[","6","]",":","%","pdoc","obj","No","documentation","found","for","obj","In","[","5","]",":","obj2","=","NoDoc","(",")","In","[","6","]",":","%","pdoc","obj2","No","documentation","found","for","obj2"]
code: def pdoc(self, obj, oname="", formatter=None):
      """Print the docstring for any object.
  
      Optional:
      -formatter: a function to run the docstring through for specially
      formatted docstrings.
  
      Examples
      --------
      In [1]: class NoInit:
         ...:     pass
  
      In [2]: class NoDoc:
         ...:     def __init__(self):
         ...:         pass
  
      In [3]: %pdoc NoDoc
      No documentation found for NoDoc
  
      In [4]: %pdoc NoInit
      No documentation found for NoInit
  
      In [5]: obj = NoInit()
  
      In [6]: %pdoc obj
      No documentation found for obj
  
      In [5]: obj2 = NoDoc()
  
      In [6]: %pdoc obj2
      No documentation found for obj2
      """
  
      head = self.__head  # For convenience
      lines = []
      ds = getdoc(obj)
      if formatter:
          ds = formatter(ds).get("plain/text", ds)
      if ds:
          lines.append(head("Class docstring:"))
          lines.append(indent(ds))
      if inspect.isclass(obj) and hasattr(obj, "__init__"):
          init_ds = getdoc(obj.__init__)
          if init_ds is not None:
              lines.append(head("Init docstring:"))
              lines.append(indent(init_ds))
      elif hasattr(obj, "__call__"):
          call_ds = getdoc(obj.__call__)
          if call_ds:
              lines.append(head("Call docstring:"))
              lines.append(indent(call_ds))
  
      if not lines:
          self.noinfo("documentation", oname)
      else:
          page.page("\n".join(lines))
  
imports: from dataclasses import dataclass
  from inspect import signature
  from textwrap import dedent
  import ast
  import html
  import inspect
  import io
  import linecache
  import os
  import sys
  import types
  import warnings
  from typing import Any, Optional, Dict, Union, List, Tuple
  from typing import TypeAlias
  from IPython.core import page
  from IPython.lib.pretty import pretty
  from IPython.testing.skipdoctest import skip_doctest
  from IPython.utils import PyColorize
  from IPython.utils import openpy
  from IPython.utils.dir2 import safe_hasattr
  from IPython.utils.path import compress_user
  from IPython.utils.text import indent
  from IPython.utils.wildcard import list_namespace
  from IPython.utils.wildcard import typestr2type
  from IPython.utils.coloransi import TermColors, ColorScheme, ColorSchemeTable
  from IPython.utils.py3compat import cast_unicode
  from IPython.utils.colorable import Colorable
  from IPython.utils.decorators import undoc
  from pygments import highlight
  from pygments.lexers import PythonLexer
  from pygments.formatters import HtmlFormatter
label_desc: Use image node_id 7 for calling the Inspector obj's underlying member method code with example usage: obj.pdoc(obj, oname, formatter) without return types