<s> """<STR_LIT>""" <EOL> from windml . preprocessing . missing_data_finder import MissingDataFinder <EOL> from numpy import zeros , int32 , float32 , nan <EOL> class OverrideMissing ( object ) : <EOL> def override ( self , timeseries , timestep , override_val ) : <EOL> val = override_val <EOL> new_amount = timeseries . shape [ <NUM_LIT:0> ] <EOL> misses = MissingDataFinder ( ) . find ( timeseries , timestep ) <EOL> starts = { } <EOL> for start , end , amount in misses : <EOL> new_amount += amount <EOL> starts [ start ] = [ end , amount ] <EOL> filled = zeros ( ( new_amount , ) , dtype = [ ( '<STR_LIT:date>' , int32 ) , ( '<STR_LIT>' , float32 ) , ( '<STR_LIT>' , float32 ) ] ) <EOL> keys = starts . keys ( ) <EOL> current_index = <NUM_LIT:0> <EOL> for i in range ( len ( timeseries ) ) : <EOL> if ( i in keys ) : <EOL> cs = '<STR_LIT>' <EOL> d = '<STR_LIT:date>' <EOL> filled [ current_index ] = timeseries [ i ] <EOL> current_index += <NUM_LIT:1> <EOL> end , n = starts [ i ] <EOL> for j in range ( <NUM_LIT:1> , n + <NUM_LIT:1> ) : <EOL> new_timestep = timeseries [ i ] [ d ] + j * timestep <EOL> filled [ current_index ] = ( new_timestep , val , val ) <EOL> current_index += <NUM_LIT:1> <EOL> else : <EOL> filled [ current_index ] = timeseries [ i ] <EOL> current_index += <NUM_LIT:1> <EOL> return filled </s>
