code: def _compute_snr(arr1, arr2):
      arr1 = arr1.flatten()
      arr2 = arr2.flatten()
      noise = arr1 - arr2
      noise_var = _np.sum(noise**2) / len(noise) + 1e-7
      signal_energy = _np.sum(arr2**2) / len(arr2)
      max_signal_energy = _np.amax(arr2**2)
      snr = 10 * _np.log10(signal_energy / noise_var)
      psnr = 10 * _np.log10(max_signal_energy / noise_var)
      return snr, psnr
  
imports: import itertools
  import os
  import tempfile
  import numpy
  import PIL.Image
  import pytest
  import coremltools
  from coremltools._deps import _HAS_TF_2, _HAS_TORCH, MSG_TF2_NOT_FOUND, MSG_TORCH_NOT_FOUND
  from coremltools.converters.mil import Builder
  from coremltools.converters.mil.testing_reqs import backends, compute_units
label_desc: Use image node_id 2 for calling a global function with example usage: _compute_snr(arr1, arr2) and returns: snr,  psnr