code: def test_cmp_pkg_version():
      # Test version comparator
      npt.assert_equal(cmp_pkg_version(dipy.__version__), 0)
      npt.assert_equal(cmp_pkg_version("0.0"), -1)
      npt.assert_equal(cmp_pkg_version("1000.1000.1"), 1)
      npt.assert_equal(
          cmp_pkg_version(dipy.__version__, dipy.__version__), 0
      )
      for test_ver, pkg_ver, exp_out in (
          ("1.0", "1.0", 0),
          ("1.0.0", "1.0", 0),
          ("1.0", "1.0.0", 0),
          ("1.1", "1.1", 0),
          ("1.2", "1.1", 1),
          ("1.1", "1.2", -1),
          ("1.1.1", "1.1.1", 0),
          ("1.1.2", "1.1.1", 1),
          ("1.1.1", "1.1.2", -1),
          ("1.1", "1.1dev", 1),
          ("1.1dev", "1.1", -1),
          ("1.2.1", "1.2.1rc1", 1),
          ("1.2.1rc1", "1.2.1", -1),
          ("1.2.1rc1", "1.2.1rc", 1),
          ("1.2.1rc", "1.2.1rc1", -1),
          ("1.2.1rc1", "1.2.1rc", 1),
          ("1.2.1rc", "1.2.1rc1", -1),
          ("1.2.1b", "1.2.1a", 1),
          ("1.2.1a", "1.2.1b", -1),
      ):
          npt.assert_equal(cmp_pkg_version(test_ver, pkg_ver), exp_out)
  
      npt.assert_raises(ValueError, cmp_pkg_version, "foo.2")
      npt.assert_raises(ValueError, cmp_pkg_version, "foo.2", "1.0")
      npt.assert_raises(ValueError, cmp_pkg_version, "1.0", "foo.2")
      npt.assert_raises(ValueError, cmp_pkg_version, "foo")
  
file_path: dipy/dipy/utils/tests/test_deprecator.py
imports: import sys
  import warnings
  import numpy.testing
  import pytest
  import dipy
  from dipy.testing import clear_and_catch_warnings, assert_true
  from dipy.utils.deprecator import cmp_pkg_version, _add_dep_doc, _ensure_cr, deprecate_with_version, deprecated_params, ArgsDeprecationWarning, ExpiredDeprecationError
label_desc: Use image node_id 1 for calling a global function with example usage: test_cmp_pkg_version() without return types