code: def optimize_hypers(self, comp, vals, durs):
      # First the GP to observations
      mygp = gp.GP(self.cov_func.__name__)
      mygp.real_init(comp.shape[1], vals)
      mygp.optimize_hypers(comp, vals)
      self.mean = mygp.mean
      self.ls = mygp.ls
      self.amp2 = mygp.amp2
      self.noise = mygp.noise
  
      # Now the GP to times
      timegp = gp.GP(self.cov_func.__name__)
      timegp.real_init(comp.shape[1], durs)
      timegp.optimize_hypers(comp, durs)
      self.time_mean = timegp.mean
      self.time_amp2 = timegp.amp2
      self.time_noise = timegp.noise
      self.time_ls = timegp.ls
  
      # Save hyperparameter samples
      self.hyper_samples.append(
          (self.mean, self.noise, self.amp2, self.ls)
      )
      self.time_hyper_samples.append(
          (
              self.time_mean,
              self.time_noise,
              self.time_amp2,
              self.time_ls,
          )
      )
      self.dump_hypers()
  
imports: import os
  from ..None import gp
  import sys
  from ..None import util
  import tempfile
  import numpy
  import numpy.random
  import scipy.linalg
  import scipy.stats
  import scipy.optimize
  import pickle
  from ..helpers import *
  from ..Locker import *
  import logging
label_desc: Use image node_id 17 for calling the GPEIperSecChooser obj's underlying member method code with example usage: obj.optimize_hypers(comp, vals, durs) without return types