def clean_series(start, stop, rollup, series):
 start_timestamp = to_timestamp(start)
 stop_timestamp = to_timestamp(stop)
 result = []
 for (i, (timestamp, value)) in enumerate(series):
  assert (timestamp == (start_timestamp + (rollup * i)))
  if (timestamp >= stop_timestamp):
   break
  result.append((timestamp, value))
 return result

def clean_series ( start , stop , rollup , series ) : start_timestamp = to_timestamp ( start ) stop_timestamp = to_timestamp ( stop ) result = [ ] for ( i , ( timestamp , value ) ) in enumerate ( series ) : assert ( timestamp == ( start_timestamp + ( rollup * i ) ) ) if ( timestamp >= stop_timestamp ) : break result . append ( ( timestamp , value ) ) return result
validate a series .