class_docstr: Class to handle the cost of evaluating the function.
  
  param cost_withGradients: function that returns the cost of evaluating the function and its gradient. By default
  no cost is used. Options are:
      - cost_withGradients is some pre-defined cost function. Should return numpy array as outputs.
      - cost_withGradients = 'evaluation_time'.
  
  .. Note:: if cost_withGradients = 'evaluation time' the evaluation time of the function is used to model a GP whose
  mean is used as cost.
docstr: Updates the GP used to handle the cost.
  
  param x: input of the GP for the cost model.
  param x_cost: values of the time cost at the input locations.
code: def update_cost_model(self, x, cost_x):
      """
      Updates the GP used to handle the cost.
  
      param x: input of the GP for the cost model.
      param x_cost: values of the time cost at the input locations.
      """
  
      if self.cost_type == "evaluation_time":
          cost_evals = np.log(np.atleast_2d(np.asarray(cost_x)).T)
  
          if self.num_updates == 0:
              X_all = x
              costs_all = cost_evals
          else:
              X_all = np.vstack((self.cost_model.model.X, x))
              costs_all = np.vstack(
                  (self.cost_model.model.Y, cost_evals)
              )
  
          self.num_updates += 1
          self.cost_model.updateModel(X_all, costs_all, None, None)
  
file_path: GPyOpt/GPyOpt/core/task/cost.py
imports: from ...models import GPModel
  import numpy
label_desc: Use image node_id 4 for calling the CostModel obj's underlying member method code with example usage: obj.update_cost_model(x, cost_x) without return types