def METHOD_NAME(source: Source, data_only: bool = False,
                        tokenize_variables: bool = False,
                        lang: LanguagesLike = None) -> 'Iterator[Token]':
    """Parses the given source to resource file tokens.
    Same as :func:`get_tokens` otherwise, but the source is considered to be
    a resource file. This affects, for example, what settings are valid.
    """
    lexer = Lexer(ResourceFileContext(lang=lang), data_only, tokenize_variables)
    lexer.input(source)
    return lexer.get_tokens()