code: def check_prerequisites(
      prerequisites,
      checker,
      msg_tmpl='Prerequisites "{}" are required in method "{}" but not '
      "found, please install them first.",
  ):  # yapf: disable
      """A decorator factory to check if prerequisites are satisfied.
  
      Args:
          prerequisites (str of list[str]): Prerequisites to be checked.
          checker (callable): The checker method that returns True if a
              prerequisite is meet, False otherwise.
          msg_tmpl (str): The message template with two variables.
  
      Returns:
          decorator: A specific decorator.
      """
  
      def wrap(func):
          @functools.wraps(func)
          def wrapped_func(*args, **kwargs):
              requirements = (
                  [prerequisites]
                  if isinstance(prerequisites, str)
                  else prerequisites
              )
              missing = []
              for item in requirements:
                  if not checker(item):
                      missing.append(item)
              if missing:
                  print(
                      msg_tmpl.format(", ".join(missing), func.__name__)
                  )
                  raise RuntimeError("Prerequisites not meet.")
              else:
                  return func(*args, **kwargs)
  
          return wrapped_func
  
      return wrap
  
imports: import collections.abc
  import functools
  import itertools
  import subprocess
  import warnings
  from collections import abc
  from importlib import import_module
  from inspect import getfullargspec
  from itertools import repeat
label_desc: Use image node_id 12 for calling a global function with example usage: check_prerequisites(prerequisites, checker, msg_tmpl) and returns: wrap, wrapped_func, func