def path_match_patterns(path, patterns):
 for pattern in patterns:
  if fnmatch.fnmatch(path, pattern):
   return True
 return False

def path_match_patterns ( path , patterns ) : for pattern in patterns : if fnmatch . fnmatch ( path , pattern ) : return True return False
check if a path matches one or more patterns .