def METHOD_NAME(self, object):
    """ Yield the named instance trait from the given object. If the named
    trait cannot be found and optional is false, raise an error.
    Parameters
    ----------
    object: object
        Object provided by another observers or by the user.
    Yields
    ------
    CTrait
    Raises
    ------
    ValueError
        If the trait is not found and optional flag is set to false.
    """
    if not object_has_named_trait(object, self.name):
        if self.optional:
            return
        raise ValueError(
            "Trait named {!r} not found on {!r}.".format(self.name, object)
        )
    yield object._trait(self.name, 2)