code: def test_names():
      """Test the regressor naming function."""
      name = "con"
      assert _regressor_names(name, "spm") == [name]
      assert _regressor_names(name, "spm + derivative") == [
          name,
          f"{name}_derivative",
      ]
      assert _regressor_names(
          name, "spm + derivative + dispersion"
      ) == [
          name,
          f"{name}_derivative",
          f"{name}_dispersion",
      ]
      assert _regressor_names(name, "glover") == [name]
      assert _regressor_names(name, "glover + derivative") == [
          name,
          f"{name}_derivative",
      ]
      assert _regressor_names(
          name, "glover + derivative + dispersion"
      ) == [
          name,
          f"{name}_derivative",
          f"{name}_dispersion",
      ]
  
      assert _regressor_names(name, None) == [name]
      assert _regressor_names(name, [None, None]) == [
          f"{name}_0",
          f"{name}_1",
      ]
      assert _regressor_names(name, "typo") == [name]
      assert _regressor_names(name, ["typo", "typo"]) == [
          f"{name}_0",
          f"{name}_1",
      ]
  
      def custom_rf(tr, ov):
          return np.ones(int(tr * ov))
  
      assert _regressor_names(name, custom_rf) == [
          f"{name}_{custom_rf.__name__}"
      ]
      assert _regressor_names(name, [custom_rf]) == [
          f"{name}_{custom_rf.__name__}"
      ]
  
      with pytest.raises(
          ValueError, match="Computed regressor names are not unique"
      ):
          _regressor_names(
              name,
              [
                  lambda tr, ov: np.ones(int(tr * ov)),
                  lambda tr, ov: np.ones(int(tr * ov)),
              ],
          )
  
imports: import warnings
  import numpy
  import pytest
  from numpy.testing import assert_almost_equal, assert_array_almost_equal, assert_array_equal
  from nilearn.glm.first_level.hemodynamic_models import _calculate_tr, _hrf_kernel, _regressor_names, _resample_regressor, _sample_condition, compute_regressor, glover_dispersion_derivative, glover_hrf, glover_time_derivative, orthogonalize, spm_dispersion_derivative, spm_hrf, spm_time_derivative
label_desc: Use image node_id 15 for calling a global function with example usage: test_names() and returns: np