MCPcopy Index your code
hub / github.com/ipython/ipython / _get_index

Method _get_index

IPython/lib/demo.py:347–359  ·  view source on GitHub ↗

Get the current block index, validating and checking status. Returns None if the demo is finished

(self,index)

Source from the content-addressed store, hash-verified

345 raise ValueError('invalid block index %s' % index)
346
347 def _get_index(self,index):
348 """Get the current block index, validating and checking status.
349
350 Returns None if the demo is finished"""
351
352 if index is None:
353 if self.finished:
354 print('Demo finished. Use <demo_name>.reset() if you want to rerun it.')
355 return None
356 index = self.block_index
357 else:
358 self._validate_index(index)
359 return index
360
361 def seek(self,index):
362 """Move the current seek pointer to the given block.

Callers 3

editMethod · 0.95
showMethod · 0.95
__call__Method · 0.95

Calls 1

_validate_indexMethod · 0.95

Tested by

no test coverage detected