code: def replace_pyvis_iframe(
      text,  # pylint: disable=W0621
      parent,  # pylint: disable=W0621
      stem,  # pylint: disable=W0621
  ):
      """
      Substitute the generated image from PyVis
      """
      output = []
  
      for chunk in PAT_IFRAME.split(text):
          m_iframe = PAT_IFRAME.match(chunk)
  
          if m_iframe:
              iframe = m_iframe.group()
              source_html = get_pyvis_html(iframe)
  
              if source_html:
                  source_png = source_html.replace(".html", ".png")
  
                  try:
                      os.mkdir("{}/{}_files".format(parent, stem))
                  except:  # pylint: disable=W0702  # nosec
                      pass
  
                  render_screenshot(
                      "file://{}/examples/{}".format(
                          os.getcwd(), source_html
                      ),
                      "{}/{}_files/{}".format(parent, stem, source_png),
                  )
  
                  output.append(
                      "![png]({}_files/{})".format(stem, source_png)
                  )
              else:
                  output.append(chunk)
          else:
              output.append(chunk)
  
      return "\n".join(output)
  
file_path: pytextrank/bin/vis_doc.py
imports: from selenium import webdriver
  from selenium.webdriver.chrome.options import Options
  import os
  import pathlib
  import re
  import sys
  import time
label_desc: Use image node_id 3 for calling a global function with example usage: replace_pyvis_iframe(text, parent, stem) and returns: str