def find_closing_bracket(line: str, openbracketid: int) -> int:
    """Returns the index of the closing bracket for a given opening bracket.

    Looks for the closing bracket in string for an opening bracket that is
    pointed by the ``openbracketid``.

    Args:
        line (str) : a single line from the EDIF file
        openbracketid (int): the index of the opening bracket for which the
            closing bracket should be found

    Returns:
        int: index for the closing bracket or -1 if not found
    """
    opencount = 0
    finid = openbracketid
    for c in line[openbracketid:]:
        if c == '(':
            opencount += 1
        elif c == ')':
            opencount -= 1
        if opencount == 0:
            return finid
        finid += 1
    return -1