<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def psnr(data1, data2, method='starck', max_pix=255):
 r"""Peak Signal-to-Noise Ratio This method calculates the Peak Signal-to-Noise Ratio between an two data sets Parameters data1 : np.ndarray First data set data2 : np.ndarray Second data set method : str {'starck', 'wiki'}, optional PSNR implementation, default ('starck') max_pix : int, optional Maximum number of pixels, default (max_pix=255) Returns ------- float PSNR value Examples -------- 12.041199826559248 42.110203695399477 Notes ----- 'starck': Implements eq.3.7 from _[S2010] 'wiki': Implements PSNR equation on https://en.wikipedia.org/wiki/Peak_signal-to-noise_ratio .. math:: \mathrm{PSNR} = 20\log_{10}(\mathrm{MAX}_I - 10\log_{10}(\mathrm{MSE})) """


    if method == 'starck':

        return (20 * np.log10((data1.shape[0] * np.abs(np.max(data1) -
                np.min(data1))) / np.linalg.norm(data1 - data2)))

    elif method == 'wiki':

        return (20 * np.log10(max_pix) - 10 *
                np.log10(mse(data1, data2)))

    else:

        raise ValueError('Invalid PSNR method. Options are "starck" and '
                         '"wiki"')