def find_balanced(text, start=0, start_sep='(', end_sep=')'):
    """ Finds balanced ``start_sep`` with ``end_sep`` assuming
        that ``start`` is pointing to ``start_sep`` in ``text``.
    """
    if start >= len(text) or start_sep != text[start]:
        return start
    balanced = 1
    pos = start + 1
    while pos < len(text):
        token = text[pos]
        pos += 1
        if token == end_sep:
            if balanced == 1:
                return pos
            balanced -= 1
        elif token == start_sep:
            balanced += 1
    return start