code: def compare_result(x, y, tolerance):
      """compares the objects x and y, whether they be python immutable types,
      iterables or numerical arrays (within a given tolerance)
      """
      assert type(x) == type(y)
      if isinstance(x, dict):
          assert set(x.keys()) == set(y.keys())
          for key in x:
              assert compare_result_field(x[key], y[key], tolerance)
          return True
      if isinstance(x, tuple):
          for xx, yy in zip(x, y):
              assert compare_result_field(xx, yy, tolerance)
          return True
      return compare_result_field(x, y, tolerance)
  
imports: import os
  import pytest
  import requests
  from modelkit import ModelLibrary, testing
  from modelkit.core.models.tensorflow_model import AsyncTensorflowModel, TensorflowModel, has_tensorflow
  from modelkit.core.settings import LibrarySettings
  from modelkit.testing import tf_serving_fixture
  from modelkit.utils.tensorflow import write_config
  from tests import TEST_DIR
  from tests.conftest import skip_unless
label_desc: Use image node_id 7 for calling a global function with example usage: compare_result(x, y, tolerance) and returns: compare_result_field, True, True