def clean_parenthesized_string(string):
    """Produce a clipped substring of `string` comprising all characters from the beginning of
    `string` through the closing paren that matches the first opening paren in `string`

    Parameters
    ----------
    string: String
        A string that contains a parenthesized statement in its entirety, along with extra content
        to be removed. The target parenthesized statement may contain additional parentheses

    Returns
    -------
    clean_string: String
        A substring of `string`, extending from the beginning of `string`, through the closing paren
        that matches the first opening paren found, producing a valid parenthesized statement"""
    close_paren = 0
    for i in range(len(string)):
        if string[i] == '(':
            close_paren += 1
        elif string[i] == ')':
            if close_paren > 1:
                close_paren -= 1
            else:
                return string[:i + 1]
    raise ValueError(
        f'Need closing paren:"""\n{string}\n"""\nRemaining close_paren: {close_paren}'
        )
