code: def averageOutsidePercentile(requestContext, seriesList, n):
      
      averages = [safeAvg(s) for s in seriesList]
  
      if n < 50:
          n = 100 - n
  
      lowPercentile = _getPercentile(averages, 100 - n)
      highPercentile = _getPercentile(averages, n)
  
      return [s for s in seriesList
              if not lowPercentile < safeAvg(s) < highPercentile]
docs: Removes functions lying inside an average percentile interval