code: def test_lower_triangular():
      tensor = np.arange(9).reshape((3, 3))
      D = lower_triangular(tensor)
      npt.assert_array_equal(D, [0, 3, 4, 6, 7, 8])
      D = lower_triangular(tensor, 1)
      npt.assert_array_equal(D, [0, 3, 4, 6, 7, 8, 0])
      npt.assert_raises(ValueError, lower_triangular, np.zeros((2, 3)))
      shape = (4, 5, 6)
      many_tensors = np.empty(shape + (3, 3))
      many_tensors[:] = tensor
      result = np.empty(shape + (6,))
      result[:] = [0, 3, 4, 6, 7, 8]
      D = lower_triangular(many_tensors)
      npt.assert_array_equal(D, result)
      D = lower_triangular(many_tensors, 1)
      result = np.empty(shape + (7,))
      result[:] = [0, 3, 4, 6, 7, 8, 0]
      npt.assert_array_equal(D, result)
  
imports: import warnings
  import numpy
  import numpy.testing
  import scipy.optimize
  import dipy.reconst.dti
  from dipy.io.gradients import read_bvals_bvecs
  from dipy.reconst.dti import ols_resort_msg, axial_diffusivity, color_fa, fractional_anisotropy, from_lower_triangular, geodesic_anisotropy, lower_triangular, mean_diffusivity, radial_diffusivity, TensorModel, trace, linearity, planarity, sphericity, decompose_tensor, _decompose_tensor_nan
  from dipy.io.image import load_nifti_data
  from dipy.data import get_fnames, dsi_voxels, get_sphere
  from dipy.core.subdivide_octahedron import create_unit_sphere
  import dipy.core.gradients
  import dipy.core.sphere
  from dipy.sims.voxel import single_tensor
  from dipy.testing.decorators import set_random_number_generator
label_desc: Use image node_id 13 for calling a global function with example usage: test_lower_triangular() without return types