public static boolean isGenerator(@NotNull PyType type) {
    return type instanceof PyCollectionType genericType && GENERATOR.equals(genericType.getClassQName());
  }
public static boolean isGenerator(@NotNull PyType type)