def is_excluded(root, excludes):
 for exclude in excludes:
  if fnmatch(root, exclude):
   return True
 return False

def is_excluded ( root , excludes ) : for exclude in excludes : if fnmatch ( root , exclude ) : return True return False
check if the directory is in the exclude list .