code: def test_linear_operators():
      A = np.arange(6).reshape((3, 2))
  
      d_left = np.array([-1, 2, 5])
      DA = np.diag(d_left).dot(A)
      J_left = left_multiplied_operator(A, d_left)
  
      d_right = np.array([5, 10])
      AD = A.dot(np.diag(d_right))
      J_right = right_multiplied_operator(A, d_right)
  
      x = np.array([-2, 3])
      X = -2 * np.arange(2, 8).reshape((2, 3))
      xt = np.array([0, -2, 15])
  
      assert_allclose(DA.dot(x), J_left.matvec(x))
      assert_allclose(DA.dot(X), J_left.matmat(X))
      assert_allclose(DA.T.dot(xt), J_left.rmatvec(xt))
  
      assert_allclose(AD.dot(x), J_right.matvec(x))
      assert_allclose(AD.dot(X), J_right.matmat(X))
      assert_allclose(AD.T.dot(xt), J_right.rmatvec(xt))
  
file_path: scipy/scipy/optimize/tests/test_lsq_common.py
imports: from numpy.testing import assert_, assert_allclose, assert_equal
  from pytest import raises
  import numpy
  from scipy.optimize._lsq.common import step_size_to_bound, find_active_constraints, make_strictly_feasible, CL_scaling_vector, intersect_trust_region, build_quadratic_1d, minimize_quadratic_1d, evaluate_quadratic, reflective_transformation, left_multiplied_operator, right_multiplied_operator
label_desc: Use image node_id 2 for calling a global function with example usage: test_linear_operators() without return types