def METHOD_NAME(self, source, noise, snr):
    get_power = lambda x: np.mean(x**2)
    if get_power(noise):
        scl = np.sqrt(
            get_power(source) / (np.power(10, snr / 10) * get_power(noise))
        )
    else:
        scl = 0
    return 1 * source + scl * noise