code: def _get_tokens_for_line_func(self, cli, document):
          
          # Cache using `document.text`.
          def get_tokens_for_line():
              return self.lexer.lex_document(cli, document)
  
          return self._token_cache.get(document.text, get_tokens_for_line)
docs: Create a function that returns the tokens for a given line.