def holtWintersConfidenceBands(requestContext, seriesList, delta=3):
    """
    Performs a Holt-Winters forecast using the series as input data and plots
    upper and lower bands with the predicted forecast deviations.
    """
    previewSeconds = 7 * 86400  # 7 days
    # ignore original data and pull new, including our preview
    newContext = requestContext.copy()
    newContext['startTime'] = (requestContext['startTime'] -
                               timedelta(seconds=previewSeconds))
    previewList = evaluateTokens(newContext, requestContext['args'][0])
    results = []
    for series in previewList:
        analysis = holtWintersAnalysis(series)

        data = analysis['predictions']
        windowPoints = previewSeconds // data.step
        forecast = TimeSeries(data.name, data.start + previewSeconds,
                              data.end, data.step, data[windowPoints:])
        forecast.pathExpression = data.pathExpression

        data = analysis['deviations']
        windowPoints = previewSeconds // data.step
        deviation = TimeSeries(data.name, data.start + previewSeconds,
                               data.end, data.step, data[windowPoints:])
        deviation.pathExpression = data.pathExpression

        seriesLength = len(forecast)
        i = 0
        upperBand = list()
        lowerBand = list()
        while i < seriesLength:
            forecast_item = forecast[i]
            deviation_item = deviation[i]
            i = i + 1
            if forecast_item is None or deviation_item is None:
                upperBand.append(None)
                lowerBand.append(None)
            else:
                scaled_deviation = delta * deviation_item
                upperBand.append(forecast_item + scaled_deviation)
                lowerBand.append(forecast_item - scaled_deviation)

        upperName = "holtWintersConfidenceUpper(%s)" % series.name
        lowerName = "holtWintersConfidenceLower(%s)" % series.name
        upperSeries = TimeSeries(upperName, forecast.start, forecast.end,
                                 forecast.step, upperBand)
        lowerSeries = TimeSeries(lowerName, forecast.start, forecast.end,
                                 forecast.step, lowerBand)
        upperSeries.pathExpression = series.pathExpression
        lowerSeries.pathExpression = series.pathExpression
        results.append(lowerSeries)
        results.append(upperSeries)
    return results

    Performs a Holt-Winters forecast using the series as input data and plots
    upper and lower bands with the predicted forecast deviations.
    
graphite_api/functions.py