code: def resid(params, x, ydata):
      decay = params["decay"].value
      offset = params["offset"].value
      omega = params["omega"].value
      amp = params["amp"].value
  
      y_model = offset + amp * np.sin(x * omega) * np.exp(-x / decay)
      return y_model - ydata
  
imports: import matplotlib.pyplot
  import numpy
  import lmfit
label_desc: Use image node_id 1 for calling a global function with example usage: resid(params, x, ydata) and returns: unknown