code: def _run_code(code, code_path, ns=None, function_name=None):
      """Run a docstring example if it does not contain ``'doctest:+SKIP'``, or a
      ```pyvista-plot::`` directive.  In the later case, the doctest parser will
      present the code-block again with the ```pyvista-plot::`` directive
      and its options removed.
  
      Import a Python module from a path, and run the function given by
      name, if function_name is not None.
      """
      # do not execute code containing any SKIP directives
      if "doctest:+SKIP" in code:
          return ns
  
      if "pyvista-plot::" in code:
          return ns
  
      try:
          if pyvista.PLOT_DIRECTIVE_THEME is not None:
              pyvista.set_plot_theme(
                  pyvista.PLOT_DIRECTIVE_THEME
              )  # pragma: no cover
          exec(code, ns)
      except (Exception, SystemExit) as err:  # pragma: no cover
          raise PlotError(traceback.format_exc()) from err
  
      return ns
  
imports: import doctest
  import os
  from os.path import relpath
  from pathlib import Path
  import re
  import shutil
  import textwrap
  import traceback
  from docutils.parsers.rst import Directive, directives
  from docutils.parsers.rst.directives.images import Image
  import jinja2
  import pyvista
label_desc: Use image node_id 9 for calling a global function with example usage: _run_code(code, code_path, ns, function_name) and returns: ns, ns, ns