private static boolean withinClass(@NotNull PyClass cls, @Nullable PsiElement location) {
    PyClass containingClass = PsiTreeUtil.getParentOfType(location, PyClass.class);
    if (containingClass != null) {
      containingClass = CompletionUtilCoreImpl.getOriginalElement(containingClass);
    }
    return containingClass == PyiUtil.getOriginalElementOrLeaveAsIs(cls, PyClass.class) || isInSuperCall(location);
  }
private static boolean withinClass(@NotNull PyClass cls, @Nullable PsiElement location)