def renderLatexSinglePage(
                            inputData,
                            targetData,
                            questionIdict,
                            ansIdict,
                            urlDict,
                            outputFolder,
                            pictureFolder='img',
                            topK=10,
                            comments=None,
                            caption=None,
                            modelOutputs=None,
                            modelNames=None,
                            questionIds=None):
    result = []
    result.append('\\begin{figure*}[ht!]\n')
    result.append('\\centering\\small\n')
    result.append('$\\begin{array}{p{5cm} p{5cm} p{5cm}}\n')
    imgPerRow = 3
    imgFolder = os.path.join(outputFolder, pictureFolder)
    for n in range(inputData.shape[0]):
        # Download the images
        imageId = inputData[n, 0, 0]
        imageFilename = urlDict[imageId - 1]
        r = requests.get(imageFilename)
        qid = questionIds[n] if questionIds is not None else n
        if not os.path.exists(imgFolder):
            os.makedirs(imgFolder)
        with open(os.path.join(imgFolder, '%d.jpg' % qid), 'wb') as f:
            f.write(r.content)
        question = it.decodeQuestion(inputData[n], questionIdict)
        answer = ansIdict[targetData[n, 0]]
        topAnswers, topAnswerScores = \
                    pickTopAnswers(
                            ansIdict,
                            n,
                            topK=topK,
                            modelOutputs=modelOutputs, 
                            modelNames=modelNames)
        comment = comments[n] \
                if comments is not None else None
        result.append(
            renderLatexSingleItem(
                            qid,
                            question,
                            answer,
                            pictureFolder=pictureFolder,
                            comment=comment,
                            topAnswers=topAnswers,
                            topAnswerScores=topAnswerScores,
                            modelNames=modelNames))
        if np.mod(n, imgPerRow) == imgPerRow - 1:
            result.append('\\\\\n')
            if n != 1 - inputData.shape[0]:
                result.append('\\noalign{\\smallskip}\\\
                    noalign{\\smallskip}\\noalign{\\smallskip}\n')
        else:
            result.append('&\n')
    result.append('\end{array}$\n')
    result.append('\caption{%s}\n' % caption if caption is not None else '')
    result.append('\end{figure*}\n')
    return ''.join(result)
dataset/ETHPy150Open renmengye/imageqa-public/src/imageqa_render.py/renderLatexSinglePage/swapped operands of `-`