code: def test_qti_model(rng):
      """Test the QTI model class."""
  
      # Input validation
      gtab = gradient_table(np.ones(1), np.array([[1, 0, 0]]))
      npt.assert_raises(ValueError, qti.QtiModel, gtab)
      gtab = gradient_table(
          np.ones(1), np.array([[1, 0, 0]]), btens="LTE"
      )
      npt.assert_warns(UserWarning, qti.QtiModel, gtab)
      npt.assert_raises(
          ValueError, qti.QtiModel, _qti_gtab(rng), "non-linear"
      )
  
      # Design matrix calculation
      gtab = _qti_gtab(rng)
      qtimodel = qti.QtiModel(gtab)
      npt.assert_almost_equal(qtimodel.X, qti.design_matrix(gtab.btens))
  
imports: import numpy
  import numpy.testing
  import dipy.reconst.qti
  from dipy.core.gradients import gradient_table
  from dipy.sims.voxel import vec2vec_rotmat
  from dipy.core.sphere import disperse_charges, HemiSphere
  from dipy.reconst.dti import fractional_anisotropy
  from dipy.testing.decorators import set_random_number_generator
  from dipy.utils.optpkg import optional_package
label_desc: Use image node_id 15 for calling a global function with example usage: test_qti_model(rng) without return types