private static PyFunction getBaseMethod(List<PsiElement> superMethods,
                                         PyClass containingClass) {

    for (PyClass ancestor : containingClass.getAncestorClasses(null)) {
      for (PsiElement method : superMethods) {
        if (ancestor.equals(((PyFunction)method).getContainingClass()))
          return (PyFunction)method;
      }
    }
    return (PyFunction) superMethods.get(superMethods.size()-1);
  }
private static PyFunction getBaseMethod(List<PsiElement> superMethods,
                                         PyClass containingClass)