Set the restriction on the given object.

        You can use this to signal that a certain function is restricted.
        Then you can query the restriction later with :meth:`Reftrack.is_restricted`.

        :param obj: a hashable object
        :param restricted: True, if you want to restrict the object.
        :type restricted: :class:`bool`
        :returns: None
        :rtype: None
        :raises: None

def set_restricted(self, obj, restricted):
        """Set the restriction on the given object.

        You can use this to signal that a certain function is restricted.
        Then you can query the restriction later with :meth:`Reftrack.is_restricted`.

        :param obj: a hashable object
        :param restricted: True, if you want to restrict the object.
        :type restricted: :class:`bool`
        :returns: None
        :rtype: None
        :raises: None
        """
        if restricted:
            self._restricted.add(obj)
        elif obj in self._restricted:
            self._restricted.remove(obj)