<commit_before>package com.jetbrains.python.console;

import com.intellij.execution.console.LanguageConsoleImpl;
import com.intellij.execution.console.LanguageConsoleViewImpl;
import com.intellij.execution.process.ProcessOutputTypes;
import com.intellij.execution.runners.ConsoleExecuteActionHandler;
import com.intellij.execution.ui.ConsoleViewContentType;
import com.intellij.openapi.editor.Document;
import com.intellij.openapi.editor.ex.EditorEx;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.Key;
import com.intellij.openapi.wm.IdeFocusManager;
import com.jetbrains.python.PythonLanguage;
import com.jetbrains.python.console.completion.PythonConsoleAutopopupBlockingHandler;
import com.jetbrains.python.console.pydev.ConsoleCommunication;
import org.jetbrains.annotations.NotNull;

/**
 * @author traff
 */
public class PythonConsoleView extends LanguageConsoleViewImpl implements PyCodeExecutor {
  private ConsoleExecuteActionHandler myExecuteActionHandler;

  public PythonConsoleView(final Project project, final String title) {
    super(project, new PythonLanguageConsole(project, title));
    getPythonLanguageConsole().setPythonConsoleView(this);
    getPythonLanguageConsole().setPrompt(PyPromptUtil.ORDINARY_PROMPT);
  }

  public void setConsoleCommunication(final ConsoleCommunication communication) {
    getPythonLanguageConsole().setConsoleCommunication(communication);
  }

  public void setExecutionHandler(@NotNull ConsoleExecuteActionHandler consoleExecuteActionHandler) {
    myExecuteActionHandler = consoleExecuteActionHandler;
  }

  public void requestFocus() {
    IdeFocusManager.findInstance().requestFocus(getPythonLanguageConsole().getConsoleEditor().getContentComponent(), true);
  }
<commit_msg>Added optimization checks before running hyperlinks highlighting code. Add possibility to turn off folding updating (it was a bottle neck and unnecessary in Python Console).<commit_after>package com.jetbrains.python.console;

import com.intellij.execution.console.LanguageConsoleImpl;
import com.intellij.execution.console.LanguageConsoleViewImpl;
import com.intellij.execution.process.ProcessOutputTypes;
import com.intellij.execution.runners.ConsoleExecuteActionHandler;
import com.intellij.execution.ui.ConsoleViewContentType;
import com.intellij.openapi.editor.Document;
import com.intellij.openapi.editor.ex.EditorEx;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.Key;
import com.intellij.openapi.wm.IdeFocusManager;
import com.jetbrains.python.PythonLanguage;
import com.jetbrains.python.console.completion.PythonConsoleAutopopupBlockingHandler;
import com.jetbrains.python.console.pydev.ConsoleCommunication;
import org.jetbrains.annotations.NotNull;

/**
 * @author traff
 */
public class PythonConsoleView extends LanguageConsoleViewImpl implements PyCodeExecutor {
  private ConsoleExecuteActionHandler myExecuteActionHandler;

  public PythonConsoleView(final Project project, final String title) {
    super(project, new PythonLanguageConsole(project, title));
    getPythonLanguageConsole().setPythonConsoleView(this);
    getPythonLanguageConsole().setPrompt(PyPromptUtil.ORDINARY_PROMPT);
    setUpdateFoldingsEnabled(false);
  }

  public void setConsoleCommunication(final ConsoleCommunication communication) {
    getPythonLanguageConsole().setConsoleCommunication(communication);
  }

  public void setExecutionHandler(@NotNull ConsoleExecuteActionHandler consoleExecuteActionHandler) {
    myExecuteActionHandler = consoleExecuteActionHandler;
  }

  public void requestFocus() {
    IdeFocusManager.findInstance().requestFocus(getPythonLanguageConsole().getConsoleEditor().getContentComponent(), true);
  }

{'fraction_non_alphanumeric': 0.08192318023099651, 'fraction_numerical': 0.0, 'mean_word_length': 7.387387387387387, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3226643', 'n_tokens_mistral': 1024, 'n_tokens_neox': 963, 'n_words': 171}