code: def lowpass(var, key, factor):
      '''a simple lowpass filter'''
      global lowpass_data
      if not key in lowpass_data:
          lowpass_data[key] = var
      else:
          lowpass_data[key] = factor*lowpass_data[key] + (1.0 - factor)*var
      return lowpass_data[keyf lowpass(var, key, factor):
      '''a simple lowpass filter'''
      global lowpass_data
      if not key in lowpass_data:
          lowpass_data[key] = var
      else:
          lowpass_data[key] = factor*lowpass_data[key] + (1.0 - factor)*var
      return lowpass_data[key]
docs: a simple lowpass filter