<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def log_normal(self, x):
 """ Returns the log density of probability of x or the one dimensional array of all log probabilities if many vectors are given. @param x : may be of (n,) shape """

        d = self.mu.shape[0]
        xc = x - self.mu
        if len(x.shape) == 1:
            exp_term = numpy.sum(numpy.multiply(xc, numpy.dot(self.inv, xc)))
        else:
            exp_term = numpy.sum(numpy.multiply(xc, numpy.dot(xc, self.inv)), axis=1)

        return -.5 * (d * numpy.log(2 * numpy.pi) + numpy.log(self.det) + exp_term)