code: def lsmr_operator(Jop, d, active_set):
      """Compute LinearOperator to use in LSMR by dogbox algorithm.
  
      `active_set` mask is used to excluded active variables from computations
      of matrix-vector products.
      """
      m, n = Jop.shape
  
      def matvec(x):
          x_free = x.ravel().copy()
          x_free[active_set] = 0
          return Jop.matvec(x * d)
  
      def rmatvec(x):
          r = d * Jop.rmatvec(x)
          r[active_set] = 0
          return r
  
      return LinearOperator(
          (m, n), matvec=matvec, rmatvec=rmatvec, dtype=float
      )
  
file_path: catboost/contrib/python/scipy/py3/scipy/optimize/_lsq/dogbox.py
imports: import numpy
  from numpy.linalg import lstsq, norm
  from scipy.sparse.linalg import LinearOperator, aslinearoperator, lsmr
  from scipy.optimize import OptimizeResult
  from .common import step_size_to_bound, in_bounds, update_tr_radius, evaluate_quadratic, build_quadratic_1d, minimize_quadratic_1d, compute_grad, compute_jac_scale, check_termination, scale_for_robust_loss_function, print_header_nonlinear, print_iteration_nonlinear
label_desc: Use image node_id 1 for calling a global function with example usage: lsmr_operator(Jop, d, active_set) and returns: LinearOperator, Jop, r