def find_brackets(smiles):
    """
    Find indexes of the first matching brackets ( "(" and ")" ). It doesn't check if all brackets are valid, i.e. complete.

    Parameters
    ----------
    smiles

    Returns
    -------
    list
        Index of first and second matching bracket.
    """

    indexes = []
    n_brackets = 0
    for i, char in enumerate(smiles):
        if char == "(":
            if n_brackets == 0:
                indexes.append(i)
            n_brackets += 1
        elif char == ")":
            n_brackets -= 1
            if n_brackets == 0:
                indexes.append(i)
                break
    return indexes