# Path: mu/virtual_environment.py
# ENCODING = sys.stdout.encoding if hasattr(sys.stdout, "encoding") else "utf-8"
# class VirtualEnvironmentError(Exception):
# class VirtualEnvironmentEnsureError(VirtualEnvironmentError):
# class VirtualEnvironmentCreateError(VirtualEnvironmentError):
# class Process(QObject):
# class Pip(object):
# class SplashLogHandler(logging.NullHandler):
# class VirtualEnvironment(object):
#     def __init__(self, message):
# def compact(text):
#     def __init__(self):
#     def _set_up_run(self, **envvars):
#     def run_blocking(self, command, args, wait_for_s=30.0, **envvars):
#     def run(self, command, args, **envvars):
#     def wait(self, wait_for_s=30):
#     def data(self):
#     def _started(self):
#     def _readyRead(self):
#     def _finished(self):
#     def __init__(self, pip_executable):
#     def run(
#         self, command, *args, wait_for_s=120.0, slots=Process.Slots(), **kwargs
#     ):
#     def install(self, packages, slots=Process.Slots(), **kwargs):
#     def uninstall(self, packages, slots=Process.Slots(), **kwargs):
#     def freeze(self):
#     def list(self):
#     def installed(self):
#     def __init__(self, emitter):
#     def emit(self, record):
#     def handle(self, record):
#     def __init__(self, dirpath=None):
#     def __str__(self):
#     def _generate_dirpath():
#     def run_subprocess(self, *args, **kwargs):
#     def reset_pip(self):
#     def relocate(self, dirpath):
#     def run_python(self, *args, slots=Process.Slots()):
#     def _directory_is_venv(self):
#     def quarantine_venv(self, reason="FAILED"):
#     def recreate(self):
#     def ensure_and_create(self, emitter=None):
#     def ensure(self):
#     def ensure_path(self):
#     def ensure_interpreter(self):
#     def ensure_interpreter_version(self):
#     def ensure_key_modules(self):
#     def ensure_pip(self):
#     def create(self):
#     def create_venv(self):
#     def install_jupyter_kernel(self):
#     def install_from_zipped_wheels(self, zipped_wheels_filepath):
#     def install_baseline_packages(self):
#     def register_baseline_packages(self):
#     def baseline_packages(self):
#     def install_user_packages(self, packages, slots=Process.Slots()):
#     def remove_user_packages(self, packages, slots=Process.Slots()):
#     def installed_packages(self):


import logging
import os
from .base import BaseMode
from ..debugger.config import DEBUGGER_PORT
from ..debugger.client import Debugger
from ..debugger.utils import is_breakpoint_line
from ..virtual_environment import venv
from PyQt5.QtCore import QTimer

    def api(self):
        """
        Return a list of API specifications to be used by auto-suggest and call
        tips.
        """
        return []

    def start(self):
        """
        Start debugging the current script.
        """
        # Grab the Python file.
        tab = self.view.current_tab
        if tab is None:
            logger.debug("There is no active text editor.")
            self.stop()
            return
        if tab.path is None:
            # Unsaved file.
            self.editor.save()
        if tab.path:
            # If needed, save the script.
            if tab.isModified():
                self.editor.save_tab_to_file(tab)
            logger.debug(tab.text())
            self.set_buttons(modes=False)
            envars = self.editor.envars
            cwd = os.path.dirname(tab.path)
            self.runner = self.view.add_python3_runner(

# Path: mu/virtual_environment.py
# ENCODING = sys.stdout.encoding if hasattr(sys.stdout, "encoding") else "utf-8"
# class VirtualEnvironmentError(Exception):
# class VirtualEnvironmentEnsureError(VirtualEnvironmentError):
# class VirtualEnvironmentCreateError(VirtualEnvironmentError):
# class Process(QObject):
# class Pip(object):
# class SplashLogHandler(logging.NullHandler):
# class VirtualEnvironment(object):
#     def __init__(self, message):
# def compact(text):
#     def __init__(self):
#     def _set_up_run(self, **envvars):
#     def run_blocking(self, command, args, wait_for_s=30.0, **envvars):
#     def run(self, command, args, **envvars):
#     def wait(self, wait_for_s=30):
#     def data(self):
#     def _started(self):
#     def _readyRead(self):
#     def _finished(self):
#     def __init__(self, pip_executable):
#     def run(
#         self, command, *args, wait_for_s=120.0, slots=Process.Slots(), **kwargs
#     ):
#     def install(self, packages, slots=Process.Slots(), **kwargs):
#     def uninstall(self, packages, slots=Process.Slots(), **kwargs):
#     def freeze(self):
#     def list(self):
#     def installed(self):
#     def __init__(self, emitter):
#     def emit(self, record):
#     def handle(self, record):
#     def __init__(self, dirpath=None):
#     def __str__(self):
#     def _generate_dirpath():
#     def run_subprocess(self, *args, **kwargs):
#     def reset_pip(self):
#     def relocate(self, dirpath):
#     def run_python(self, *args, slots=Process.Slots()):
#     def _directory_is_venv(self):
#     def quarantine_venv(self, reason="FAILED"):
#     def recreate(self):
#     def ensure_and_create(self, emitter=None):
#     def ensure(self):
#     def ensure_path(self):
#     def ensure_interpreter(self):
#     def ensure_interpreter_version(self):
#     def ensure_key_modules(self):
#     def ensure_pip(self):
#     def create(self):
#     def create_venv(self):
#     def install_jupyter_kernel(self):
#     def install_from_zipped_wheels(self, zipped_wheels_filepath):
#     def install_baseline_packages(self):
#     def register_baseline_packages(self):
#     def baseline_packages(self):
#     def install_user_packages(self, packages, slots=Process.Slots()):
#     def remove_user_packages(self, packages, slots=Process.Slots()):
#     def installed_packages(self):


# Path: mu/modes/debugger.py
import logging
import os
from .base import BaseMode
from ..debugger.config import DEBUGGER_PORT
from ..debugger.client import Debugger
from ..debugger.utils import is_breakpoint_line
from ..virtual_environment import venv
from PyQt5.QtCore import QTimer


    def api(self):
        """
        Return a list of API specifications to be used by auto-suggest and call
        tips.
        """
        return []

    def start(self):
        """
        Start debugging the current script.
        """
        # Grab the Python file.
        tab = self.view.current_tab
        if tab is None:
            logger.debug("There is no active text editor.")
            self.stop()
            return
        if tab.path is None:
            # Unsaved file.
            self.editor.save()
        if tab.path:
            # If needed, save the script.
            if tab.isModified():
                self.editor.save_tab_to_file(tab)
            logger.debug(tab.text())
            self.set_buttons(modes=False)
            envars = self.editor.envars
            cwd = os.path.dirname(tab.path)
            self.runner = self.view.add_python3_runner(

                venv.interpreter, tab.path, cwd, debugger=True, envars=envars