code: def save_figures(block, block_vars, gallery_conf):
      
      image_path_iterator = block_vars['image_path_iterator']
      all_rst = u''
      prev_count = len(image_path_iterator)
      for scraper in gallery_conf['image_scrapers']:
          rst = scraper(block, block_vars, gallery_conf)
          if not isinstance(rst, basestring):
              raise TypeError('rst from scraper %r was not a string, '
                              'got type %s:\n%r'
                              % (scraper, type(rst), rst))
          n_new = len(image_path_iterator) - prev_count
          for ii in range(n_new):
              current_path, _ = _find_image_ext(
                  image_path_iterator.paths[prev_count + ii])
              if not os.path.isfile(current_path):
                  raise RuntimeError('Scraper %s did not produce expected image:'
                                     '\n%s' % (scraper, current_path))
          all_rst += rst
      return all_rst
docs: Save all open figures of the example code-block.
  
      Parameters
      ----------
      block : tuple
          A tuple containing the (label, content, line_number) of the block.
      block_vars : dict
          Dict of block variables.
      gallery_conf : dict
          Contains the configuration of Sphinx-Gallery
  
      Returns
      -------
      images_rst : str
          rst code to embed the images in the document.