def compute_grad(J, f):
    if isinstance(J, LinearOperator):
        return J.rmatvec(f)
    else:
        return J.T.dot(f)
Test LoadPemGeneric().
dataset/ETHPy150Open scipy/scipy/scipy/optimize/_lsq/common.py/compute_grad--crossover with--dataset/ETHPy150Open google/simian/src/tests/simian/auth/x509_test.py/X509ModuleTest.testLoadPemGenericWhenMissingHeader