code: def diagonal_gaussian_energy_grad(x, y):  # pragma: no cover
      mu_1 = x[0] - y[0]
      mu_2 = x[1] - y[1]
  
      sigma_11 = np.abs(x[2]) + np.abs(y[2])
      sigma_12 = 0.0
      sigma_22 = np.abs(x[3]) + np.abs(y[3])
  
      det = sigma_11 * sigma_22
      sign_s1 = np.sign(x[2])
      sign_s2 = np.sign(x[3])
  
      if det == 0.0:
          # TODO: figure out the right thing to do here
          return mu_1**2 + mu_2**2, np.array(
              [0.0, 0.0, 1.0, 1.0], dtype=np.float32
          )
  
      cross_term = 2 * sigma_12
      m_dist = (
          np.abs(sigma_22) * (mu_1**2)
          - cross_term * mu_1 * mu_2
          + np.abs(sigma_11) * (mu_2**2)
      )
  
      dist = (m_dist / det + np.log(np.abs(det))) / 2.0 + np.log(
          2 * np.pi
      )
      grad = np.empty(6, dtype=np.float32)
  
      grad[0] = (2 * sigma_22 * mu_1 - cross_term * mu_2) / (2 * det)
      grad[1] = (2 * sigma_11 * mu_2 - cross_term * mu_1) / (2 * det)
      grad[2] = (
          sign_s1
          * (sigma_22 * (det - m_dist) + det * mu_2**2)
          / (2 * det**2)
      )
      grad[3] = (
          sign_s2
          * (sigma_11 * (det - m_dist) + det * mu_1**2)
          / (2 * det**2)
      )
  
      return dist, grad
  
imports: import numba
  import numpy
  import scipy.stats
  from sklearn.metrics import pairwise_distances
label_desc: Use image node_id 48 for calling a global function with example usage: diagonal_gaussian_energy_grad(x, y) and returns: dist,  grad, unknown,  np