private static boolean isParamSpec(@Nullable PyType type) {
    if (type instanceof PyClassLikeType) {
      String classQName = ((PyClassLikeType)type).getClassQName();
      return TYPING_PARAM_SPEC.equals(classQName) || TYPING_EXTENSIONS_PARAM_SPEC.equals(classQName);
    }
    else if (type instanceof PyUnionType) {
      return ((PyUnionType)type).getMembers().stream().anyMatch(it -> isParamSpec(it));
    }
    return false;
  }
private static boolean isParamSpec(@Nullable PyType type)