(expr, braces, stopchar)
return i
Returns the closing position of the expression which is either the first occurrence of a character
    in stopchar that is not in braces, the first unmatched closing brace or the end of the expression.

    Examples
    ========

    >>> from sympy.utilities.compilef import __getClosePos
    >>> __getClosePos('3*x', '()', '+-')
    2
    >>> __getClosePos('3 + x) + 2', '()', '+-')
    2
    >>> __getClosePos('(3 + x)*y) + 4', '()', '+-')
    9
Returns the closing position of the expression which is either the first occurrence of a character
    in stopchar that is not in braces, the first unmatched closing brace or the end of the expression.
Returns the closing position of the expression which is either the first occurrence of a character in stopchar that is not in braces the first unmatched closing brace or the end of the expression .
def __getClosePos(expr, braces, stopchar):
    """
    Returns the closing position of the expression which is either the first occurrence of a character
    in stopchar that is not in braces, the first unmatched closing brace or the end of the expression.

    Examples
    ========

    >>> from sympy.utilities.compilef import __getClosePos
    >>> __getClosePos('3*x', '()', '+-')
    2
    >>> __getClosePos('3 + x) + 2', '()', '+-')
    2
    >>> __getClosePos('(3 + x)*y) + 4', '()', '+-')
    9
    """
    openbraces = 0
    for i, char in enumerate(expr):
        if char == braces[0]:
            openbraces += 1
        elif char == braces[1]:
            if not openbraces:  # happens when operator is in braces
                return i
            openbraces -= 1
        elif char in stopchar and not openbraces:
            return i
    return i
def __getClosePos ( expr , braces , stopchar ) : openbraces = 0 for i , char in enumerate ( expr ) : if char == braces [ 0 ] : openbraces += 1 elif char == braces [ 1 ] : if not openbraces : # happens when operator is in braces return i openbraces -= 1 elif char in stopchar and not openbraces : return i return i