def variance(vals):
  vals = filter(lambda x: x is not None, vals)
  avg = mean(vals)
  if avg is None:
    return None
  if avg in (float('inf'), float('-inf')):
    return avg
  return mean(map((avg - _) ** 2, vals))
dataset/ETHPy150Open jansel/opentuner/opentuner/utils/stats.py/variance/swapped operands of `-`