# Path: src/pif/exceptions.py
# class InvalidRegistryItemType(ValueError):
#     """Raised when an attempt is made to register an irrelevant item.
# 
#     Raised when an attempt is made to register an item in the registry
#     which does not have a proper type.
#     """


import logging
import socket
from .exceptions import InvalidRegistryItemType

        :param pif.base.BaseIPChecker cls: Subclass of
            ``pif.base.BaseIPChecker``.
        :param bool force: If set to True, item stays forced. It's not
            possible to un-register a forced item.
        :return bool: True if registered and False otherwise.
        """
        if not issubclass(cls, BasePublicIPChecker):
            raise InvalidRegistryItemType(
                "Invalid item type `%s` for registry "
                "`%s`" % (cls, self.__class__)
            )

        if cls.uid not in self._registry:
            self._registry[cls.uid] = cls
            return True
        else:
            return False

    def unregister(self, checker):
        """Un-registers an item from registry.

        :param mixed checker: May be a subclass of
            ``pif.base.BasePublicIPChecker`` or string, representing the
            checker name.
        :return bool: True if unregistered and False otherwise.
        """
        # If not string, then we check it it's of a right class.
        if not isinstance(checker, str):
            if not issubclass(checker, BasePublicIPChecker):

# Path: src/pif/exceptions.py
# class InvalidRegistryItemType(ValueError):
#     """Raised when an attempt is made to register an irrelevant item.
# 
#     Raised when an attempt is made to register an item in the registry
#     which does not have a proper type.
#     """


# Path: src/pif/base.py
import logging
import socket
from .exceptions import InvalidRegistryItemType


        :param pif.base.BaseIPChecker cls: Subclass of
            ``pif.base.BaseIPChecker``.
        :param bool force: If set to True, item stays forced. It's not
            possible to un-register a forced item.
        :return bool: True if registered and False otherwise.
        """
        if not issubclass(cls, BasePublicIPChecker):
            raise InvalidRegistryItemType(
                "Invalid item type `%s` for registry "
                "`%s`" % (cls, self.__class__)
            )

        if cls.uid not in self._registry:
            self._registry[cls.uid] = cls
            return True
        else:
            return False

    def unregister(self, checker):
        """Un-registers an item from registry.

        :param mixed checker: May be a subclass of
            ``pif.base.BasePublicIPChecker`` or string, representing the
            checker name.
        :return bool: True if unregistered and False otherwise.
        """
        # If not string, then we check it it's of a right class.
        if not isinstance(checker, str):
            if not issubclass(checker, BasePublicIPChecker):

                raise InvalidRegistryItemType(