docstr: run a block of the demo.
  
  If index is given, it should be an integer >=1 and <= nblocks.  This
  means that the calling convention is one off from typical Python
  lists.  The reason for the inconsistency is that the demo always
  prints 'Block n/N, and N is the total, so it would be very odd to use
  zero-indexing here.
docstr_tok: ["run","a","block","of","the","demo",".","If","index","is","given",",","it","should","be","an","integer",">","=1","and","<","=","nblocks",".","This","means","that","the","calling","convention","is","one","off","from","typical","Python","lists",".","The","reason","for","the","inconsistency","is","that","the","demo","always","prints","'Block","n\/N",",","and","N","is","the","total",",","so","it","would","be","very","odd","to","use","zero-indexing","here","."]
code: def __call__(self, index=None):
      """run a block of the demo.
  
      If index is given, it should be an integer >=1 and <= nblocks.  This
      means that the calling convention is one off from typical Python
      lists.  The reason for the inconsistency is that the demo always
      prints 'Block n/N, and N is the total, so it would be very odd to use
      zero-indexing here."""
  
      index = self._get_index(index)
      if index is None:
          return
      try:
          marquee = self.marquee
          next_block = self.src_blocks[index]
          self.block_index += 1
          if self._silent[index]:
              print(
                  marquee(
                      "Executing silent block # %s (%s remaining)"
                      % (index, self.nblocks - index - 1)
                  )
              )
          else:
              self.pre_cmd()
              self.show(index)
              if self.auto_all or self._auto[index]:
                  print(marquee("output:"))
              else:
                  print(
                      marquee(
                          "Press <q> to quit, <Enter> to execute..."
                      ),
                      end=" ",
                  )
                  ans = py3compat.input().strip()
                  if ans:
                      print(marquee("Block NOT executed"))
                      return
          try:
              save_argv = sys.argv
              sys.argv = self.sys_argv
              self.run_cell(next_block)
              self.post_cmd()
          finally:
              sys.argv = save_argv
  
      except:
          if self.inside_ipython:
              self.ip_showtb(filename=self.fname)
      else:
          if self.inside_ipython:
              self.ip_ns.update(self.user_ns)
  
      if self.block_index == self.nblocks:
          mq1 = self.marquee("END OF DEMO")
          if mq1:
              # avoid spurious print if empty marquees are used
              print()
              print(mq1)
              print(
                  self.marquee(
                      "Use <demo_name>.reset() if you want to rerun it."
                  )
              )
          self.finished = True
  
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 15 for calling the Demo obj's underlying member method code with example usage: obj.__call__(index) without return types