code: def _matching_pattern_sets(self):
          
          gather = []
          if self.matched_and_subdir:
              gather.append(self.matched_and_subdir.iter())
              gather.append(self.matched_no_subdir.iter())
          ref = self
          while ref is not None:
              if ref.matched_inherit:
                  gather.append(ref.matched_inherit.iter())
              if ref.parent_has_patterns:
                  ref = ref.parent
              else:
                  ref = None
          return chain.from_iterable(gather)
docs: Returns an iterator containing all PatternSets that match this
          directory.
  
          This is build by chaining the this-directory specific PatternSet
          (self.matched_and_subdir), the local (non-inheriting) PatternSet
          (self.matched_no_subdir) with all the inherited PatternSets
          that match this directory and all its parents (self.match_inherit).