input: Write a python function to optimize a portfolio using scipy's minimize function.
  assert np.allclose(optimize_portfolio(np.ones(5)/5), [0.2, 0.2, 0.2, 0.2, 0.2])
  assert np.allclose(optimize_portfolio(np.array([0.1, 0.2, 0.3, 0.4, 0.0])), [0.1, 0.2, 0.3, 0.4, 0.0])
  assert np.allclose(optimize_portfolio(np.array([0.4, 0.4, 0.1, 0.1, 0.0])), [0.4, 0.4, 0.1, 0.1, 0.0])
output: import numpy as np
  from scipy.optimize import minimize
  
  def optimize_portfolio(initial_weights):
      def objective(weights):
          return np.sum(weights**2)
      
      constraints = ({'type': 'eq', 'fun': lambda weights: np.sum(weights) - 1})
      bounds = [(0, 1) for _ in initial_weights]
      
      result = minimize(objective, initial_weights, method='SLSQP', bounds=bounds, constraints=constraints)
      return result.x