MCPcopy Create free account
hub / github.com/ipython/ipython / ip2py

Method ip2py

IPython/testing/plugin/ipdoctest.py:384–390  ·  view source on GitHub ↗

Convert input IPython source into valid Python.

(self,source)

Source from the content-addressed store, hash-verified

382 _EXTERNAL_IP = re.compile(r'#\s*ipdoctest:\s*EXTERNAL')
383
384 def ip2py(self,source):
385 """Convert input IPython source into valid Python."""
386 block = _ip.input_transformer_manager.transform_cell(source)
387 if len(block.splitlines()) == 1:
388 return _ip.prefilter(block)
389 else:
390 return block
391
392 def parse(self, string, name='<string>'):
393 """

Callers 1

_parse_exampleMethod · 0.95

Calls 1

transform_cellMethod · 0.45

Tested by

no test coverage detected