input: Write a python function to optimize the weights such that their sum is 1, using the given objective function and constraint.
  assert np.allclose(optimize_weights(), [0.33333333, 0.33333333, 0.33333333], atol=1e-6)
  assert np.isclose(np.sum(optimize_weights()), 1.0)
output: import numpy as np
  from scipy.optimize import minimize
  
  def optimize_weights():
      def objective(weights):
          return np.sum(weights**2)
  
      constraints = ({'type': 'eq', 'fun': lambda w: np.sum(w) - 1})
      bounds = [(0, 1)] * 3
      initial_guess = [1/3, 1/3, 1/3]
  
      result = minimize(objective, initial_guess, bounds=bounds, constraints=constraints)
  
      return result.x