code: def test_register_stacking():
      f = Dispatcher("f")
  
      @f.register(list)
      @f.register(tuple)
      def rev(x):
          return x[::-1]
  
      assert f((1, 2, 3)) == (3, 2, 1)
      assert f([1, 2, 3]) == [3, 2, 1]
  
      assert raises(NotImplementedError, lambda: f("hello"))
      assert rev("hello") == "olleh"
  
imports: from sympy.multipledispatch.dispatcher import Dispatcher, MDNotImplementedError, MethodDispatcher, halt_ordering, restart_ordering, ambiguity_register_error_ignore_dup
  from sympy.testing.pytest import raises, warns
label_desc: Use image node_id 16 for calling a global function with example usage: test_register_stacking() and returns: x