code: def test_Dispatcher():
      foo = Dispatcher()
      foo.register(int, lambda a, b, c=1: a + b + c)
      foo.register(float, lambda a, b, c=1: a - b + c)
      foo.register(object, lambda a, b, c=1: 10)
  
      class Bar:
          pass
  
      b = Bar()
      assert foo(1, 2) == 4
      assert foo(1, 2.0, 3.0) == 6.0
      assert foo(1.0, 2.0, 3.0) == 2.0
      assert foo(b, 2) == 10
  
file_path: datashader/datashader/tests/test_utils.py
imports: from __future__ import annotations
  import numpy
  from xarray import DataArray
  from datashader.datashape import dshape
  from datashader.utils import Dispatcher, apply, calc_res, isreal, orient_array
label_desc: Use image node_id 1 for calling a global function with example usage: test_Dispatcher() without return types