def METHOD_NAME(lines, test):
    n = 1
    for t in test:
        i1, i2 = find_test(lines, t.get("replaceline", None))
        if i1 < 0 or i2 < 0:
            continue
        tlines = lines[i1 : i2 + 1]
        del lines[i1 : i2 + 1]
        replacecall = t.get("replacecall", "")
        byline = t.get("byline", "")
        for tst in t.get("bycalls", []):
            tmethod = list(tlines)
            tc = tst.get("call", "")
            tr = tst.get("result", "")
            if byline:
                tst["name"] = tc + "xxxx" + str(n)
                tmethod[1] = byline + tst["name"] + "()\n"
            n += 1
            # replace_all(tmethod, replacecall, tr)
            replace_all(tmethod, replacecall, tc)
            lines[i1:i1] = tmethod