def overwrite_from_dates(asof, dense_dates, sparse_dates, asset_idx, value):
 if (asof is pd.NaT):
  return
 first_row = dense_dates.searchsorted(asof)
 next_idx = sparse_dates.searchsorted(asof.asm8, 'right')
 if (next_idx == len(sparse_dates)):
  last_row = (len(dense_dates) - 1)
 else:
  last_row = (dense_dates.searchsorted(sparse_dates[next_idx]) - 1)
 if (first_row > last_row):
  return
 (first, last) = asset_idx
 (yield Float64Overwrite(first_row, last_row, first, last, value))

def overwrite_from_dates ( asof , dense_dates , sparse_dates , asset_idx , value ) : if ( asof is pd . NaT ) : return first_row = dense_dates . searchsorted ( asof ) next_idx = sparse_dates . searchsorted ( asof . asm8 , 'right' ) if ( next_idx == len ( sparse_dates ) ) : last_row = ( len ( dense_dates ) - 1 ) else : last_row = ( dense_dates . searchsorted ( sparse_dates [ next_idx ] ) - 1 ) if ( first_row > last_row ) : return ( first , last ) = asset_idx ( yield Float64Overwrite ( first_row , last_row , first , last , value ) )
construct a float64overwrite with the correct start and end date based on the asof date of the delta .