code: def setup_test():
      """Set numpy print options to "legacy" for new versions of numpy.
  
      If imported into a file, pytest will run this before any doctests.
  
      References
      ----------
      https://github.com/numpy/numpy/commit/710e0327687b9f7653e5ac02d222ba62c657a718
      https://github.com/numpy/numpy/commit/734b907fc2f7af6e40ec989ca49ee6d87e21c495
      https://github.com/nipy/nibabel/pull/556
  
      """
      if Version(np.__version__) >= Version("1.14"):
          np.set_printoptions(legacy="1.13")
  
      # Temporary fix until scipy release in October 2018
      # must be removed after that
      # print the first occurrence of matching warnings for each location
      # (module + line number) where the warning is issued
      if (
          Version(np.__version__) >= Version("1.15")
          and Version(scipy.version.short_version) <= "1.1.0"
      ):
          warnings.simplefilter(
              action="default", category=FutureWarning
          )
  
      warnings.simplefilter("always", category=UserWarning)
  
file_path: dipy/dipy/testing/__init__.py
imports: import operator
  from functools import partial
  from os.path import dirname, abspath, join
  from numpy.testing import assert_array_equal
  import numpy
  import numpy.testing
  import scipy
  from packaging.version import Version
  import warnings
label_desc: Use image node_id 3 for calling a global function with example usage: setup_test() without return types