code: def optimize(request):
      
      #Parse arguments
      seasonLength = int(request.POST.get('seasonLength', 6))
      valuesToForecast = int(request.POST.get('valuesToForecast', 0))
      data = json.loads(request.POST.get('data', []))
  
      original = TimeSeries.from_twodim_list(data)
      original.normalize("day") #due to bug in TimeSeries.apply
      original.set_timeformat("%d.%m")
  
      #optimize smoothing
      hwm = HoltWintersMethod(seasonLength = seasonLength, valuesToForecast = valuesToForecast)
      gridSearch = GridSearch(SMAPE)
      optimal_forecasting, error, optimal_params = gridSearch.optimize(original, [hwm])
  
      #perform smoothing
      smoothed = optimal_forecasting.execute(original)
      smoothed.set_timeformat("%d.%m")
      result = {  'params': optimal_params,
                  'original': original,
                  'smoothed': smoothed,
                  'error': round(error.get_error(), 3)
                  }
      return itty.Response(json.dumps(result, cls=PycastEncoder), content_type='application/json')
docs: Performs Holt Winters Parameter Optimization on the given post data.
      Expects the following values set in the post of the request:
          seasonLength - integer
          valuesToForecast - integer
          data - two dimensional array of [timestamp, value]