Repository: Avaiga/taipy
File: taipy/core/notification/notifier.py (Python)

Code before:
                for all events related to this entity. Otherwise, the listener
                will be notified for events related to all entities.
            operation (Optional[EventOperation^]): If provided, the listener will
                be notified for all events related to this operation. Otherwise,
                the listener will be notified for events related to all operations.
                <br>
                The possible operation values are defined in the `EventOperation^`
                enum. The possible values are:
                <ul>
                    <li>CREATION</li>
                    <li>UPDATE</li>
                    <li>DELETION</li>
                    <li>SUBMISSION</li>
                </ul>
            attribute_name (Optional[str]): If provided, the listener will be notified
                for all events related to this entity's attribute. Otherwise, the listener
                will be notified for events related to all attributes.

        Returns:
            A tuple containing the registration id and the event queue.
        """
        registration = _Registration.from_topic(entity_type, entity_id, operation, attribute_name)
        return cls.__do_register(registration)

    @classmethod
    def unregister(cls, registration_id: Union[str, _Registration]) -> None:
        """Unregister a listener.

        !!! example "Standard usage"

            ```python
            registration_id, registered_queue = Notifier.register(
                entity_type=EventEntityType.CYCLE,
                entity_id="CYCLE_cycle_1",
                operation=EventOperation.CREATION
            )

            Notifier.unregister(registration_id)
            ```

        Arguments:
            registration_id (`RegistrationId`): The registration id returned by the `register` method.
        """
        to_remove_registration: Optional[_Registration] = None

        for _, registrations in cls._topics_registrations_list.items():
            for reg in registrations:
                if reg.registration_id == registration_id:
                    to_remove_registration = reg
                    break
            if to_remove_registration:

Review comment (suggestion):
```suggestion
    def unregister(cls, registration_id: str) -> None:
```

Code after:
                for all events related to this entity. Otherwise, the listener
                will be notified for events related to all entities.
            operation (Optional[EventOperation^]): If provided, the listener will
                be notified for all events related to this operation. Otherwise,
                the listener will be notified for events related to all operations.
                <br>
                The possible operation values are defined in the `EventOperation^`
                enum. The possible values are:
                <ul>
                    <li>CREATION</li>
                    <li>UPDATE</li>
                    <li>DELETION</li>
                    <li>SUBMISSION</li>
                </ul>
            attribute_name (Optional[str]): If provided, the listener will be notified
                for all events related to this entity's attribute. Otherwise, the listener
                will be notified for events related to all attributes.

        Returns:
            A tuple containing the registration id and the event queue.
        """
        registration = _Registration.from_topic(entity_type, entity_id, operation, attribute_name)
        return cls.__do_register(registration)

    @classmethod
    def unregister(cls, registration_id: str) -> None:
        """Unregister a listener.

        !!! example "Standard usage"

            ```python
            registration_id, registered_queue = Notifier.register(
                entity_type=EventEntityType.CYCLE,
                entity_id="CYCLE_cycle_1",
                operation=EventOperation.CREATION
            )

            Notifier.unregister(registration_id)
            ```

        Arguments:
            registration_id (`RegistrationId`): The registration id returned by the `register` method.
        """
        to_remove_registration: Optional[_Registration] = None

        for _, registrations in cls._topics_registrations_list.items():
            for reg in registrations:
                if reg.registration_id == registration_id:
                    to_remove_registration = reg
                    break
            if to_remove_registration: