code: func (p Plan) Run(input map[Req][]models.Series) ([]models.Series, error) {
  	var out []models.Series
  	p.data = input
  	for _, fn := range p.funcs {
  		series, err := fn.Exec(p.data)
  		if err != nil {
  			return nil, err
  		}
  		out = append(out, series...)
  	}
  	for i, o := range out {
  		if p.MaxDataPoints != 0 && len(o.Datapoints) > int(p.MaxDataPoints) {
  			// series may have been created by a function that didn't know which consolidation function to default to.
  			// in the future maybe we can do more clever things here. e.g. perSecond maybe consolidate by max.
  			if o.Consolidator == 0 {
  				o.Consolidator = consolidation.Avg
  			}
  			out[i].Datapoints, out[i].Interval = consolidation.ConsolidateStable(o.Datapoints, o.Interval, p.MaxDataPoints, o.Consolidator)
  		}
  	}
  	return out, nil
  }
docs: // Run invokes all processing as specified in the plan (expressions, from/to) with the input as input