@Nullable
  @Override
  public ASTNode parseContents(@NotNull ASTNode node) {
    final LanguageLevel languageLevel = getLanguageLevel(node.getPsi());
    PythonRuntimeService instance = PythonRuntimeService.getInstance();
    if (instance != null) {
      PythonConsoleData consoleData = instance.getPythonConsoleData(node);
      if (consoleData != null) {
        return parseConsoleCode(node, consoleData);
      }
    }
    final PsiElement psi = node.getPsi();
    if (psi != null) {
      final Project project = psi.getProject();
      final PsiBuilderFactory factory = PsiBuilderFactory.getInstance();
      final Language language = getLanguage();
      final ParserDefinition parserDefinition = LanguageParserDefinitions.INSTANCE.forLanguage(language);
      if (parserDefinition == null) {
        return null;
      }
      final Lexer lexer = parserDefinition.createLexer(project);
      final PsiParser parser = parserDefinition.createParser(project);
      final PsiBuilder builder = factory.createBuilder(project, node, lexer, language, node.getChars());
      if (parser instanceof PyParser pythonParser) {
        pythonParser.setLanguageLevel(languageLevel);
      }
      var startTime = System.nanoTime();
      var result = parser.parse(this, builder).getFirstChildNode();
      ParsingDiagnostics.registerParse(builder, getLanguage(), System.nanoTime() - startTime);
      return result;
    }
    return null;
  }
@Nullable
  @Override
  public ASTNode parseContents(@NotNull ASTNode node)