def split_call(lines, open_paren_line=0):
    num_open = 0
    num_closed = 0
    for i, line in enumerate(lines):
        c = line.count('(')
        num_open += c
        if not c and i==open_paren_line:
            raise Exception('Exception open parenthesis in line %d but there is not one there: %s' % (i, str(lines)))
        num_closed += line.count(')')

        if num_open == num_closed:
            return (lines[:i+1], lines[i+1:])

    print ''.join(lines)
    raise Exception('parenthesis are mismatched (%d open, %d closed found)' % (num_open, num_closed))
Returns a 2-tuple where the first element is the list of lines from the
dataset/ETHPy150Open neovim/python-client/scripts/logging_statement_modifier.py/split_call