def METHOD_NAME(
    self, text, pattern, at_depth=None, extract_strings=False, **kwargs
):
    """
    Given a pattern to search for eg ("AUTHORITY", "[", String.Double, ",", String.Double, "]") -
    returns the text that matches the first occurrence of that pattern.
    Whitespace is skipped and is not included in the result.
    """
    token_iter = super().get_tokens(text, **kwargs)
    token_iter = filter(lambda tok: tok[0] != Whitespace, token_iter)
    depth = 0
    result = []
    result_len = 0
    for tokentype, value in token_iter:
        if tokentype is OpenBracket:
            depth += 1
        elif tokentype is CloseBracket:
            depth -= 1
        if at_depth is not None and result_len == 0 and depth != at_depth:
            continue
        if self._matches(pattern[result_len], tokentype, value):
            result.append(value)
            result_len += 1
            if result_len == len(pattern):
                return (
                    self._extract_strings(pattern, result)
                    if extract_strings
                    else tuple(result)
                )
        else:
            result.clear()
            result_len = 0
    return None