docs: def _extractReporterIons(ionArrays, reporterMz, mzTolerance):
      """Find and a list of reporter ions and return mz and intensity values.
  
      Expected reporter mz values are searched in "ionArray['mz']" and reported if
      the observed relative deviation is less than specified by "mzTolerance". In
      the case of multiple matches, the one with the minimal deviation is picked.
      If no matching entries are found numpy.nan is returned for the mz value and
      an intensity of 0. The returned arrays are in the order of "reporterMz"
      values.
  
      :param ionArrays: a dictionary containing two numpy arrays of equal size,
          {"i": an array of ion intensities, "mz" an array of ion mz values}
      :param reporterMz: a list of reporter mz values
      :param mzTolerance: maximum allowed relative mz deviation
      :returns: {'mz': numpy.array(), 'i': numpy.array()}
      """
      reporterIons = {'mz': [], 'i': []}
      for reporterMzValue in reporterMz:
          limHi = reporterMzValue * (1+mzTolerance)
          limLo = reporterMzValue * (1-mzTolerance)
          loPos = bisect.bisect_left(ionArrays['mz'], limLo)
          upPos = bisect.bisect_right(ionArrays['mz'], limHi)
  
          matchingValues = ionArrays['mz'][loPos:upPos]
          if matchingValues.size == 0:
              reporterIons['i'].append(0)
              reporterIons['mz'].append(numpy.nan)
          elif matchingValues.size == 1:
              reporterIons['i'].append(ionArrays['i'][loPos])
              reporterIons['mz'].append(ionArrays['mz'][loPos])
          else:
              mzDeviations = numpy.abs(matchingValues-reporterMzValue)
              minDeviationPos = numpy.argmin(mzDeviations)
              bestMatchArrayPos = range(loPos, upPos)[minDeviationPos]
              reporterIons['i'].append(ionArrays['i'][bestMatchArrayPos])
              reporterIons['mz'].append(ionArrays['mz'][bestMatchArrayPos])
  
      reporterIons['mz'] = numpy.array(reporterIons['mz'],
                                       dtype=ionArrays['mz'].dtype
                                       )
      reporterIons['i'] = numpy.array(reporterIons['i'],
                                      dtype=ionArrays['i'].dtype
                                      )
  
      return reporterIons