code: def test_union_types():
      f = Dispatcher("f")
      f.register((int, float))(inc)
  
      assert f(1) == 2
      assert f(1.0) == 2.0
  
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 5 for calling a global function with example usage: test_union_types() without return types