boolean (@NotNull PyFile file) { final PyIfStatement dunderMain = SyntaxTraverser.psiApi() .children(file) .filterMap(psi -> psi instanceof PyIfStatement ? ((PyIfStatement)psi) : null) .find(ifStatement -> isIfNameEqualsMain(ifStatement)); return dunderMain != null; }