code: def wishart_eval(n, V, W, dV=None, dW=None, piV=None):
      """Evaluation of the  probability of W under Wishart(n,V)
  
      Parameters
      ----------
      n: float,
          the number of degrees of freedom (dofs)
      V: array of shape (n,n)
          the scale matrix of the Wishart density
      W: array of shape (n,n)
          the sample to be evaluated
      dV: float, optional,
          determinant of V
      dW: float, optional,
          determinant of W
      piV: array of shape (n,n), optional
           inverse of V
  
      Returns
      -------
      (float) the density
      """
      # check that shape(V)==shape(W)
      p = V.shape[0]
      if dV is None:
          dV = detsh(V)
      if dW is None:
          dW = detsh(W)
      if piV is None:
          piV = inv(V)
      ldW = math.log(dW) * (n - p - 1) / 2
      ltr = -np.trace(np.dot(piV, W)) / 2
      la = (n * p * math.log(2) + math.log(dV) * n) / 2
      lg = math.log(math.pi) * p * (p - 1) / 4
      lg += gammaln(
          np.arange(n - p + 1, n + 1).astype(np.float64) / 2
      ).sum()
      lt = ldW + ltr - la - lg
      return math.exp(lt)
  
imports: import math
  import numpy
  import numpy.random
  from scipy.linalg import cholesky, eigvalsh, inv
  from scipy.special import gammaln
  from .gmm import GMM
  from .utils import kmeans
label_desc: Use image node_id 5 for calling a global function with example usage: wishart_eval(n, V, W, dV, dW, piV) and returns: math