code: def filter_redundant(self, ids):
          
          sids = set(ids)
          for id in ids:
              sids = sids.difference(self.ancestors(id, reflexive=False))
          return sids
docs: Return all non-redundant ids from a list