def get_enabled(filter_item):
    """ Internal worker function to return a filter's enabled state
    from a frame filter object.  This is a fail free function as it is
    used in sorting and filtering.  If a badly implemented frame
    filter does not implement the enabled attribute, return False
    (otherwise sorting/filtering will fail and prevent other frame
    filters from executing).

    Arguments:
        filter_item: An object conforming to the frame filter
                     interface.

    Returns:
        The enabled state of the frame filter from the "enabled"
        attribute, or False.
    """

    # If the filter class is badly implemented when called from the
    # Python filter command, do not cease filter operations, just set
    # enabled to False.
    return getattr(filter_item, "enabled", False)