@Nullable
      private static PsiElement resolveCallingClass(@NotNull PyExpression calleeQualifier) {
        if (calleeQualifier instanceof PyCallExpression) {
          return Optional
            .of((PyCallExpression)calleeQualifier)
            .map(PyCallExpression::getCallee)
            .map(PyExpression::getReference)
            .map(PsiReference::resolve)
            .orElse(null);
        }
        else {
          return Optional
            .ofNullable(calleeQualifier.getReference())
            .map(PsiReference::resolve)
            .orElse(null);
        }
      }
@Nullable
      private static PsiElement resolveCallingClass(@NotNull PyExpression calleeQualifier)