def running_avg():
  """
  Generator and coroutine for keeping track of a changing average. Example usage:
  > avg_helper = running_avg()
  > avg_helper.next()
  > print avg_helper.send(1.0)
  1.0
  > avg_helper.next()
  > print avg_helper.send(2.0)
  1.5
  """

  count = 0
  total = 0.0

  while True:
    total += (yield)
    count += 1
    yield count/total
dataset/ETHPy150Open linkedin/mobster/src/linkedin/mobster/utils.py/running_avg/swapped operands of `/`