def has_preference_fn(feature):
    """
    Answer True if the feature has a preference_fun set. 
    Answer False if not set or it does not have this attribute.
    """
    return hasattr(feature, 'preference_fn') and feature.preference_fn is not None