code: def state_dicts_almost_equal(sd1, sd2):
      sd1 = dict(sorted(sd1.items()))
      sd2 = dict(sorted(sd2.items()))
  
      models_are_equal = True
      for ten1, ten2 in zip(sd1.values(), sd2.values()):
          if (ten1 - ten2).abs().sum() > 1e-3:
              models_are_equal = False
  
      return models_are_equal
  
file_path: diffusers/tests/pipelines/test_pipelines_combined.py
imports: import unittest
  import torch
  from huggingface_hub import ModelCard
  from diffusers import DDPMScheduler, DiffusionPipeline, KandinskyV22CombinedPipeline, KandinskyV22Pipeline, KandinskyV22PriorPipeline
  from diffusers.pipelines.pipeline_utils import CONNECTED_PIPES_KEYS
label_desc: Use image node_id 1 for calling a global function with example usage: state_dicts_almost_equal(sd1, sd2) and returns: models_are_equal