def METHOD_NAME(buf: Union[bytes, bytearray]) -> bytes:
    """
    Returns a copy of ``buf`` that retains only the sequences of English
    alphabet and high byte characters that are not between <> characters.
    This filter can be applied to all scripts which contain both English
    characters and extended ASCII characters, but is currently only used by
    ``Latin1Prober``.
    """
    filtered = bytearray()
    in_tag = False
    prev = 0
    buf = memoryview(buf).cast("c")
    for curr, buf_char in enumerate(buf):
        # Check if we're coming out of or entering an XML tag
        # https://github.com/python/typeshed/issues/8182
        if buf_char == b">":  # type: ignore[comparison-overlap]
            prev = curr + 1
            in_tag = False
        # https://github.com/python/typeshed/issues/8182
        elif buf_char == b"<":  # type: ignore[comparison-overlap]
            if curr > prev and not in_tag:
                # Keep everything after last non-extended-ASCII,
                # non-alphabetic character
                filtered.extend(buf[prev:curr])
                # Output a space to delimit stretch we kept
                filtered.extend(b" ")
            in_tag = True
    # If we're not in a tag...
    if not in_tag:
        # Keep everything after last non-extended-ASCII, non-alphabetic
        # character
        filtered.extend(buf[prev:])
    return filtered