Document (@NotNull final Project project, @NotNull String text) { text = text.trim(); final PyExpressionCodeFragmentImpl fragment = new PyExpressionCodeFragmentImpl(project, "start_script.py", text, true); return PsiDocumentManager.getInstance(project).getDocument(fragment); }