def METHOD_NAME(remap_lines, temp_prefix, pssm, ruby_script):
    #assert test(remap_lines) == "FAIL"
    header = remap_lines[:1]
    remap_lines = remap_lines[1:]
    n = 2     # Initial granularity
    while len(remap_lines) >= 2:
        start = 0
        subset_length = len(remap_lines) / n
        some_complement_is_failing = False
        while start < len(remap_lines):
            complement = remap_lines[:start] + remap_lines[start + subset_length:]
            if test(header + complement, temp_prefix, pssm, ruby_script) == "FAIL":
                remap_lines = complement
                n = max(n - 1, 2)
                some_complement_is_failing = True
                break
            start += subset_length
        if not some_complement_is_failing:
            n = min(n*2, len(remap_lines))
            if n == len(remap_lines):
                break
    return header + remap_lines