code: def test_equals():
      assert _mutable_equal(
          Categorical([1, 2, 3], label="x"),
          Categorical([1, 2, 3], label="x"),
      )
      assert not _mutable_equal(Categorical([1, 2, 3], label="x"), 1)
      assert not _mutable_equal(1, Categorical([1, 2, 3], label="x"))
      assert not _mutable_equal(1, 2)
      assert not _mutable_equal(False, True)
      assert _mutable_equal(False, False)
      assert _mutable_equal("a", "a")
      assert _mutable_equal("abc", "abc")
      assert not _mutable_equal("abc", "abcd")
      assert _mutable_equal(
          {
              "a": Categorical([1, 2, 3], label="x"),
              "b": Categorical([4, 5, 6], label="y"),
          },
          {
              "a": Categorical([1, 2, 3], label="x"),
              "b": Categorical([4, 5, 6], label="y"),
          },
      )
      assert not _mutable_equal(
          {
              "a": Categorical([1, 2, 3], label="x"),
              "b": Categorical([4, 5, 6], label="y"),
          },
          {
              "a": Categorical([1, 2, 3], label="x"),
              "b": Categorical([4, 5, 6], label="y"),
              "c": Categorical([7, 8, 9], label="z"),
          },
      )
      assert not _mutable_equal(
          {
              "a": Categorical([1, 2, 3], label="x"),
              "b": Categorical([4, 5, 6], label="y"),
          },
          {
              "a": Categorical([1, 2, 3], label="x"),
              "b": Categorical([4, 5, 6], label="z"),
          },
      )
      assert not _mutable_equal(
          {
              "a": Categorical([1, 2, 3], label="x"),
              "b": Categorical([4, 5, 6], label="y"),
              "c": Categorical([7, 8, 9], label="z"),
          },
          {
              "a": Categorical([1, 2, 3], label="x"),
              "b": Categorical([4, 5, 6], label="y"),
          },
      )
      assert _mutable_equal(
          {
              "a": ["b", "c", Numerical(0, 1, label="x")],
          },
          {
              "a": ["b", "c", Numerical(0, 1, label="x")],
          },
      )
      assert _mutable_equal([1, 2, 3], [1, 2, 3])
      assert not _mutable_equal([1, 2, 3], [1, 2, 3, 4])
      assert not _mutable_equal(
          [1, 2, Categorical([1, 2, 3])], [1, 2, 3]
      )
  
      assert _mutable_equal(
          {
              MyCategorical([0, 1], label="x"),
              MyCategorical([2, 3], label="y"),
          },
          {
              MyCategorical([0, 1], label="x"),
              MyCategorical([2, 3], label="y"),
          },
      )
      assert not _mutable_equal(
          {
              MyCategorical([0, 1], label="x"),
              MyCategorical([2, 3], label="y"),
              3,
          },
          {
              MyCategorical([0, 1], label="x"),
              MyCategorical([2, 3], label="y"),
          },
      )
      assert not _mutable_equal(
          {
              MyCategorical([0, 1], label="x"),
              MyCategorical([4, 5], label="y"),
          },
          {
              MyCategorical([0, 1], label="x"),
              MyCategorical([2, 3], label="y"),
          },
      )
  
      assert _mutable_equal(
          Categorical([1, 2], label="a") * 0.75
          + Numerical(0, 1, label="b"),
          Categorical([1, 2], label="a") * 0.75
          + Numerical(0, 1, label="b"),
      )
      assert _mutable_equal(
          MutableExpression.to_int(
              Categorical([1, 2], label="a") * 0.75
          )
          + Numerical(0, 1, label="b"),
          MutableExpression.to_int(
              Categorical([1, 2], label="a") * 0.75
          )
          + Numerical(0, 1, label="b"),
      )
      assert not _mutable_equal(
          Categorical([1, 2], label="a") * 0.75
          + Numerical(0, 1, label="b"),
          0.75 * Categorical([1, 2], label="a")
          + Numerical(0, 1, label="b"),
      )
  
      assert _mutable_equal(
          MutableList(
              [
                  Categorical([1, 2], label="a"),
                  Categorical([3, 4], label="b"),
              ]
          ),
          MutableList(
              [
                  Categorical([1, 2], label="a"),
                  Categorical([3, 4], label="b"),
              ]
          ),
      )
      assert not _mutable_equal(
          MutableList(
              [
                  Categorical([1, 2], label="a"),
                  Categorical([3, 4], label="b"),
              ]
          ),
          MutableList(
              [
                  Categorical([1, 2], label="a"),
                  Categorical([3, 5], label="b"),
              ]
          ),
      )
      assert _mutable_equal(
          MutableDict(
              {
                  "a": Categorical([1, 2], label="a"),
                  "x": Categorical([3, 4], label="b"),
              }
          ),
          MutableDict(
              {
                  "a": Categorical([1, 2], label="a"),
                  "x": Categorical([3, 4], label="b"),
              }
          ),
      )
      assert not _mutable_equal(
          MutableDict(
              {
                  "a": Categorical([1, 2], label="a"),
                  "x": Categorical([3, 4], label="b"),
              }
          ),
          MutableDict(
              {
                  "a": Categorical([1, 2], label="a"),
                  "x": Categorical([3, 4], label="x"),
              }
          ),
      )
  
      assert _mutable_equal(
          np.zeros_like((2, 2)), np.zeros_like((2, 2))
      )
      assert not _mutable_equal(
          np.zeros_like((2, 2)), np.ones_like((2, 2))
      )
  
imports: import math
  from collections import Counter
  import numpy
  import pytest
  from nni.mutable import *
  from nni.mutable.mutable import _dedup_labeled_mutables, _mutable_equal
label_desc: Use image node_id 15 for calling a global function with example usage: test_equals() without return types