def is_empty_dir(path):
 for (_, _, files) in os.walk(path):
  if files:
   return False
 return True

def is_empty_dir ( path ) : for ( _ , _ , files ) in os . walk ( path ) : if files : return False return True
checks if any files are present within a directory and all sub-directories .