code: def test_brute_lmfit_vs_scipy_stepsize(params_lmfit):
      """TEST 3: using finite bounds and brute_step for both parameters."""
      # set brute_step for parameters and assert whether that worked correctly
      params_lmfit["x"].set(brute_step=0.25)
      params_lmfit["y"].set(brute_step=0.25)
      assert_equal(params_lmfit["x"].brute_step, 0.25)
      assert_equal(params_lmfit["y"].brute_step, 0.25)
  
      rranges = (slice(-4, 4, 0.25), slice(-2, 2, 0.25))
      ret = optimize.brute(
          func_scipy,
          rranges,
          args=params,
          full_output=True,
          Ns=20,
          finish=None,
      )
      mini = lmfit.Minimizer(func_lmfit, params_lmfit)
      out = mini.minimize(method="brute")
  
      assert_equal(ret[2], out.brute_grid)  # grid identical
      assert_equal(
          ret[3], out.brute_Jout
      )  # function values on grid identical
  
      # best-fit values and function value identical
      assert_equal(ret[0][0], out.brute_x0[0])
      assert_equal(ret[0][1], out.brute_x0[1])
      assert_equal(ret[1], out.brute_fval)
  
      points_x = np.arange(
          rranges[0].start, rranges[0].stop, rranges[0].step
      ).size
      points_y = np.arange(
          rranges[1].start, rranges[1].stop, rranges[1].step
      ).size
      nmb_evals = points_x * points_y
      assert_equal(out.nfev, nmb_evals)
  
imports: import pickle
  import numpy
  from numpy.testing import assert_allclose, assert_equal
  import pytest
  from scipy import optimize
  import lmfit
label_desc: Use image node_id 6 for calling a global function with example usage: test_brute_lmfit_vs_scipy_stepsize(params_lmfit) without return types