code: def magn(xyz, n=1):
      """magnitude of vector"""
      mag = np.sum(xyz**2, axis=1) ** 0.5
      imag = np.where(mag == 0)
      mag[imag] = np.finfo(float).eps
  
      if n > 1:
          return np.tile(mag, (n, 1)).T
      return mag.reshape(len(mag), 1)
  
imports: from dipy.utils.deprecator import deprecate_with_version
  from dipy.tracking.streamline import set_number_of_points
  import numpy
  from scipy.interpolate import splprep, splev
label_desc: Use image node_id 7 for calling a global function with example usage: magn(xyz, n) and returns: mag, np