code: def test_find_MAP_issue_5923():
      # Test that gradient-based minimization works well regardless of the order
      # of variables in `vars`, and even when starting a reasonable distance from
      # the MAP.
      tol = 2.0**-11  # 16 bit machine epsilon, a low bar
      data = np.random.randn(100)
      # data should be roughly mean 0, std 1, but let's
      # normalize anyway to get it really close
      data = (data - np.mean(data)) / np.std(data)
  
      with pm.Model():
          mu = pm.Uniform("mu", -1, 1)
          sigma = pm.Uniform("sigma", 0.5, 1.5)
          pm.Normal("y", mu=mu, tau=sigma**-2, observed=data)
  
          start = {"mu": -0.5, "sigma": 1.25}
          map_est1 = find_MAP(
              progressbar=False, vars=[mu, sigma], start=start
          )
          map_est2 = find_MAP(
              progressbar=False, vars=[sigma, mu], start=start
          )
  
      assert_allclose(map_est1["mu"], 0, atol=tol)
      assert_allclose(map_est1["sigma"], 1, atol=tol)
  
      assert_allclose(map_est2["mu"], 0, atol=tol)
      assert_allclose(map_est2["sigma"], 1, atol=tol)
  
imports: import re
  import numpy
  import pytest
  from numpy.testing import assert_allclose
  import pymc
  from pymc.exceptions import ImputationWarning
  from pymc.step_methods.metropolis import tune
  from pymc.testing import select_by_precision
  from pymc.tuning import find_MAP
  from tests import models
  from tests.models import non_normal, simple_arbitrary_det, simple_model
label_desc: Use image node_id 8 for calling a global function with example usage: test_find_MAP_issue_5923() without return types