code: def assert_warn_len_equal(mod, n_in_context):
      mod_warns = mod.__warningregistry__
      # Python 3 appears to clear any pre-existing warnings of the same type,
      # when raising warnings inside a catch_warnings block. So, there is a
      # warning generated by the tests within the context manager, but no
      # previous warnings.
      if "version" in mod_warns:
          # including 'version'
          npt.assert_equal(len(mod_warns), 2)
      else:
          npt.assert_equal(len(mod_warns), n_in_context)
  
file_path: dipy/dipy/testing/tests/test_testing.py
imports: import sys
  import warnings
  import numpy
  import dipy.testing
  import numpy.testing
label_desc: Use image node_id 2 for calling a global function with example usage: assert_warn_len_equal(mod, n_in_context) without return types