def _filter_from_path_rules(self, path_rules):
        """Return the CategoryFilter associated to a path rules tuple."""
        # We reuse the same CategoryFilter where possible to take
        # advantage of the caching they do.
        if path_rules not in self._path_rules_to_filter:
            rules = list(self._base_rules) # Make a copy
            rules.extend(path_rules)
            rules.extend(self.user_rules)
            self._path_rules_to_filter[path_rules] = _CategoryFilter(rules)

        return self._path_rules_to_filter[path_rules]