code: def get_filtering_contenthandler(element):
      
      from ligo.lw.ligolw import FilteringLIGOLWContentHandler
      from ligo.lw.table import Table
  
      if issubclass(element, Table):
          def _element_filter(name, attrs):
              return ~element.CheckProperties(name, attrs)
      else:
          def _element_filter(name, _):
              # pylint: disable=unused-argument
              return name != element.tagName
  
      return build_content_handler(FilteringLIGOLWContentHandler,
                                   _element_filter)
docs: Build a `FilteringLIGOLWContentHandler` to exclude this element
  
      Parameters
      ----------
      element : `type`, subclass of :class:`~ligo.lw.ligolw.Element`
          the element to exclude (and its children)
  
      Returns
      -------
      contenthandler : `type`
          a subclass of
          :class:`~ligo.lw.ligolw.FilteringLIGOLWContentHandler` to
          exclude an element and its children