def match_patterns(pathname, patterns):
 for pattern in patterns:
  if fnmatch(pathname, pattern):
   return True
 return False

def match_patterns ( pathname , patterns ) : for pattern in patterns : if fnmatch ( pathname , pattern ) : return True return False
returns true if the pathname matches any of the given patterns .