code: def _image_directories(func):
      """
      Compute the baseline and result image directories for testing *func*.
  
      For test module ``foo.bar.test_baz``, the baseline directory is at
      ``foo/bar/baseline_images/test_baz`` and the result directory at
      ``$(pwd)/result_images/test_baz``.  The result directory is created if it
      doesn't exist.
      """
      module_path = Path(inspect.getfile(func))
      baseline_dir = (
          module_path.parent / "baseline_images" / module_path.stem
      )
      result_dir = Path().resolve() / "result_images" / module_path.stem
      result_dir.mkdir(parents=True, exist_ok=True)
      return baseline_dir, result_dir
  
imports: import contextlib
  import functools
  import inspect
  import os
  from platform import uname
  from pathlib import Path
  import shutil
  import string
  import sys
  import warnings
  from packaging.version import parse
  import matplotlib.style
  import matplotlib.units
  import matplotlib.testing
  from matplotlib import _pylab_helpers, cbook, ft2font, pyplot, ticker
  from .compare import comparable_formats, compare_images, make_test_filename
  from .exceptions import ImageComparisonFailure
label_desc: Use image node_id 10 for calling a global function with example usage: _image_directories(func) and returns: baseline_dir,  result_dir