DocStringFormat (@NotNull PsiFile file) { if (file instanceof PyFile) { final PyTargetExpression expr = ((PyFile)file).findTopLevelAttribute(PyNames.DOCFORMAT); if (expr != null) { final String docformat = PyPsiUtils.strValue(expr.findAssignedValue()); if (docformat != null) { final List<String> words = StringUtil.split(docformat, " "); if (words.size() > 0) { final DocStringFormat fileFormat = DocStringFormat.fromName(words.get(0)); if (fileFormat != null) { return fileFormat; } } } } } return null; }