def METHOD_NAME(self, text: str) -> TokenInfos:
    """A stand-in for `tokenize.generate_tokens`."""
    if text != self.last_text:
        self.last_text = text
        readline = io.StringIO(text).readline
        try:
            self.last_tokens = list(tokenize.METHOD_NAME(readline))
        except:
            self.last_text = None
            raise
    return self.last_tokens