def matches_patterns(path, patterns=None):
 if (patterns is None):
  patterns = []
 for pattern in patterns:
  if fnmatch.fnmatchcase(path, pattern):
   return True
 return False

def matches_patterns ( path , patterns = None ) : if ( patterns is None ) : patterns = [ ] for pattern in patterns : if fnmatch . fnmatchcase ( path , pattern ) : return True return False
return true or false depending on whether the path should be ignored .