code: def filter_enum(pred, enum):
      
      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()))
docs: 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.