def smooth_list(l): res = [] cur_l = None for v in l: if not cur_l: cur_l = Load(m=1, initial_value=v) cur_l.update_load(v, 5) res.append(cur_l.get_load()) return res
def quick_update(self, prev_val, new_val, m, interval): l = Load(m=m, initial_value=prev_val) l.update_load(new_val, interval) return l.get_load()