Binds an IoC registration to a given key. It should be used if you
        introduce custom registrations; otherwise, registerTransient() and registerSingleton()
        are usually shorter and simpler.
        Registering a key twice raises a KeyError.

def addRegistration(self, key, registration):
        """
        Binds an IoC registration to a given key. It should be used if you
        introduce custom registrations; otherwise, registerTransient() and registerSingleton()
        are usually shorter and simpler.
        Registering a key twice raises a KeyError.
        """
        if key in self._registrations:
            raise KeyError("Key already registered")

        self._registrations[key] = registration
        return self