private boolean isDeclaredInSlots(@NotNull PyType type, @NotNull String attrName) {
    return PyTypeUtil.toStream(type)
      .select(PyClassType.class)
      .map(PyClassType::getPyClass)
      .flatMap(cls -> StreamEx.of(cls).append(cls.getAncestorClasses(myTypeEvalContext)))
      .nonNull()
      .filter(c -> c.isNewStyleClass(myTypeEvalContext))
      .flatCollection(PyClass::getOwnSlots)
      .anyMatch(attrName::equals);
  }
private boolean isDeclaredInSlots(@NotNull PyType type, @NotNull String attrName)