def getFilesToAnnotateByPatch(baseDir, exclude, patchInput, filesDict=None):
    if filesDict is None:
        files = {}
    else:
        files = filesDict
    cwd = os.getcwd()
    try:
        os.chdir(baseDir)
        patchReaderPath = os.environ['COVERAGE_PATH'] + '/patchreader'
        stdin, output = os.popen2((patchReaderPath,) % '%s -p', 'w')
        stdin.write(patchInput.read())
        stdin.flush()
        stdin.close()
    finally:
        os.chdir(cwd)
    while True:
        fileName = output.readline().strip()
        if not fileName:
            break
        lines = [ int(x) for x in output.readline().split()]
        files[fileName] = lines
    for fileName in files.keys():
        for excludePattern in exclude:
            if re.search(excludePattern, fileName):
                del files[fileName]
dataset/ETHPy150Open sassoftware/conary/conary_test/coveragewrapper.py/getFilesToAnnotateByPatch/swapped operands of `%`