<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def filter_enum(pred, enum):
 """ Create a new enumeration containing only items filtered from another enumeration. Hidden enum items in the original enumeration are excluded. :type pred: ``Callable[[`EnumItem`], bool]`` :param pred: Predicate that will keep items for which the result is true. :type enum: Enum :param enum: Enumeration to filter. :rtype: Enum :return: New filtered enumeration. """

    def _items():
        for item in enum:
            yield EnumItem(
                item.value,
                item.desc,
                not pred(item),
                **item._extra)
    return Enum('Filtered from {!r}'.format(enum), list(_items()))