code: def skip_if_command_unavailable(cmd):
      """
      skips a test if a command is unavailable.
  
      Parameters
      ----------
      cmd : list of str
          must be a complete command which should not
          return a non zero exit code, something like
          ["latex", "-version"]
      """
      from matplotlib.compat.subprocess import check_output
  
      try:
          check_output(cmd)
      except:
          import pytest
  
          return pytest.mark.skip(reason="missing command: %s" % cmd[0])
  
      return lambda f: f
  
imports: from __future__ import absolute_import, division, print_function
  import six
  import functools
  import inspect
  import os
  import sys
  import shutil
  import warnings
  import unittest
  import matplotlib
  import matplotlib.style
  import matplotlib.units
  import matplotlib.testing
  from matplotlib import cbook
  from matplotlib import ticker
  from matplotlib import pyplot
  from matplotlib import ft2font
  from matplotlib.testing.compare import comparable_formats, compare_images, make_test_filename
  from .None import _copy_metadata, is_called_from_pytest
  from .exceptions import ImageComparisonFailure
label_desc: Use image node_id 15 for calling a global function with example usage: skip_if_command_unavailable(cmd) and returns: function, pytest