boolean (final DataContext dataContext) { Project project = CommonDataKeys.PROJECT.getData(dataContext); if (project == null) return false; RunnerAndConfigurationSettings settings = RunManager.getInstance(project).getSelectedConfiguration(); if (settings != null) { return settings.getConfiguration() instanceof AbstractPythonRunConfiguration; } return false; }