nodes: 0, module; 1, function_definition; 2, function_name:integral; 3, parameters; 4, block; 5, identifier:requestContext; 6, identifier:seriesList; 7, expression_statement; 8, expression_statement; 9, for_statement; 10, return_statement; 11, comment:"""
      This will show the sum over time, sort of like a continuous addition
      function. Useful for finding totals or trends in metrics that are
      collected per minute.
  
      Example::
  
          &target=integral(company.sales.perMinute)
  
      This would start at zero on the left side of the graph, adding the sales
      each minute, and show the total sales for the time period selected at the
      right side, (time now, or the time specified by '&until=').
      """; 12, assignment; 13, identifier:series; 14, identifier:seriesList; 15, block; 16, identifier:results; 17, identifier:results; 18, list; 19, expression_statement; 20, expression_statement; 21, for_statement; 22, expression_statement; 23, expression_statement; 24, expression_statement; 25, expression_statement; 26, assignment; 27, assignment; 28, identifier:val; 29, identifier:series; 30, block; 31, assignment; 32, assignment; 33, assignment; 34, call; 35, identifier:newValues; 36, list; 37, identifier:current; 38, float:0.0; 39, if_statement; 40, identifier:newName; 41, binary_operator:"integral(%s)" % series.name; 42, identifier:newSeries; 43, call; 44, attribute; 45, identifier:newName; 46, attribute; 47, argument_list; 48, comparison_operator:val is None; 49, block; 50, else_clause; 51, string:"integral(%s)"; 52, attribute; 53, identifier:TimeSeries; 54, argument_list; 55, identifier:newSeries; 56, identifier:pathExpression; 57, identifier:results; 58, identifier:append; 59, identifier:newSeries; 60, identifier:val; 61, None; 62, expression_statement; 63, block; 64, identifier:series; 65, identifier:name; 66, identifier:newName; 67, attribute; 68, attribute; 69, attribute; 70, identifier:newValues; 71, call; 72, expression_statement; 73, expression_statement; 74, identifier:series; 75, identifier:start; 76, identifier:series; 77, identifier:end; 78, identifier:series; 79, identifier:step; 80, attribute; 81, argument_list; 82, augmented_assignment; 83, call; 84, identifier:newValues; 85, identifier:append; 86, None; 87, identifier:current; 88, identifier:val; 89, attribute; 90, argument_list; 91, identifier:newValues; 92, identifier:append; 93, identifier:current
code: def integral(requestContext, seriesList):
      """
      This will show the sum over time, sort of like a continuous addition
      function. Useful for finding totals or trends in metrics that are
      collected per minute.
  
      Example::
  
          &target=integral(company.sales.perMinute)
  
      This would start at zero on the left side of the graph, adding the sales
      each minute, and show the total sales for the time period selected at the
      right side, (time now, or the time specified by '&until=').
      """
      results = []
      for series in seriesList:
          newValues = []
          current = 0.0
          for val in series:
              if val is None:
                  newValues.append(None)
              else:
                  current += val
                  newValues.append(current)
          newName = "integral(%s)" % series.name
          newSeries = TimeSeries(newName, series.start, series.end, series.step,
                                 newValues)
          newSeries.pathExpression = newName
          results.append(newSeries)
      return results