code: def cmp_pkg_version(version_str, pkg_version_str=__version__):
      """Compare `version_str` to current package version.
  
      Parameters
      ----------
      version_str : str
          Version string to compare to current package version
      pkg_version_str : str, optional
          Version of our package.  Optional, set from ``__version__`` by default.
  
      Returns
      -------
      version_cmp : int
          1 if `version_str` is a later version than `pkg_version_str`, 0 if
          same, -1 if earlier.
  
      Examples
      --------
      >>> cmp_pkg_version('1.2.1', '1.2.0')
      1
      >>> cmp_pkg_version('1.2.0dev', '1.2.0')
      -1
  
      """
      if any(
          [
              re.match(r"^[a-z, A-Z]", v)
              for v in [version_str, pkg_version_str]
          ]
      ):
          msg = "Invalid version {0} or {1}".format(
              version_str, pkg_version_str
          )
          raise ValueError(msg)
      elif version_cmp(version_str) > version_cmp(pkg_version_str):
          return 1
      elif version_cmp(version_str) == version_cmp(pkg_version_str):
          return 0
      else:
          return -1
  
file_path: dipy/dipy/utils/deprecator.py
imports: import functools
  import warnings
  import re
  from inspect import signature
  from dipy import __version__
  from packaging.version import parse
label_desc: Use image node_id 3 for calling a global function with example usage: cmp_pkg_version(version_str, pkg_version_str) and returns: int, int, unknown