<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def extend_array(a, n):
 """Increase the resolution of an array by duplicating its values to fill a larger array. Parameters n: integer Factor by which to expand the array. Returns ------- """

    a_new = a.copy()
    for d in range(a.ndim):
        a_new = np.repeat(a_new, n, axis=d)
    return a_new