code: def backtracking(A, g, x, p, theta, p_dot_g, lb, ub):
      """Find an appropriate step size using backtracking line search."""
      alpha = 1
      while True:
          x_new, _ = reflective_transformation(x + alpha * p, lb, ub)
          step = x_new - x
          cost_change = -evaluate_quadratic(A, g, step)
          if cost_change > -0.1 * alpha * p_dot_g:
              break
          alpha *= 0.5
  
      active = find_active_constraints(x_new, lb, ub)
      if np.any(active != 0):
          x_new, _ = reflective_transformation(
              x + theta * alpha * p, lb, ub
          )
          x_new = make_strictly_feasible(x_new, lb, ub, rstep=0)
          step = x_new - x
          cost_change = -evaluate_quadratic(A, g, step)
  
      return x, step, cost_change
  
file_path: catboost/contrib/python/scipy/py3/scipy/optimize/_lsq/trf_linear.py
imports: import numpy
  from numpy.linalg import norm
  from scipy.linalg import qr, solve_triangular
  from scipy.sparse.linalg import lsmr
  from scipy.optimize import OptimizeResult
  from .givens_elimination import givens_elimination
  from .common import EPS, step_size_to_bound, find_active_constraints, in_bounds, make_strictly_feasible, build_quadratic_1d, evaluate_quadratic, minimize_quadratic_1d, CL_scaling_vector, reflective_transformation, print_header_linear, print_iteration_linear, compute_grad, regularized_lsq_operator, right_multiplied_operator
label_desc: Use image node_id 2 for calling a global function with example usage: backtracking(A, g, x, p, theta, p_dot_g, lb, ub) and returns: x,  step,  cost_change