class_docstr: Solve a linear equation;
  some methods find the exact solution in a finite number of steps
class_docstr_tok: ["Solve","a","linear","equation",";","some","methods","find","the","exact","solution","in","a","finite","number","of","steps"]
code: def _check(self, jac, N, maxiter, complex=False, **kw):
      np.random.seed(123)
  
      A = np.random.randn(N, N)
      if complex:
          A = A + 1j * np.random.randn(N, N)
      b = np.random.randn(N)
      if complex:
          b = b + 1j * np.random.randn(N)
  
      def func(x):
          return dot(A, x) - b
  
      sol = nonlin.nonlin_solve(
          func,
          np.zeros(N),
          jac,
          maxiter=maxiter,
          f_tol=1e-6,
          line_search=None,
          verbose=0,
      )
      assert_(np.allclose(dot(A, sol), b, atol=1e-6))
  
imports: from __future__ import division, print_function, absolute_import
  from numpy.testing import assert_
  import pytest
  from scipy._lib.six import xrange
  from scipy.optimize import nonlin, root
  from numpy import diag, dot
  from numpy.linalg import inv
  import numpy
  from .test_minpack import pressure_network
label_desc: Use image node_id 1 for calling the TestLinear obj's underlying member method code with example usage: obj._check(jac, N, maxiter, complex) and returns: unknown