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

Method get_cells

IPython/core/interactiveshell.py:2794–2806  ·  view source on GitHub ↗

generator for sequence of code blocks to run

()

Source from the content-addressed store, hash-verified

2792 dname = os.path.dirname(fname)
2793
2794 def get_cells():
2795 """generator for sequence of code blocks to run"""
2796 if fname.endswith('.ipynb'):
2797 from nbformat import read
2798 nb = read(fname, as_version=4)
2799 if not nb.cells:
2800 return
2801 for cell in nb.cells:
2802 if cell.cell_type == 'code':
2803 yield cell.source
2804 else:
2805 with open(fname) as f:
2806 yield f.read()
2807
2808 with prepended_to_syspath(dname):
2809 try:

Callers

nothing calls this directly

Calls 1

readMethod · 0.80

Tested by

no test coverage detected