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

Method _get_index

IPython/lib/demo.py:346–358  ·  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

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