code: def _compare_version(version_a, operator, version_b):
      """Compare two version strings via a user-specified operator.
  
      Parameters
      ----------
      version_a : str
          First version string.
      operator : '==' | '>' | '<' | '>=' | '<='
          Operator to compare ``version_a`` and ``version_b`` in the form of
          ``version_a operator version_b``.
      version_b : str
          Second version string.
  
      Returns
      -------
      bool
          The result of the version comparison.
      """
      from packaging.version import parse
  
      mapping = {
          "<": "lt",
          "<=": "le",
          "==": "eq",
          "!=": "ne",
          ">=": "ge",
          ">": "gt",
      }
      with warnings.catch_warnings(record=True):
          warnings.simplefilter("ignore")
          ver_a = parse(version_a)
          ver_b = parse(version_b)
          return getattr(operator_module, mapping[operator])(
              ver_a, ver_b
          )
  
imports: import inspect
  import operator
  import os
  import warnings
  from contextlib import contextmanager
  from io import StringIO
  from math import log
  from pprint import pprint
  import numpy
label_desc: Use image node_id 1 for calling a global function with example usage: _compare_version(version_a, operator, version_b) and returns: getattr