input: Write a function to optimize a given multivariate function using the scipy library. The function should take as input the multivariate function and an initial guess for the optimization, and return the optimized values of the variables as a NumPy array. If the input function or initial guess is invalid, raise an appropriate exception.
  assert np.array_equal(optimize_function(lambda x: x[0]**2 + x[1]**2, [1, 1]), [0, 0])
  assert np.array_equal(optimize_function(lambda x: x[0]**2 + x[1]**2, [0, 0]), [0, 0])
  assert np.array_equal(optimize_function(lambda x: (x[0]-1)**2 + (x[1]-1)**2, [1, 1]), [1, 1])
  assert np.array_equal(optimize_function(lambda x: (x[0]-5)**2 + (x[1]-5)**2, [0, 0]), [5, 5])
  assert np.array_equal(optimize_function(lambda x: x[0]**2, [2]), [0])
output: def optimize_function(func, initial_guess):
      import numpy as np
      from scipy.optimize import minimize
      
      if not callable(func) or not isinstance(initial_guess, (list, np.ndarray)):
          raise ValueError("Invalid input function or initial guess")
      
      result = minimize(func, initial_guess)
      return result.x