code: def test_default_threads():
      if have_openmp:
          try:
              expected_threads = int(
                  os.environ.get("OMP_NUM_THREADS", None)
              )
              if expected_threads < 1:
                  raise ValueError("invalid number of threads")
          except (ValueError, TypeError):
              expected_threads = cpu_count()
      else:
          expected_threads = 1
      assert_equal(default_threads, expected_threads)
  
file_path: dipy/dipy/utils/tests/test_omp.py
imports: import os
  from dipy.utils.omp import cpu_count, thread_count, default_threads, _set_omp_threads, _restore_omp_threads, have_openmp, determine_num_threads
  import pytest
  from dipy.utils.parallel import has_ray, has_joblib
  from numpy.testing import assert_equal, assert_raises
label_desc: Use image node_id 2 for calling a global function with example usage: test_default_threads() without return types