code: def test_eq_dunder():
      """Tests equality dunder for BaseObject descendants.
  
      Equality should be determined only by get_params results.
  
      Raises
      ------
      AssertionError if logic behind __eq__ is incorrect, logic tested:
          equality of non-composites depends only on params, not on identity
          equality of composites depends only on params, not on identity
          result is not affected by fitting the estimator
      """
      non_composite = FittableCompositionDummy(foo=42)
      non_composite_2 = FittableCompositionDummy(foo=42)
      non_composite_3 = FittableCompositionDummy(foo=84)
  
      composite = FittableCompositionDummy(foo=non_composite)
      composite_2 = FittableCompositionDummy(foo=non_composite_2)
      composite_3 = FittableCompositionDummy(foo=non_composite_3)
  
      assert non_composite == non_composite
      assert composite == composite
      assert non_composite == non_composite_2
      assert non_composite != non_composite_3
      assert non_composite_2 != non_composite_3
      assert composite == composite_2
      assert composite != composite_3
      assert composite_2 != composite_3
  
      # equality should not be affected by fitting
      composite.fit()
      non_composite_2.fit()
  
      assert non_composite == non_composite
      assert composite == composite
      assert non_composite == non_composite_2
      assert non_composite != non_composite_3
      assert non_composite_2 != non_composite_3
      assert composite == composite_2
      assert composite != composite_3
      assert composite_2 != composite_3
  
imports: from copy import deepcopy
  import pytest
  from sktime.base import BaseEstimator, BaseObject
  from sktime.utils.validation._dependencies import _check_soft_dependencies
label_desc: Use image node_id 15 for calling a global function with example usage: test_eq_dunder() without return types