class_docstr: A class used to parse strings containing doctest examples.
  
  Note: This is a version modified to properly recognize IPython input and
  convert any IPython examples into valid Python ones.
docstr: Convert input IPython source into valid Python.
docstr_tok: ["Convert","input","IPython","source","into","valid","Python","."]
code: def ip2py(self, source):
      """Convert input IPython source into valid Python."""
      block = _ip.input_transformer_manager.transform_cell(source)
      if len(block.splitlines()) == 1:
          return _ip.prefilter(block)
      else:
          return block
  
imports: import doctest
  import inspect
  import logging
  import os
  import re
  import sys
  from testpath import modified_env
  from inspect import getmodule
  from doctest import REPORTING_FLAGS, REPORT_ONLY_FIRST_FAILURE, _unittest_reportflags, DocTestRunner, _extract_future_flags, pdb, _OutputRedirectingPdb, _exception_traceback, linecache
  from nose.plugins import doctests, Plugin
  from nose.util import anyp, tolist
  from IPython.utils.py3compat import builtin_mod, PY3, getcwd
label_desc: Use image node_id 1 for calling the IPDocTestParser obj's underlying member method code with example usage: obj.ip2py(source) and returns: _ip, block