def register(self, *args, **kwargs):
        """ Register the given model with the given details. """
        # TODO: change to exception handling
        if 'model' in kwargs:
            model = kwargs.pop('model')
        elif args:
            args = list(args)
            model = args.pop(0)
        else:
            raise TypeError("register() requires the argument 'model'")

        if model in self.models:
            raise AlreadyRegistered("The model %s is already registered." % model)

        self.models[model] = Populator(model, *args, **kwargs)
dataset/ETHPy150Open willhardy/Roll-Your-Own/rollyourown/populate/registration.py/PopulateCache.register/original