human
I wrote the below code

    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)

What's a good function header?
assistant
#Here's a good function header.

def right_multiplied_operator(J, d):