PyExpression (@NotNull String contents, @NotNull PsiElement anchor) { final PsiFile file = FileContextUtil.getContextFile(anchor); if (file == null) return null; PyExpression fragment = PyUtil.createExpressionFromFragment(contents, file); if (fragment != null) { fragment.getContainingFile().putUserData(FRAGMENT_OWNER, anchor); } return fragment; }