code: def interpolate(requestContext, seriesList, limit=INF):
      
      for series in seriesList:
          series.name = "interpolate(%s)" % (series.name)
          series.pathExpression = series.name
          consecutiveNones = 0
          for i, value in enumerate(series):
              series[i] = value
  
              # No 'keeping' can be done on the first value because we have no
              # idea what came before it.
              if i == 0:
                  continue
  
              if value is None:
                  consecutiveNones += 1
              elif consecutiveNones == 0:
                  # Have a value but no need to interpolate
                  continue
              elif series[i - consecutiveNones - 1] is None:
                  # Have a value but can't interpolate: reset count
                  consecutiveNones = 0
                  continue
              else:
                  # Have a value and can interpolate. If a non-None value is
                  # seen before the limit of Nones is hit, backfill all the
                  # missing datapoints with the last known value.
                  if consecutiveNones > 0 and consecutiveNones <= limit:
                      lastIndex = i - consecutiveNones - 1
                      lastValue = series[lastIndex]
                      for index in range(i - consecutiveNones, i):
                          nextValue = lastValue + (index - lastIndex)
                          nextValue = nextValue * (value - lastValue)
                          nextValue = nextValue / (consecutiveNones + 1)
                          series[index] = nextValue
  
                  consecutiveNones = 0
  
      return seriesList
docs: Takes one metric or a wildcard seriesList, and optionally a limit to the
      number of 'None' values to skip over. Continues the line with the last
      received value when gaps ('None' values) appear in your data, rather than
      breaking your line.
  
      Example::
  
          &target=interpolate(Server01.connections.handled)
          &target=interpolate(Server01.connections.handled, 10)