def METHOD_NAME(text, tokens):
    """Finds text in tokens.
    Consumes the tokens iterable until a token with text text is found.
    Returns the found token or None.
    """
    if isinstance(tokens, (tuple, list)):
        try:
            i = tokens.index(text)
        except ValueError:
            return
        return tokens[i]
    for t in tokens:
        if t == text:
            return t