docstr: Get the current block index, validating and checking status.
  
  Returns None if the demo is finished
docstr_tok: ["Get","the","current","block","index",",","validating","and","checking","status",".","Returns","None","if","the","demo","is","finished"]
code: def _get_index(self, index):
      """Get the current block index, validating and checking status.
  
      Returns None if the demo is finished"""
  
      if index is None:
          if self.finished:
              print(
                  "Demo finished.  Use <demo_name>.reset() if you want to rerun it."
              )
              return None
          index = self.block_index
      else:
          self._validate_index(index)
      return index
  
imports: import os
  import re
  import shlex
  import sys
  import pygments
  from pathlib import Path
  from IPython.utils.text import marquee
  from IPython.utils import openpy
  from IPython.utils import py3compat
label_desc: Use image node_id 6 for calling the Demo obj's underlying member method code with example usage: obj._get_index(index) and returns: index, None