code: def uplift(model, features):
      """
      Parameters
      ----------
      model :
          CatBoost / CatBoostClassifier / CatBoostRanker / CatBoostRegressor model
          NOTE: uplift allways use RawFormulaVal
      features :
          must be a dict mapping strings (factor names) or integers (flat indexes) into pairs of floats (base and next values)
      """
      model = model.copy()
  
      factor_ids = []
      factor_base_values = []
      factor_next_values = []
      for factor_id, (
          factor_base_value,
          factor_next_value,
      ) in features.items():
          assert type(factor_id) is str or type(factor_id) is int
          assert (
              type(factor_base_value) is float
              or type(factor_base_value) is int
          )
          assert (
              type(factor_next_value) is float
              or type(factor_next_value) is int
          )
          if len(factor_ids):
              assert type(factor_ids[0]) == type(factor_id)
  
          factor_ids.append(factor_id)
          factor_base_values.append(float(factor_base_value))
          factor_next_values.append(float(factor_next_value))
  
      if len(factor_ids):
          if type(factor_ids[0]) is str:
              _uplift_by_name(
                  model._object,
                  factor_ids,
                  factor_base_values,
                  factor_next_values,
              )
          else:
              _uplift_by_index(
                  model._object,
                  factor_ids,
                  factor_base_values,
                  factor_next_values,
              )
  
      return model
  
label_desc: Use image node_id 2 for calling a global function with example usage: uplift(model, features) and returns: model