code: def add_function(dsp, inputs_kwargs=False, inputs_defaults=False, **kw):
      
  
      def decorator(f):
          dsp.add_func(
              f, inputs_kwargs=inputs_kwargs, inputs_defaults=inputs_defaults,
              **kw
          )
          return f
  
      return decorator
docs: Decorator to add a function to a dispatcher.
  
      :param dsp:
          A dispatcher.
      :type dsp: schedula.Dispatcher
  
      :param inputs_kwargs:
          Do you want to include kwargs as inputs? 
      :type inputs_kwargs: bool
      
      :param inputs_defaults:
          Do you want to set default values? 
      :type inputs_defaults: bool
      
      :param kw:
          See :func:~`schedula.dispatcher.Dispatcher.add_function`.
      :type kw: dict
  
      :return:
          Decorator.
      :rtype: callable
  
      **------------------------------------------------------------------------**
      
      **Example**:
      
      .. dispatcher:: sol
         :opt: graph_attr={'ratio': '1'}
         :code:
  
          >>> import schedula as sh
          >>> dsp = sh.Dispatcher(name='Dispatcher')
          >>> @sh.add_function(dsp, outputs=['e'])
          ... @sh.add_function(dsp, False, True, outputs=['i'], inputs='ecah')
          ... @sh.add_function(dsp, True, outputs=['l'])
          ... def f(a, b, c, d=1):
          ...     return (a + b) - c + d
          >>> @sh.add_function(dsp, True, outputs=['d'])
          ... def g(e, i, *args, d=0):
          ...     return e + i + d
          >>> sol = dsp({'a': 1, 'b': 2, 'c': 3}); sol
          Solution([('a', 1), ('b', 2), ('c', 3), ('h', 1), ('e', 1), ('i', 4),
                    ('d', 5), ('l', 5)])