private void executeCodeImpl(@Nullable String code) {
    if (code != null) {
      if (PyConsoleUtil.isCommandQueueEnabled(getProject())) {
        executeInConsole(code);
      }
      else {
        ProgressManager.getInstance().run(new Task.Backgroundable(null, PyBundle.message("console.executing.code.in.console"), true) {
          @Override
          public void run(final @NotNull ProgressIndicator indicator) {
            while (!myExecuteActionHandler.isEnabled() || !myExecuteActionHandler.canExecuteNow()) {
              if (indicator.isCanceled()) {
                break;
              }
              TimeoutUtil.sleep(300);
            }
            if (!indicator.isCanceled()) {
              executeInConsole(code);
            }
          }
        });
      }
    }
    else {
      requestFocus();
    }
  }
private void executeCodeImpl(@Nullable String code)