<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def average_gradient(data, *kwargs):
 """ Compute average gradient norm of an image """

    return np.average(np.array(np.gradient(data))**2)