code: def test_encode_decode(obj, obj_type):
      """Test encoding/decoding of the various object types to/from JSON."""
      encoded = encode4js(obj)
      decoded = decode4js(encoded)
  
      if isinstance(obj, np.ndarray) and obj.dtype == "object":
          assert decoded[0] == obj[0]
          assert np.all(decoded[1] == obj[1])
      else:
          assert decoded == obj
  
      assert isinstance(decoded, obj_type)
  
file_path: lmfit-py/tests/test_jsonutils.py
imports: from types import BuiltinFunctionType, FunctionType
  import numpy
  import pytest
  from scipy.optimize import basinhopping
  import lmfit
  from lmfit.jsonutils import decode4js, encode4js, find_importer, import_from
  from lmfit.printfuncs import alphanumeric_sort
label_desc: Use image node_id 2 for calling a global function with example usage: test_encode_decode(obj, obj_type) without return types