<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_stetson_k(self, mag, avg, err):
 """ Return Stetson K feature. Parameters mag : array_like An array of magnitude. avg : float An average value of magnitudes. err : array_like An array of magnitude errors. Returns ------- stetson_k : float Stetson K value. """


        residual = (mag - avg) / err
        stetson_k = np.sum(np.fabs(residual)) \
                    / np.sqrt(np.sum(residual * residual)) / np.sqrt(len(mag))

        return stetson_k