docstr: Return a mime bundle representation of the input text.
  
  - if `formatter` is None, the returned mime bundle has
     a `text/plain` field, with the input text.
     a `text/html` field with a `<pre>` tag containing the input text.
  
  - if `formatter` is not None, it must be a callable transforming the
    input text into a mime bundle. Default values for `text/plain` and
    `text/html` representations are the ones described above.
  
  Note:
  
  Formatters returning strings are supported but this behavior is deprecated.
code: def _mime_format(self, text, formatter=None):
      """Return a mime bundle representation of the input text.
  
      - if `formatter` is None, the returned mime bundle has
         a `text/plain` field, with the input text.
         a `text/html` field with a `<pre>` tag containing the input text.
  
      - if `formatter` is not None, it must be a callable transforming the
        input text into a mime bundle. Default values for `text/plain` and
        `text/html` representations are the ones described above.
  
      Note:
  
      Formatters returning strings are supported but this behavior is deprecated.
  
      """
      text = cast_unicode(text)
      defaults = {
          "text/plain": text,
          "text/html": "<pre>" + text + "</pre>",
      }
  
      if formatter is None:
          return defaults
      else:
          formatted = formatter(text)
  
          if not isinstance(formatted, dict):
              # Handle the deprecated behavior of a formatter returning
              # a string instead of a mime bundle.
              return {
                  "text/plain": formatted,
                  "text/html": "<pre>" + formatted + "</pre>",
              }
  
          else:
              return dict(defaults, **formatted)
  
imports: from __future__ import print_function
  import inspect
  import linecache
  import warnings
  import os
  from textwrap import dedent
  import types
  import io
  from IPython.core import page
  from IPython.lib.pretty import pretty
  from IPython.testing.skipdoctest import skip_doctest_py3
  from IPython.utils import PyColorize
  from IPython.utils import openpy
  from IPython.utils import py3compat
  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.coloransi import TermColors, ColorScheme, ColorSchemeTable
  from IPython.utils.py3compat import cast_unicode, string_types, PY3
  from IPython.utils.signatures import signature
  from IPython.utils.colorable import Colorable
  from pygments import highlight
  from pygments.formatters import HtmlFormatter
label_desc: Use image node_id 11 for calling the Inspector obj's underlying member method code with example usage: obj._mime_format(text, formatter) and returns: defaults, dict, dict