code: def assert_stage_equal(d1, d2):
      """Keeps the params section in order, and then checks for equality."""
      for d in [d1, d2]:
          assert recurse_not_a_node(d)
          for _, stage_d in d.get("stages", {}).items():
              params = _merge_params(stage_d.get("params", []))
              for k in params:
                  params[k] = sorted(params[k])
              if params:
                  stage_d["params"] = params
      assert d1 == d2
  
file_path: dvc/tests/func/parsing/test_interpolated_entry.py
imports: import os
  from copy import deepcopy
  import pytest
  from dvc.dependency import _merge_params
  from dvc.parsing import DEFAULT_PARAMS_FILE, DataResolver
  from dvc.parsing.context import recurse_not_a_node
  from dvc.parsing.interpolate import escape_str
  from .None import CONTEXT_DATA, RESOLVED_DVC_YAML_DATA, TEMPLATED_DVC_YAML_DATA, USED_VARS
label_desc: Use image node_id 1 for calling a global function with example usage: assert_stage_equal(d1, d2) without return types