<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def add_command(self, cmd_id, handler):
 """Add a command to the TBBlock. The cmd_id must be a non-negative 2 byte number. handler should be the command handler """


        if cmd_id < 0 or cmd_id >= 2**16:
            raise ArgumentError("Command ID in mib block is not a non-negative 2-byte number",
                                cmd_id=cmd_id, handler=handler)

        if cmd_id in self.commands:
            raise ArgumentError("Attempted to add the same command ID twice.", cmd_id=cmd_id,
                                existing_handler=self.commands[cmd_id],
                                new_handler=handler)

        self.commands[cmd_id] = handler