def get_examples_from_docstring(doc_str):
 examples = _DOCSTRING_TEST_PARSER.get_examples(doc_str)
 example_str = ''
 for example in examples:
  example_str += ('%s' % (example.source,))
  example_str += ('%s' % (example.want,))
 return cgi.escape(example_str)

def get_examples_from_docstring ( doc_str ) : examples = _DOCSTRING_TEST_PARSER . get_examples ( doc_str ) example_str = '' for example in examples : example_str += ( '%s' % ( example . source , ) ) example_str += ( '%s' % ( example . want , ) ) return cgi . escape ( example_str )
parse doctest style code examples from a docstring .