private static boolean isPureReferenceExpression(@NotNull PyExpression expr) {
    if (!(expr instanceof PyReferenceExpression)) {
      return false;
    }
    final PyExpression qualifier = ((PyReferenceExpression)expr).getQualifier();
    return qualifier == null || isPureReferenceExpression(qualifier);
  }
private static boolean isPureReferenceExpression(@NotNull PyExpression expr)