code: def right_multiplied_operator(J, d):
      """Return J diag(d) as LinearOperator."""
      J = aslinearoperator(J)
  
      def matvec(x):
          return J.matvec(np.ravel(x) * d)
  
      def matmat(X):
          return J.matmat(X * d[:, np.newaxis])
  
      def rmatvec(x):
          return d * J.rmatvec(x)
  
      return LinearOperator(
          J.shape, matvec=matvec, matmat=matmat, rmatvec=rmatvec
      )
  
imports: from __future__ import division, print_function, absolute_import
  from math import copysign
  import numpy
  from numpy.linalg import norm
  from scipy.linalg import cho_factor, cho_solve, LinAlgError
  from scipy.sparse import issparse
  from scipy.sparse.linalg import LinearOperator, aslinearoperator
label_desc: Use image node_id 21 for calling a global function with example usage: right_multiplied_operator(J, d) and returns: LinearOperator, J, J, unknown