def validateCommands(commands):
    '''Given a list of reportlab's table commands, it fixes some common errors
    and/or removes commands that can't be fixed'''

    fixed=[]

    for command in commands:
        command[0]=command[0].upper()
        flag=False
        # See if the command is valid
        if command[0] not in validCommands:
            log.error('Unknown table command %s in stylesheet',command[0])
            continue

        # See if start and stop are the right types
        if type(command[1]) not in (ListType,TupleType):
            log.error('Start cell in table command should be list or tuple, got %s [%s]',type(command[1]),command[1])
            flag=True

        if type(command[2]) not in (ListType,TupleType):
            log.error('Stop cell in table command should be list or tuple, got %s [%s]',type(command[1]),command[1])
            flag=True

        # See if the number of arguments is right
        l=len(command)-3
        if validCommands[command[0]][1] > l:
            log.error('Too many arguments in table command: %s',command)
            flag=True

        if l<validCommands[command[0]][0]:
            log.error('Too few arguments in table command: %s',command)
            flag=True

        # Validate argument types
        for pos,arg in enumerate(command[3:]):
            typ = validCommands[command[0]][pos+2]
            if typ == "color":
                # Convert all 'string' colors to numeric
                command[3+pos]=formatColor(arg)
            elif typ == "colorlist":
                command[3+pos]=[ formatColor(c) for c in arg]
            elif typ == "number":
                pass
            elif typ == "string":
                # Force string, not unicode
                command[3+pos]=str(arg)
            else:
                log.error("This should never happen: wrong type %s",typ)

        if not flag:
            fixed.append(command)

    return fixed
dataset/ETHPy150Open rst2pdf/rst2pdf/rst2pdf/styles.py/validateCommands/swapped operands of `>`