<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def normalize(self, inplace=True):
 """ Normalizes the values of factor so that they sum to 1. Parameters inplace: boolean If inplace=True it will modify the factor itself, else would return a new factor Returns ------- DiscreteFactor or None: if inplace=True (default) returns None if inplace=False returns a new `DiscreteFactor` instance. Examples -------- array([[[ 0, 1], [ 2, 3], [ 4, 5]], [[ 6, 7], [ 8, 9], [10, 11]]]) ['x1', 'x2', 'x3'] array([2, 3, 2]) array([[[ 0. , 0.01515152], [ 0.03030303, 0.04545455], [ 0.06060606, 0.07575758]], [[ 0.09090909, 0.10606061], [ 0.12121212, 0.13636364], [ 0.15151515, 0.16666667]]]) """

        phi = self if inplace else self.copy()

        phi.values = phi.values / phi.values.sum()

        if not inplace:
            return phi