code: def linear_weights(i, n):
      
      if i >= n:
          return 0.0
      return float(n - i) / float(n)
docs: A window function that falls off arithmetically.
  
      This is used to calculate a weighted moving average (WMA) that gives higher
      weight to changes near the point being analyzed, and smooth out changes at
      the opposite edge of the moving window.  See bug 879903 for details.