def execute(self, command):
        """
        Execute a command.

        @param command: A command for the invoker to execute.
        @type command: Command
        """
        if command.__class__ not in self._valid_commands:
            raise AttributeError('Invalid Command')
        else:
            self._history.append(command)
            return command.execute()

        Execute a command.

        @param command: A command for the invoker to execute.
        @type command: Command
        
pypattyrn/behavioral/command.py