@@ -0,0 +1,2395 @@
+// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.%0Apackage com.jetbrains.python;%0A%0Aimport com.google.common.collect.Lists;%0Aimport com.intellij.codeInsight.lookup.LookupElementBuilder;%0Aimport com.intellij.psi.PsiElement;%0Aimport com.intellij.util.ProcessingContext;%0Aimport com.jetbrains.python.codeInsight.PyCustomMember;%0Aimport com.jetbrains.python.psi.AccessDirection;%0Aimport com.jetbrains.python.psi.PyExpression;%0Aimport com.jetbrains.python.psi.impl.ResolveResultList;%0Aimport com.jetbrains.python.psi.resolve.PyResolveContext;%0Aimport com.jetbrains.python.psi.resolve.RatedResolveResult;%0Aimport com.jetbrains.python.psi.types.PyType;%0Aimport org.jetbrains.annotations.NotNull;%0Aimport org.jetbrains.annotations.Nullable;%0A%0Aimport java.util.List;%0A%0A/**%0A * @author traff%0A */%0Apublic class PySyntheticType implements PyType %7B%0A  private final List%3CPyCustomMember%3E myMembers;%0A  private final String myName;%0A  private final PsiElement myContext;%0A%0A  public PySyntheticType(String name, PsiElement context, PyCustomMember... members) %7B%0A    myName = name;%0A    myContext = context;%0A    myMembers = Lists.newArrayList(members);%0A  %7D%0A%0A  @Override%0A  public List%3C? extends RatedResolveResult%3E resolveMember(@NotNull String name,%0A                                                          @Nullable PyExpression location,%0A                                                          @NotNull AccessDirection direction,%0A                                                          @NotNull PyResolveContext resolveContext) %7B%0A    final ResolveResultList result = new ResolveResultList();%0A    for (PyCustomMember member : myMembers) %7B%0A      if (name.equals(member.getName())) %7B%0A        result.poke(member.resolve(myContext, resolveContext), RatedResolveResult.RATE_NORMAL);%0A      %7D%0A    %7D%0A    return result;%0A  %7D%0A%0A  @Override%0A  public Object%5B%5D getCompletionVariants(String completionPrefix, PsiElement location, ProcessingContext context) %7B%0A    final List%3CObject%3E result = Lists.newArrayList();%0A    for (PyCustomMember member : myMembers) %7B%0A      result.add(LookupElementBuilder.create(member.getName()));%0A    %7D%0A    return result.toArray();%0A  %7D%0A%0A  @Override%0A  public String getName() %7B%0A    return myName;%0A  %7D%0A%0A  @Override%0A  public boolean isBuiltin() %7B%0A    return false;%0A  %7D%0A%0A  @Override%0A  public void assertValid(String message) %7B%0A  %7D%0A%7D%0A

Move PySyntheticType to community to make it available outside of PyCharm Professional.