input: Write a python function to smooth data using a convolution with a specified window size.
  assert np.allclose(smooth_data([1, 2, 3, 4, 5], 3), [1.0, 2.0, 3.0, 4.0, 3.0])
  assert np.allclose(smooth_data([10, 20, 30, 40, 50], 2), [5.0, 15.0, 25.0, 35.0, 45.0])
  assert np.allclose(smooth_data([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], 4), [1.5, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 8.5, 7.5])
output: import numpy as np
  
  def smooth_data(data, window_size):
      window = np.ones(window_size) / window_size
      smoothed = np.convolve(data, window, mode='same')
      return smoothed.tolist()