code: def test_guess_from_peak():
      """Regression test for guess_from_peak function (see GH #627)."""
      x = np.linspace(-5, 5)
      amplitude = 0.8
      center = 1.7
      sigma = 0.3
      y = lineshapes.lorentzian(
          x, amplitude=amplitude, center=center, sigma=sigma
      )
  
      model = models.LorentzianModel()
      guess_increasing_x = model.guess(y, x=x)
      guess_decreasing_x = model.guess(y[::-1], x=x[::-1])
  
      assert guess_increasing_x == guess_decreasing_x
  
      for param, value in zip(
          ["amplitude", "center", "sigma"], [amplitude, center, sigma]
      ):
          assert (
              np.abs((guess_increasing_x[param].value - value) / value)
              < 0.5
          )
  
file_path: lmfit-py/tests/test_builtin_models.py
imports: import inspect
  import numpy
  from numpy.testing import assert_allclose
  import pytest
  from scipy.optimize import fsolve
  from lmfit import lineshapes, models
  from lmfit.models import GaussianModel
label_desc: Use image node_id 6 for calling a global function with example usage: test_guess_from_peak() without return types