private String getStdlibUrlFor(PsiElement element, QualifiedName moduleName, Sdk sdk) {
    StringBuilder urlBuilder = new StringBuilder(getExternalDocumentationRoot(sdk));

    final String webpageName = webPageName(moduleName, sdk);

    final boolean isBuiltin = isBuiltins(webpageName);

    final String className = element instanceof PyFunction && ((PyFunction)element).getContainingClass() != null ?
                             ((PyFunction)element).getContainingClass().getName() : "";
    final String name = element instanceof PsiNamedElement && !(element instanceof PyFile) ? ((PsiNamedElement)element).getName() : null;
    final String name2 = "__init__".equals(name) ? "" : name;
    final String qName = name == null ? null : className + (!"".equals(className) && !name2.isEmpty() ? "." : "") + name2;
    final String webpageName2 = isBuiltin ? stdlibObjectsToWebpage.get(qName) : webpageName;

    if (webpageName2 != null) {
      urlBuilder.append(webpageName2).append(".html");
    }

    if (webpageName2 != null && element instanceof PsiNamedElement && !(element instanceof PyFile)) {
      urlBuilder.append('#');
      if (!isBuiltin) {
        urlBuilder.append(fragmentName(moduleName.toString())).append(".");
      }
      urlBuilder.append(qName);
    }
    return urlBuilder.toString();
  }
private String getStdlibUrlFor(PsiElement element, QualifiedName moduleName, Sdk sdk)