code: def mult(q1, q2):
      """Multiply two quaternions
  
      Parameters
      ----------
      q1 : 4 element sequence
      q2 : 4 element sequence
  
      Returns
      -------
      q12 : shape (4,) array
  
      Notes
      -----
      See : https://en.wikipedia.org/wiki/Quaternions#Hamilton_product
      """
      w1, x1, y1, z1 = q1
      w2, x2, y2, z2 = q2
      w = w1 * w2 - x1 * x2 - y1 * y2 - z1 * z2
      x = w1 * x2 + x1 * w2 + y1 * z2 - z1 * y2
      y = w1 * y2 + y1 * w2 + z1 * x2 - x1 * z2
      z = w1 * z2 + z1 * w2 + x1 * y2 - y1 * x2
      return np.array([w, x, y, z])
  
file_path: nibabel/nibabel/quaternions.py
imports: import math
  import numpy
  from .casting import sctypes
label_desc: Use image node_id 4 for calling a global function with example usage: mult(q1, q2) and returns: np