code: def test_pickle_parameters():
      """Test that we can pickle a Parameters object."""
      p = lmfit.Parameters()
      p.add("a", 10, True, 0, 100)
      p.add("b", 10, True, 0, 100, "a * sin(1)")
      p.update_constraints()
      p._asteval.symtable["abc"] = "2 * 3.142"
  
      pkl = pickle.dumps(p, -1)
      q = pickle.loads(pkl)
  
      q.update_constraints()
      assert p == q
      assert p is not q
  
      # now test if the asteval machinery survived
      assert q._asteval.symtable["abc"] == "2 * 3.142"
  
      # check that unpickling of Parameters is not affected by expr that
      # refer to Parameter that are added later on. In the following
      # example var_0.expr refers to var_1, which is a Parameter later
      # on in the Parameters dictionary.
      p = lmfit.Parameters()
      p.add("var_0", value=1)
      p.add("var_1", value=2)
      p["var_0"].expr = "var_1"
      pkl = pickle.dumps(p)
      q = pickle.loads(pkl)
  
imports: from copy import copy, deepcopy
  import os
  import pickle
  import numpy
  from numpy.testing import assert_allclose
  import pytest
  import lmfit
  from lmfit.models import VoigtModel
label_desc: Use image node_id 16 for calling a global function with example usage: test_pickle_parameters() without return types