def METHOD_NAME(pkg_name, version=None, optional=False, checker=parse_version,
                  version_getter=None, messages=None, show_only=False):
    """
    Check if package `pkg_name` is present, and in correct version.
    Parameters
    ----------
    pkg_name : str or sequence of str
       The name of the package as imported into python. Alternative names
       (e.g. for different versions) may be given in a list.
    version : str, optional
       The minimum version of the package that is required. If not given, the
       version is not checked.
    optional : bool, optional
       If False, raise error for absent package or wrong version;
       otherwise warn
    checker : callable, optional
       If given, the callable with which to return a comparable thing from a
       version string. The default is ``pkg_resources.parse_version``.
    version_getter : callable, optional:
       If given, the callable that takes `pkg_name` as argument, and returns
       the package version string - as in::
          ``version = version_getter(pkg_name)``
       The default is equivalent to::
          mod = __import__(pkg_name); version = mod.__version__``
    messages : dict, optional
       If given, the dictionary providing (some of) output messages.
    show_only : bool
       If True, do not raise exceptions, only show the package name and version
       information.
    """
    if version_getter is None:
        def version_getter(pkg_name):
            mod = __import__(pkg_name)
            return mod.__version__
    if messages is None:
        messages = {}
    msgs = {
         'available' : '%s is available',
         'missing' : '%s is missing',
         'opt suffix' : '; you may get run-time errors',
         'version' : '%s is available in version %s',
         'version old' : '%s is available in version %s, but >= %s is needed',
         'no version' : '%s is available, cannot determine version',
    }
    msgs.update(messages)
    if isinstance(pkg_name, str):
        names = [pkg_name]
    else:
        names = pkg_name
    import_ok = False
    for pkg_name in names:
        try:
            __import__(pkg_name)
        except ImportError:
            pass
        else:
            import_ok = True
    pkg_info = pkg_name + (' (optional)' if optional else '')
    if not import_ok:
        if not (optional or show_only):
            raise RuntimeError(msgs['missing'] % pkg_name)
        log.warn(msgs['missing'] % pkg_info + msgs['opt suffix'])
        return
    if not version:
        if show_only:
            log.info(msgs['available'] % pkg_info)
        return
    try:
        have_version = version_getter(pkg_name)
    except AttributeError:
        raise RuntimeError(msgs['no version'] % pkg_info)
    if not have_version:
        if optional or show_only:
            log.warn(msgs['no version'] % pkg_info)
        else:
            raise RuntimeError(msgs['no version'] % pkg_info)
    elif checker(have_version) < checker(version):
        if optional or show_only:
            log.warn(msgs['version old'] % (pkg_info, have_version, version)
                     + msgs['opt suffix'])
        else:
            raise RuntimeError(msgs['version old'] % (pkg_info, have_version,
                                                      version))
    elif show_only:
        log.info(msgs['version'] % (pkg_info, have_version))