def _filter_ignored(self, entries, selector=None):
    """Given an opaque entry list, filter any ignored entries.

    :param entries: A list or generator that produces entries to filter.
    :param selector: A function that computes a path for an entry relative to the root of the
      ProjectTree, or None to use identity.
    """
    selector = selector or (lambda x: x)
    prefixed_entries = [(self._append_slash_if_dir_path(selector(entry)), entry)
                          for entry in entries]
    ignored_paths = set(self.ignore.match_files(path for path, _ in prefixed_entries))
    return [entry for path, entry in prefixed_entries if path not in ignored_paths]
Given an opaque entry list, filter any ignored entries.

    :param entries: A list or generator that produces entries to filter.
    :param selector: A function that computes a path for an entry relative to the root of the
      ProjectTree, or None to use identity.