code: def _matches_patterns(path, patterns):
          
          for glob in patterns:
              try:
                  if PurePath(path).match(glob):
                      return True
              except TypeError:
                  pass
          return False
docs: Given a list of patterns, returns a if a path matches any pattern.