code: def snr_from_loglr(loglr):
      
      singleval = isinstance(loglr, float)
      if singleval:
          loglr = numpy.array([loglr])
      # temporarily quiet sqrt(-1) warnings
      numpysettings = numpy.seterr(invalid='ignore')
      snrs = numpy.sqrt(2*loglr)
      numpy.seterr(**numpysettings)
      snrs[numpy.isnan(snrs)] = 0.
      if singleval:
          snrs = snrs[0]
      return snrs
docs: Returns SNR computed from the given log likelihood ratio(s). This is
      defined as `sqrt(2*loglr)`.If the log likelihood ratio is < 0, returns 0.
  
      Parameters
      ----------
      loglr : array or float
          The log likelihood ratio(s) to evaluate.
  
      Returns
      -------
      array or float
          The SNRs computed from the log likelihood ratios.