<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def register_provider(self, func):
 """ Register a provider function. """

        if 'provides' not in getattr(func, '__di__', {}):
            raise DiayException('function %r is not a provider' % func)

        self.factories[func.__di__['provides']] = func