def check_for_folder(path):
 for (_root, dirs, _files) in os.walk(path):
  if dirs:
   return True
 return False

def check_for_folder ( path ) : for ( _root , dirs , _files ) in os . walk ( path ) : if dirs : return True return False
return true if any folder is found in the tree at path .