code: def initialize_callbacks(self):
          
          callbacks_ = []
  
          class Dummy:
              # We cannot use None as dummy value since None is a
              # legitimate value to be set.
              pass
  
          for name, cb in self._uniquely_named_callbacks():
              # check if callback itself is changed
              param_callback = getattr(self, 'callbacks__' + name, Dummy)
              if param_callback is not Dummy:  # callback itself was set
                  cb = param_callback
  
              # below: check for callback params
              # don't set a parameter for non-existing callback
              params = self._get_params_for('callbacks__{}'.format(name))
              if (cb is None) and params:
                  raise ValueError("Trying to set a parameter for callback {} "
                                   "which does not exist.".format(name))
              if cb is None:
                  continue
  
              if isinstance(cb, type):  # uninitialized:
                  cb = cb(**params)
              else:
                  cb.set_params(**params)
              cb.initialize()
              callbacks_.append((name, cb))
  
          self.callbacks_ = callbacks_
          return self
docs: Initializes all callbacks and save the result in the
          ``callbacks_`` attribute.
  
          Both ``default_callbacks`` and ``callbacks`` are used (in that
          order). Callbacks may either be initialized or not, and if
          they don't have a name, the name is inferred from the class
          name. The ``initialize`` method is called on all callbacks.
  
          The final result will be a list of tuples, where each tuple
          consists of a name and an initialized callback. If names are
          not unique, a ValueError is raised.