public static boolean hasIfNameEqualsMain(@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;
  }
public static boolean hasIfNameEqualsMain(@NotNull PyFile file)