def METHOD_NAME(
    report: io.TextIOBase,
    tristate_okay: bool = False,
    quiet: bool = False,
    tristate_cell_prefix: str = "",
) -> bool:
    """
    >>> rpt = io.StringIO(MULTIPLE_FAILURES); parse_yosys_check(rpt, False, True) #doctest: +REPORT_NDIFF +NORMALIZE_WHITESPACE
    True
    >>> rpt = io.StringIO(MULTIPLE_FAILURES); parse_yosys_check(rpt, True, True) #doctest: +REPORT_NDIFF +NORMALIZE_WHITESPACE
    True
    >>> rpt = io.StringIO(NO_TRISTATE); parse_yosys_check(rpt, True, True) #doctest: +REPORT_NDIFF +NORMALIZE_WHITESPACE
    True
    >>> rpt = io.StringIO(NO_TRISTATE); parse_yosys_check(rpt, False, True) #doctest: +REPORT_NDIFF +NORMALIZE_WHITESPACE
    True
    >>> rpt = io.StringIO(TRISTATE_ONLY); parse_yosys_check(rpt, True, True) #doctest: +REPORT_NDIFF +NORMALIZE_WHITESPACE
    False
    >>> rpt = io.StringIO(TRISTATE_ONLY); parse_yosys_check(rpt, False, True) #doctest: +REPORT_NDIFF +NORMALIZE_WHITESPACE
    True
    """
    log = (lambda *a, **k: 0) if quiet else print
    error_encountered = False
    current_warning = None
    for line in report:
        if line.startswith("Warning:") or line.startswith("Found and reported"):
            if current_warning is not None:
                if tristate_okay and (
                    ("tribuf" in current_warning)
                    or (
                        tristate_cell_prefix != ""
                        and tristate_cell_prefix in current_warning
                    )
                ):
                    log("Ignoring tristate-related error:")
                    log(current_warning)
                else:
                    log("Encountered check error:")
                    log(current_warning)
                    error_encountered = True
            current_warning = line
        elif starts_with_whitespace.match(line) is not None:
            current_warning += line
        else:
            pass
    return error_encountered