<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def bind(self, key, factory):
 """ Bind a factory to a key. :raises AlreadyBoundError: if the key is alrady bound """

        if key in self.factories:
            raise AlreadyBoundError(key)
        else:
            self.factories[key] = factory