def METHOD_NAME(self, object):
    """ Yield the content of the set if the given object is an observable
    set. Otherwise, raise an error, unless the observer is optional.
    The content of the set will be passed onto the children observer(s)
    following this one in an ObserverGraph.
    Parameters
    ----------
    object: object
        Object provided by another observers or by the user.
    Yields
    ------
    value : object
    Raises
    ------
    ValueError
        If the given object is not an observable set and optional is false.
    """
    if not isinstance(object, TraitSet):
        if self.optional:
            return
        raise ValueError(
            "Expected a TraitSet to be observed, "
            "got {!r} (type: {!r})".format(object, type(object))
        )
    yield from object