code: def assert_set_equal(
      estimate: tp.Iterable[tp.Any],
      reference: tp.Iterable[tp.Any],
      err_msg: str = "",
  ) -> None:
      """Asserts that both sets are equals, with comprehensive error message.
      This function should only be used in tests.
      Parameters
      ----------
      estimate: iterable
          sequence of elements to compare with the reference set of elements
      reference: iterable
          reference sequence of elements
      """
      estimate, reference = (set(x) for x in [estimate, reference])
      elements = [
          ("additional", estimate - reference),
          ("missing", reference - estimate),
      ]
      messages = [
          "  - {} element(s): {}.".format(name, s)
          for (name, s) in elements
          if s
      ]
      if messages:
          messages = (
              ([err_msg] if err_msg else [])
              + ["Sets are not equal:"]
              + messages
          )
          raise AssertionError("\n".join(messages))
  
imports: import re
  import os
  import warnings
  import platform
  import unittest
  import inspect
  import contextlib
  from pathlib import Path
  import typing
  import numpy
  from .None import errors
label_desc: Use image node_id 2 for calling a global function with example usage: assert_set_equal(estimate, reference, err_msg) without return types