code: def is_mpl_installed():
      try:
          import pytest_mpl  # noqa: F401
          import matplotlib.pyplot as plt  # noqa: F401
  
          return True
      except PackageNotFoundError:
          return False
  
file_path: fairlearn/test/unit/postprocessing/test_plots.py
imports: from importlib.metadata import PackageNotFoundError
  import pytest
  from fairlearn.postprocessing import ThresholdOptimizer, plot_threshold_optimizer
  from .conftest import ExamplePredictor, _data_ex1, _data_ex2, _data_ex3, scores_ex
label_desc: Use image node_id 2 for calling a global function with example usage: is_mpl_installed() and returns: True, False