code: def grad_optimize_ei_over_hypers(
      self, cand, comp, pend, vals, compute_grad=True
  ):
      summed_ei = 0
      summed_grad_ei = np.zeros(cand.shape).flatten()
      ls = self.ls.copy()
      amp2 = self.amp2
      mean = self.mean
      noise = self.noise
  
      for hyper in self.hyper_samples:
          self.mean = hyper[0]
          self.noise = hyper[1]
          self.amp2 = hyper[2]
          self.ls = hyper[3]
          if compute_grad:
              (ei, g_ei) = self.grad_optimize_ei(
                  cand, comp, pend, vals, compute_grad
              )
              summed_grad_ei = summed_grad_ei + g_ei
          else:
              ei = self.grad_optimize_ei(
                  cand, comp, pend, vals, compute_grad
              )
          summed_ei += ei
  
      self.mean = mean
      self.amp2 = amp2
      self.noise = noise
      self.ls = ls.copy()
  
      if compute_grad:
          return (summed_ei, summed_grad_ei)
      else:
          return summed_ei
  
imports: import os
  from ..None import gp
  import sys
  from ..None import util
  import tempfile
  import pickle
  import copy
  import numpy
  import numpy.random
  import scipy.linalg
  import scipy.stats
  import scipy.optimize
  import multiprocessing
  from ..helpers import *
  from ..Locker import *
  import logging
label_desc: Use image node_id 10 for calling the GPEIOptChooser obj's underlying member method code with example usage: obj.grad_optimize_ei_over_hypers(cand, comp, pend, vals, compute_grad) and returns: summed_ei,  summed_grad_ei, summed_ei