VirtualFile (VirtualFile[] files) { for (VirtualFile file : files) { if (!file.isValid()) { continue; } if ((file.findChild("__future__.py") != null || file.findChild("__future__.pyc") != null) && file.findChild("xml") != null && file.findChild("email") != null) { return file; } // Mock SDK does not have aforementioned modules if (ApplicationManager.getApplication().isUnitTestMode() && file.getName().equals("Lib")) { return file; } } return null; }